forked from cms-sw/cmssw
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request cms-sw#166 from amarini/taunu_and_hmm
Hmm
- Loading branch information
Showing
19 changed files
with
2,106 additions
and
28 deletions.
There are no files selected for viewing
Large diffs are not rendered by default.
Oops, something went wrong.
Binary file not shown.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,85 @@ | ||
include=dat/configHmumu.dat | ||
sub=systDir|/eos/user/a/amarini/Nero/v2.2.1/Syst | ||
sub=amariniUser|/store/user/amarini/Nero/v2.2.1 | ||
|
||
#only signal!!! | ||
Files= | ||
## Signal | ||
#include=dat/catalog/2017.moriond/hmm.dat | ||
|
||
addfiles=%(amariniUser)s/GluGlu_HToMuMu_M125_13TeV_powheg_pythia8 | ||
addfiles=%(amariniUser)s/VBF_HToMuMu_M125_13TeV_powheg_pythia8 | ||
addfiles=%(amariniUser)s/WMinusH_HToMuMu_M125_13TeV_powheg_pythia8 | ||
addfiles=%(amariniUser)s/WPlusH_HToMuMu_M125_13TeV_powheg_pythia8 | ||
addfiles=%(amariniUser)s/ZH_HToMuMu_M125_13TeV_powheg_pythia8 | ||
addfiles=/eos/user/a/amarini/Nero/v2.2.1/ttH_HToMuMu_M125_13TeV_powheg_pythia8_v2 | ||
|
||
addfiles=%(systDir)s/GluGlu_HToMuMu_M125_PSDown_13TeV_powheg_pythia8 | ||
addfiles=%(systDir)s/GluGlu_HToMuMu_M125_PSUp_13TeV_powheg_pythia8 | ||
addfiles=%(systDir)s/GluGlu_HToMuMu_M125_TuneDown_13TeV_powheg_pythia8 | ||
addfiles=%(systDir)s/GluGlu_HToMuMu_M125_TuneUp_13TeV_powheg_pythia8 | ||
addfiles=%(systDir)s/VBF_HToMuMu_M125_PSDown_13TeV_powheg_pythia8 | ||
addfiles=%(systDir)s/VBF_HToMuMu_M125_PSUp_13TeV_powheg_pythia8 | ||
addfiles=%(systDir)s/VBF_HToMuMu_M125_TuneDown_13TeV_powheg_pythia8 | ||
addfiles=%(systDir)s/VBF_HToMuMu_M125_TuneUp_13TeV_powheg_pythia8 | ||
addfiles=%(systDir)s/WMinusH_HToMuMu_M125_PSDown_13TeV_powheg_pythia8 | ||
addfiles=%(systDir)s/WMinusH_HToMuMu_M125_PSUp_13TeV_powheg_pythia8 | ||
addfiles=%(systDir)s/WMinusH_HToMuMu_M125_TuneDown_13TeV_powheg_pythia8 | ||
addfiles=%(systDir)s/WMinusH_HToMuMu_M125_TuneUp_13TeV_powheg_pythia8 | ||
addfiles=%(systDir)s/WPlusH_HToMuMu_M125_PSDown_13TeV_powheg_pythia8 | ||
addfiles=%(systDir)s/WPlusH_HToMuMu_M125_PSUp_13TeV_powheg_pythia8 | ||
addfiles=%(systDir)s/WPlusH_HToMuMu_M125_TuneDown_13TeV_powheg_pythia8 | ||
addfiles=%(systDir)s/WPlusH_HToMuMu_M125_TuneUp_13TeV_powheg_pythia8 | ||
addfiles=%(systDir)s/ZH_HToMuMu_M125_PSDown_13TeV_powheg_pythia8 | ||
addfiles=%(systDir)s/ZH_HToMuMu_M125_PSUp_13TeV_powheg_pythia8 | ||
addfiles=%(systDir)s/ZH_HToMuMu_M125_TuneDown_13TeV_powheg_pythia8 | ||
addfiles=%(systDir)s/ZH_HToMuMu_M125_TuneUp_13TeV_powheg_pythia8 | ||
|
||
addConfig=HmumuAnalysis|labels.clear() | ||
|
||
### PSUp | ||
addConfig=HmumuAnalysis|AddLabel('GluGlu_HToMuMu_M125_PSUp') | ||
addConfig=HmumuAnalysis|AddLabel('VBF_HToMuMu_M125_PSUp') | ||
addConfig=HmumuAnalysis|AddLabel('ZH_HToMuMu_M125_PSUp') | ||
addConfig=HmumuAnalysis|AddLabel('WMinusH_HToMuMu_M125_PSUp') | ||
addConfig=HmumuAnalysis|AddLabel('WPlusH_HToMuMu_M125_PSUp') | ||
addConfig=HmumuAnalysis|AddLabel('ttH_HToMuMu_M125_PSUp') | ||
|
||
### PSDown | ||
addConfig=HmumuAnalysis|AddLabel('GluGlu_HToMuMu_M125_PSDown') | ||
addConfig=HmumuAnalysis|AddLabel('VBF_HToMuMu_M125_PSDown') | ||
addConfig=HmumuAnalysis|AddLabel('ZH_HToMuMu_M125_PSDown') | ||
addConfig=HmumuAnalysis|AddLabel('WMinusH_HToMuMu_M125_PSDown') | ||
addConfig=HmumuAnalysis|AddLabel('WPlusH_HToMuMu_M125_PSDown') | ||
addConfig=HmumuAnalysis|AddLabel('ttH_HToMuMu_M125_PSDown') | ||
|
||
### TuneUp | ||
addConfig=HmumuAnalysis|AddLabel('GluGlu_HToMuMu_M125_TuneUp') | ||
addConfig=HmumuAnalysis|AddLabel('VBF_HToMuMu_M125_TuneUp') | ||
addConfig=HmumuAnalysis|AddLabel('ZH_HToMuMu_M125_TuneUp') | ||
addConfig=HmumuAnalysis|AddLabel('WMinusH_HToMuMu_M125_TuneUp') | ||
addConfig=HmumuAnalysis|AddLabel('WPlusH_HToMuMu_M125_TuneUp') | ||
addConfig=HmumuAnalysis|AddLabel('ttH_HToMuMu_M125_TuneUp') | ||
|
||
### TuneDown | ||
addConfig=HmumuAnalysis|AddLabel('GluGlu_HToMuMu_M125_TuneDown') | ||
addConfig=HmumuAnalysis|AddLabel('VBF_HToMuMu_M125_TuneDown') | ||
addConfig=HmumuAnalysis|AddLabel('ZH_HToMuMu_M125_TuneDown') | ||
addConfig=HmumuAnalysis|AddLabel('WMinusH_HToMuMu_M125_TuneDown') | ||
addConfig=HmumuAnalysis|AddLabel('WPlusH_HToMuMu_M125_TuneDown') | ||
addConfig=HmumuAnalysis|AddLabel('ttH_HToMuMu_M125_TuneDown') | ||
|
||
|
||
################ NOMINAL ############ | ||
addConfig=HmumuAnalysis|AddLabel('GluGlu_HToMuMu_M125') | ||
addConfig=HmumuAnalysis|AddLabel('VBF_HToMuMu_M125') | ||
addConfig=HmumuAnalysis|AddLabel('ZH_HToMuMu_M125') | ||
addConfig=HmumuAnalysis|AddLabel('WMinusH_HToMuMu_M125') | ||
addConfig=HmumuAnalysis|AddLabel('WPlusH_HToMuMu_M125') | ||
addConfig=HmumuAnalysis|AddLabel('ttH_HToMuMu_M125') | ||
|
||
Smear=NONE | ||
|
||
## be less peaky, given the n. of systs | ||
#Final=true | ||
EntryPerSecond=10 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,69 @@ | ||
import ROOT | ||
import os,sys | ||
from array import array | ||
import re,math | ||
from optparse import OptionParser, OptionGroup | ||
print "-> Looking for basepath" | ||
basepath = "" | ||
mypath = os.path.abspath(os.getcwd()) | ||
while mypath != "" and mypath != "/": | ||
if "ChargedHiggs" in os.path.basename(mypath): | ||
basepath = os.path.abspath(mypath) | ||
mypath = os.path.dirname(mypath) | ||
print "-> Base Path is " + basepath | ||
sys.path.insert(0,basepath) | ||
sys.path.insert(0,basepath +"/python") | ||
from hmm import hmm,hmmAutoCat,hmmWithTTH, Stack | ||
parser=OptionParser() | ||
parser.add_option("-i","--input",type='string',help="Input ROOT file. [%default]", default="Background.root") | ||
parser.add_option("","--hmm",dest="hmm",type="string",help="HmmConfig instance [%default]",default="hmmWithTTH") | ||
parser.add_option("","--unblind",dest="blind",action='store_false',help="Un/Blind plots [%default]",default=True) | ||
parser.add_option("-p","--plot",type='string',help="Plot Dir [%default]", default="Hmumu/Plot/bkg") | ||
opts,args= parser.parse_args() | ||
|
||
|
||
fIn = ROOT.TFile.Open(opts.input) | ||
if fIn == None: | ||
print "<*> Error,",opts.input,"no such file or directory" | ||
|
||
w = fIn.Get("w") | ||
if w == None: | ||
print "<*> Error, unable to locate workspace w in input file" | ||
|
||
config= eval(opts.hmm) | ||
config.Print() | ||
|
||
if len(config.bkg_functions) == 0 : | ||
print "<*> Error, no bkg functions in configuration" | ||
|
||
try: | ||
os.mkdir(opts.plot) | ||
except OSError: | ||
pass | ||
|
||
obj=[] | ||
for icat,cat in enumerate(config.categories): | ||
print "* Doing cat",cat | ||
x = w.var("mmm") | ||
x.SetTitle("m_{#mu#mu} [GeV]") | ||
c=ROOT.TCanvas(cat,cat,800,800) | ||
p=x.frame() | ||
data=w.data("dataObs_"+cat) | ||
if opts.blind: | ||
data.plotOn(p,ROOT.RooFit.Name("data"), ROOT.RooFit.CutRange("unblindReg_1"),ROOT.RooFit.Binning(200)); | ||
data.plotOn(p,ROOT.RooFit.Name("data"), ROOT.RooFit.CutRange("unblindReg_2"),ROOT.RooFit.Binning(200)); | ||
data.plotOn(p,ROOT.RooFit.Name("data"), ROOT.RooFit.Invisible(),ROOT.RooFit.Binning(200)); | ||
p.SetMinimum(0.1); | ||
else: | ||
data.plotOn(p,ROOT.RooFit.Name("data"),ROOT.RooFit.Binning(200)); | ||
pdf=w.pdf( config.bkg_functions[icat]) | ||
pdf.plotOn(p) | ||
|
||
obj.extend([data,c,p,pdf]) | ||
p.Draw() | ||
c.SaveAs(opts.plot +"/final_bkg_"+ cat+ ".pdf" ); | ||
c.SaveAs(opts.plot +"/final_bkg_"+ cat+ ".png" ); | ||
#raw_input("ok?") | ||
|
||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.