-
Notifications
You must be signed in to change notification settings - Fork 393
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Nckw add example teststat plots #845
Changes from 4 commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -15,6 +15,7 @@ | |
ROOT.gROOT.SetBatch(1) | ||
ROOT.gROOT.ProcessLine(".L $CMSSW_BASE/src/HiggsAnalysis/CombinedLimit/test/plotting/hypoTestResultTree.cxx") | ||
ROOT.gROOT.ProcessLine(".L $CMSSW_BASE/src/HiggsAnalysis/CombinedLimit/test/plotting/qmuPlot.cxx") | ||
ROOT.gStyle.SetOptStat(0) | ||
|
||
from ROOT import hypoTestResultTree, q0Plot, qmuPlot | ||
|
||
|
@@ -42,6 +43,13 @@ | |
type="str", | ||
help="poi values, comma separated (type all to make a plot for every value found in the file)", | ||
) | ||
parser.add_option( | ||
"", | ||
"--sub_label", | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I'm not sure if there is an existing convention for some of this combine scripts already. But (at least with recent versions) of option/argument parser, using (Same comment below) There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. No strong feelings here so can go with hyphens instead |
||
default="", | ||
type="str", | ||
help="change sub-label from q to q_sub_label (doesn't apply if using --signif option", | ||
) | ||
parser.add_option( | ||
"-r", | ||
"--rebin", | ||
|
@@ -99,6 +107,13 @@ | |
default=False, | ||
help="If --signif, Force plotting of both distributions (including for signal injected).", | ||
) | ||
parser.add_option( | ||
"", | ||
"--save_as_pdf", | ||
action="store_true", | ||
default=False, | ||
help="Save plots as pdfs as well as Canvases in root files.", | ||
) | ||
(options, args) = parser.parse_args() | ||
|
||
if options.quantileExpected >= 0: | ||
|
@@ -167,8 +182,11 @@ def findPOIvals(fi, m): | |
options.rebin, | ||
options.expected, | ||
options.quantileExpected, | ||
options.sub_label, | ||
) | ||
canvases.append(can.Clone()) | ||
if options.save_as_pdf: | ||
can.SaveAs(options.output + "_" + can.GetName() + ".pdf") | ||
ft.Close() | ||
ofile = ROOT.TFile(options.output, "RECREATE") | ||
for can in canvases: | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Not necessarily for this PR, but I wonder if it is worth making this behaviour default, based on the test stat that is being used, rather than requiring the user to do it manually?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The reason I would leave this option open is that we did have a workflow that was specifically for spin Hypotheses and iirc it was not quite the same as using the TeV test stat but was double sided. Honestly, if you don't use the option when you should, you'll see pretty quickly from the resulting figure that you should have used it. In any case, this script doesn't know about the test stat but I think what you're saying is you we could pass the test-stat in as an option and have the plot figure it out?