cms-analysis / CombineHarvester

CMSSW package for the creation, editing and analysis of combine datacards and workspaces
cms-analysis.github.io/CombineHarvester/
15 stars 180 forks source link

Add 2D plotting script PostFit2DShapesFromWorkspace.cpp #327

Open mroguljic opened 3 weeks ago

mroguljic commented 3 weeks ago

Resurrection of this PR. I just checked that it compiles on el9. @ajgilbert your comment on code duplication still stands, but it has been some time since the linked PR and I'm not sure if these functionalities have been added.

mroguljic commented 1 week ago

Thank you for the review @ajgilbert The PR was updated per your comments. I tested it on my usual 2D workflows, do you have some workflows that I could run to ensure it does not break the typical 1D case?

ajgilbert commented 1 week ago

Thanks, I think you could run on any set of 1D cards. For example there are some in the tutorials section: https://github.com/cms-analysis/HiggsAnalysis-CombinedLimit/tree/main/data/tutorials/htt/125

mroguljic commented 5 days ago

I ran the following:

combine -M FitDiagnostics datacard_part2.txt -m 800 --saveShapes --saveWithUncertainties
text2workspace.py datacard_part2.txt -m 800 -o 
workspace_part2.root
PostFitShapesFromWorkspace -d datacard_part2.txt  --output test_shapes.root -m 800 -f fitDiagnosticsTest.root:fit_s --postfit --sampling --print -w workspace_part2.root

where the datacard_part2.txt is slightly changed from the one in Combine repository tutorial. The output plots look reasonable. I'm attaching the datacard and a screenshot of one of the output plots (cannot upload .root files here) image