From 2f0ff8ee2f197ecdbdccf46766fad7e28e3f7f55 Mon Sep 17 00:00:00 2001 From: maria Date: Sat, 24 Mar 2018 10:14:53 +0100 Subject: [PATCH 01/60] leptonic card script as MARCH23 --- interface/Smearer.hpp | 12 +-- script/bwsTB.py | 171 +++++++++++++++++++++++++++++++++++------- src/Loop.cpp | 1 - src/Smearer.cpp | 11 --- 4 files changed, 145 insertions(+), 50 deletions(-) diff --git a/interface/Smearer.hpp b/interface/Smearer.hpp index d58e1cfd..df1d8212 100644 --- a/interface/Smearer.hpp +++ b/interface/Smearer.hpp @@ -32,7 +32,6 @@ class SmearBase : public Named { virtual int smear(Event *e){return 0;}; // 0 = success; 1 not applicable to the event virtual int smear(CorrectorBase *c){return 0;}; // 0 = success; 1 not applicable to the event virtual inline vector &GetJets(Event *e){return e->jets_;} - virtual inline vector &GetFatJets(Event *e){return e->fat_;} virtual inline vector &GetTaus(Event *e){return e->taus_;} virtual inline Met &GetMet(Event *e){return e->met_;} }; @@ -48,7 +47,7 @@ class SmearJes : virtual public SmearBase { public: SmearJes() : SmearBase(){ name_ = "JES";} - int smear(Event*e) override; + int smear(Event*e) override; }; class SmearJesAndCSV : virtual public SmearBase @@ -220,15 +219,6 @@ class SmearWG1 : virtual public SmearBase }; - -class SmearSDMassScale : virtual public SmearBase -{ - public: - SmearSDMassScale() : SmearBase(){ name_ = "SDmassSCALE";} - int smear(Event*e) override; -}; - - #endif // Local Variables: // mode:c++ diff --git a/script/bwsTB.py b/script/bwsTB.py index c5572b57..19f3b9f0 100644 --- a/script/bwsTB.py +++ b/script/bwsTB.py @@ -18,12 +18,11 @@ parser= OptionParser() -#### FILES w/ KERAS connected (V1) for AN -parser.add_option("","--input1L",type='string',help="Input ROOT file. [%default]", default="/afs/cern.ch/work/d/dalfonso/CMSSW_9_1_0_pre2_ReTestNERO/src/ChargedHiggs/FEB26_FINAL_2ThirdSYST_KerasV5_bin1000_1l.root") -parser.add_option("","--input2L",type='string',help="Input ROOT file. [%default]", default="/afs/cern.ch/work/d/dalfonso/CMSSW_9_1_0_pre2_ReTestNERO/src/ChargedHiggs/FEB26_FINAL_2ThirdSYST_KerasV4_bin1000_2l.root") +parser.add_option("","--input1L",type='string',help="Input ROOT file. [%default]", default="/afs/cern.ch/work/d/dalfonso/CMSSW_9_1_0_pre2_ReTestNERO/src/ChargedHiggs/MARCH15_FINAL_2ThirdSYST_KerasV5_bin1000_wDATA_1l.root") +parser.add_option("","--input2L",type='string',help="Input ROOT file. [%default]", default="/afs/cern.ch/work/d/dalfonso/CMSSW_9_1_0_pre2_ReTestNERO/src/ChargedHiggs/MARCH15_FINAL_2ThirdSYST_KerasV5_bin1000_wDATA_2l.root") -parser.add_option("","--input1LBin",type='string',help="Input ROOT file. [%default]", default="/afs/cern.ch/work/d/dalfonso/CMSSW_9_1_0_pre2_ReTestNERO/src/ChargedHiggs/FEB26_FINAL_1Third_bin1000_1l.root") -parser.add_option("","--input2LBin",type='string',help="Input ROOT file. [%default]", default="/afs/cern.ch/work/d/dalfonso/CMSSW_9_1_0_pre2_ReTestNERO/src/ChargedHiggs/FEB26_FINAL_1Third_bin1000_2l.root") +parser.add_option("","--input1LBin",type='string',help="Input ROOT file. [%default]", default="/afs/cern.ch/work/d/dalfonso/CMSSW_9_1_0_pre2_ReTestNERO/src/ChargedHiggs/MARCH15_FINAL_1Third_bin1000_1l.root") +parser.add_option("","--input2LBin",type='string',help="Input ROOT file. [%default]", default="/afs/cern.ch/work/d/dalfonso/CMSSW_9_1_0_pre2_ReTestNERO/src/ChargedHiggs/MARCH15_FINAL_1Third_bin1000_2l.root") ###### ###### @@ -128,11 +127,13 @@ def RebinN(h,nBin): #1l if opts.kTest==0 or opts.kTest==1 or opts.kTest==2 or opts.kTest==3 or opts.kTest==4 or opts.kTest==5 or opts.kTest==6 or opts.kTest==7 or opts.kTest==8 or opts.kTest==9 or opts.kTest==10 or opts.kTest==11 or opts.kTest==12 or opts.kTest==13 or opts.kTest==14 or opts.kTest==15 or opts.kTest==16 or opts.kTest==100 or opts.kTest==101 or opts.kTest==102: channel = ["1Mu","1Ele"] +## channel = ["1L"] basecat = ["Baseline","topCRR4","topCRR5","extraRadCRR10","extraRadCRR7","charmCR"] #2l if opts.kTest==30 or opts.kTest==31 or opts.kTest==32 or opts.kTest==33 or opts.kTest==34 or opts.kTest==35 or opts.kTest==36 or opts.kTest==37 or opts.kTest==38 or opts.kTest==39 or opts.kTest==40 or opts.kTest==41 or opts.kTest==42 or opts.kTest==43 or opts.kTest==44 or opts.kTest==45 or opts.kTest==46 or opts.kTest==200 or opts.kTest==201 or opts.kTest==202: channel = ["1Mu1Ele","2Mu","2Ele"] +# channel = ["2L"] basecat = ["Baseline","topCRR4","topCRR5","extraRadCRR10","extraRadCRR7"] ### combined @@ -161,7 +162,9 @@ def RebinN(h,nBin): for y in channel: for x in basecat: label="2l_" - if y == "1Ele" or y == "1Mu" or y == "1L": label="1l_" + if y == "1L": label="1L_" + if y == "1Ele" or y == "1Mu": label="1l_" + if y == "2L": label="2L_" ## if opts.kTest==20: label="combined_" srList = [""] @@ -231,7 +234,7 @@ def RebinN(h,nBin): if opts.kTest==35 and (y == "2Ele" or y == "2Mu" or y == "1Mu1Ele" or y == "2L") and ( x=="Baseline" or x=="charmCR" or "extraRadCR" in x ): srList = ["5"] if opts.kTest==36 and (y == "2Ele" or y == "2Mu" or y == "1Mu1Ele" or y == "2L") and ( x=="Baseline" or x=="charmCR" or "extraRadCR" in x ): srList = ["6"] if opts.kTest==37 and (y == "2Ele" or y == "2Mu" or y == "1Mu1Ele" or y == "2L") and ( x=="Baseline" or x=="charmCR" or "extraRadCR" in x ): srList = ["7"] - if opts.kTest==38 and (y == "2Ele" or y == "2Mu" or y == "1Mu1Ele" or y == "1L") and ( x=="Baseline" or x=="charmCR" or "extraRadCR" in x ): srList = ["8"] + if opts.kTest==38 and (y == "2Ele" or y == "2Mu" or y == "1Mu1Ele" or y == "2L") and ( x=="Baseline" or x=="charmCR" or "extraRadCR" in x ): srList = ["8"] if opts.kTest==39 and (y == "2Ele" or y == "2Mu" or y == "1Mu1Ele" or y == "2L") and ( x=="Baseline" or x=="charmCR" or "extraRadCR" in x ): srList = ["9"] if opts.kTest==40 and (y == "2Ele" or y == "2Mu" or y == "1Mu1Ele" or y == "2L") and ( x=="Baseline" or x=="charmCR" or "extraRadCR" in x ): srList = ["10"] if opts.kTest==41 and (y == "2Ele" or y == "2Mu" or y == "1Mu1Ele" or y == "2L") and ( x=="Baseline" or x=="charmCR" or "extraRadCR" in x ): srList = ["11"] @@ -428,12 +431,12 @@ def RebinN(h,nBin): #print "---------------------- --------" #fileTmp="AUG6_HT/"+label+VarTest+opts.output -fileTmp="FEB26_bin50/"+ label + VarTest + str(opts.kMass) + opts.output +fileTmp="MARCH23_DATA/"+ label + VarTest + str(opts.kMass) + opts.output w = ROOT.RooWorkspace("w","w") datNameTmp = opts.datCardName #datName = "AUG6_HT/"+ label + VarTest + datNameTmp -datName = "FEB26_bin50/"+ label + VarTest + str(opts.kMass) + datNameTmp +datName = "MARCH23_DATA/"+ label + VarTest + str(opts.kMass) + datNameTmp datacard=open(datName,"w") datacard.write("-------------------------------------\n") @@ -503,7 +506,7 @@ def skip(cat,mc): ## write shapes in workspace -if False: # data +if True: # data datacard.write("shapes data_obs *\t" + fileTmp +"\t") datacard.write("data_obs_$CHANNEL") datacard.write("\n") @@ -527,7 +530,7 @@ def skip(cat,mc): for cat in catStore: datacard.write("%s\t"%cat) datacard.write("\n") -datacard.write("bin\t") +datacard.write("observation\t") for cat in catStore: datacard.write("-1\t") datacard.write("\n") @@ -603,7 +606,7 @@ def writeSystISRFSR(name="test",valueL=["1.027","1.026"], regexpL=["TT","ST",""] ## regexpL=["ttlf","ttb","ttbb","tt2b","ttcc"] # if "1L" in cat: - if "1Ele" in cat or "1Mu" in cat and not "1Ele1Mu" in cat: + if "1L" in cat or "1Ele" in cat or "1Mu" in cat and not "1Ele1Mu" in cat : ### if "topCRR4" in cat: valueUp = PartonShowerSyst(mySyst, "1L", "up", 4, 1, proc) @@ -906,16 +909,52 @@ def envelop(tfile,togetClone, s) : hname=togetClone+'RF'+s - hTmp=tfile.Get(hname) -# hTmp.Rebin(5) + if "1L" in hname: + toget_1=hname.replace("_1L", "_1Mu") + toget_2=hname.replace("_1L", "_1Ele") + hTmp=tfile.Get(toget_1) + hTmp2=tfile.Get(toget_2) + if hTmp!=None and hTmp2!=None:hTmp.Add(hTmp2) + elif "2L" in hname: + toget_1=hname.replace("_2L", "_2Mu") + toget_2=hname.replace("_2L", "_2Ele") + toget_3=hname.replace("_2L", "_1Mu1Ele") + hTmp=tfile.Get(toget_1) + hTmp2=tfile.Get(toget_2) + hTmp3=tfile.Get(toget_3) + if hTmp!=None and hTmp2!=None: hTmp.Add(hTmp2) + if hTmp!=None and hTmp3!=None: hTmp.Add(hTmp3) + else: + hTmp=tfile.Get(hname) + + hTmp.Rebin(5) h=hTmp.Clone() if hTmp==None: return for w in [ 'R','F','RF']: - hTmp=tfile.Get(togetClone+w+s) -# hTmp.Rebin(5) + hnameClone=togetClone+w+s + + if "1L" in hname: + toget_1=hnameClone.replace("_1L", "_1Mu") + toget_2=hnameClone.replace("_1L", "_1Ele") + hTmp=tfile.Get(toget_1) + hTmp2=tfile.Get(toget_2) + if hTmp!=None and hTmp2!=None: hTmp.Add(hTmp2) + elif "2L" in hname: + toget_1=hnameClone.replace("_2L", "_2Mu") + toget_2=hnameClone.replace("_2L", "_2Ele") + toget_3=hnameClone.replace("_2L", "_1Mu1Ele") + hTmp=tfile.Get(toget_1) + hTmp2=tfile.Get(toget_2) + hTmp3=tfile.Get(toget_3) + if hTmp!=None and hTmp2!=None: hTmp.Add(hTmp2) + if hTmp!=None and hTmp3!=None: hTmp.Add(hTmp3) + else: + hTmp=tfile.Get(hnameClone) + + hTmp.Rebin(5) for iBin in range(1,h.GetNbinsX()+1): c= h.GetBinContent(iBin) @@ -1002,10 +1041,30 @@ def importPdfFromTH1(cat,mc,myBin,LikelihoodMapping,syst=None): if "QCDscale" in target: if mc["name"]=="Hptb" or "WJetsToLNu_HT" in mc["name"] or "DYJetsToLL_M-50_HT" in mc["name"] or "DYJetsToLL_M-5to50_HT" in mc["name"] or "ttlf" in mc["name"] or "ttb" in mc["name"] or "ttbb" in mc["name"] or "tt2b" in mc["name"] or "ttcc" in mc["name"]: + hTmp = envelop(tfile,togetClone,s) - toget = togetClone+'RF'+s + else: - hTmp=tfile.Get(toget) + if "1L" in cat["dir"]: + toget_1=toget.replace("_1L", "_1Mu") + toget_2=toget.replace("_1L", "_1Ele") + hTmp=tfile.Get(toget_1) + hTmp2=tfile.Get(toget_2) + if hTmp!=None and hTmp2!=None: hTmp.Add(hTmp2) + elif "2L" in cat["dir"]: + toget_1=toget.replace("_2L", "_2Mu") + toget_2=toget.replace("_2L", "_2Ele") + toget_3=toget.replace("_2L", "_1Mu1Ele") + hTmp=tfile.Get(toget_1) + hTmp2=tfile.Get(toget_2) + hTmp3=tfile.Get(toget_3) + if hTmp!=None and hTmp2!=None: hTmp.Add(hTmp2) + if hTmp!=None and hTmp3!=None: hTmp.Add(hTmp3) + else: + hTmp=tfile.Get(toget) + + if hTmp!= None: + hTmp.Rebin(5) if hTmp!= None: print "<*> Reading Hist '"+toget+"' integral=",hTmp.Integral(),' nBin=',hTmp.GetNbinsX(), 'underflow=',hTmp.GetBinContent(0), 'overflow=',hTmp.GetBinContent(hTmp.GetNbinsX()+1),' entries=',hTmp.GetEntries() if hTmp == None: @@ -1015,9 +1074,27 @@ def importPdfFromTH1(cat,mc,myBin,LikelihoodMapping,syst=None): if syst != None: print "<*> Hist '"+toget+"' doesn't exist wih the syst cloning now from the central " toget=base + "/" +cat["dir"] + "/" + cat["var"] + "_" + hname - hTmp=tfile.Get(toget) - # if hTmp!= None: - # hTmp.Rebin(5) + + if "1L" in cat["dir"]: + toget_1=toget.replace("_1L", "_1Mu") + toget_2=toget.replace("_1L", "_1Ele") + hTmp=tfile.Get(toget_1) + hTmp2=tfile.Get(toget_2) + if hTmp!=None and hTmp2!=None: hTmp.Add(hTmp2) + elif "2L" in cat["dir"]: + toget_1=toget.replace("_2L", "_2Mu") + toget_2=toget.replace("_2L", "_2Ele") + toget_3=toget.replace("_2L", "_1Mu1Ele") + hTmp=tfile.Get(toget_1) + hTmp2=tfile.Get(toget_2) + hTmp3=tfile.Get(toget_3) + if hTmp!=None and hTmp2!=None: hTmp.Add(hTmp2) + if hTmp!=None and hTmp3!=None: hTmp.Add(hTmp3) + else: + hTmp=tfile.Get(toget) + + if hTmp!= None: + hTmp.Rebin(5) if hTmp!= None: print "<*> Reading Hist '"+toget+"' integral=",hTmp.Integral(),' nBin=',hTmp.GetNbinsX(), 'underflow=',hTmp.GetBinContent(0), 'overflow=',hTmp.GetBinContent(hTmp.GetNbinsX()+1),' entries=',hTmp.GetEntries() ### SCALE for the 2/3 @@ -1193,9 +1270,26 @@ def importPdfFromTH1SumBKG(cat,mc,syst=None,do1Third=False): if mc["name"]=="Hptb" and m!=opts.kMass: continue - hTmp=tfile.Get(toget) -# if hTmp!= None: -# hTmp.Rebin(5) + if "1L" in cat["dir"]: + toget_1=toget.replace("_1L", "_1Mu") + toget_2=toget.replace("_1L", "_1Ele") + hTmp=tfile.Get(toget_1) + hTmp2=tfile.Get(toget_2) + if hTmp!= None and hTmp2!= None: hTmp.Add(hTmp2) + elif "2L" in cat["dir"]: + toget_1=toget.replace("_2L", "_2Mu") + toget_2=toget.replace("_2L", "_2Ele") + toget_3=toget.replace("_2L", "_1Mu1Ele") + hTmp=tfile.Get(toget_1) + hTmp2=tfile.Get(toget_2) + hTmp3=tfile.Get(toget_3) + if hTmp!= None and hTmp2!= None: hTmp.Add(hTmp2) + if hTmp!= None and hTmp3!= None: hTmp.Add(hTmp3) + else: + hTmp=tfile.Get(toget) + + if hTmp!= None: + hTmp.Rebin(5) if hTmp!= None: print "<*> Reading Hist '"+toget+"'",hTmp.Integral(),' nBin=',hTmp.GetNbinsX(),'underflow=',hTmp.GetBinContent(0), 'overflow=',hTmp.GetBinContent(hTmp.GetNbinsX()+1), ' entries=',hTmp.GetEntries() @@ -1351,6 +1445,7 @@ def importPdfFromTH1SumBKG(cat,mc,syst=None,do1Third=False): ##import data ###for c in catStore: + cat=catStore[c] tfile = cat["file"] if tfile == None: @@ -1364,9 +1459,31 @@ def importPdfFromTH1SumBKG(cat,mc,syst=None,do1Third=False): if ("1Ele" in cat["dir"] or "2Ele" in cat["dir"]) and not ("1Mu1Ele" in cat["dir"]): toget+="_SingleElectron" elif "1Mu" in cat["dir"] or "2Mu" in cat["dir"] or "1Mu1Ele" in cat["dir"]: toget+="_SingleMuon" - h=tfile.Get(toget) -# if h != None: -# h.Rebin(5) + if "1L" in cat["dir"]: + toget_1=toget.replace("_1L", "_1Mu") + toget_1+="_SingleMuon" + toget_2=toget.replace("_1L", "_1Ele") + toget_2+="_SingleElectron" + h=tfile.Get(toget_1) + hTmp2=tfile.Get(toget_2) + if h!= None: h.Add(hTmp2) + elif "2L" in cat["dir"]: + toget_1=toget.replace("_2L", "_2Mu") + toget_1+="_SingleMuon" + toget_2=toget.replace("_2L", "_2Ele") + toget_2+="_SingleElectron" + toget_3=toget.replace("_2L", "_1Mu1Ele") + toget_3+="_SingleMuon" + h=tfile.Get(toget_1) + hTmp2=tfile.Get(toget_2) + hTmp3=tfile.Get(toget_3) + if h!= None and hTmp2: h.Add(hTmp2) + if h!= None and hTmp3: h.Add(hTmp3) + else: + h=tfile.Get(toget) + + if h != None: + h.Rebin(5) if h == None: print "<*> Hist do not exists ",toget diff --git a/src/Loop.cpp b/src/Loop.cpp index e87ec6ab..7ff64028 100644 --- a/src/Loop.cpp +++ b/src/Loop.cpp @@ -50,7 +50,6 @@ int Looper::AddSmear(string name){ if (name == "JES"){ SmearJes *s = new SmearJes(); systs_ . push_back(s); return 0;} if (name == "JER"){ SmearJer *s = new SmearJer(); systs_ . push_back(s); return 0;} if (name == "PU"){ SmearPu *s = new SmearPu(); systs_ . push_back(s); return 0;} - if (name == "SDMassSCALE"){ SmearSDMassScale *s = new SmearSDMassScale(); systs_ . push_back(s); return 0;} cout <<"[Looper]::[AddSmear]::[WARNING] Smear "<sdmasssyst = syst_; - } - - return SMEAR_OK; - -} // Local Variables: // mode:c++ From 065d028b7d58aa661ff40291c43eef5f493261c6 Mon Sep 17 00:00:00 2001 From: maria Date: Sat, 24 Mar 2018 10:19:44 +0100 Subject: [PATCH 02/60] fullHad: march23 --- script/bwsFullHadTB.py | 31 ++++++++++--------------------- 1 file changed, 10 insertions(+), 21 deletions(-) diff --git a/script/bwsFullHadTB.py b/script/bwsFullHadTB.py index 818b047c..42433bd4 100644 --- a/script/bwsFullHadTB.py +++ b/script/bwsFullHadTB.py @@ -21,27 +21,15 @@ parser= OptionParser() -##parser.add_option("","--input",type='string',help="Input ROOT file. [%default]", default="/afs/cern.ch/user/h/hum/work/public/CMSSW_8_0_26_patch1/src/ChargedHiggs/June12.root") -##parser.add_option("","--input",type='string',help="Input ROOT file. [%default]", default="/afs/cern.ch/user/h/hum/work/public/CMSSW_8_0_26_patch1/src/ChargedHiggs/hysteriaMeow.root") -##parser.add_option("","--input",type='string',help="Input ROOT file. [%default]", default="/afs/cern.ch/user/h/hum/work/public/CMSSW_8_0_26_patch1/src/ChargedHiggs/ohho.root") -##parser.add_option("","--input",type='string',help="Input ROOT file. [%default]", default="/afs/cern.ch/user/h/hum/work/public/CMSSW_8_0_26_patch1/src/ChargedHiggs/ssolstice.root") - -##parser.add_option("","--input",type='string',help="Input ROOT file. [%default]", default="/afs/cern.ch/user/h/hum/work/public/CMSSW_8_0_26_patch1/src/ChargedHiggs/ldoJune.root") -##parser.add_option("","--input",type='string',help="Input ROOT file. [%default]", default="/afs/cern.ch/user/h/hum/work/public/CMSSW_8_0_26_patch1/src/ChargedHiggs/bebetter.root") - -#### -#parser.add_option("","--input",type='string',help="Input ROOT file. [%default]", default="/afs/cern.ch/user/h/hum/work/public/CMSSW_8_0_26_patch1/src/ChargedHiggs/insaneM.root") -#parser.add_option("","--input",type='string',help="Input ROOT file. [%default]", default="/afs/cern.ch/user/h/hum/work/public/CMSSW_8_0_26_patch1/src/ChargedHiggs/SoHot.root") -#parser.add_option("","--input",type='string',help="Input ROOT file. [%default]", default="/afs/cern.ch/user/h/hum/work/public/CMSSW_8_0_26_patch1/src/ChargedHiggs/midAug.root") -#parser.add_option("","--input",type='string',help="Input ROOT file. [%default]", default="/afs/cern.ch/user/h/hum/work/public/CMSSW_8_0_26_patch1/src/ChargedHiggs/lateAug.root") -#parser.add_option("","--input",type='string',help="Input ROOT file. [%default]", default="/afs/cern.ch/user/h/hum/work/public/CMSSW_8_0_26_patch1/src/ChargedHiggs/ntufile/updlimit.root") -#parser.add_option("","--inputBin",type='string',help="Input ROOT file. [%default]", default="/afs/cern.ch/user/h/hum/work/public/CMSSW_8_0_26_patch1/src/ChargedHiggs/ntufile/updlimit.root") - #parser.add_option("","--input",type='string',help="Input ROOT file. [%default]", default="/afs/cern.ch/user/h/hum/work/public/CMSSW_8_0_26_patch1/src/ChargedHiggs/ntufile/crazylimit0306.root") #parser.add_option("","--inputBin",type='string',help="Input ROOT file. [%default]", default="/afs/cern.ch/user/h/hum/work/public/CMSSW_8_0_26_patch1/src/ChargedHiggs/ntufile/crazylimit0306.root") -parser.add_option("","--input",type='string',help="Input ROOT file. [%default]", default="/afs/cern.ch/user/h/hum/work/public/CMSSW_8_0_26_patch1/src/ChargedHiggs/ntufile/pipilimitnew.root") -parser.add_option("","--inputBin",type='string',help="Input ROOT file. [%default]", default="/afs/cern.ch/user/h/hum/work/public/CMSSW_8_0_26_patch1/src/ChargedHiggs/ntufile/pipilimitnew.root") +#parser.add_option("","--input",type='string',help="Input ROOT file. [%default]", default="/afs/cern.ch/user/h/hum/work/public/CMSSW_8_0_26_patch1/src/ChargedHiggs/ntufile/pipilimitnew.root") +#parser.add_option("","--inputBin",type='string',help="Input ROOT file. [%default]", default="/afs/cern.ch/user/h/hum/work/public/CMSSW_8_0_26_patch1/src/ChargedHiggs/ntufile/pipilimitnew.root") + +parser.add_option("","--input",type='string',help="Input ROOT file. [%default]", default="/afs/cern.ch/user/h/hum/work/public/CMSSW_8_0_26_patch1/src/ChargedHiggs/ntufile/freze2limit.root") +parser.add_option("","--inputBin",type='string',help="Input ROOT file. [%default]", default="/afs/cern.ch/user/h/hum/work/public/CMSSW_8_0_26_patch1/src/ChargedHiggs/ntufile/freze2limit.root") + if doSyst: parser.add_option("-o","--output",type='string',help="Output ROOT file. [%default]", default="workspace_SYST.root") @@ -293,7 +281,8 @@ def RebinN(h,nBin): # "QCDscaleS":{"type":"shape", "wsname":"QCDscaleHptb","name":"Scale","proc":["Hptb"]}, ### MET-Jets-PU "CMS_pileup":{"type":"shape", "wsname":"CMS_pileup","name":"PU","proc":[".*"]}, -# "CMS_scale_uncluster":{"type":"lnN", "value":["1.02"],"proc":[".*"],"wsname":"CMS_scale_uncluster","name":"XXX"}, + "CMS_scale_uncluster":{"type":"shape", "wsname":"CMS_scale_uncluster","name":"UNCLUSTER","proc":[".*"]}, + "CMS_SDmassScale":{"type":"shape", "wsname":"CMS_SDmassSCALE","name":"SDmassSCALE","proc":[".*"]}, # "CMS_res_j":{"type":"shape", "wsname":"CMS_res_j","name":"JER","proc":[".*"]}, "CMS_scale_j":{"type":"shape", "wsname":"CMS_scale_j","name":"JESANDCSV","proc":[".*"]}, ##Light jets Heavy flavor contamination @@ -319,11 +308,11 @@ def RebinN(h,nBin): print "* ",cat,":",catStore[cat] print "---------------------- --------" -fileTmp="MIAO_MARCH17/"+label+VarTest+opts.kMass+"_"+opts.output +fileTmp="MIAO_MARCH23/"+label+VarTest+opts.kMass+"_"+opts.output w = ROOT.RooWorkspace("w","w") datNameTmp = opts.datCardName -datName = "MIAO_MARCH17/"+label+ VarTest+opts.kMass+"_" + datNameTmp +datName = "MIAO_MARCH23/"+label+ VarTest+opts.kMass+"_" + datNameTmp datacard=open(datName,"w") datacard.write("-------------------------------------\n") From e96208b9541fde96e9836082a815c1626e49a9e0 Mon Sep 17 00:00:00 2001 From: maria Date: Fri, 20 Apr 2018 21:04:52 +0200 Subject: [PATCH 03/60] leptonic analysis --- script/SystematicSmoother.py | 329 +++++++++++++++++++++++++++++++++++ script/bwsTB.py | 309 +++++++++++++++++--------------- 2 files changed, 496 insertions(+), 142 deletions(-) create mode 100644 script/SystematicSmoother.py diff --git a/script/SystematicSmoother.py b/script/SystematicSmoother.py new file mode 100644 index 00000000..f3cda0e1 --- /dev/null +++ b/script/SystematicSmoother.py @@ -0,0 +1,329 @@ +import sys,array,copy, math +import ROOT +ROOT.gROOT.SetBatch() +ROOT.gStyle.SetOptStat(0) +ROOT.gStyle.SetOptTitle(0) + +class SystematicSmoother: + # rebins histogram such that at least one entry is present in each bin + hNomOrig = None + hNom = None # original nominal + hUp = None # original up --> will be overwritten by smoothed value + hDown = None # original down --> will be overwritten by smoothed value + + rUp = None + rDown = None + + rUpSmoothed = None + rDownSmoothed = None + + saveDir = None + name = "" + + maxStat = 0.2 + sigma = 10 + + binMin = 0 + binMax = 0 + + nameUp = "" + nameDown = "" + + # aux vars + h = None # tmp var needed for rebin functions (switch between up/down) + + def __init__(self, hNom_, hUp_, hDown_, saveDir_ = None): + + ROOT.gErrorIgnoreLevel = ROOT.kWarning + + self.nameUp = hUp_.GetName() + self.nameDown = hDown_.GetName() + + self.hNomOrig = hNom_.Clone("hNomTmp") # used to re-calculate the absolute variations (unbinned) + self.hNom = hNom_.Clone("hNom") # rebin on this + self.hUp = hUp_.Clone("hUp") # left unbinned + self.hDown = hDown_.Clone("hDown") # left unbinned + + + self.saveDir = saveDir_ # if !none: write plot of ratios to this folder + self.name = hUp_.GetName().replace("up", "").replace("Up", "").replace("/", "_") + + hUp_.Delete() + hDown_.Delete() + + # make ratios (original) + self.rUp = self.hUp.Clone("up") + self.rDown = self.hDown.Clone("down") + self.rUp.Divide(self.hNom) + self.rDown.Divide(self.hNom) + + # save min/max bins (needed for rebinning) + self.binMin = float(self.hNom.GetBinLowEdge(1)) # min bin + self.binMax = float(self.hNom.GetBinLowEdge(self.hNom.GetNbinsX()+1)) # max bin + + + def smooth(self): + + # rebin the histograms + self.rebin() + # new histograms containing the smoothed ratios --> after rebinning + self.rUpSmoothed = self.rUp.Clone("upSmoothed") + self.rDownSmoothed = self.rDown.Clone("downSmoothed") + +# if 'HplusTB_HplusToTB' in self.nameUp or 'HplusTB_HplusToTB' in self.nameDown: +# self.smoothGaussianKernel() +# else: +# self.smoothFit() + self.smoothFit() +# self.plot() # plot it + + # construct the absolute up/down variations + for i in range(1, self.hNomOrig.GetNbinsX()+1): + + self.hUp.SetBinContent(i, self.hNomOrig.GetBinContent(i)*self.rUpSmoothed.GetBinContent(self.rUpSmoothed.FindBin(self.hNomOrig.GetBinCenter(i)))) + self.hDown.SetBinContent(i, self.hNomOrig.GetBinContent(i)*self.rDownSmoothed.GetBinContent(self.rDownSmoothed.FindBin(self.hNomOrig.GetBinCenter(i)))) + self.hUp.SetName(self.nameUp) + self.hDown.SetName(self.nameDown) + + return self.hUp, self.hDown + + def smoothFit(self): + + if self.rUp.GetNbinsX() < 6: return + + prev=0. + func=None + for n in range(1,6): + + myfunc=None + if n==1: myfunc=ROOT.TF1("myfunc1","[0]+x*[1]",0, self.rUp.GetNbinsX()) + elif n==2:myfunc=ROOT.TF1("myfunc2","[0]+x*[1]+x*x*[2]",0, self.rUp.GetNbinsX()) + elif n==3:myfunc=ROOT.TF1("myfunc3","[0]+x*[1]+x*x*[2]+[3]*x*x*x",0, self.rUp.GetNbinsX()) + elif n==4:myfunc=ROOT.TF1("myfunc4","[0]+x*[1]+x*x*[2]+[3]*x*x*x+[4]*x*x*x*x",0, self.rUp.GetNbinsX()) + elif n==5:myfunc=ROOT.TF1("myfunc5","[0]+x*[1]+x*x*[2]+[3]*x*x*x+[4]*x*x*x*x+[5]*x*x*x*x*x",0, self.rUp.GetNbinsX()) + self.rUp.Fit("myfunc%d"%n,"WQN") + self.rUp.Fit("myfunc%d"%n,"WQNM") + chi2=myfunc.GetChisquare() + ftest= (prev-chi2)/1. / (chi2/( self.rUp.GetNbinsX()-n)) + prob = 1.-ROOT.TMath.FDistI(ftest,1, self.rUp.GetNbinsX()-n) + prev=chi2 + if n==5: func=myfunc + if n>1:print "-> fTest prob for degree",n,"prob=",prob + if (prob >0.02 and n > 1) or n==5: + # exit strategy + print "-> fTest choose degree",n,"for up variation","prob=",prob + for ibin in range(1, self.rUp.GetNbinsX()+1): + self.rUpSmoothed.SetBinContent(ibin, func.Eval(self.rUp.GetBinCenter(ibin))) + break + func=myfunc + + prev=0. + func=None + for n in range(1,6): + + myfunc=None + if n==1: myfunc=ROOT.TF1("myfunc1","[0]+x*[1]",0, self.rDown.GetNbinsX()) + elif n==2:myfunc=ROOT.TF1("myfunc2","[0]+x*[1]+x*x*[2]",0, self.rDown.GetNbinsX()) + elif n==3:myfunc=ROOT.TF1("myfunc3","[0]+x*[1]+x*x*[2]+[3]*x*x*x",0, self.rDown.GetNbinsX()) + elif n==4:myfunc=ROOT.TF1("myfunc4","[0]+x*[1]+x*x*[2]+[3]*x*x*x+[4]*x*x*x*x",0, self.rDown.GetNbinsX()) + elif n==5:myfunc=ROOT.TF1("myfunc5","[0]+x*[1]+x*x*[2]+[3]*x*x*x+[4]*x*x*x*x+[5]*x*x*x*x*x",0, self.rDown.GetNbinsX()) + self.rDown.Fit("myfunc%d"%n,"WQN") + self.rDown.Fit("myfunc%d"%n,"WQNM") + chi2=myfunc.GetChisquare() + ftest= (prev-chi2)/1. / (chi2/( self.rDown.GetNbinsX()-n)) + prob = 1.-ROOT.TMath.FDistI(ftest,1, self.rDown.GetNbinsX()-n) + prev=chi2 + if n==5: func=myfunc + if n>1:print "-> fTest prob for degree",n,"prob=",prob + if (prob >0.02 and n > 1) or n==5: + # exit strategy + print "-> fTest choose degree",n,"for up variation","prob=",prob + for ibin in range(1, self.rDown.GetNbinsX()+1): + self.rDownSmoothed.SetBinContent(ibin, func.Eval(self.rDown.GetBinCenter(ibin))) + break + func=myfunc + + + + def smoothGaussianKernel(self): + + if self.rUp.GetNbinsX() == 1: return + + print "[SystematicSmoother] linear adaptive Gaussian kernel smoothing with sigma = %d" % (self.sigma) + + for i in range(1, self.rUp.GetNbinsX()+1): + + numUp = 0.0 + numDn = 0.0 + denUp = 0.0 + denDown = 0.0 + + for j in range(1, self.rUp.GetNbinsX()+1): + + weightUp = math.exp( -(i-j)**2/(2.*self.sigma)) + weightDown = math.exp( -(i-j)**2/(2.*self.sigma)) + + denUp += weightUp + denDown += weightDown + numUp += self.rUp.GetBinContent(j)*weightUp + numDn += self.rDown.GetBinContent(j)*weightDown + + self.rUpSmoothed.SetBinContent(i, numUp/denUp) + self.rDownSmoothed.SetBinContent(i, numDn/denDown) + + + def rebin(self): + + # rebin the nominal histo such that enough statistics is in the bin + self.h = self.hNom + b = self.h.GetNbinsX() + pos = self.mergeCriteria() + while pos != -1: + if pos == 1 and self.h.GetNbinsX() == 1: break # in case of need to rebin in one big bin + if pos == self.h.GetNbinsX(): self.mergeBins(pos) # if uttermost right bin: merge pos and pos-1 + else: self.mergeBins(pos+1) # merge pos and pos+1 + pos = self.mergeCriteria() # update + + + a = self.h.GetNbinsX() + print "[SystematicSmoother] rebin nominal histogram from %d bins to %d bins" % (b, a) + + self.hNom = self.h + + # rebin the ratio histograms --> make them again + mybins = array.array('d', self.getBinArray()) + # make ratios (original) + self.rUp = self.hUp.Clone("up").Rebin(len(mybins)-1, "up", mybins) + self.rDown = self.hDown.Clone("down").Rebin(len(mybins)-1, "down", mybins) + self.rUp.Divide(self.hNom) + self.rDown.Divide(self.hNom) + + + def plot(self): + + if self.saveDir == None: return + + self.rUp.SetLineWidth(0) + self.rUp.SetLineColor(ROOT.kBlue) + self.rUp.SetLineColorAlpha(ROOT.kBlue, 0.4) + self.rUp.SetMarkerColor(ROOT.kBlue) + self.rUp.SetMarkerStyle(7) + + self.rDown.SetLineWidth(0) + self.rDown.SetLineColor(ROOT.kRed) + self.rDown.SetLineColorAlpha(ROOT.kRed, 0.4) + self.rDown.SetMarkerColor(ROOT.kRed) + self.rDown.SetMarkerStyle(7) + + self.rUp.GetYaxis().SetRangeUser(0.5, 1.5) + self.rUp.GetXaxis().SetRangeUser(self.binMin, self.binMax) + + c = ROOT.TCanvas("c", "c", 800, 800) + c.SetGrid() + + leg = ROOT.TLegend(0.6, 0.8, 0.9, 0.9) + leg.SetBorderSize(1) + leg.SetFillStyle(1001) #1001 + leg.SetFillColor(0) + + legUp = "up (#Delta = %.4f %%)" % (100.*abs(self.rUpSmoothed.Integral() - self.rUp.Integral())/self.rUp.Integral()) + legDown = "down (#Delta = %.4f %%)" % (100.*abs(self.rDownSmoothed.Integral() - self.rDown.Integral())/self.rDown.Integral()) + + leg.AddEntry(self.rUpSmoothed, legUp, "L") + leg.AddEntry(self.rDownSmoothed, legDown, "l") + + + + self.rUp.Draw("P") + self.rDown.Draw("SAME P") + + + self.rUpSmoothed.SetLineWidth(2) + self.rUpSmoothed.SetLineColor(ROOT.kBlue) + self.rUpSmoothed.Draw("SAME HIST") + self.rDownSmoothed.SetLineWidth(2) + self.rDownSmoothed.SetLineColor(ROOT.kRed) + self.rDownSmoothed.Draw("SAME HIST") + + + c.SetTopMargin(.06) + c.SetRightMargin(0.05) + #c.SetBottomMargin(0.0) + c.SetLeftMargin(0.12) + + # top text left + left = ROOT.TLatex() + left.SetNDC() + left.SetTextFont(43) + left.SetTextSize(20) + left.SetTextAlign(11) + #left.DrawLatex(.12,.95, "") + # top text right + right = ROOT.TLatex() + right.SetNDC() + right.SetTextFont(43) + right.SetTextSize(20) + right.SetTextAlign(31) + right.DrawLatex(.95,.95, self.name) + + # CMS preliminary + right.SetTextSize(30) + right.SetTextAlign(13) + #right.DrawLatex(.13,.93,"#bf{CMS} #scale[0.7]{#it{Preliminary}}") + + self.rUp.GetYaxis().SetTitle("ratio") + if self.binMax > 100: self.rUp.GetXaxis().SetTitle("H_{T} [GeV]") + else: self.rUp.GetXaxis().SetTitle("MVA discriminator") + self.rUp.GetYaxis().SetTitleOffset(1.5) + + + + leg.Draw() + c.SaveAs(self.saveDir + "/" + self.name + ".pdf") + c.SaveAs(self.saveDir + "/" + self.name + ".png") + + + # get the first zero/negative bin id starting from the right + def mergeCriteria(self): + + pos = -1 + for b in reversed(range(1, self.h.GetNbinsX()+1)): + if self.h.GetBinContent(b) <= 0 or self.h.GetBinError(b) / self.h.GetBinContent(b) > self.maxStat: + + #print b, self.h.GetBinError(b), self.h.GetBinContent(b), self.h.GetNbinsX() + pos = b + break + return pos + # function which merges bin i with the left adjecent bin + def mergeBins(self, i): + arr = self.getBinArray() + ''' + ARR INDEX 0 1 2 3 4 5 6 + [0, 100, 500, 1000, 2000, 5000, 8000] + BIN NUMBER 1 2 3 4 5 6 + ''' + # i represents the bin number, so do i-1 construct array of bins from the histo + arr_new = [] + for j in range(0, len(arr)): + if j == i-1: continue + arr_new.append(arr[j]) + # merge and return + mybins = array.array('d', arr_new) + + #self.h = self.h.Rebin(len(mybins)-1, self.h.GetName(), mybins) + + name = self.h.GetName() + self.h.SetName("tmpp") + tmp = self.h.Rebin(len(mybins)-1, name, mybins) + self.h.Delete() # necessary to reduce memory + self.h = tmp + + + def getBinArray(self): + ret = [self.binMin] + for i in range(2, self.h.GetNbinsX()+1): + x = float(self.h.GetBinLowEdge(i)) + ret.append(x) + + ret.append(self.binMax) + return ret diff --git a/script/bwsTB.py b/script/bwsTB.py index 19f3b9f0..ad176d24 100644 --- a/script/bwsTB.py +++ b/script/bwsTB.py @@ -7,6 +7,7 @@ sys.path.insert(0, 'script') import FwBinning as FwRebin +import SystematicSmoother as SS #maxStat=0.13 maxStat=0.3 @@ -29,8 +30,8 @@ ###### if doSyst: - parser.add_option("-o","--output",type='string',help="Output ROOT file. [%default]", default="workspace_SYST.root") - parser.add_option("-d","--datCardName",type='string',help="Output txt file. [%default]", default="cms_datacard_topbottom_SYST.txt") + parser.add_option("-o","--output",type='string',help="Output ROOT file. [%default]", default="_smooth_workspace_SYST.root") + parser.add_option("-d","--datCardName",type='string',help="Output txt file. [%default]", default="_smooth_cms_datacard_topbottom_SYST.txt") else : parser.add_option("-o","--output",type='string',help="Output ROOT file. [%default]", default="workspace_STAT.root") parser.add_option("-d","--datCardName",type='string',help="Output txt file. [%default]", default="cms_datacard_topbottom_STAT.txt") @@ -126,14 +127,14 @@ def RebinN(h,nBin): #1l if opts.kTest==0 or opts.kTest==1 or opts.kTest==2 or opts.kTest==3 or opts.kTest==4 or opts.kTest==5 or opts.kTest==6 or opts.kTest==7 or opts.kTest==8 or opts.kTest==9 or opts.kTest==10 or opts.kTest==11 or opts.kTest==12 or opts.kTest==13 or opts.kTest==14 or opts.kTest==15 or opts.kTest==16 or opts.kTest==100 or opts.kTest==101 or opts.kTest==102: - channel = ["1Mu","1Ele"] -## channel = ["1L"] +# channel = ["1Mu","1Ele"] + channel = ["1L"] basecat = ["Baseline","topCRR4","topCRR5","extraRadCRR10","extraRadCRR7","charmCR"] #2l if opts.kTest==30 or opts.kTest==31 or opts.kTest==32 or opts.kTest==33 or opts.kTest==34 or opts.kTest==35 or opts.kTest==36 or opts.kTest==37 or opts.kTest==38 or opts.kTest==39 or opts.kTest==40 or opts.kTest==41 or opts.kTest==42 or opts.kTest==43 or opts.kTest==44 or opts.kTest==45 or opts.kTest==46 or opts.kTest==200 or opts.kTest==201 or opts.kTest==202: - channel = ["1Mu1Ele","2Mu","2Ele"] -# channel = ["2L"] +# channel = ["1Mu1Ele","2Mu","2Ele"] + channel = ["2L"] basecat = ["Baseline","topCRR4","topCRR5","extraRadCRR10","extraRadCRR7"] ### combined @@ -195,22 +196,22 @@ def RebinN(h,nBin): if opts.kTest==102 and (y == "1Ele" or y == "1Mu" or y == "1L") and ( x=="Baseline" or x=="charmCR" or "extraRadCR" in x): srList = ["1lh"] ## 1d-1l - if opts.kTest==1 and (y == "1Ele" or y == "1Mu" or y == "1L") and ( x=="Baseline" or x=="charmCR" or "extraRadCR" in x): srList = ["1"] - if opts.kTest==2 and (y == "1Ele" or y == "1Mu" or y == "1L") and ( x=="Baseline" or x=="charmCR" or "extraRadCR" in x): srList = ["2"] - if opts.kTest==3 and (y == "1Ele" or y == "1Mu" or y == "1L") and ( x=="Baseline" or x=="charmCR" or "extraRadCR" in x): srList = ["3"] - if opts.kTest==4 and (y == "1Ele" or y == "1Mu" or y == "1L") and ( x=="Baseline" or x=="charmCR" or "extraRadCR" in x): srList = ["4"] - if opts.kTest==5 and (y == "1Ele" or y == "1Mu" or y == "1L") and ( x=="Baseline" or x=="charmCR" or "extraRadCR" in x): srList = ["5"] - if opts.kTest==6 and (y == "1Ele" or y == "1Mu" or y == "1L") and ( x=="Baseline" or x=="charmCR" or "extraRadCR" in x): srList = ["6"] - if opts.kTest==7 and (y == "1Ele" or y == "1Mu" or y == "1L") and ( x=="Baseline" or x=="charmCR" or "extraRadCR" in x): srList = ["7"] - if opts.kTest==8 and (y == "1Ele" or y == "1Mu" or y == "1L") and ( x=="Baseline" or x=="charmCR" or "extraRadCR" in x): srList = ["8"] - if opts.kTest==9 and (y == "1Ele" or y == "1Mu" or y == "1L") and ( x=="Baseline" or x=="charmCR" or "extraRadCR" in x): srList = ["9"] - if opts.kTest==10 and (y == "1Ele" or y == "1Mu" or y == "1L") and ( x=="Baseline" or x=="charmCR" or "extraRadCR" in x): srList = ["10"] - if opts.kTest==11 and (y == "1Ele" or y == "1Mu" or y == "1L") and ( x=="Baseline" or x=="charmCR" or "extraRadCR" in x): srList = ["11"] - if opts.kTest==12 and (y == "1Ele" or y == "1Mu" or y == "1L") and ( x=="Baseline" or x=="charmCR" or "extraRadCR" in x): srList = ["12"] - if opts.kTest==13 and (y == "1Ele" or y == "1Mu" or y == "1L") and ( x=="Baseline" or x=="charmCR" or "extraRadCR" in x): srList = ["13"] - if opts.kTest==14 and (y == "1Ele" or y == "1Mu" or y == "1L") and ( x=="Baseline" or x=="charmCR" or "extraRadCR" in x): srList = ["14"] - if opts.kTest==15 and (y == "1Ele" or y == "1Mu" or y == "1L") and ( x=="Baseline" or x=="charmCR" or "extraRadCR" in x): srList = ["15"] - if opts.kTest==16 and (y == "1Ele" or y == "1Mu" or y == "1L") and ( x=="Baseline" or x=="charmCR" or "extraRadCR" in x): srList = ["16"] + if opts.kTest==1 and (y == "1Ele" or y == "1Mu" or y == "1L") and ( x=="Baseline" or x=="charmCR" or "extraRadCR" in x or "topCR" in x): srList = ["1"] + if opts.kTest==2 and (y == "1Ele" or y == "1Mu" or y == "1L") and ( x=="Baseline" or x=="charmCR" or "extraRadCR" in x or "topCR" in x): srList = ["2"] + if opts.kTest==3 and (y == "1Ele" or y == "1Mu" or y == "1L") and ( x=="Baseline" or x=="charmCR" or "extraRadCR" in x or "topCR" in x): srList = ["3"] + if opts.kTest==4 and (y == "1Ele" or y == "1Mu" or y == "1L") and ( x=="Baseline" or x=="charmCR" or "extraRadCR" in x or "topCR" in x): srList = ["4"] + if opts.kTest==5 and (y == "1Ele" or y == "1Mu" or y == "1L") and ( x=="Baseline" or x=="charmCR" or "extraRadCR" in x or "topCR" in x): srList = ["5"] + if opts.kTest==6 and (y == "1Ele" or y == "1Mu" or y == "1L") and ( x=="Baseline" or x=="charmCR" or "extraRadCR" in x or "topCR" in x): srList = ["6"] + if opts.kTest==7 and (y == "1Ele" or y == "1Mu" or y == "1L") and ( x=="Baseline" or x=="charmCR" or "extraRadCR" in x or "topCR" in x): srList = ["7"] + if opts.kTest==8 and (y == "1Ele" or y == "1Mu" or y == "1L") and ( x=="Baseline" or x=="charmCR" or "extraRadCR" in x or "topCR" in x): srList = ["8"] + if opts.kTest==9 and (y == "1Ele" or y == "1Mu" or y == "1L") and ( x=="Baseline" or x=="charmCR" or "extraRadCR" in x or "topCR" in x): srList = ["9"] + if opts.kTest==10 and (y == "1Ele" or y == "1Mu" or y == "1L") and ( x=="Baseline" or x=="charmCR" or "extraRadCR" in x or "topCR" in x): srList = ["10"] + if opts.kTest==11 and (y == "1Ele" or y == "1Mu" or y == "1L") and ( x=="Baseline" or x=="charmCR" or "extraRadCR" in x or "topCR" in x): srList = ["11"] + if opts.kTest==12 and (y == "1Ele" or y == "1Mu" or y == "1L") and ( x=="Baseline" or x=="charmCR" or "extraRadCR" in x or "topCR" in x): srList = ["12"] + if opts.kTest==13 and (y == "1Ele" or y == "1Mu" or y == "1L") and ( x=="Baseline" or x=="charmCR" or "extraRadCR" in x or "topCR" in x): srList = ["13"] + if opts.kTest==14 and (y == "1Ele" or y == "1Mu" or y == "1L") and ( x=="Baseline" or x=="charmCR" or "extraRadCR" in x or "topCR" in x): srList = ["14"] + if opts.kTest==15 and (y == "1Ele" or y == "1Mu" or y == "1L") and ( x=="Baseline" or x=="charmCR" or "extraRadCR" in x or "topCR" in x): srList = ["15"] + if opts.kTest==16 and (y == "1Ele" or y == "1Mu" or y == "1L") and ( x=="Baseline" or x=="charmCR" or "extraRadCR" in x or "topCR" in x): srList = ["16"] ## 2d-1l ## if opts.kTest==14 and (y == "1Ele" or y == "1Mu" or y == "1L") and x=="Baseline": srList = ["_1ll"] @@ -227,22 +228,22 @@ def RebinN(h,nBin): ## HT-2l if x=="Baseline" and opts.kTest==30: srList = [""] ## 1d-2l - if opts.kTest==31 and (y == "2Ele" or y == "2Mu" or y == "1Mu1Ele" or y == "2L") and ( x=="Baseline" or x=="charmCR" or "extraRadCR" in x ): srList = ["1"] - if opts.kTest==32 and (y == "2Ele" or y == "2Mu" or y == "1Mu1Ele" or y == "2L") and ( x=="Baseline" or x=="charmCR" or "extraRadCR" in x ): srList = ["2"] - if opts.kTest==33 and (y == "2Ele" or y == "2Mu" or y == "1Mu1Ele" or y == "2L") and ( x=="Baseline" or x=="charmCR" or "extraRadCR" in x ): srList = ["3"] - if opts.kTest==34 and (y == "2Ele" or y == "2Mu" or y == "1Mu1Ele" or y == "2L") and ( x=="Baseline" or x=="charmCR" or "extraRadCR" in x ): srList = ["4"] - if opts.kTest==35 and (y == "2Ele" or y == "2Mu" or y == "1Mu1Ele" or y == "2L") and ( x=="Baseline" or x=="charmCR" or "extraRadCR" in x ): srList = ["5"] - if opts.kTest==36 and (y == "2Ele" or y == "2Mu" or y == "1Mu1Ele" or y == "2L") and ( x=="Baseline" or x=="charmCR" or "extraRadCR" in x ): srList = ["6"] - if opts.kTest==37 and (y == "2Ele" or y == "2Mu" or y == "1Mu1Ele" or y == "2L") and ( x=="Baseline" or x=="charmCR" or "extraRadCR" in x ): srList = ["7"] - if opts.kTest==38 and (y == "2Ele" or y == "2Mu" or y == "1Mu1Ele" or y == "2L") and ( x=="Baseline" or x=="charmCR" or "extraRadCR" in x ): srList = ["8"] - if opts.kTest==39 and (y == "2Ele" or y == "2Mu" or y == "1Mu1Ele" or y == "2L") and ( x=="Baseline" or x=="charmCR" or "extraRadCR" in x ): srList = ["9"] - if opts.kTest==40 and (y == "2Ele" or y == "2Mu" or y == "1Mu1Ele" or y == "2L") and ( x=="Baseline" or x=="charmCR" or "extraRadCR" in x ): srList = ["10"] - if opts.kTest==41 and (y == "2Ele" or y == "2Mu" or y == "1Mu1Ele" or y == "2L") and ( x=="Baseline" or x=="charmCR" or "extraRadCR" in x ): srList = ["11"] - if opts.kTest==42 and (y == "2Ele" or y == "2Mu" or y == "1Mu1Ele" or y == "2L") and ( x=="Baseline" or x=="charmCR" or "extraRadCR" in x ): srList = ["12"] - if opts.kTest==43 and (y == "2Ele" or y == "2Mu" or y == "1Mu1Ele" or y == "2L") and ( x=="Baseline" or x=="charmCR" or "extraRadCR" in x ): srList = ["13"] - if opts.kTest==44 and (y == "2Ele" or y == "2Mu" or y == "1Mu1Ele" or y == "2L") and ( x=="Baseline" or x=="charmCR" or "extraRadCR" in x ): srList = ["14"] - if opts.kTest==45 and (y == "2Ele" or y == "2Mu" or y == "1Mu1Ele" or y == "2L") and ( x=="Baseline" or x=="charmCR" or "extraRadCR" in x ): srList = ["15"] - if opts.kTest==46 and (y == "2Ele" or y == "2Mu" or y == "1Mu1Ele" or y == "2L") and ( x=="Baseline" or x=="charmCR" or "extraRadCR" in x ): srList = ["16"] + if opts.kTest==31 and (y == "2Ele" or y == "2Mu" or y == "1Mu1Ele" or y == "2L") and ( x=="Baseline" or x=="charmCR" or "extraRadCR" in x or "topCR" in x): srList = ["1"] + if opts.kTest==32 and (y == "2Ele" or y == "2Mu" or y == "1Mu1Ele" or y == "2L") and ( x=="Baseline" or x=="charmCR" or "extraRadCR" in x or "topCR" in x): srList = ["2"] + if opts.kTest==33 and (y == "2Ele" or y == "2Mu" or y == "1Mu1Ele" or y == "2L") and ( x=="Baseline" or x=="charmCR" or "extraRadCR" in x or "topCR" in x): srList = ["3"] + if opts.kTest==34 and (y == "2Ele" or y == "2Mu" or y == "1Mu1Ele" or y == "2L") and ( x=="Baseline" or x=="charmCR" or "extraRadCR" in x or "topCR" in x): srList = ["4"] + if opts.kTest==35 and (y == "2Ele" or y == "2Mu" or y == "1Mu1Ele" or y == "2L") and ( x=="Baseline" or x=="charmCR" or "extraRadCR" in x or "topCR" in x): srList = ["5"] + if opts.kTest==36 and (y == "2Ele" or y == "2Mu" or y == "1Mu1Ele" or y == "2L") and ( x=="Baseline" or x=="charmCR" or "extraRadCR" in x or "topCR" in x): srList = ["6"] + if opts.kTest==37 and (y == "2Ele" or y == "2Mu" or y == "1Mu1Ele" or y == "2L") and ( x=="Baseline" or x=="charmCR" or "extraRadCR" in x or "topCR" in x): srList = ["7"] + if opts.kTest==38 and (y == "2Ele" or y == "2Mu" or y == "1Mu1Ele" or y == "2L") and ( x=="Baseline" or x=="charmCR" or "extraRadCR" in x or "topCR" in x): srList = ["8"] + if opts.kTest==39 and (y == "2Ele" or y == "2Mu" or y == "1Mu1Ele" or y == "2L") and ( x=="Baseline" or x=="charmCR" or "extraRadCR" in x or "topCR" in x): srList = ["9"] + if opts.kTest==40 and (y == "2Ele" or y == "2Mu" or y == "1Mu1Ele" or y == "2L") and ( x=="Baseline" or x=="charmCR" or "extraRadCR" in x or "topCR" in x): srList = ["10"] + if opts.kTest==41 and (y == "2Ele" or y == "2Mu" or y == "1Mu1Ele" or y == "2L") and ( x=="Baseline" or x=="charmCR" or "extraRadCR" in x or "topCR" in x): srList = ["11"] + if opts.kTest==42 and (y == "2Ele" or y == "2Mu" or y == "1Mu1Ele" or y == "2L") and ( x=="Baseline" or x=="charmCR" or "extraRadCR" in x or "topCR" in x): srList = ["12"] + if opts.kTest==43 and (y == "2Ele" or y == "2Mu" or y == "1Mu1Ele" or y == "2L") and ( x=="Baseline" or x=="charmCR" or "extraRadCR" in x or "topCR" in x): srList = ["13"] + if opts.kTest==44 and (y == "2Ele" or y == "2Mu" or y == "1Mu1Ele" or y == "2L") and ( x=="Baseline" or x=="charmCR" or "extraRadCR" in x or "topCR" in x): srList = ["14"] + if opts.kTest==45 and (y == "2Ele" or y == "2Mu" or y == "1Mu1Ele" or y == "2L") and ( x=="Baseline" or x=="charmCR" or "extraRadCR" in x or "topCR" in x): srList = ["15"] + if opts.kTest==46 and (y == "2Ele" or y == "2Mu" or y == "1Mu1Ele" or y == "2L") and ( x=="Baseline" or x=="charmCR" or "extraRadCR" in x or "topCR" in x): srList = ["16"] ## ## 1d-2l if opts.kTest==200 and (y == "2Ele" or y == "2Mu" or y == "1Mu1Ele" or y == "2L") and ( x=="Baseline" or x=="charmCR" or "extraRadCR" in x ): srList = ["2ll"] @@ -331,7 +332,10 @@ def RebinN(h,nBin): # x=macroRegion y=1L sr=bdtX reg=SR12 if thee ## BDT 1-14 for each mass point and for the merged set - if (( opts.kTest>0 and opts.kTest<18) or (opts.kTest>30 and opts.kTest<48 ) or opts.kTest>99 ) and ("Baseline" in x or "extraRadCR" in x or "charmCR" in x): + # use the HT in the topCR +# if (( opts.kTest>0 and opts.kTest<18) or (opts.kTest>30 and opts.kTest<48 ) or opts.kTest>99 ) and ("Baseline" in x or "extraRadCR" in x or "charmCR" in x): + # use the DNN everywhere in the topCR + if (( opts.kTest>0 and opts.kTest<18) or (opts.kTest>30 and opts.kTest<48 ) or opts.kTest>99 ) and ("Baseline" in x or "extraRadCR" in x or "charmCR" in x or "topCR" in x): name = x + "_" + sr + "_" + reg + "_" + y catStore [ name ] = { "name": name,"dir": x+ "_" + y,"file": None, "hasMC":["all"],"var":"bdt"+sr+""+reg} ## BDT 2d to be updated @@ -391,10 +395,10 @@ def RebinN(h,nBin): # "CMS_scale_j":{"type":"shape", "wsname":"CMS_scale_j","name":"JESANDCSV","proc":[".*"]} ## name used for shape "lumi_13TeV":{"type":"lnN", "value":["1.025"] ,"proc":[".*"],"wsname":"lumi_13TeV","name":"XXX"}, ## name used for shape - "CMS_eff_m":{"type":"lnN", "value":["1.04"] ,"proc":[".*"],"wsname":"CMS_eff_m","name":"XXX"}, ## name used for shape - "CMS_eff_e":{"type":"lnN", "value":["1.03"] ,"proc":[".*"],"wsname":"CMS_eff_e","name":"XXX"}, ## name used for shape + "CMS_eff_l":{"type":"lnN", "value":["1.04"] ,"proc":[".*"],"wsname":"CMS_eff_l","name":"XXX"}, ## name used for shape "CMS_eff_t":{"type":"lnN", "value":["1.03"] ,"proc":[".*"],"wsname":"CMS_eff_t","name":"XXX"}, ## name used for shape "CMS_pileup":{"type":"shape", "wsname":"CMS_pileup","name":"PU","proc":[".*"]}, ## name used for shape +## "CMS_scale_uncluster":{"type":"shape", "wsname":"CMS_scale_uncluster","name":"UNCLUSTER","proc":[".*"]}, "CMS_scale_uncluster":{"type":"lnN", "value":["1.02"],"proc":[".*"],"wsname":"CMS_scale_uncluster","name":"XXX"}, ## name used for shape "CMS_topreweight":{"type":"shape", "wsname":"CMS_topreweight","name":"TOPRW","proc":["ttlf","ttb","ttbb","tt2b","ttcc"]}, ## name used for shape "CMS_HTreweight":{"type":"shape", "wsname":"CMS_HTreweight","name":"htRECO","proc":["ewk"]}, ## name used for shape @@ -431,12 +435,12 @@ def RebinN(h,nBin): #print "---------------------- --------" #fileTmp="AUG6_HT/"+label+VarTest+opts.output -fileTmp="MARCH23_DATA/"+ label + VarTest + str(opts.kMass) + opts.output +fileTmp="APR16/"+ label + VarTest + str(opts.kMass) + opts.output w = ROOT.RooWorkspace("w","w") datNameTmp = opts.datCardName #datName = "AUG6_HT/"+ label + VarTest + datNameTmp -datName = "MARCH23_DATA/"+ label + VarTest + str(opts.kMass) + datNameTmp +datName = "APR16/"+ label + VarTest + str(opts.kMass) + datNameTmp datacard=open(datName,"w") datacard.write("-------------------------------------\n") @@ -569,6 +573,7 @@ def skip(cat,mc): ## def writeSystISRFSR(name="test",valueL=["1.027","1.026"], regexpL=["TT","ST",""]): + datacard.write(name+"\tlnN") invert=False @@ -830,11 +835,25 @@ def importStat(): if systStore[syst]["type"] == "lnN": writeNormSyst(syst,systStore[syst]["value"],systStore[syst]["proc"]) if systStore[syst]["type"] == "shape": + +# if opts.kTest==0 or opts.kTest==1 or opts.kTest==2 or opts.kTest==3 or opts.kTest==4 or opts.kTest==5 or opts.kTest==6 or opts.kTest==7 or opts.kTest==8 or opts.kTest==9 or opts.kTest==10 or opts.kTest==11 or opts.kTest==12 or opts.kTest==13 or opts.kTest==14 or opts.kTest==15 or opts.kTest==16 or opts.kTest==100 or opts.kTest==101 or opts.kTest==102: +# if ('CMS_scale_j' in syst): systStore[syst]["wsname"] += "_1l" +# if ('CMS_btag_LFstat1' in syst): systStore[syst]["wsname"] += "_1l" +# if ('CMS_btag_LFstat2' in syst): systStore[syst]["wsname"] += "_1l" +# if ('CMS_btag_LF' in syst and not 'LFstat' in syst): systStore[syst]["wsname"] += "_1l" + +# elif opts.kTest==30 or opts.kTest==31 or opts.kTest==32 or opts.kTest==33 or opts.kTest==34 or opts.kTest==35 or opts.kTest==36 or opts.kTest==37 or opts.kTest==38 or opts.kTest==39 or opts.kTest==40 or opts.kTest==41 or opts.kTest==42 or opts.kTest==43 or opts.kTest==44 or opts.kTest==45 or opts.kTest==46 or opts.kTest==200 or opts.kTest==201 or opts.kTest==202: +# if ('CMS_scale_j' in syst): systStore[syst]["wsname"] += "_2l" +# if ('CMS_btag_LFstat1' in syst): systStore[syst]["wsname"] += "_2l" +# if ('CMS_btag_LFstat2' in syst): systStore[syst]["wsname"] += "_2l" +# if ('CMS_btag_LF' in syst and not 'LFstat' in syst): systStore[syst]["wsname"] += "_2l" + writeSystShape(systStore[syst],systStore[syst]["proc"]) + + if doSyst: writeNormSyst("QCDscale_ttbar",["0.965/1.024","0.965/1.024","0.965/1.024","0.965/1.024","0.965/1.024"],["ttlf","ttcc","ttb","ttbb","tt2b"]) if doSyst: writeNormSyst("pdf_gg",["1.042","1.042","1.042","1.042","1.042"],["ttlf","ttcc","ttb","ttbb","tt2b"]) -###if doSyst: writeNormSyst("CMS_mass_ttbar",["1.027","1.027","1.027","1.027","1.027"],["ttlf","ttcc","ttb","ttbb","tt2b"]) if doSyst: writeNormSyst("CMS_HPTB_QCDscale_ttlf",["1.50"],["ttlf"]) if doSyst: writeNormSyst("CMS_HPTB_QCDscale_ttcc",["1.50"],["ttcc"]) @@ -842,16 +861,32 @@ def importStat(): if doSyst: writeNormSyst("CMS_HPTB_QCDscale_ttbb",["1.50"],["ttbb"]) if doSyst: writeNormSyst("CMS_HPTB_QCDscale_tt2b",["1.50"],["tt2b"]) -if doSyst: writeNormSyst("QCDscale_top",["0.90/1.10"],["top"]) -if doSyst: writeNormSyst("pdf_top",["1.03"],["top"]) +## "top" get the value od the single top +if doSyst: writeNormSyst("QCDscale_top",["0.977/1.028"],["top"]) +if doSyst: writeNormSyst("pdf_top",["1.026"],["top"]) +if doSyst: writeNormSyst("CMS_mass_ttbar",["1.027","1.027","1.027","1.027","1.027","1.022"],["ttlf","ttb","ttbb","tt2b","ttcc","top"]) -if doSyst: writeNormSyst("QCDscale_ewk",["0.98/1.02"],["ewk"]) +## "ewk" get the envelop of the DY and W+jets +if doSyst: writeNormSyst("QCDscale_ewk",["0.996/1.008"],["ewk"]) if doSyst: writeNormSyst("pdf_qqbar",["1.04"],["ewk"]) if doSyst: writeSystISRFSR(name="CMS_HPTB_ISR",valueL=["-999","999"], regexpL=["ttlf","ttb","ttbb","tt2b","ttcc"]) if doSyst: writeSystISRFSR(name="CMS_HPTB_FSR",valueL=["-999","999"], regexpL=["ttlf","ttb","ttbb","tt2b","ttcc"]) if doSyst: writeSystISRFSR(name="CMS_HPTB_HDAMP",valueL=["-999","999"], regexpL=["ttlf","ttb","ttbb","tt2b","ttcc"]) +## "ISR/FSR" +#if opts.kTest==0 or opts.kTest==1 or opts.kTest==2 or opts.kTest==3 or opts.kTest==4 or opts.kTest==5 or opts.kTest==6 or opts.kTest==7 or opts.kTest==8 or opts.kTest==9 or opts.kTest==10 or opts.kTest==11 or opts.kTest==12 or opts.kTest==13 or opts.kTest==14 or opts.kTest==15 or opts.kTest==16 or opts.kTest==100 or opts.kTest==101 or opts.kTest==102: + +# if doSyst: writeSystISRFSR(name="CMS_HPTB_ISR_1l",valueL=["-999","999"], regexpL=["ttlf","ttb","ttbb","tt2b","ttcc"]) +# if doSyst: writeSystISRFSR(name="CMS_HPTB_FSR_1l",valueL=["-999","999"], regexpL=["ttlf","ttb","ttbb","tt2b","ttcc"]) +# if doSyst: writeSystISRFSR(name="CMS_HPTB_HDAMP_1l",valueL=["-999","999"], regexpL=["ttlf","ttb","ttbb","tt2b","ttcc"]) + +#elif opts.kTest==30 or opts.kTest==31 or opts.kTest==32 or opts.kTest==33 or opts.kTest==34 or opts.kTest==35 or opts.kTest==36 or opts.kTest==37 or opts.kTest==38 or opts.kTest==39 or opts.kTest==40 or opts.kTest==41 or opts.kTest==42 or opts.kTest==43 or opts.kTest==44 or opts.kTest==45 or opts.kTest==46 or opts.kTest==200 or opts.kTest==201 or opts.kTest==202: + +# if doSyst: writeSystISRFSR(name="CMS_HPTB_ISR_2l",valueL=["-999","999"], regexpL=["ttlf","ttb","ttbb","tt2b","ttcc"]) +# if doSyst: writeSystISRFSR(name="CMS_HPTB_FSR_2l",valueL=["-999","999"], regexpL=["ttlf","ttb","ttbb","tt2b","ttcc"]) +# if doSyst: writeSystISRFSR(name="CMS_HPTB_HDAMP_2l",valueL=["-999","999"], regexpL=["ttlf","ttb","ttbb","tt2b","ttcc"]) + #if doSyst: writeNormSyst("QCDscale_ttbar",["0.977/1.028"],["ST"]) #if doSyst: writeNormSyst("pdf_ttbar",["1.026"],["ST"]) @@ -904,17 +939,14 @@ def importStat(): ## g.extend([hupbin,roo_mc_binup,pdf_mc_binup]) ## g.extend([hdnbin,roo_mc_bindn,pdf_mc_bindn]) - -def envelop(tfile,togetClone, s) : - - hname=togetClone+'RF'+s +def MergeCategory(tfile,hname): if "1L" in hname: toget_1=hname.replace("_1L", "_1Mu") toget_2=hname.replace("_1L", "_1Ele") hTmp=tfile.Get(toget_1) hTmp2=tfile.Get(toget_2) - if hTmp!=None and hTmp2!=None:hTmp.Add(hTmp2) + if hTmp!=None and hTmp2!=None: hTmp.Add(hTmp2) elif "2L" in hname: toget_1=hname.replace("_2L", "_2Mu") toget_2=hname.replace("_2L", "_2Ele") @@ -927,7 +959,53 @@ def envelop(tfile,togetClone, s) : else: hTmp=tfile.Get(hname) - hTmp.Rebin(5) + #nominal + if hTmp!= None and "bdt" in hname: + hTmp.Rebin(5) + elif hTmp!= None: + hTmp.Rebin(800) + + + return hTmp + + + + +def SmoothAndMergeSyst(tfile,togetNom,togetSyst,s): + + + hTmpNom=MergeCategory(tfile,togetNom) + hTmpUp=MergeCategory(tfile,togetSyst+'Up') + hTmpDown=MergeCategory(tfile,togetSyst+'Down') + + if hTmpUp==None: return hTmpNom + if hTmpDown==None: return hTmpNom + + for iBin in range(1,hTmpNom.GetNbinsX()+1): +# c= hTmpNom.SetBinError(iBin,0) + c= hTmpUp.SetBinError(iBin,0) + c= hTmpDown.SetBinError(iBin,0) + +# if 'JESANDCSV' in togetSyst or "TOPRW" in togetSyst: + if 'JESANDCSV' in togetSyst or "PU" in togetSyst or "JER" in togetSyst: +# return hTmpNom + hUp, hDown = SS.SystematicSmoother(hTmpNom, hTmpUp, hTmpDown,"~/www/ChargedHiggsTB/APR13/SYST").smooth() + else: + hUp = hTmpUp + hDown = hTmpDown + + if 'Up' in s: + return hUp + + if 'Down' in s: + return hDown + +def envelop(tfile,togetClone, s) : + + hname=togetClone+'RF'+s + + hTmp=MergeCategory(tfile,hname) + h=hTmp.Clone() if hTmp==None: return @@ -936,31 +1014,18 @@ def envelop(tfile,togetClone, s) : hnameClone=togetClone+w+s - if "1L" in hname: - toget_1=hnameClone.replace("_1L", "_1Mu") - toget_2=hnameClone.replace("_1L", "_1Ele") - hTmp=tfile.Get(toget_1) - hTmp2=tfile.Get(toget_2) - if hTmp!=None and hTmp2!=None: hTmp.Add(hTmp2) - elif "2L" in hname: - toget_1=hnameClone.replace("_2L", "_2Mu") - toget_2=hnameClone.replace("_2L", "_2Ele") - toget_3=hnameClone.replace("_2L", "_1Mu1Ele") - hTmp=tfile.Get(toget_1) - hTmp2=tfile.Get(toget_2) - hTmp3=tfile.Get(toget_3) - if hTmp!=None and hTmp2!=None: hTmp.Add(hTmp2) - if hTmp!=None and hTmp3!=None: hTmp.Add(hTmp3) - else: - hTmp=tfile.Get(hnameClone) - - hTmp.Rebin(5) + hTmp=MergeCategory(tfile,hnameClone) for iBin in range(1,h.GetNbinsX()+1): c= h.GetBinContent(iBin) - if hTmp.GetBinContent(iBin)>c: + + ## take the maximum for the Up + if "Up" in s and hTmp.GetBinContent(iBin)>c: h.SetBinContent(iBin,hTmp.GetBinContent(iBin)) + ## take the minimum for the Down + if "Down" in s and hTmp.GetBinContent(iBin) Reading Hist '"+toget+"' integral=",hTmp.Integral(),' nBin=',hTmp.GetNbinsX(), 'underflow=',hTmp.GetBinContent(0), 'overflow=',hTmp.GetBinContent(hTmp.GetNbinsX()+1),' entries=',hTmp.GetEntries() if hTmp == None: @@ -1072,29 +1131,11 @@ def importPdfFromTH1(cat,mc,myBin,LikelihoodMapping,syst=None): print "<*> Hist '"+toget+"' doesn't exist" raise IOError if syst != None: - print "<*> Hist '"+toget+"' doesn't exist wih the syst cloning now from the central " - toget=base + "/" +cat["dir"] + "/" + cat["var"] + "_" + hname - - if "1L" in cat["dir"]: - toget_1=toget.replace("_1L", "_1Mu") - toget_2=toget.replace("_1L", "_1Ele") - hTmp=tfile.Get(toget_1) - hTmp2=tfile.Get(toget_2) - if hTmp!=None and hTmp2!=None: hTmp.Add(hTmp2) - elif "2L" in cat["dir"]: - toget_1=toget.replace("_2L", "_2Mu") - toget_2=toget.replace("_2L", "_2Ele") - toget_3=toget.replace("_2L", "_1Mu1Ele") - hTmp=tfile.Get(toget_1) - hTmp2=tfile.Get(toget_2) - hTmp3=tfile.Get(toget_3) - if hTmp!=None and hTmp2!=None: hTmp.Add(hTmp2) - if hTmp!=None and hTmp3!=None: hTmp.Add(hTmp3) - else: - hTmp=tfile.Get(toget) - - if hTmp!= None: - hTmp.Rebin(5) + print "<*> Hist '"+toget+"' doesn't exist with the syst cloning now from the central " +# toget=base + "/" +cat["dir"] + "/" + cat["var"] + "_" + hname + + hTmp = MergeCategory(tfile,togetNom) + if hTmp!= None: print "<*> Reading Hist '"+toget+"' integral=",hTmp.Integral(),' nBin=',hTmp.GetNbinsX(), 'underflow=',hTmp.GetBinContent(0), 'overflow=',hTmp.GetBinContent(hTmp.GetNbinsX()+1),' entries=',hTmp.GetEntries() ### SCALE for the 2/3 @@ -1108,8 +1149,7 @@ def importPdfFromTH1(cat,mc,myBin,LikelihoodMapping,syst=None): ## tranform the HT into the likelihood hTmp = likelihoodBinning.applyMapping(LikelihoodMapping, hTmp) # print LikelihoodMapping -# -# h = hTmp + # if mc["name"]=="Hptb" and hTmpSum==None: hTmpSum = hTmp # if mc["name"]=="Hptb": @@ -1123,6 +1163,7 @@ def importPdfFromTH1(cat,mc,myBin,LikelihoodMapping,syst=None): else: hTmpSum.Add(hTmp) + #clean h h=hTmpSum @@ -1270,26 +1311,7 @@ def importPdfFromTH1SumBKG(cat,mc,syst=None,do1Third=False): if mc["name"]=="Hptb" and m!=opts.kMass: continue - if "1L" in cat["dir"]: - toget_1=toget.replace("_1L", "_1Mu") - toget_2=toget.replace("_1L", "_1Ele") - hTmp=tfile.Get(toget_1) - hTmp2=tfile.Get(toget_2) - if hTmp!= None and hTmp2!= None: hTmp.Add(hTmp2) - elif "2L" in cat["dir"]: - toget_1=toget.replace("_2L", "_2Mu") - toget_2=toget.replace("_2L", "_2Ele") - toget_3=toget.replace("_2L", "_1Mu1Ele") - hTmp=tfile.Get(toget_1) - hTmp2=tfile.Get(toget_2) - hTmp3=tfile.Get(toget_3) - if hTmp!= None and hTmp2!= None: hTmp.Add(hTmp2) - if hTmp!= None and hTmp3!= None: hTmp.Add(hTmp3) - else: - hTmp=tfile.Get(toget) - - if hTmp!= None: - hTmp.Rebin(5) + hTmp = MergeCategory(tfile,toget) if hTmp!= None: print "<*> Reading Hist '"+toget+"'",hTmp.Integral(),' nBin=',hTmp.GetNbinsX(),'underflow=',hTmp.GetBinContent(0), 'overflow=',hTmp.GetBinContent(hTmp.GetNbinsX()+1), ' entries=',hTmp.GetEntries() @@ -1446,6 +1468,7 @@ def importPdfFromTH1SumBKG(cat,mc,syst=None,do1Third=False): ##import data ###for c in catStore: + cat=catStore[c] tfile = cat["file"] if tfile == None: @@ -1482,8 +1505,10 @@ def importPdfFromTH1SumBKG(cat,mc,syst=None,do1Third=False): else: h=tfile.Get(toget) - if h != None: + if h != None and "bdt" in cat["var"]: h.Rebin(5) + elif h != None: + h.Rebin(800) if h == None: print "<*> Hist do not exists ",toget From 1bd3004bfab107c407f896ccdfaead95872a6526 Mon Sep 17 00:00:00 2001 From: maria Date: Fri, 20 Apr 2018 21:05:57 +0200 Subject: [PATCH 04/60] fully hadronic card - APR16 --- script/bwsFullHadTB.py | 397 +++++++++++++++++++++++++++++------------ 1 file changed, 287 insertions(+), 110 deletions(-) diff --git a/script/bwsFullHadTB.py b/script/bwsFullHadTB.py index 42433bd4..9ad23117 100644 --- a/script/bwsFullHadTB.py +++ b/script/bwsFullHadTB.py @@ -7,8 +7,12 @@ sys.path.insert(0, 'script') import FwBinning as FwRebin +import SystematicSmoother as SS maxStat=0.15 +# original binning is 10GeV +nRebinHT=1 +##LikeBins=1 LikeBins=10 doRebin = False @@ -21,15 +25,9 @@ parser= OptionParser() -#parser.add_option("","--input",type='string',help="Input ROOT file. [%default]", default="/afs/cern.ch/user/h/hum/work/public/CMSSW_8_0_26_patch1/src/ChargedHiggs/ntufile/crazylimit0306.root") -#parser.add_option("","--inputBin",type='string',help="Input ROOT file. [%default]", default="/afs/cern.ch/user/h/hum/work/public/CMSSW_8_0_26_patch1/src/ChargedHiggs/ntufile/crazylimit0306.root") - -#parser.add_option("","--input",type='string',help="Input ROOT file. [%default]", default="/afs/cern.ch/user/h/hum/work/public/CMSSW_8_0_26_patch1/src/ChargedHiggs/ntufile/pipilimitnew.root") -#parser.add_option("","--inputBin",type='string',help="Input ROOT file. [%default]", default="/afs/cern.ch/user/h/hum/work/public/CMSSW_8_0_26_patch1/src/ChargedHiggs/ntufile/pipilimitnew.root") - -parser.add_option("","--input",type='string',help="Input ROOT file. [%default]", default="/afs/cern.ch/user/h/hum/work/public/CMSSW_8_0_26_patch1/src/ChargedHiggs/ntufile/freze2limit.root") -parser.add_option("","--inputBin",type='string',help="Input ROOT file. [%default]", default="/afs/cern.ch/user/h/hum/work/public/CMSSW_8_0_26_patch1/src/ChargedHiggs/ntufile/freze2limit.root") - +# new fixed (SYST only) +parser.add_option("","--input",type='string',help="Input ROOT file. [%default]", default="/afs/cern.ch/user/h/hum/work/public/CMSSW_8_0_26_patch1/src/ChargedHiggs/ntufile/post0systlimit.root") +parser.add_option("","--inputBin",type='string',help="Input ROOT file. [%default]", default="/afs/cern.ch/user/h/hum/work/public/CMSSW_8_0_26_patch1/src/ChargedHiggs/ntufile/post0systlimit.root") if doSyst: parser.add_option("-o","--output",type='string',help="Output ROOT file. [%default]", default="workspace_SYST.root") @@ -42,6 +40,7 @@ extra = OptionGroup(parser,"Extra options:","") extra.add_option("-k","--kMass",type='string',help = "Which mass point. [%default]", default=1000) +extra.add_option("-c","--kCat",type='int',help = "Which category. [%default]", default=0) #extra.add_option("-r","--rebin",type='int',help = "Rebin Histogram. [%default]", default=-1) # #parser.add_option_group(extra) @@ -118,6 +117,63 @@ def RebinN(h,nBin): ######### +def Merge3B(tfile,hname): + + hname_1=hname.replace("_two", "_three") + hTmp=tfile.Get(hname) + hTmp1=tfile.Get(hname_1) + if hTmp!=None and hTmp1!=None: hTmp.Add(hTmp1) + + return hTmp + + +def MergeAbove(tfile,hname): + + hname_1=hname.replace("_below", "_above") + hTmp=tfile.Get(hname) + hTmp1=tfile.Get(hname_1) + if hTmp!=None and hTmp1!=None: hTmp.Add(hTmp1) + + return hTmp + + +def MergeAbove3B(tfile,hname): + + ## histos has "below" and "two" + + hname_=hname.replace("_below", "_above") + hname_1=hname_.replace("_two", "_three") + # original + hTmp=tfile.Get(hname) + # changed + hTmp1=tfile.Get(hname_1) + if hTmp!=None and hTmp1!=None: hTmp.Add(hTmp1) + + return hTmp + + +def mergeCategory(tfile,toget): + + if doSChannel: + + if "_two" in toget and not "_below" in toget: + hTmp = Merge3B(tfile,toget) + elif "_below" in toget and not "_two" in toget: + hTmp = MergeAbove(tfile,toget) + elif "_below" and "_two" in toget: + hTmp = MergeAbove3B(tfile,toget) + + else: + hTmp = tfile.Get(toget) + else: + if "_below" in toget: + hTmp = MergeAbove(tfile,toget) + else: + hTmp = tfile.Get(toget) + + return hTmp + + ### TEST conf #channel = ["t0b"] #channel = ["t1b"] @@ -126,25 +182,42 @@ def RebinN(h,nBin): #basecat = ["OneBOneFat_two_highj"] ### FINAL conf -basecat = ["OneBOneFat_one_highj","OneBOneFat_two_highj","OneBOneFat_three_highj", "OneBOneFat_one_lowj","OneBOneFat_two_lowj","OneBOneFat_three_lowj" - ,"OneBOneFat1l_one","OneBOneFat1l_two","OneBOneFat1l_three" - ,"OneBOneMirrorFat_one_highj","OneBOneMirrorFat_two_highj","OneBOneMirrorFat_three_highj", "OneBOneMirrorFat_one_lowj","OneBOneMirrorFat_two_lowj","OneBOneMirrorFat_three_lowj" - ] +if doSChannel: + basecat = ["OneBOneFat_one_highj","OneBOneFat_two_highj", "OneBOneFat_one_lowj","OneBOneFat_two_lowj" + ## ,"OneBOneFat1l_one","OneBOneFat1l_two","OneBOneFat1l_three" + ,"OneBOneMirrorFat_one_highj","OneBOneMirrorFat_two_highj", "OneBOneMirrorFat_one_lowj","OneBOneMirrorFat_two_lowj" + ] +else: + basecat = ["OneBOneFat_one_highj","OneBOneFat_two_highj","OneBOneFat_three_highj", "OneBOneFat_one_lowj","OneBOneFat_two_lowj","OneBOneFat_three_lowj" + ## ,"OneBOneFat1l_one","OneBOneFat1l_two","OneBOneFat1l_three" + ,"OneBOneMirrorFat_one_highj","OneBOneMirrorFat_two_highj","OneBOneMirrorFat_three_highj", "OneBOneMirrorFat_one_lowj","OneBOneMirrorFat_two_lowj","OneBOneMirrorFat_three_lowj" + ] + if doSChannel: - channel = ["t0b","t1b"] -# channel = ["t1b"] + channel = ["t0b","t1b","wbb","wbj"] label="sChan_" else: - channel = ["t0b","t1b","wbb","wbj"] -# channel = ["t0b"] -# channel = ["t1b"] -# channel = ["wbb"] -# channel = ["wbj"] - label="fullHad_" -# label="wbj_fullHad_" + + if opts.kCat==0: + channel = ["t0b","t1b","wbb","wbj"] +# channel = ["t0b","t1b","wbb"] + label="fullHad_" + if opts.kCat==1: + channel = ["t0b"] + label="t0b_fullHad_" + if opts.kCat==2: + channel = ["t1b"] + label="t1b_fullHad_" + if opts.kCat==3: + channel = ["wbb"] + label="wbb_fullHad_" + if opts.kCat==4: + channel = ["wbj"] + label="wbj_fullHad_" # label="counting_" # label="sronly_" +# label="inonly_" catStore = { } ## name -> {"file", extra options for syst}, hasSignal statStore = {} ## used to store th1d for stat uncertainties @@ -157,8 +230,10 @@ def RebinN(h,nBin): for y in channel: for x in basecat: - region = ["_in","_above","_below"] +## region = ["_in","_above","_below"] + region = ["_in","_below"] +#counting # if True: # region = ["_in"] # if "OneBOneFat1l" in x: continue @@ -179,53 +254,68 @@ def RebinN(h,nBin): # catStore [ name ] = { "name": name,"dir": x+ "_" + y,"file": None, "hasMC":["all"],"var":"invariantExt"} - # THIS IS planB -# if "_lowj" in x and y=="wbb": continue -# if "_lowj" in x and y=="wbj": continue # UNDEFINED if "OneBOneFat_one" in x and y=="wbb": continue if "OneBOneMirrorFat_one" in x and y=="wbb": continue if "OneBOneFat1l_one" in x and y=="wbb": continue - # UNDEFINED - # they should not exist but some are filled - if "OneBOneFat_one" in x and y=="t1b": continue - if "OneBOneMirrorFat_one" in x and y=="t1b": continue - if "OneBOneFat1l_one" in x and y=="t1b": continue - - if "OneBOneFat_three" in x and y=="wbj": continue - if "OneBOneMirrorFat_three" in x and y=="wbj": continue - if "OneBOneFat1l_three" in x and y=="wbj": continue - - if opts.kMass=="2000" or opts.kMass=="2500" or opts.kMass=="3000": - # # for the 2000,2500,3000: (They are all in the below bin) - if "OneBOneMirrorFat" in x and y=="wbb" and ("above" in reg or "in" in reg): continue - if "OneBOneMirrorFat" in x and y=="wbj" and ("above" in reg or "in" in reg): continue - # ## recovered the wbb - in - if "OneBOneFat" in x and y=="wbb" and ("above" in reg ): continue - if "OneBOneFat" in x and y=="wbj" and ("above" in reg or "in" in reg): continue - - # t0b/t1b & 3b NO STAT very rare situation - if "OneBOneMirrorFat_three_lowj" in x and y=="t1b": continue - if "OneBOneMirrorFat_three_highj" in x and y=="t1b": continue - - if doSChannel or (opts.kMass=="2000" or opts.kMass=="2500" or opts.kMass=="3000"): - if "OneBOneFat_three" in x and y=="t0b": continue - if "OneBOneMirrorFat_three" in x and y=="t0b": continue - - ## NO STAT - if "OneBOneFat1l_one" in x and (y=="t0b" or y=="wbj"): continue - ## - if "OneBOneFat1l_two" in x and ( y=="wbb" or y=="wbj" or y=="t0b" or y=="t1b"): continue - ## - if "OneBOneFat1l_three" in x and ( y=="wbb" or y=="t1b" or y=="t0b"): continue + ## generally BKG very rare + if "_three_lowj" in x and y=="wbj": continue + + ## very rare + if opts.kMass=="400": + if "_three_highj" in x and y=="wbj": continue + if "_two_lowj" in x and y=="wbj": continue + if "_two_lowj" in x and y=="wbb": continue + if "_three_lowj" in x and y=="t0b" and "in" in reg: continue + if "_one_highj" in x and (y=="t1b" or y=="t0b") and "in" in reg: continue + + if opts.kMass=="3000": +## if "_two_highj" in x and y=="wbb": continue +## if "_three_lowj" in x and (y=="t0b") and "above" in reg: continue + if "_three_lowj" in x and (y=="t1b") and "in" in reg: continue + + # strange with systematics + if opts.kMass=="2500": + if "_three_lowj" in x and (y=="t0b") and "in" in reg: continue + + ## below are for associated only + if not doSChannel and (opts.kMass=="500" or opts.kMass=="400") and "in" in reg: + if "_three_lowj" in x and y=="wbb": continue + if "_one_lowj" in x and y=="wbj": continue + + if doSChannel and (opts.kMass=="800" or opts.kMass=="900" or opts.kMass=="1000" or opts.kMass=="1500" or opts.kMass=="2000" or opts.kMass=="2500" or opts.kMass=="3000") and "in" in reg: + if "_two_highj" in x and y=="wbb": continue + if "_one_highj" in x and y=="wbj": continue + + if doSChannel and (opts.kMass=="900" or opts.kMass=="1000" or opts.kMass=="1500" or opts.kMass=="2000" or opts.kMass=="2500" or opts.kMass=="3000") and "in" in reg: + if "_two_lowj" in x and y=="wbj": continue + if "_two_highj" in x and y=="wbj": continue + + if doSChannel and (opts.kMass=="1000" or opts.kMass=="1500" or opts.kMass=="2000" or opts.kMass=="2500" or opts.kMass=="3000") and "in" in reg: + if y=="wbb": continue + if y=="wbj": continue + + if not doSChannel and (opts.kMass=="1500" or opts.kMass=="2000" or opts.kMass=="2500" or opts.kMass=="3000") and "in" in reg: + if "_two_lowj" in x and y=="wbj": continue + if "_three_highj" in x and y=="wbj": continue + + if not doSChannel and (opts.kMass=="2000" or opts.kMass=="2500" or opts.kMass=="3000") and "in" in reg: + if "_one_highj" in x and y=="wbj": continue + if "_two_highj" in x and y=="wbj": continue + + if not doSChannel and (opts.kMass=="2500" or opts.kMass=="3000") and "in" in reg: + if "_two_lowj" in x and y=="wbb": continue + if "_three_lowj" in x and y=="wbb": continue + if "_three_highj" in x and y=="wbb": continue + if "_one_lowj" in x and y=="wbj": continue if "OneBOneFat1l" in x: - catStore [ name ] = { "name": name,"dir": x+ "_" + y,"file": None, "hasMC":["top"],"var":"HT"+reg} + catStore [ name ] = { "name": name,"dir": x+ "_" + y,"file": None, "hasMC":["ttbar"],"var":"HT"+reg} name = x+ "_" + y else: - catStore [ name ] = { "name": name,"dir": x+ "_" + y,"file": None, "hasMC":["top"],"var":"HT_"+mas+reg} + catStore [ name ] = { "name": name,"dir": x+ "_" + y,"file": None, "hasMC":["ttbar"],"var":"HT_"+mas+reg} catStore[name]['file'] = fIn @@ -233,36 +323,36 @@ def RebinN(h,nBin): # catStore[name]["hasMC"]=["qcd","top","Hptb"] ### QCD uncorrelated - if ( y=="wbb" or y=="wbj") and "_one" in x: catStore[name]["hasMC"]=["qcd_wx_one","top","Hptb"] - if ( y=="wbb" or y=="wbj") and "_two" in x: catStore[name]["hasMC"]=["qcd_wx_two","top","Hptb"] - if ( y=="wbb" or y=="wbj") and "_three" in x: catStore[name]["hasMC"]=["qcd_wx_three","top","Hptb"] - if ( y=="t0b" or y=="t1b") and "_one" in x: catStore[name]["hasMC"]=["qcd_tx_one","top","Hptb"] - if ( y=="t0b" or y=="t1b") and "_two" in x: catStore[name]["hasMC"]=["qcd_tx_two","top","Hptb"] - if ( y=="t0b" or y=="t1b") and "_three" in x: catStore[name]["hasMC"]=["qcd_tx_three","top","Hptb"] + if ( y=="wbb" or y=="wbj") and "_one" in x: catStore[name]["hasMC"]=["qcd_wx_one","ttbar","Hptb"] + if ( y=="wbb" or y=="wbj") and "_two" in x: catStore[name]["hasMC"]=["qcd_wx_two","ttbar","Hptb"] + if ( y=="wbb" or y=="wbj") and "_three" in x: catStore[name]["hasMC"]=["qcd_wx_three","ttbar","Hptb"] + if ( y=="t0b" or y=="t1b") and "_one" in x: catStore[name]["hasMC"]=["qcd_tx_one","ttbar","Hptb"] + if ( y=="t0b" or y=="t1b") and "_two" in x: catStore[name]["hasMC"]=["qcd_tx_two","ttbar","Hptb"] + if ( y=="t0b" or y=="t1b") and "_three" in x: catStore[name]["hasMC"]=["qcd_tx_three","ttbar","Hptb"] if doSChannel: mcStore={ "Hptb":{"name":"Hptb", "hist":["WprimeToTB_TToHad_M-%d"], "num":0 }, ## "qcd":{"name":"qcd", "hist":["QCD_HT"], "num":1 }, "qcd_wx_one":{"name":"qcd_wx_one", "hist":["QCD_HT"], "num":1 }, - "qcd_wx_two":{"name":"qcd_wx_two", "hist":["QCD_HT"], "num":1 }, - "qcd_wx_three":{"name":"qcd_wx_three", "hist":["QCD_HT"], "num":1 }, - "qcd_tx_one":{"name":"qcd_tx_one", "hist":["QCD_HT"], "num":1 }, - "qcd_tx_two":{"name":"qcd_tx_two", "hist":["QCD_HT"], "num":1 }, - "qcd_tx_three":{"name":"qcd_tx_three", "hist":["QCD_HT"], "num":1 }, - "top":{ "name":"top","hist":["TT_TuneCUETP8M2T4_13TeV-powheg-pythia8"],"num":2} + "qcd_wx_two":{"name":"qcd_wx_two", "hist":["QCD_HT"], "num":2 }, + "qcd_wx_three":{"name":"qcd_wx_three", "hist":["QCD_HT"], "num":3 }, + "qcd_tx_one":{"name":"qcd_tx_one", "hist":["QCD_HT"], "num":4 }, + "qcd_tx_two":{"name":"qcd_tx_two", "hist":["QCD_HT"], "num":5 }, + "qcd_tx_three":{"name":"qcd_tx_three", "hist":["QCD_HT"], "num":6 }, + "ttbar":{ "name":"ttbar","hist":["TT_TuneCUETP8M2T4_13TeV-powheg-pythia8"],"num":7} } else: mcStore={ "Hptb":{"name":"Hptb", "hist":["ChargedHiggs_HplusTB_HplusToTB_M-%d_13TeV_amcatnlo_pythia8"], "num":0 }, ## "qcd":{"name":"qcd", "hist":["QCD_HT"], "num":1 }, "qcd_wx_one":{"name":"qcd_wx_one", "hist":["QCD_HT"], "num":1 }, - "qcd_wx_two":{"name":"qcd_wx_two", "hist":["QCD_HT"], "num":1 }, - "qcd_wx_three":{"name":"qcd_wx_three", "hist":["QCD_HT"], "num":1 }, - "qcd_tx_one":{"name":"qcd_tx_one", "hist":["QCD_HT"], "num":1 }, - "qcd_tx_two":{"name":"qcd_tx_two", "hist":["QCD_HT"], "num":1 }, - "qcd_tx_three":{"name":"qcd_tx_three", "hist":["QCD_HT"], "num":1 }, - "top":{ "name":"top","hist":["TT_TuneCUETP8M2T4_13TeV-powheg-pythia8"],"num":2} + "qcd_wx_two":{"name":"qcd_wx_two", "hist":["QCD_HT"], "num":2 }, + "qcd_wx_three":{"name":"qcd_wx_three", "hist":["QCD_HT"], "num":3 }, + "qcd_tx_one":{"name":"qcd_tx_one", "hist":["QCD_HT"], "num":4 }, + "qcd_tx_two":{"name":"qcd_tx_two", "hist":["QCD_HT"], "num":5 }, + "qcd_tx_three":{"name":"qcd_tx_three", "hist":["QCD_HT"], "num":6 }, + "ttbar":{ "name":"ttbar","hist":["TT_TuneCUETP8M2T4_13TeV-powheg-pythia8"],"num":7} } if doSyst: @@ -270,30 +360,31 @@ def RebinN(h,nBin): "None":None, "lumi_13TeV":{"type":"lnN", "value":["1.025"] ,"proc":[".*"],"wsname":"lumi_13TeV","name":"XXX"}, ### lepton veto - "CMS_eff_m":{"type":"lnN", "value":["1.04"] ,"proc":[".*"],"wsname":"CMS_eff_m","name":"XXX"}, - "CMS_eff_e":{"type":"lnN", "value":["1.03"] ,"proc":[".*"],"wsname":"CMS_eff_e","name":"XXX"}, - "CMS_eff_t":{"type":"lnN", "value":["1.03"] ,"proc":[".*"],"wsname":"CMS_eff_t","name":"XXX"}, + "CMS_eff_l":{"type":"lnN", "value":["0.96"] ,"proc":[".*"],"wsname":"CMS_eff_l","name":"XXX"}, ## name used for shape + "CMS_eff_t":{"type":"lnN", "value":["1.03"] ,"proc":[".*"],"wsname":"CMS_eff_t","name":"XXX"}, ## name used for shape ### trigger efficiency "CMS_eff_trigger":{"type":"lnN", "value":["1.05"] ,"proc":[".*"],"wsname":"CMS_eff_triggger","name":"XXX"}, ### Theory modeling - "CMS_topreweight":{"type":"shape", "wsname":"CMS_topreweight","name":"TOPRW","proc":["top"]}, -# "QCDscaleT":{"type":"shape", "wsname":"QCDscaleTTbar","name":"Scale","proc":["top"]}, -# "QCDscaleS":{"type":"shape", "wsname":"QCDscaleHptb","name":"Scale","proc":["Hptb"]}, + "CMS_topreweight":{"type":"shape", "wsname":"CMS_topreweight","name":"TOPRW","proc":["ttbar"]}, + "QCDscaleT":{"type":"shape", "wsname":"QCDscaleTTbar","name":"Scale","proc":["ttbar"]}, + "QCDscaleS":{"type":"shape", "wsname":"QCDscaleHptb","name":"Scale","proc":["Hptb"]}, ### MET-Jets-PU "CMS_pileup":{"type":"shape", "wsname":"CMS_pileup","name":"PU","proc":[".*"]}, "CMS_scale_uncluster":{"type":"shape", "wsname":"CMS_scale_uncluster","name":"UNCLUSTER","proc":[".*"]}, - "CMS_SDmassScale":{"type":"shape", "wsname":"CMS_SDmassSCALE","name":"SDmassSCALE","proc":[".*"]}, + "CMS_SDMassScale":{"type":"shape", "wsname":"CMS_SDMassSCALE","name":"SDMassSCALE","proc":[".*"]}, # "CMS_res_j":{"type":"shape", "wsname":"CMS_res_j","name":"JER","proc":[".*"]}, - "CMS_scale_j":{"type":"shape", "wsname":"CMS_scale_j","name":"JESANDCSV","proc":[".*"]}, + "CMS_scale_j_qcd":{"type":"shape", "wsname":"CMS_scale_j_qcd","name":"JESANDCSV","proc":["qcd_wx_one","qcd_wx_two","qcd_wx_three","qcd_tx_one","qcd_tx_two","qcd_tx_three"]}, + "CMS_scale_j":{"type":"shape", "wsname":"CMS_scale_j","name":"JESANDCSV","proc":["Hptb","ttbar"]}, ##Light jets Heavy flavor contamination "CMS_btag_HF":{"type":"shape", "wsname":"CMS_btag_HF","name":"CSVRHF","proc":[".*"]}, ##Heavy jets light flavor contamination - "CMS_btag_LF":{"type":"shape", "wsname":"CMS_btag_LF","name":"CSVRLF","proc":[".*"]}, + "CMS_btag_LF_qcd":{"type":"shape", "wsname":"CMS_btag_LF_0l_qcd","name":"CSVRLF","proc":["qcd_wx_one","qcd_wx_two","qcd_wx_three","qcd_tx_one","qcd_tx_two","qcd_tx_three"]}, + "CMS_btag_LF":{"type":"shape", "wsname":"CMS_btag_LF_0l","name":"CSVRLF","proc":["Hptb","ttbar"]}, ##Linear and quadratic uncertainties "CMS_btag_HFstat1":{"type":"shape", "wsname":"CMS_btag_HFstat1","name":"CSVRHFSTAT1","proc":[".*"]}, "CMS_btag_HFstat2":{"type":"shape", "wsname":"CMS_btag_HFstat2","name":"CSVRHFSTAT2","proc":[".*"]}, - "CMS_btag_LFstat1":{"type":"shape", "wsname":"CMS_btag_LFstat1","name":"CSVRLFSTAT1","proc":[".*"]}, - "CMS_btag_LFstat2":{"type":"shape", "wsname":"CMS_btag_LFstat2","name":"CSVRLFSTAT2","proc":[".*"]}, + "CMS_btag_LFstat1":{"type":"shape", "wsname":"CMS_btag_LFstat1_0l","name":"CSVRLFSTAT1","proc":[".*"]}, + "CMS_btag_LFstat2":{"type":"shape", "wsname":"CMS_btag_LFstat2_0l","name":"CSVRLFSTAT2","proc":[".*"]}, "CMS_btag_CFerr1":{"type":"shape", "wsname":"CMS_btag_CFerr1","name":"CSVRCERR1","proc":[".*"]}, "CMS_btag_CFerr2":{"type":"shape", "wsname":"CMS_btag_CFerr2","name":"CSVRCERR2","proc":[".*"]} #### @@ -308,11 +399,11 @@ def RebinN(h,nBin): print "* ",cat,":",catStore[cat] print "---------------------- --------" -fileTmp="MIAO_MARCH23/"+label+VarTest+opts.kMass+"_"+opts.output +fileTmp="MIAO_APR16/"+label+VarTest+opts.kMass+"_"+opts.output w = ROOT.RooWorkspace("w","w") datNameTmp = opts.datCardName -datName = "MIAO_MARCH23/"+label+ VarTest+opts.kMass+"_" + datNameTmp +datName = "MIAO_APR16/"+label+ VarTest+opts.kMass+"_" + datNameTmp datacard=open(datName,"w") datacard.write("-------------------------------------\n") @@ -370,10 +461,10 @@ def skip(cat,mc): datacard.write("\n") if True: # Sig datacard.write("shapes Hptb *\t" + fileTmp +"\t") - datacard.write("pdf_$PROCESS_M-$MASS_$CHANNEL\t") - datacard.write("pdf_$PROCESS_M-$MASS_$CHANNEL_$SYSTEMATIC") -# datacard.write("pdf_$PROCESS_$CHANNEL\t") -# datacard.write("pdf_$PROCESS_$CHANNEL_$SYSTEMATIC") +# datacard.write("pdf_$PROCESS_M-$MASS_$CHANNEL\t") +# datacard.write("pdf_$PROCESS_M-$MASS_$CHANNEL_$SYSTEMATIC") + datacard.write("pdf_$PROCESS_$CHANNEL\t") + datacard.write("pdf_$PROCESS_$CHANNEL_$SYSTEMATIC") datacard.write("\n") if True: # bkg datacard.write("shapes * * %s\t"%fileTmp +"\t") @@ -542,9 +633,13 @@ def importStat(): if systStore[syst]["type"] == "shape": writeSystShape(systStore[syst],systStore[syst]["proc"]) -if doSyst: writeNormSyst("QCDscale_ttbar",["0.965/1.024","0.965/1.024","0.965/1.024","0.965/1.024","0.965/1.024"],["ttlf","ttcc","ttb","ttbb","tt2b"]) -if doSyst: writeNormSyst("pdf_gg",["1.042","1.042","1.042","1.042","1.042"],["ttlf","ttcc","ttb","ttbb","tt2b"]) -###if doSyst: writeNormSyst("CMS_mass_ttbar",["1.027","1.027","1.027","1.027","1.027"],["ttlf","ttcc","ttb","ttbb","tt2b"]) +if doSyst: writeNormSyst("QCDscale_ttbar",["0.965/1.024"],["ttbar"]) +if doSyst: writeNormSyst("pdf_gg",["1.042"],["ttbar"]) +if doSyst: writeNormSyst("CMS_mass_ttbar",["1.027"],["ttbar"]) + +#if doSyst: writeNormSyst("QCDscale_ttbar",["0.965/1.024","0.965/1.024","0.965/1.024","0.965/1.024","0.965/1.024"],["ttlf","ttcc","ttb","ttbb","tt2b"]) +#if doSyst: writeNormSyst("pdf_gg",["1.042","1.042","1.042","1.042","1.042"],["ttlf","ttcc","ttb","ttbb","tt2b"]) +##if doSyst: writeNormSyst("CMS_mass_ttbar",["1.027","1.027","1.027","1.027","1.027"],["ttlf","ttcc","ttb","ttbb","tt2b"]) if doSyst: writeNormSyst("CMS_HPTB_QCDnonclosure_",["1.20","1.20","1.20"],["qcd_wx_one","qcd_wx_two","qcd_wx_three"]) if doSyst: writeNormSyst("CMS_HPTB_QCDnonclosure_",["1.20","1.20","1.20"],["qcd_tx_one","qcd_tx_two","qcd_tx_three"]) @@ -612,7 +707,71 @@ def importStat(): ## g.extend([hupbin,roo_mc_binup,pdf_mc_binup]) ## g.extend([hdnbin,roo_mc_bindn,pdf_mc_bindn]) -## improt Everything in ws TODO + +def SmoothAndMergeSyst(tfile,togetNom,togetSyst,s): + + hTmpNom=mergeCategory(tfile,togetNom) + hTmpUp=mergeCategory(tfile,togetSyst+'Up') + hTmpDown=mergeCategory(tfile,togetSyst+'Down') + + if hTmpUp==None: return hTmpNom + if hTmpDown==None: return hTmpNom + + for iBin in range(1,hTmpNom.GetNbinsX()+1): +# c= hTmpNom.SetBinError(iBin,0) + c= hTmpUp.SetBinError(iBin,0) + c= hTmpDown.SetBinError(iBin,0) + + if 'JESANDCSV' in togetSyst or "PU" in togetSyst or "JER" in togetSyst or "SDMassScale" in togetSyst: +# return hTmpNom + hUp, hDown = SS.SystematicSmoother(hTmpNom, hTmpUp, hTmpDown,"~/www/forMIAO/APR16/SYST").smooth() + else: + hUp = hTmpUp + hDown = hTmpDown + + if 'Up' in s: + return hUp + + if 'Down' in s: + return hDown + + +def envelop(tfile,togetClone, s) : + + hname=togetClone+'RF'+s + + hTmp=mergeCategory(tfile,hname) + +## if hTmp!=None: hTmp.Rebin(nRebinHT) + + h=hTmp.Clone() + + if hTmp==None: return + + for w in [ 'R','F','RF']: + + hnameClone=togetClone+w+s + + hTmp=mergeCategory(tfile,hnameClone) + +## if hTmp!=None: hTmp.Rebin(nRebinHT) + + for iBin in range(1,h.GetNbinsX()+1): + c= h.GetBinContent(iBin) + + ## take the maximum for the Up + if "Up" in s and hTmp.GetBinContent(iBin)>c: + h.SetBinContent(iBin,hTmp.GetBinContent(iBin)) + + ## take the minimum for the Down + if "Down" in s and hTmp.GetBinContent(iBin) File not exists" raise IOError base="ChargedHiggsTopBottom" - if mc["name"]=="Hptb":masses=[400,500,650,800,900,1000,1500,2000,2500,3000] + if doSChannel and mc["name"]=="Hptb":masses=[800,900,1000,1500,2000,2500,3000] + elif mc["name"]=="Hptb":masses=[400,500,650,800,1000,1500,2000,2500,3000] +## if mc["name"]=="Hptb":masses=[400,500,650,800,900,1000,1500,2000,2500,3000] ## if mc["name"]=="Hptb":masses=[180,200,220,250,300,350,400,500,650,800,1000,1500,2000,2500,3000] -## elif doSChannel and mc["name"]=="Hptb":masses=[800] else: masses=[0] if syst == None: shifts=["x"] @@ -679,7 +839,7 @@ def importPdfFromTH1(cat,mc,myBin,LikelihoodMapping,syst=None): target = "pdf_" + mc["name"] +"_"+ cat["name"] if m >10 : - target = "pdf_" + mc["name"] +"_M-%d"%m+"_"+ cat["name"] + target = "pdf_" + mc["name"] + "_" + cat["name"] if syst != None: target += "_" + syst["wsname"] + s @@ -692,12 +852,26 @@ def importPdfFromTH1(cat,mc,myBin,LikelihoodMapping,syst=None): if mc["name"]=="Hptb": toget=toget%m + + togetNom = toget + togetSyst = '' if syst != None: + togetSyst = toget + "_" + syst["name"] toget += "_" + syst["name"] + s - hTmp=tfile.Get(toget) -## hTmp.Rebin(5) - print "<*> Reading Hist '"+toget+"'",hTmp.Integral() + if "Scale" in toget: + if mc["name"]=="Hptb" or mc["name"]=="ttbar": + hTmp = envelop(tfile,togetSyst,s) +# toget = togetClone+'RF'+s + + elif syst != None: + + hTmp = SmoothAndMergeSyst(tfile,togetNom,togetSyst,s) + else: + hTmp = mergeCategory(tfile,togetNom) + + if hTmp!=None: hTmp.Rebin(nRebinHT) + if hTmp!=None: print "<*> Reading Hist '"+toget+"'",hTmp.Integral() if hTmp == None: print "<*> Hist '"+toget+"' doesn't exist" @@ -793,9 +967,9 @@ def importPdfFromTH1SumBKG(cat,mc,syst=None,do1Third=False): print "<*> File not exists" raise IOError base="ChargedHiggsTopBottom" - if mc["name"]=="Hptb":masses=[400,500,650,800,900,1000,1500,2000,2500,3000] + if doSChannel and mc["name"]=="Hptb":masses=[800,900,1000,1500,2000,2500,3000] + elif mc["name"]=="Hptb":masses=[400,500,650,800,1000,1500,2000,2500,3000] ## if mc["name"]=="Hptb":masses=[180,200,220,250,300,350,400,500,650,800,1000,1500,2000,2500,3000] -# elif doSChannel and mc["name"]=="Hptb":masses=[800] else: masses=[0] if syst == None: shifts=["x"] @@ -850,10 +1024,12 @@ def importPdfFromTH1SumBKG(cat,mc,syst=None,do1Third=False): toget=toget%m if syst != None: +## togetClone = toget + "_" + syst["name"] toget += "_" + syst["name"] + s hTmp=tfile.Get(toget) -## hTmp.Rebin(5) + + if hTmp!= None: hTmp.Rebin(nRebinHT) if hTmp!= None: print "<*> 1/3 Reading Hist '"+toget+"'",hTmp.Integral(),' nBin=',hTmp.GetNbinsX() if hTmp == None: @@ -870,7 +1046,7 @@ def importPdfFromTH1SumBKG(cat,mc,syst=None,do1Third=False): # print 'going to add = ',hTmp.GetName() hSum.Add(hTmp) - if mc["name"]=="top" and hTmp!=None: hRef=hTmp.Clone() + if mc["name"]=="ttbar" and hTmp!=None: hRef=hTmp.Clone() if mc["name"]=="Hptb" and hTmp!= None: hSig=hTmp.Clone() @@ -980,8 +1156,9 @@ def importPdfFromTH1SumBKG(cat,mc,syst=None,do1Third=False): # if ("1Ele" in cat["dir"] or "2Ele" in cat["dir"]) and not ("1Mu1Ele" in cat["dir"]): toget+="_SingleElectron" # elif "1Mu" in cat["dir"] or "2Mu" in cat["dir"] or "1Mu1Ele" in cat["dir"]: toget+="_SingleMuon" + ## MARIA REMEMBER TO MERGE THE CATEGORY h=tfile.Get(toget) -## if h : h.Rebin(5) + if h!= None: h.Rebin(nRebinHT) if h == None: print "<*> Hist do not exists ",toget ### MARIA COMMENT THIS FOR NOW From 493a1cceaccf8de5b2a312a7a413733c9d74bcbd Mon Sep 17 00:00:00 2001 From: maria Date: Thu, 26 Apr 2018 14:43:41 +0200 Subject: [PATCH 05/60] fix sign of sources --- src/SmearJesSources.cpp | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/src/SmearJesSources.cpp b/src/SmearJesSources.cpp index 14ba93eb..6dcb6b42 100644 --- a/src/SmearJesSources.cpp +++ b/src/SmearJesSources.cpp @@ -26,19 +26,19 @@ int SmearJesSource::smear(Event *e) jecUnc_->setJetPt(j->Pt()); jecUnc_->setJetEta(j->Eta()); - float sup = jecUnc_->getUncertainty(true);; + float sup = jecUnc_->getUncertainty(true); jecUnc_->setJetPt(j->Pt()); // need to be reset jecUnc_->setJetEta(j->Eta()); - float sdw = jecUnc_->getUncertainty(false);; + float sdw = jecUnc_->getUncertainty(false); //Log(__FUNCTION__,"DEBUG",Form("Getting Uncertainties up=%f down=%d",sup,sdw)); j->SetValueUp(Smearer::SOURCES,j->Pt() * (1+ sup) ) ; - j->SetValueDown(Smearer::SOURCES,j->Pt() * (1+sdw) ) ; + j->SetValueDown(Smearer::SOURCES,j->Pt() * (1 - sdw) ) ; - TLorentzVector sUp (j->GetP4() ) ; sUp * (1+sup); - TLorentzVector sDown (j->GetP4() ) ; sDown * (1+sdw); + TLorentzVector sUp (j->GetP4() ) ; sUp *= (1+sup); + TLorentzVector sDown (j->GetP4() ) ; sDown *= (1 - sdw); smearedUp += sUp; smearedDown += sDown; From 02961dbfe592cf20a6bebc41133697c521c815dd Mon Sep 17 00:00:00 2001 From: maria Date: Thu, 26 Apr 2018 14:45:52 +0200 Subject: [PATCH 06/60] add the doSources switch --- interface/AnalysisChargedHiggsTopBottom.hpp | 2 ++ src/AnalysisChargedHiggsTopBottom.cpp | 25 +++++++++++---------- 2 files changed, 15 insertions(+), 12 deletions(-) diff --git a/interface/AnalysisChargedHiggsTopBottom.hpp b/interface/AnalysisChargedHiggsTopBottom.hpp index c4995b9a..71346ca5 100644 --- a/interface/AnalysisChargedHiggsTopBottom.hpp +++ b/interface/AnalysisChargedHiggsTopBottom.hpp @@ -22,6 +22,8 @@ class ChargedHiggsTopBottom: virtual public AnalysisBase ChargedHiggsTopBottom() : AnalysisBase () {} virtual ~ChargedHiggsTopBottom () {} + bool doJECSources = true; + bool doSynch = false; bool doQCD = false; bool doBDTSyst = true; diff --git a/src/AnalysisChargedHiggsTopBottom.cpp b/src/AnalysisChargedHiggsTopBottom.cpp index 732c243b..79bcb4bf 100644 --- a/src/AnalysisChargedHiggsTopBottom.cpp +++ b/src/AnalysisChargedHiggsTopBottom.cpp @@ -643,8 +643,8 @@ void ChargedHiggsTopBottom::InitScikit(){ py -> Exec("import numpy as np"); py -> Exec("from sklearn.externals import joblib "); /* original (no leptonPT, no MET) */ - if(do1lAnalysis) py -> Exec("kmodel=keras.models.load_model('aux/tb_trainings/tb_1l_keras_trained_model_MlbmaxPt.h5')"); - if(do2lAnalysis) py -> Exec("kmodel=keras.models.load_model('aux/tb_trainings/tb_2l_keras_trained_model_MlbmaxPt.h5')"); + if(do1lAnalysis) py -> Exec("kmodel=keras.models.load_model('aux/tb_trainings/tb_1l_keras_trained_model_MlbmaxPt_long.h5')"); + if(do2lAnalysis) py -> Exec("kmodel=keras.models.load_model('aux/tb_trainings/tb_2l_keras_trained_model_MlbmaxPt_long.h5')"); py -> Exec("kmodel.summary()"); @@ -955,18 +955,18 @@ void ChargedHiggsTopBottom::BookSplit(string label, string category) Book(Form("ChargedHiggsTopBottom/CutFlow/SplitMC%s_%u",category.c_str(),0),"split mc cut flow",2,0,2); Book(Form("ChargedHiggsTopBottom/CutFlow/SplitMCWeight%s_%u",category.c_str(),0),"split mc cut flow",2,0,2); - AddFinalHisto(Form("ChargedHiggsTopBottom/CutFlow/SplitMC%s_%u",category.c_str(),mc)); + // AddFinalHisto(Form("ChargedHiggsTopBottom/CutFlow/SplitMC%s_%u",category.c_str(),mc)); Book(Form("ChargedHiggsTopBottom/CutFlow/SplitMC%s_%u",category.c_str(),mc),"split mc cut flow",2,0,2); - AddFinalHisto(Form("ChargedHiggsTopBottom/CutFlow/SplitMCWeight%s_%u",category.c_str(),mc)); + // AddFinalHisto(Form("ChargedHiggsTopBottom/CutFlow/SplitMCWeight%s_%u",category.c_str(),mc)); Book(Form("ChargedHiggsTopBottom/CutFlow/SplitMCWeight%s_%u",category.c_str(),mc),"split mc cut flow weight",2,0,2); //// - AddFinalHisto(Form("ChargedHiggsTopBottom/CutFlow/SplitMCCR%s_%u",category.c_str(),mc)); + // AddFinalHisto(Form("ChargedHiggsTopBottom/CutFlow/SplitMCCR%s_%u",category.c_str(),mc)); Book(Form("ChargedHiggsTopBottom/CutFlow/SplitMCCR%s_%u",category.c_str(),mc),"split mc cut flow",2,0,2); - AddFinalHisto(Form("ChargedHiggsTopBottom/CutFlow/SplitMCWeightCR%s_%u",category.c_str(),mc)); + // AddFinalHisto(Form("ChargedHiggsTopBottom/CutFlow/SplitMCWeightCR%s_%u",category.c_str(),mc)); Book(Form("ChargedHiggsTopBottom/CutFlow/SplitMCWeightCR%s_%u",category.c_str(),mc),"split mc cut flow weight",2,0,2); } @@ -1128,10 +1128,12 @@ void ChargedHiggsTopBottom::BookFlavor(string l, string category, string phasesp // TEMPORARY // doBDTSyst=true; + if(doJECSources and iBDT!=9) continue; if(do1lAnalysis or do2lAnalysis) AddFinalHisto("ChargedHiggsTopBottom/"+phasespace+category+"/bdt"+BDT+"_"+SR+flavor+l); } + if(do1lAnalysis && doTMVA) AddFinalHisto("ChargedHiggsTopBottom/"+phasespace+category+"/bdt1lh_"+SR+flavor+l); if(do1lAnalysis && doTMVA) AddFinalHisto("ChargedHiggsTopBottom/"+phasespace+category+"/bdt1lm_"+SR+flavor+l); if(do1lAnalysis && doTMVA) AddFinalHisto("ChargedHiggsTopBottom/"+phasespace+category+"/bdt1ll_"+SR+flavor+l); @@ -1230,14 +1232,11 @@ void ChargedHiggsTopBottom::BookHisto(string l, string category, string phasespa // TEMPORARY // doBDTSyst=true; - + if(doJECSources and iBDT!=9) continue; // SR if(doBDTSyst and do1lAnalysis) AddFinalHisto("ChargedHiggsTopBottom/"+phasespace+category+"/bdt"+BDT+"_"+l); if(doBDTSyst and do2lAnalysis) AddFinalHisto("ChargedHiggsTopBottom/"+phasespace+category+"/bdt"+BDT+"_"+l); - // 2D - // if(iBDT>24 and iBDT<37) continue; // this is the 2d // // // 25-36 - } if(doBDTSyst and doTMVA and do1lAnalysis) AddFinalHisto("ChargedHiggsTopBottom/"+phasespace+category+"/bdt1lh_"+l); @@ -1283,6 +1282,8 @@ void ChargedHiggsTopBottom::BookHisto(string l, string category, string phasespa // TEMPORARY // doBDTSyst=true; + if(doJECSources and iBDT!=9) continue; + if(doSplit) { if(doBDTSyst and (do1lAnalysis or do2lAnalysis)) AddFinalHisto("ChargedHiggsTopBottom/"+phasespace+category+"/bdt"+BDT+"_"+"SR1_"+l); if(doBDTSyst and (do1lAnalysis or do2lAnalysis)) AddFinalHisto("ChargedHiggsTopBottom/"+phasespace+category+"/bdt"+BDT+"_"+"SR2_"+l); @@ -3670,7 +3671,6 @@ int ChargedHiggsTopBottom::analyze(Event*e,string systname) ) return EVENT_NOT_USED; */ - /* // use the 2/3 // QCD is full // diboson+triboson is full @@ -3687,8 +3687,8 @@ int ChargedHiggsTopBottom::analyze(Event*e,string systname) (label.find("TTG") !=string::npos) or (label.find("ST") !=string::npos) ) and (e->eventNum()%3)==0 ) return EVENT_NOT_USED; - */ + /* // use the 1/3 if ( ((label.find("TT_TuneCUETP8M2T4_13TeV-powheg-pythia8") !=string::npos) or @@ -3698,6 +3698,7 @@ int ChargedHiggsTopBottom::analyze(Event*e,string systname) (label.find("WJetsToLNu_HT") !=string::npos) or (label.find("ST") !=string::npos) ) and (e->eventNum()%3)!=0 ) return EVENT_NOT_USED; + */ /* TRandom3 *r = new TRandom3(); From 4ff8d84cf03771eb98d750fce1801f145cdb515a Mon Sep 17 00:00:00 2001 From: maria Date: Sat, 5 May 2018 17:55:24 +0200 Subject: [PATCH 07/60] script fullHad APR28 --- script/bwsFullHadTB.py | 189 +++++++++++++++++++++++++++++++++++------ 1 file changed, 165 insertions(+), 24 deletions(-) diff --git a/script/bwsFullHadTB.py b/script/bwsFullHadTB.py index 9ad23117..9ca50b6f 100644 --- a/script/bwsFullHadTB.py +++ b/script/bwsFullHadTB.py @@ -18,16 +18,63 @@ doRebin = False applyLikelihoodRebinBin = True -doSyst = False +doSyst = True likelihoodBinning = FwRebin.RebinLikelihood(LikeBins) doSChannel = False parser= OptionParser() -# new fixed (SYST only) -parser.add_option("","--input",type='string',help="Input ROOT file. [%default]", default="/afs/cern.ch/user/h/hum/work/public/CMSSW_8_0_26_patch1/src/ChargedHiggs/ntufile/post0systlimit.root") -parser.add_option("","--inputBin",type='string',help="Input ROOT file. [%default]", default="/afs/cern.ch/user/h/hum/work/public/CMSSW_8_0_26_patch1/src/ChargedHiggs/ntufile/post0systlimit.root") +##parser.add_option("","--input",type='string',help="Input ROOT file. [%default]", default="/afs/cern.ch/user/h/hum/work/public/CMSSW_8_0_26_patch1/src/ChargedHiggs/June12.root") +##parser.add_option("","--input",type='string',help="Input ROOT file. [%default]", default="/afs/cern.ch/user/h/hum/work/public/CMSSW_8_0_26_patch1/src/ChargedHiggs/hysteriaMeow.root") +##parser.add_option("","--input",type='string',help="Input ROOT file. [%default]", default="/afs/cern.ch/user/h/hum/work/public/CMSSW_8_0_26_patch1/src/ChargedHiggs/ohho.root") +##parser.add_option("","--input",type='string',help="Input ROOT file. [%default]", default="/afs/cern.ch/user/h/hum/work/public/CMSSW_8_0_26_patch1/src/ChargedHiggs/ssolstice.root") + +##parser.add_option("","--input",type='string',help="Input ROOT file. [%default]", default="/afs/cern.ch/user/h/hum/work/public/CMSSW_8_0_26_patch1/src/ChargedHiggs/ldoJune.root") +##parser.add_option("","--input",type='string',help="Input ROOT file. [%default]", default="/afs/cern.ch/user/h/hum/work/public/CMSSW_8_0_26_patch1/src/ChargedHiggs/bebetter.root") + +#### +#parser.add_option("","--input",type='string',help="Input ROOT file. [%default]", default="/afs/cern.ch/user/h/hum/work/public/CMSSW_8_0_26_patch1/src/ChargedHiggs/insaneM.root") +#parser.add_option("","--input",type='string',help="Input ROOT file. [%default]", default="/afs/cern.ch/user/h/hum/work/public/CMSSW_8_0_26_patch1/src/ChargedHiggs/SoHot.root") +#parser.add_option("","--input",type='string',help="Input ROOT file. [%default]", default="/afs/cern.ch/user/h/hum/work/public/CMSSW_8_0_26_patch1/src/ChargedHiggs/midAug.root") +#parser.add_option("","--input",type='string',help="Input ROOT file. [%default]", default="/afs/cern.ch/user/h/hum/work/public/CMSSW_8_0_26_patch1/src/ChargedHiggs/lateAug.root") +#parser.add_option("","--input",type='string',help="Input ROOT file. [%default]", default="/afs/cern.ch/user/h/hum/work/public/CMSSW_8_0_26_patch1/src/ChargedHiggs/ntufile/updlimit.root") +#parser.add_option("","--inputBin",type='string',help="Input ROOT file. [%default]", default="/afs/cern.ch/user/h/hum/work/public/CMSSW_8_0_26_patch1/src/ChargedHiggs/ntufile/updlimit.root") + +#parser.add_option("","--input",type='string',help="Input ROOT file. [%default]", default="/afs/cern.ch/user/h/hum/work/public/CMSSW_8_0_26_patch1/src/ChargedHiggs/ntufile/crazylimit0306.root") +#parser.add_option("","--inputBin",type='string',help="Input ROOT file. [%default]", default="/afs/cern.ch/user/h/hum/work/public/CMSSW_8_0_26_patch1/src/ChargedHiggs/ntufile/crazylimit0306.root") + +#parser.add_option("","--input",type='string',help="Input ROOT file. [%default]", default="/afs/cern.ch/user/h/hum/work/public/CMSSW_8_0_26_patch1/src/ChargedHiggs/ntufile/pipilimitnew.root") +#parser.add_option("","--inputBin",type='string',help="Input ROOT file. [%default]", default="/afs/cern.ch/user/h/hum/work/public/CMSSW_8_0_26_patch1/src/ChargedHiggs/ntufile/pipilimitnew.root") + +#parser.add_option("","--input",type='string',help="Input ROOT file. [%default]", default="/afs/cern.ch/user/h/hum/work/public/CMSSW_8_0_26_patch1/src/ChargedHiggs/ntufile/freze2limit.root") +#parser.add_option("","--inputBin",type='string',help="Input ROOT file. [%default]", default="/afs/cern.ch/user/h/hum/work/public/CMSSW_8_0_26_patch1/src/ChargedHiggs/ntufile/freze2limit.root") + +#parser.add_option("","--input",type='string',help="Input ROOT file. [%default]", default="/afs/cern.ch/user/h/hum/work/public/CMSSW_8_0_26_patch1/src/ChargedHiggs/ntufile/freze1limit.root") +#parser.add_option("","--inputBin",type='string',help="Input ROOT file. [%default]", default="/afs/cern.ch/user/h/hum/work/public/CMSSW_8_0_26_patch1/src/ChargedHiggs/ntufile/freze1limit.root") + +#parser.add_option("","--input",type='string',help="Input ROOT file. [%default]", default="/afs/cern.ch/user/h/hum/work/public/CMSSW_8_0_26_patch1/src/ChargedHiggs/ntufile/freze00limit.root") +#parser.add_option("","--inputBin",type='string',help="Input ROOT file. [%default]", default="/afs/cern.ch/user/h/hum/work/public/CMSSW_8_0_26_patch1/src/ChargedHiggs/ntufile/freze00limit.root") + +## this is the one used for the freezed note +#parser.add_option("","--input",type='string',help="Input ROOT file. [%default]", default="/afs/cern.ch/user/h/hum/work/public/CMSSW_8_0_26_patch1/src/ChargedHiggs/ntufile/freze00systlimit.root") +#parser.add_option("","--inputBin",type='string',help="Input ROOT file. [%default]", default="/afs/cern.ch/user/h/hum/work/public/CMSSW_8_0_26_patch1/src/ChargedHiggs/ntufile/freze00systlimit.root") + +# new fixed (STAT only) +#parser.add_option("","--input",type='string',help="Input ROOT file. [%default]", default="/afs/cern.ch/user/h/hum/work/public/CMSSW_8_0_26_patch1/src/ChargedHiggs/ntufile/post0limit.root") +#parser.add_option("","--inputBin",type='string',help="Input ROOT file. [%default]", default="/afs/cern.ch/user/h/hum/work/public/CMSSW_8_0_26_patch1/src/ChargedHiggs/ntufile/post0limit.root") + +# new fixed (SYST) +#parser.add_option("","--input",type='string',help="Input ROOT file. [%default]", default="/afs/cern.ch/user/h/hum/work/public/CMSSW_8_0_26_patch1/src/ChargedHiggs/ntufile/post0systlimit.root") +#parser.add_option("","--inputBin",type='string',help="Input ROOT file. [%default]", default="/afs/cern.ch/user/h/hum/work/public/CMSSW_8_0_26_patch1/src/ChargedHiggs/ntufile/post0systlimit.root") + +# new fixed (minor SYST only) +parser.add_option("","--input",type='string',help="Input ROOT file. [%default]", default="/afs/cern.ch/user/h/hum/work/public/CMSSW_8_0_26_patch1/src/ChargedHiggs/ntufile/post0systlimit_ALL.root") +parser.add_option("","--inputBin",type='string',help="Input ROOT file. [%default]", default="/afs/cern.ch/user/h/hum/work/public/CMSSW_8_0_26_patch1/src/ChargedHiggs/ntufile/post0systlimit_ALL.root") + +## fixed mass window for 400-500 + lowered the bjet PT 40->30 +#parser.add_option("","--input",type='string',help="Input ROOT file. [%default]", default="/afs/cern.ch/user/h/hum/work/public/CMSSW_8_0_26_patch1/src/ChargedHiggs/ntufile/finaltry.root") +#parser.add_option("","--inputBin",type='string',help="Input ROOT file. [%default]", default="/afs/cern.ch/user/h/hum/work/public/CMSSW_8_0_26_patch1/src/ChargedHiggs/ntufile/finaltry.root") if doSyst: parser.add_option("-o","--output",type='string',help="Output ROOT file. [%default]", default="workspace_SYST.root") @@ -181,6 +228,11 @@ def mergeCategory(tfile,toget): #channel = ["wbj"] #basecat = ["OneBOneFat_two_highj"] +#basecat = ["OneBOneFat_one_highj","OneBOneFat_two_highj", "OneBOneFat_one_lowj","OneBOneFat_two_lowj" +## ,"OneBOneFat1l_one","OneBOneFat1l_two" +# ,"OneBOneMirrorFat_one_highj","OneBOneMirrorFat_two_highj", "OneBOneMirrorFat_one_lowj","OneBOneMirrorFat_two_lowj" +# ] + ### FINAL conf if doSChannel: basecat = ["OneBOneFat_one_highj","OneBOneFat_two_highj", "OneBOneFat_one_lowj","OneBOneFat_two_lowj" @@ -196,6 +248,11 @@ def mergeCategory(tfile,toget): if doSChannel: channel = ["t0b","t1b","wbb","wbj"] +## channel = ["wbj"] +## channel = ["t1b"] +## label="sChan_" +## label="sChan_sronly_" +## label="sChan_inonly_" label="sChan_" else: @@ -311,6 +368,91 @@ def mergeCategory(tfile,toget): if "_three_highj" in x and y=="wbb": continue if "_one_lowj" in x and y=="wbj": continue + +# if opts.kMass=="2000" or opts.kMass=="2500" or opts.kMass=="3000": +## if opts.kMass=="1500" or opts.kMass=="2000" or opts.kMass=="2500" or opts.kMass=="3000": +# if y=="wbj": continue +# if "_three" in x and y=="wbb": continue +# if "_two" in x and y=="wbj": continue +# if "_two" in x and y=="wbb" and opts.kMass=="3000": continue +# if "_three" in x and y=="t0b": continue + + +# if opts.kMass=="2500" or opts.kMass=="3000": + # # for the 2000,2500,3000: (They are all in the below bin) +# if "OneBOneMirrorFat" in x and y=="wbb" and ("above" in reg or "in" in reg): continue +# if "OneBOneMirrorFat" in x and y=="wbj" and ("above" in reg or "in" in reg): continue +# if "OneBOneFat" in x and y=="wbb" and ("above" in reg or "in" in reg): continue +# if "OneBOneFat" in x and y=="wbj" and ("above" in reg or "in" in reg): continue + + +## if "OneBOneMirrorFat_three_lowj" in x and y=="t0b": continue +# if "_three" in x and ("above" in reg) and (y=="t0b"): continue +# if "_three" in x and ("above" in reg) and (y=="t1b"): continue +# if "_two" in x and ("above" in reg) and (y=="t0b"): continue +# if "_two" in x and ("above" in reg) and (y=="t1b"): continue +# if "_three" in x and (y=="wbb"): continue +# if "_three" in x and (y=="wbj"): continue + +# if doSChannel and opts.kMass=="3000": +# if ("in" in reg or "above" in reg): continue + +# if doSChannel and opts.kMass=="3000": +# if "OneBOneFat_two_lowj" in x and y=="t1b" and "in" in reg: continue +# if "OneBOneMirrorFat_two_highj" in x and y=="t1b" and ("above" in reg) : continue +# if "OneBOneFat_two_highj" in x and y=="t1b" and ("in" in reg) : continue +# if "OneBOneMirrorFat_two_highj" in x and y=="t1b" and ("in" in reg) : continue + +# if "OneBOneFat_one_lowj" in x and y=="wbb": continue +# if "OneBOneMirrorFat_one_highj" in x and y=="wbb": continue + +# if opts.kMass=="2000" or opts.kMass=="2500" or opts.kMass=="3000": +# # # for the 2000,2500,3000: (They are all in the below bin) +# if "OneBOneMirrorFat" in x and y=="wbb" and ("above" in reg): continue +# if "OneBOneMirrorFat" in x and y=="wbj" and ("above" in reg): continue +# if "OneBOneFat" in x and y=="wbb" and ("above" in reg): continue +# if "OneBOneFat" in x and y=="wbj" and ("above" in reg): continue + + # THIS IS planB +# if "_lowj" in x and y=="wbb": continue +# if "_lowj" in x and y=="wbj": continue + + + # UNDEFINED + # they should not exist but some are filled +# if "OneBOneFat_one" in x and y=="t1b": continue +# if "OneBOneMirrorFat_one" in x and y=="t1b": continue +# if "OneBOneFat1l_one" in x and y=="t1b": continue + +# if "OneBOneFat_three" in x and y=="wbj": continue +# if "OneBOneMirrorFat_three" in x and y=="wbj": continue +# if "OneBOneFat1l_three" in x and y=="wbj": continue + +# if opts.kMass=="2000" or opts.kMass=="2500" or opts.kMass=="3000": +# # # for the 2000,2500,3000: (They are all in the below bin) +# if "OneBOneMirrorFat" in x and y=="wbb" and ("above" in reg or "in" in reg): continue +# if "OneBOneMirrorFat" in x and y=="wbj" and ("above" in reg or "in" in reg): continue +# # ## recovered the wbb - in +# if "OneBOneFat" in x and y=="wbb" and ("above" in reg ): continue +# if "OneBOneFat" in x and y=="wbj" and ("above" in reg or "in" in reg): continue + +# # t0b/t1b & 3b NO STAT very rare situation +# if "OneBOneMirrorFat_three_lowj" in x and y=="t1b": continue +# if "OneBOneMirrorFat_three_highj" in x and y=="t1b": continue + +# if doSChannel or (opts.kMass=="2000" or opts.kMass=="2500" or opts.kMass=="3000"): +# if "OneBOneFat_three" in x and y=="t0b": continue +# if "OneBOneMirrorFat_three" in x and y=="t0b": continue + +# ## NO STAT +# if "OneBOneFat1l_one" in x and (y=="t0b" or y=="wbj"): continue + ## +## if "OneBOneFat1l_two" in x and ( y=="wbb" or y=="wbj" or y=="t0b" or y=="t1b"): continue +# if "OneBOneFat1l_two" in x and ( y=="wbb" or y=="wbj" or y=="t0b" or y=="t1b"): continue + ## +## if "OneBOneFat1l_three" in x and ( y=="wbb" or y=="t1b" or y=="t0b"): continue +# if "OneBOneFat1l_three" in x and ( y=="wbb" or y=="t1b" or y=="t0b"): continue + if "OneBOneFat1l" in x: catStore [ name ] = { "name": name,"dir": x+ "_" + y,"file": None, "hasMC":["ttbar"],"var":"HT"+reg} name = x+ "_" + y @@ -378,13 +520,13 @@ def mergeCategory(tfile,toget): ##Light jets Heavy flavor contamination "CMS_btag_HF":{"type":"shape", "wsname":"CMS_btag_HF","name":"CSVRHF","proc":[".*"]}, ##Heavy jets light flavor contamination - "CMS_btag_LF_qcd":{"type":"shape", "wsname":"CMS_btag_LF_0l_qcd","name":"CSVRLF","proc":["qcd_wx_one","qcd_wx_two","qcd_wx_three","qcd_tx_one","qcd_tx_two","qcd_tx_three"]}, - "CMS_btag_LF":{"type":"shape", "wsname":"CMS_btag_LF_0l","name":"CSVRLF","proc":["Hptb","ttbar"]}, + "CMS_btag_LF_qcd":{"type":"shape", "wsname":"CMS_btag_LF_qcd","name":"CSVRLF","proc":["qcd_wx_one","qcd_wx_two","qcd_wx_three","qcd_tx_one","qcd_tx_two","qcd_tx_three"]}, + "CMS_btag_LF":{"type":"shape", "wsname":"CMS_btag_LF","name":"CSVRLF","proc":["Hptb","ttbar"]}, ##Linear and quadratic uncertainties "CMS_btag_HFstat1":{"type":"shape", "wsname":"CMS_btag_HFstat1","name":"CSVRHFSTAT1","proc":[".*"]}, "CMS_btag_HFstat2":{"type":"shape", "wsname":"CMS_btag_HFstat2","name":"CSVRHFSTAT2","proc":[".*"]}, - "CMS_btag_LFstat1":{"type":"shape", "wsname":"CMS_btag_LFstat1_0l","name":"CSVRLFSTAT1","proc":[".*"]}, - "CMS_btag_LFstat2":{"type":"shape", "wsname":"CMS_btag_LFstat2_0l","name":"CSVRLFSTAT2","proc":[".*"]}, + "CMS_btag_LFstat1":{"type":"shape", "wsname":"CMS_btag_LFstat1","name":"CSVRLFSTAT1","proc":[".*"]}, + "CMS_btag_LFstat2":{"type":"shape", "wsname":"CMS_btag_LFstat2","name":"CSVRLFSTAT2","proc":[".*"]}, "CMS_btag_CFerr1":{"type":"shape", "wsname":"CMS_btag_CFerr1","name":"CSVRCERR1","proc":[".*"]}, "CMS_btag_CFerr2":{"type":"shape", "wsname":"CMS_btag_CFerr2","name":"CSVRCERR2","proc":[".*"]} #### @@ -739,8 +881,7 @@ def SmoothAndMergeSyst(tfile,togetNom,togetSyst,s): def envelop(tfile,togetClone, s) : hname=togetClone+'RF'+s - - hTmp=mergeCategory(tfile,hname) + hTmp=MergeCategory(tfile,hname) ## if hTmp!=None: hTmp.Rebin(nRebinHT) @@ -749,28 +890,26 @@ def envelop(tfile,togetClone, s) : if hTmp==None: return for w in [ 'R','F','RF']: + for var in [ 'Up','Down']: - hnameClone=togetClone+w+s - - hTmp=mergeCategory(tfile,hnameClone) + hnameClone=togetClone+w+var -## if hTmp!=None: hTmp.Rebin(nRebinHT) + hTmp=MergeCategory(tfile,hnameClone) - for iBin in range(1,h.GetNbinsX()+1): - c= h.GetBinContent(iBin) +## if hTmp!=None: hTmp.Rebin(nRebinHT) - ## take the maximum for the Up - if "Up" in s and hTmp.GetBinContent(iBin)>c: - h.SetBinContent(iBin,hTmp.GetBinContent(iBin)) + for iBin in range(1,h.GetNbinsX()+1): + c= h.GetBinContent(iBin) - ## take the minimum for the Down - if "Down" in s and hTmp.GetBinContent(iBin)c: + h.SetBinContent(iBin,hTmp.GetBinContent(iBin)) + ## take the minimum for the Down + if 'Down' in s and hTmp.GetBinContent(iBin)10 : target = "pdf_" + mc["name"] + "_" + cat["name"] +# target = "pdf_" + mc["name"] +"_M-%d"%m+"_"+ cat["name"] if syst != None: target += "_" + syst["wsname"] + s @@ -867,6 +1007,7 @@ def importPdfFromTH1(cat,mc,myBin,LikelihoodMapping,syst=None): elif syst != None: hTmp = SmoothAndMergeSyst(tfile,togetNom,togetSyst,s) +## hTmp = MergeCategory(tfile,togetSyst+s) else: hTmp = mergeCategory(tfile,togetNom) From 8f32ad7d2685ed035de76a010e9aebdd0d1ff378 Mon Sep 17 00:00:00 2001 From: maria Date: Sat, 5 May 2018 17:56:20 +0200 Subject: [PATCH 08/60] script leptonic MAY4 --- script/bwsTB.py | 184 +++++++++++++++++++++++++++++++++--------------- 1 file changed, 129 insertions(+), 55 deletions(-) diff --git a/script/bwsTB.py b/script/bwsTB.py index ad176d24..7b4bd670 100644 --- a/script/bwsTB.py +++ b/script/bwsTB.py @@ -12,6 +12,7 @@ maxStat=0.3 LikeBins=50 +#LikeBins=1 doSyst = False @@ -30,8 +31,8 @@ ###### if doSyst: - parser.add_option("-o","--output",type='string',help="Output ROOT file. [%default]", default="_smooth_workspace_SYST.root") - parser.add_option("-d","--datCardName",type='string',help="Output txt file. [%default]", default="_smooth_cms_datacard_topbottom_SYST.txt") + parser.add_option("-o","--output",type='string',help="Output ROOT file. [%default]", default="_workspace_SYST.root") + parser.add_option("-d","--datCardName",type='string',help="Output txt file. [%default]", default="_cms_datacard_topbottom_SYST.txt") else : parser.add_option("-o","--output",type='string',help="Output ROOT file. [%default]", default="workspace_STAT.root") parser.add_option("-d","--datCardName",type='string',help="Output txt file. [%default]", default="cms_datacard_topbottom_STAT.txt") @@ -127,8 +128,8 @@ def RebinN(h,nBin): #1l if opts.kTest==0 or opts.kTest==1 or opts.kTest==2 or opts.kTest==3 or opts.kTest==4 or opts.kTest==5 or opts.kTest==6 or opts.kTest==7 or opts.kTest==8 or opts.kTest==9 or opts.kTest==10 or opts.kTest==11 or opts.kTest==12 or opts.kTest==13 or opts.kTest==14 or opts.kTest==15 or opts.kTest==16 or opts.kTest==100 or opts.kTest==101 or opts.kTest==102: -# channel = ["1Mu","1Ele"] - channel = ["1L"] + channel = ["1Mu","1Ele"] +# channel = ["1L"] basecat = ["Baseline","topCRR4","topCRR5","extraRadCRR10","extraRadCRR7","charmCR"] #2l @@ -328,7 +329,11 @@ def RebinN(h,nBin): # if opts.kTest==19: VarTest="2d_high_" for reg in region: + # use the HT in the topCR +# name = x+ "_" + y + "" + reg + # use the DNN everywhere in the topCR name = x+ "_" + y + "" + sr + "" + reg + # x=macroRegion y=1L sr=bdtX reg=SR12 if thee ## BDT 1-14 for each mass point and for the merged set @@ -367,12 +372,13 @@ def RebinN(h,nBin): "Hptb":{"name":"Hptb", "hist":["ChargedHiggs_HplusTB_HplusToTB_M-%d_13TeV_amcatnlo_pythia8"], "num":0 }, "ttlf":{ "name":"ttlf","hist":["ttlight_TT_TuneCUETP8M2T4_13TeV-powheg-pythia8"],"num":1}, "ttb":{ "name":"ttb","hist":["tt1b_TT_TuneCUETP8M2T4_13TeV-powheg-pythia8"],"num":2}, - "ttbb":{ "name":"ttbb","hist":["tt2b_TT_TuneCUETP8M2T4_13TeV-powheg-pythia8"],"num":3}, - "tt2b":{ "name":"tt2b","hist":["tt2bMerged_TT_TuneCUETP8M2T4_13TeV-powheg-pythia8"],"num":4}, - "ttcc":{ "name":"ttcc","hist":["ttc_TT_TuneCUETP8M2T4_13TeV-powheg-pythia8"],"num":5}, +### "ttbb":{ "name":"ttbb","hist":["tt2b_TT_TuneCUETP8M2T4_13TeV-powheg-pythia8"],"num":3}, +### "tt2b":{ "name":"tt2b","hist":["tt2bMerged_TT_TuneCUETP8M2T4_13TeV-powheg-pythia8"],"num":4}, + "ttbb":{ "name":"ttbb","hist":["tt2b_TT_TuneCUETP8M2T4_13TeV-powheg-pythia8","tt2bMerged_TT_TuneCUETP8M2T4_13TeV-powheg-pythia8"],"num":3}, + "ttcc":{ "name":"ttcc","hist":["ttc_TT_TuneCUETP8M2T4_13TeV-powheg-pythia8"],"num":4}, # "ewk":{ "name":"ewk","hist":["WJetsToLNu_HT","DYJetsToLL_M-50_HT","DYJetsToLL_M-5to50_HT","ZZTo","WWTo","WZTo","ZZZ","WZZ","WWZ","WWW","VHToNonbb_M125","WH_HToBB_WToLNu_M125","ZH_HToBB_ZToLL"],"num":6}, - "ewk":{ "name":"ewk","hist":["WJetsToLNu_HT","DYJetsToLL_M-50_HT","DYJetsToLL_M-5to50_HT","ZZTo","WZTo","ZZZ","WZZ","WWZ","WWW","WH_HToBB_WToLNu_M125","ZH_HToBB_ZToLL"],"num":6}, - "top":{ "name":"top","hist":["TTZ","TTW","TTG","ttH","TTTT","ST"],"num":7} + "ewk":{ "name":"ewk","hist":["WJetsToLNu_HT","DYJetsToLL_M-50_HT","DYJetsToLL_M-5to50_HT","ZZTo","WZTo","ZZZ","WZZ","WWZ","WWW","WH_HToBB_WToLNu_M125","ZH_HToBB_ZToLL"],"num":5}, + "top":{ "name":"top","hist":["TTZ","TTW","TTG","ttH","TTTT","ST"],"num":6} # "qcd":{ "name":"top","hist":["QCD_HT"],"num":8} } else: @@ -380,12 +386,13 @@ def RebinN(h,nBin): "Hptb":{"name":"Hptb", "hist":["ChargedHiggs_HplusTB_HplusToTB_M-%d_13TeV_amcatnlo_pythia8"], "num":0 }, "ttlf":{ "name":"ttlf","hist":["ttlight_TT_TuneCUETP8M2T4_13TeV-powheg-pythia8"],"num":1}, "ttb":{ "name":"ttb","hist":["tt1b_TT_TuneCUETP8M2T4_13TeV-powheg-pythia8"],"num":2}, - "ttbb":{ "name":"ttbb","hist":["tt2b_TT_TuneCUETP8M2T4_13TeV-powheg-pythia8"],"num":3}, - "tt2b":{ "name":"tt2b","hist":["tt2bMerged_TT_TuneCUETP8M2T4_13TeV-powheg-pythia8"],"num":4}, - "ttcc":{ "name":"ttcc","hist":["ttc_TT_TuneCUETP8M2T4_13TeV-powheg-pythia8"],"num":5}, +# "ttbb":{ "name":"ttbb","hist":["tt2b_TT_TuneCUETP8M2T4_13TeV-powheg-pythia8"],"num":3}, +# "tt2b":{ "name":"tt2b","hist":["tt2bMerged_TT_TuneCUETP8M2T4_13TeV-powheg-pythia8"],"num":4}, + "ttbb":{ "name":"ttbb","hist":["tt2b_TT_TuneCUETP8M2T4_13TeV-powheg-pythia8","tt2bMerged_TT_TuneCUETP8M2T4_13TeV-powheg-pythia8"],"num":3}, + "ttcc":{ "name":"ttcc","hist":["ttc_TT_TuneCUETP8M2T4_13TeV-powheg-pythia8"],"num":4}, # "ewk":{ "name":"ewk","hist":["WJetsToLNu_HT","DYJetsToLL_M-50_HT","DYJetsToLL_M-5to50_HT","ZZTo","WWTo","WZTo","ZZZ","WZZ","WWZ","WWW","VHToNonbb_M125","WH_HToBB_WToLNu_M125","ZH_HToBB_ZToLL"],"num":6}, - "ewk":{ "name":"ewk","hist":["WJetsToLNu_HT","DYJetsToLL_M-50_HT","ZZTo"],"num":6}, - "top":{ "name":"top","hist":["TTZ","TTW","TTG","ttH","TTTT","ST"],"num":7} + "ewk":{ "name":"ewk","hist":["WJetsToLNu_HT","DYJetsToLL_M-50_HT","ZZTo"],"num":5}, + "top":{ "name":"top","hist":["TTZ","TTW","TTG","ttH","TTTT","ST"],"num":6} # "qcd":{ "name":"top","hist":["QCD_HT"],"num":8} } @@ -395,20 +402,61 @@ def RebinN(h,nBin): # "CMS_scale_j":{"type":"shape", "wsname":"CMS_scale_j","name":"JESANDCSV","proc":[".*"]} ## name used for shape "lumi_13TeV":{"type":"lnN", "value":["1.025"] ,"proc":[".*"],"wsname":"lumi_13TeV","name":"XXX"}, ## name used for shape + ## 2l "CMS_eff_l":{"type":"lnN", "value":["1.04"] ,"proc":[".*"],"wsname":"CMS_eff_l","name":"XXX"}, ## name used for shape - "CMS_eff_t":{"type":"lnN", "value":["1.03"] ,"proc":[".*"],"wsname":"CMS_eff_t","name":"XXX"}, ## name used for shape + ## 1l + "CMS_eff_m":{"type":"lnN", "value":["1.04"] ,"proc":[".*"],"wsname":"CMS_eff_m","name":"XXX"}, ## name used for shape + "CMS_eff_e":{"type":"lnN", "value":["1.03"] ,"proc":[".*"],"wsname":"CMS_eff_e","name":"XXX"}, ## name used for shape + "CMS_eff_t_veto":{"type":"lnN", "value":["1.03"] ,"proc":[".*"],"wsname":"CMS_eff_t_veto","name":"XXX"}, ## name used for shape "CMS_pileup":{"type":"shape", "wsname":"CMS_pileup","name":"PU","proc":[".*"]}, ## name used for shape ## "CMS_scale_uncluster":{"type":"shape", "wsname":"CMS_scale_uncluster","name":"UNCLUSTER","proc":[".*"]}, "CMS_scale_uncluster":{"type":"lnN", "value":["1.02"],"proc":[".*"],"wsname":"CMS_scale_uncluster","name":"XXX"}, ## name used for shape + #### + #### Theo + #### "CMS_topreweight":{"type":"shape", "wsname":"CMS_topreweight","name":"TOPRW","proc":["ttlf","ttb","ttbb","tt2b","ttcc"]}, ## name used for shape - "CMS_HTreweight":{"type":"shape", "wsname":"CMS_HTreweight","name":"htRECO","proc":["ewk"]}, ## name used for shape + "CMS_HPTB_mcreweight_ewk":{"type":"shape", "wsname":"CMS_HPTB_mcreweight_ewk","name":"htRECO","proc":["ewk"]}, ## name used for shape ## "QCDscale":{"type":"shape", "wsname":"QCDscale","name":"ScaleRF","proc":["Hptb","ttlf","ttb","ttbb","tt2b","ttcc"]} ## name used for shape - "QCDscaleT":{"type":"shape", "wsname":"QCDscaleTTbar","name":"Scale","proc":["ttlf","ttb","ttbb","tt2b","ttcc"]}, ## name used for shape - "QCDscaleV":{"type":"shape", "wsname":"QCDscaleEwk","name":"Scale","proc":["ewk"]}, ## name used for shape - "QCDscaleS":{"type":"shape", "wsname":"QCDscaleHptb","name":"Scale","proc":["Hptb"]}, ## name used for shape + "muRF_ttbar":{"type":"shape", "wsname":"muRF_ttbar","name":"Scale","proc":["ttlf","ttb","ttbb","tt2b","ttcc"]}, ## name used for shape + "muRF_ewk":{"type":"shape", "wsname":"muRF_ewk","name":"Scale","proc":["ewk"]}, ## name used for shape + "muRF_Hptb":{"type":"shape", "wsname":"muRF_Hptb","name":"Scale","proc":["Hptb"]}, ## name used for shape "CMS_res_j":{"type":"shape", "wsname":"CMS_res_j","name":"JER","proc":[".*"]}, ## name used for shape -## "CMS_scale_j":{"type":"shape", "wsname":"CMS_scale_j","name":"JES","proc":[".*"]}, ## name used for shape + #### + #### JEC sources + #### +# "CMS_scale_j":{"type":"shape", "wsname":"CMS_scale_j","name":"JES","proc":[".*"]}, ## name used for shape "CMS_scale_j":{"type":"shape", "wsname":"CMS_scale_j","name":"JESANDCSV","proc":[".*"]}, ## name used for shape +# "CMS_scale_AbsoluteStat_j":{"type":"shape", "wsname":"CMS_scale_AbsoluteStat_j","name":"JES_AbsoluteStat","proc":[".*"]}, ## name used for shape +# "CMS_scale_AbsoluteScale_j":{"type":"shape", "wsname":"CMS_scale_AbsoluteScale_j","name":"JES_AbsoluteScale","proc":[".*"]}, ## name used for shape +# "CMS_scale_AbsoluteMPFBias_j":{"type":"shape", "wsname":"CMS_scale_AbsoluteMPFBias_j","name":"JES_AbsoluteMPFBias","proc":[".*"]}, ## name used for shape +# "CMS_scale_Fragmentation_j":{"type":"shape", "wsname":"CMS_scale_Fragmentation_j","name":"JES_Fragmentation","proc":[".*"]}, ## name used for shape +# "CMS_scale_SinglePionECAL_j":{"type":"shape", "wsname":"CMS_scale_SinglePionECAL_j","name":"JES_SinglePionECAL","proc":[".*"]}, ## name used for shape +# "CMS_scale_SinglePionHCAL_j":{"type":"shape", "wsname":"CMS_scale_SinglePionECAL_j","name":"JES_SinglePionHCAL","proc":[".*"]}, ## name used for shape +# "CMS_scale_FlavorQCD_j":{"type":"shape", "wsname":"CMS_scale_FlavorQCD_j","name":"JES_FlavorQCD","proc":[".*"]}, ## name used for shape +# "CMS_scale_TimePtEta_j":{"type":"shape", "wsname":"CMS_scale_TimePtEta_j","name":"JES_TimePtEta","proc":[".*"]}, ## name used for shape + ##### +# "CMS_scale_RelativeJEREC1_j":{"type":"shape", "wsname":"CMS_scale_RelativeJEREC1_j","name":"JES_RelativeJEREC1","proc":[".*"]}, ## name used for shape +# "CMS_scale_RelativePtBB_j":{"type":"shape", "wsname":"CMS_scale_RelativePtBB_j","name":"JES_RelativePtBB","proc":[".*"]}, ## name used for shape +# "CMS_scale_RelativePtEC1_j":{"type":"shape", "wsname":"CMS_scale_RelativePtEC1_j","name":"JES_RelativePtEC1","proc":[".*"]}, ## name used for shape +# "CMS_scale_RelativeBalance_j":{"type":"shape", "wsname":"CMS_scale_RelativePtBalance_j","name":"JES_RelativeBal","proc":[".*"]}, ## name used for shape +# "CMS_scale_RelativeFSR_j":{"type":"shape", "wsname":"CMS_scale_RelativeFSR_j","name":"JES_RelativeFSR","proc":[".*"]}, ## name used for shape +# "CMS_scale_RelativeStatFSR_j":{"type":"shape", "wsname":"CMS_scale_RelativeStatFSR_j","name":"JES_RelativeStatFSR","proc":[".*"]}, ## name used for shape +# "CMS_scale_RelativeStatEC_j":{"type":"shape", "wsname":"CMS_scale_RelativeStatEC_j","name":"JES_RelativeStatEC","proc":[".*"]}, ## name used for shape + ##### +# "CMS_scale_PileUpPtBB_j":{"type":"shape", "wsname":"CMS_scale_PileUpPtBB_j","name":"JES_PileUpPtBB","proc":[".*"]}, ## name used for shape +# "CMS_scale_PileUpPtEC1_j":{"type":"shape", "wsname":"CMS_scale_PileUpPtEC1_j","name":"JES_PileUpPtEC1","proc":[".*"]}, ## name used for shape +# "CMS_scale_PileUpDataMC_j":{"type":"shape", "wsname":"CMS_scale_PileUpDataMC_j","name":"JES_PileUpDataMC","proc":[".*"]}, ## name used for shape +# "CMS_scale_PileUpPtRef_j":{"type":"shape", "wsname":"CMS_scale_PileUpPtRef_j","name":"JES_PileUpPtRef","proc":[".*"]}, ## name used for shape + ##### comment since are null +# "CMS_scale_RelativeJEREC2_j":{"type":"shape", "wsname":"CMS_scale_RelativeJEREC2_j","name":"JES_RelativeJEREC2","proc":[".*"]}, ## name used for shape # "CMS_scale_RelativePtEC2_j":{"type":"shape", "wsname":"CMS_scale_RelativePtEC2_j","name":"JES_RelativePtEC2","proc":[".*"]}, ## name used for shape +# "CMS_scale_PileUpPtEC2_j":{"type":"shape", "wsname":"CMS_scale_PileUpPtEC2_j","name":"JES_PileUpPtEC2","proc":[".*"]}, ## name used for shape +# "CMS_scale_RelativeJERHF_j":{"type":"shape", "wsname":"CMS_scale_RelativeJERHF_j","name":"JES_RelativeJERHF","proc":[".*"]}, ## name used for shape +# "CMS_scale_RelativePtHF_j":{"type":"shape", "wsname":"CMS_scale_RelativePtHF_j","name":"JES_RelativePtHF","proc":[".*"]}, ## name used for shape +# "CMS_scale_RelativeStatHF_j":{"type":"shape", "wsname":"CMS_scale_RelativeStatHF_j","name":"JES_RelativeStatHF","proc":[".*"]}, ## name used for shape +# "CMS_scale_PileUpPtHF_j":{"type":"shape", "wsname":"CMS_scale_PileUpPtHF_j","name":"JES_PileUpPtHF","proc":[".*"]}, ## name used for shape + #### + #### BTAG UNC + #### ##Light jets Heavy flavor contamination "CMS_btag_HF":{"type":"shape", "wsname":"CMS_btag_HF","name":"CSVRHF","proc":[".*"]}, ## name used for shape ##Heavy jets light flavor contamination @@ -435,12 +483,12 @@ def RebinN(h,nBin): #print "---------------------- --------" #fileTmp="AUG6_HT/"+label+VarTest+opts.output -fileTmp="APR16/"+ label + VarTest + str(opts.kMass) + opts.output +fileTmp="MAY4/"+ label + VarTest + str(opts.kMass) + opts.output w = ROOT.RooWorkspace("w","w") datNameTmp = opts.datCardName #datName = "AUG6_HT/"+ label + VarTest + datNameTmp -datName = "APR16/"+ label + VarTest + str(opts.kMass) + datNameTmp +datName = "MAY4/"+ label + VarTest + str(opts.kMass) + datNameTmp datacard=open(datName,"w") datacard.write("-------------------------------------\n") @@ -511,18 +559,18 @@ def skip(cat,mc): ## write shapes in workspace if True: # data - datacard.write("shapes data_obs *\t" + fileTmp +"\t") + datacard.write("shapes data_obs *\t" + fileTmp.split('/')[1] +"\t") datacard.write("data_obs_$CHANNEL") datacard.write("\n") if True: # Sig - datacard.write("shapes Hptb *\t" + fileTmp +"\t") + datacard.write("shapes Hptb *\t" + fileTmp.split('/')[1] +"\t") ### datacard.write("pdf_$PROCESS_M-$MASS_$CHANNEL\t") ### datacard.write("pdf_$PROCESS_M-$MASS_$CHANNEL_$SYSTEMATIC") datacard.write("pdf_$PROCESS_$CHANNEL\t") datacard.write("pdf_$PROCESS_$CHANNEL_$SYSTEMATIC") datacard.write("\n") if True: #bkg - datacard.write("shapes * * %s\t"%fileTmp +"\t") + datacard.write("shapes * * %s\t"%fileTmp.split('/')[1] +"\t") datacard.write("pdf_$PROCESS_$CHANNEL\t") datacard.write("pdf_$PROCESS_$CHANNEL_$SYSTEMATIC\n") datacard.write("-------------------------------------\n") @@ -619,7 +667,7 @@ def writeSystISRFSR(name="test",valueL=["1.027","1.026"], regexpL=["TT","ST",""] if "topCRR5" in cat: valueUp = PartonShowerSyst(mySyst, "1L", "up", 4, 2, proc) valueDown = PartonShowerSyst(mySyst, "1L", "down", 4, 2, proc) - if "charmCR6" in cat: + if "charmCR" in cat: valueUp = PartonShowerSyst(mySyst, "1L", "up", 4, 3, proc) valueDown = PartonShowerSyst(mySyst, "1L", "down", 4, 3, proc) if "extraRadCRR7" in cat: @@ -659,7 +707,7 @@ def writeSystISRFSR(name="test",valueL=["1.027","1.026"], regexpL=["TT","ST",""] if "topCRR5" in cat: valueUp = PartonShowerSyst(mySyst, "2L", "up", 2, 2, proc) valueDown = PartonShowerSyst(mySyst, "2L", "down", 2, 2, proc) - if "charmCR6" in cat: + if "charmCR" in cat: valueUp = PartonShowerSyst(mySyst, "2L", "up", 2, 3, proc) valueDown = PartonShowerSyst(mySyst, "2L", "down", 2, 3, proc) if "extraRadCRR7" in cat: @@ -705,7 +753,7 @@ def writeSystISRFSR(name="test",valueL=["1.027","1.026"], regexpL=["TT","ST",""] ## -def writeNormSyst(name="lumi",valueL=["1.027","1.026"], regexpL=["TT","ST",""]): +def writeNormSyst(name="lumi",valueL=["1.027","1.026"], regexpL=["TT","ST",""],regexpCat=[]): ##def writeNormSyst(name="lumi",valueL=["1.027","1.026"], regexpL=["TT"]): datacard.write(name+"\tlnN") invert=False @@ -723,8 +771,18 @@ def writeNormSyst(name="lumi",valueL=["1.027","1.026"], regexpL=["TT","ST",""]): if (match and not invert) or (not match and invert): idx=i break + idx2=-1 + invert=False + for i,regexp in enumerate(regexpCat): + match=re.search(regexp,cat) + if regexp != "" and regexp[0] == '!': + invert=True + regexp=regexp[1:] + if (match and not invert) or (not match and invert): + idx2=i + break - if (idx>=0): + if (idx>=0 and (idx2>=0 or len(regexpCat)==0 )): datacard.write("\t"+valueL[idx]) else: datacard.write("\t-") @@ -833,7 +891,16 @@ def importStat(): for syst in systStore: if syst == "None": continue if systStore[syst]["type"] == "lnN": - writeNormSyst(syst,systStore[syst]["value"],systStore[syst]["proc"]) + if "CMS_eff_m" in systStore[syst]["wsname"]: + writeNormSyst(syst,systStore[syst]["value"],systStore[syst]["proc"],["1Mu"]) + elif "CMS_eff_e" in systStore[syst]["wsname"]: + writeNormSyst(syst,systStore[syst]["value"],systStore[syst]["proc"],["1Ele"]) + elif "CMS_eff_l" in systStore[syst]["wsname"]: + writeNormSyst(syst,systStore[syst]["value"],systStore[syst]["proc"],["2L"]) + elif "CMS_eff_t_veto" in systStore[syst]["wsname"]: + writeNormSyst(syst,systStore[syst]["value"],systStore[syst]["proc"],["1Mu","1Ele"]) + else: + writeNormSyst(syst,systStore[syst]["value"],systStore[syst]["proc"]) if systStore[syst]["type"] == "shape": # if opts.kTest==0 or opts.kTest==1 or opts.kTest==2 or opts.kTest==3 or opts.kTest==4 or opts.kTest==5 or opts.kTest==6 or opts.kTest==7 or opts.kTest==8 or opts.kTest==9 or opts.kTest==10 or opts.kTest==11 or opts.kTest==12 or opts.kTest==13 or opts.kTest==14 or opts.kTest==15 or opts.kTest==16 or opts.kTest==100 or opts.kTest==101 or opts.kTest==102: @@ -854,17 +921,18 @@ def importStat(): if doSyst: writeNormSyst("QCDscale_ttbar",["0.965/1.024","0.965/1.024","0.965/1.024","0.965/1.024","0.965/1.024"],["ttlf","ttcc","ttb","ttbb","tt2b"]) if doSyst: writeNormSyst("pdf_gg",["1.042","1.042","1.042","1.042","1.042"],["ttlf","ttcc","ttb","ttbb","tt2b"]) +if doSyst: writeNormSyst("CMS_mass_ttbar",["1.027","1.027","1.027","1.027","1.027"],["ttlf","ttb","ttbb","tt2b","ttcc"]) -if doSyst: writeNormSyst("CMS_HPTB_QCDscale_ttlf",["1.50"],["ttlf"]) -if doSyst: writeNormSyst("CMS_HPTB_QCDscale_ttcc",["1.50"],["ttcc"]) -if doSyst: writeNormSyst("CMS_HPTB_QCDscale_ttb",["1.50"],["ttb"]) -if doSyst: writeNormSyst("CMS_HPTB_QCDscale_ttbb",["1.50"],["ttbb"]) -if doSyst: writeNormSyst("CMS_HPTB_QCDscale_tt2b",["1.50"],["tt2b"]) +###if doSyst: writeNormSyst("CMS_HPTB_QCDscale_ttlf",["1.50"],["ttlf"]) +if doSyst: writeNormSyst("bgnorm_ttcc",["1.50"],["ttcc"]) +if doSyst: writeNormSyst("bgnorm_ttb",["1.50"],["ttb"]) +if doSyst: writeNormSyst("bgnorm_ttbb",["1.50"],["ttbb"]) +##if doSyst: writeNormSyst("bgnorm_tt2b",["1.50"],["tt2b"]) ## "top" get the value od the single top if doSyst: writeNormSyst("QCDscale_top",["0.977/1.028"],["top"]) if doSyst: writeNormSyst("pdf_top",["1.026"],["top"]) -if doSyst: writeNormSyst("CMS_mass_ttbar",["1.027","1.027","1.027","1.027","1.027","1.022"],["ttlf","ttb","ttbb","tt2b","ttcc","top"]) +if doSyst: writeNormSyst("CMS_mass_top",["1.022"],["top"]) ## "ewk" get the envelop of the DY and W+jets if doSyst: writeNormSyst("QCDscale_ewk",["0.996/1.008"],["ewk"]) @@ -961,9 +1029,12 @@ def MergeCategory(tfile,hname): #nominal if hTmp!= None and "bdt" in hname: + # in the histos nbin=1000 then rebin5 hTmp.Rebin(5) elif hTmp!= None: - hTmp.Rebin(800) + # in the histos nbin=10GeV bin then rebin5 + hTmp.Rebin(5) + #hTmp.Rebin(800) return hTmp @@ -986,10 +1057,10 @@ def SmoothAndMergeSyst(tfile,togetNom,togetSyst,s): c= hTmpUp.SetBinError(iBin,0) c= hTmpDown.SetBinError(iBin,0) -# if 'JESANDCSV' in togetSyst or "TOPRW" in togetSyst: - if 'JESANDCSV' in togetSyst or "PU" in togetSyst or "JER" in togetSyst: -# return hTmpNom - hUp, hDown = SS.SystematicSmoother(hTmpNom, hTmpUp, hTmpDown,"~/www/ChargedHiggsTB/APR13/SYST").smooth() + if 'JESANDCSV' in togetSyst or 'JES_' in togetSyst or "PU" in togetSyst or "JER" in togetSyst: +## if 'typo' in togetSyst: +## return hTmpNom + hUp, hDown = SS.SystematicSmoother(hTmpNom, hTmpUp, hTmpDown,"~/www/ChargedHiggsTB/MAY3/SYST/").smooth() else: hUp = hTmpUp hDown = hTmpDown @@ -1003,29 +1074,28 @@ def SmoothAndMergeSyst(tfile,togetNom,togetSyst,s): def envelop(tfile,togetClone, s) : hname=togetClone+'RF'+s - hTmp=MergeCategory(tfile,hname) - h=hTmp.Clone() if hTmp==None: return for w in [ 'R','F','RF']: + for var in [ 'Up','Down']: - hnameClone=togetClone+w+s + hnameClone=togetClone+w+var - hTmp=MergeCategory(tfile,hnameClone) + hTmp=MergeCategory(tfile,hnameClone) - for iBin in range(1,h.GetNbinsX()+1): - c= h.GetBinContent(iBin) + for iBin in range(1,h.GetNbinsX()+1): + c= h.GetBinContent(iBin) - ## take the maximum for the Up - if "Up" in s and hTmp.GetBinContent(iBin)>c: - h.SetBinContent(iBin,hTmp.GetBinContent(iBin)) + ## take the maximum for the Up and Down + if 'Up' in s and hTmp.GetBinContent(iBin)>c: + h.SetBinContent(iBin,hTmp.GetBinContent(iBin)) ## take the minimum for the Down - if "Down" in s and hTmp.GetBinContent(iBin) Hist do not exists ",toget From b46b9c241eadd9b43c6bc8912f438ba3e59ba9fe Mon Sep 17 00:00:00 2001 From: maria Date: Sun, 6 May 2018 13:39:20 +0200 Subject: [PATCH 09/60] add macro for barPlot - MAY6 --- test/macroTB/getBarPlot.C | 399 ++++++++++++++++++++++++++++++++++++++ 1 file changed, 399 insertions(+) create mode 100644 test/macroTB/getBarPlot.C diff --git a/test/macroTB/getBarPlot.C b/test/macroTB/getBarPlot.C new file mode 100644 index 00000000..653b0d8e --- /dev/null +++ b/test/macroTB/getBarPlot.C @@ -0,0 +1,399 @@ +#include "TH1.h" +#include "TH1D.h" +#include "THStack.h" +#include "TFile.h" +#include "TLegend.h" +#include "TLatex.h" +#include "TLine.h" +#include "TStyle.h" +#include "TROOT.h" +#include "TCanvas.h" +#include "TPad.h" + +using namespace std; + +void getBarPlot() { + + gStyle->SetOptStat(0); + // gROOT->LoadMacro("utils.C++"); + gROOT->LoadMacro("utils.C"); + + bool do2l=true; + + TString histoName=""; + TString macroRegion=""; + TString mc=""; + TString legend=""; + TString fileName="MAY4_bin1/1l_3000_workspace_SYST.root"; + if(do2l) fileName="MAY4_bin1/2L_3000_workspace_SYST.root"; + + TString fileName2="MAY4_bin1/1l_500_workspace_SYST.root"; + if(do2l) fileName2="MAY4_bin1/2L_500_workspace_SYST.root"; + + int color=1; + char *labels1l[9] = {"4j,1b","4j,2b","4j,>2b", "5j,1b","5j,2b","5j,>2b", ">=6j,1b",">=6j,2b",">=6j,>2b"}; + char *labels2l[9] = {"2j,1b","2j,2b","2j,>2b", "3j,1b","3j,2b","3j,>2b", ">=4j,1b",">=4j,2b",">=4j,>2b"}; + + TH1D *hYIELD_sig3000 = new TH1D("h1", "histogram title", 9, 0., 9.); + TH1D *hYIELD_sig500 = new TH1D("h1", "histogram title", 9, 0., 9.); + TH1D *hYIELD_data = new TH1D("h1", "histogram title", 9, 0., 9.); + THStack *hs = new THStack("hs",""); + THStack *hsUp = new THStack("hsUp",""); + THStack *hsDown = new THStack("hsDown",""); + + // std::vector systlabel{ "_CMS_pileup","_CMS_res_J","_CMS_topreweight","_CMS_scale_J","_CMS_eff_b_CFerr2","_CMS_eff_b_CFerr1","_CMS_eff_b_HF","_CMS_eff_b_LF","_CMS_eff_b_LFstat2","_CMS_eff_b_LFstat1","_CMS_eff_b_HFstat2","_CMS_eff_b_HFstat1"}; + + std::vector systlabel; + systlabel.push_back("_lumi_13TeV"); + systlabel.push_back("_CMS_scale_j"); + systlabel.push_back("_CMS_pileup"); + systlabel.push_back("_CMS_res_j"); + systlabel.push_back("_CMS_scale_uncluster"); + //### + systlabel.push_back("_CMS_topreweight"); + systlabel.push_back("_muRF_ttbar"); + systlabel.push_back("_CMS_HPTB_ISR"); + systlabel.push_back("_CMS_HPTB_FSR"); + systlabel.push_back("_CMS_HPTB_HDAMP"); + //### EWK only + // CMS_HPTB_mcreweight_ewk + // muRF_ewk + //### + systlabel.push_back("_CMS_btag_CFerr2"); + systlabel.push_back("_CMS_btag_CFerr1"); + systlabel.push_back("_CMS_btag_HF"); + systlabel.push_back("_CMS_btag_LF"); + systlabel.push_back("_CMS_btag_LFstat2"); + systlabel.push_back("_CMS_btag_LFstat1"); + systlabel.push_back("_CMS_btag_HFstat2"); + systlabel.push_back("_CMS_btag_HFstat1"); + + ////////// + ////////// + ////////// + + TLegend* this_leg = new TLegend(0.4,0.6,0.55,0.89); + this_leg->SetFillColor(0); + this_leg->SetBorderSize(0); + this_leg->SetTextSize(0.04); + TLegend* this_leg1 = new TLegend(0.55,0.7,0.85,0.89); + this_leg1->SetFillColor(0); + this_leg1->SetBorderSize(0); + this_leg1->SetTextSize(0.05); + + int nLepCat=2; + // if(do2l) nLepCat=3; + if(do2l) nLepCat=1; + + for(int sampleI=0; sampleI<11; sampleI++) { + // for(int sampleI=3; sampleI<8; sampleI++) { + // for(int sampleI=0; sampleI<11; sampleI++) { + + if(sampleI==4) continue; + + if(sampleI==0 && do2l) continue; + + for(int lepFlavor=0; lepFlavorIntegral()=" << hyield->Integral() << " histoName=" << histoName.Data() << endl; + // if(hyield) h->SetBinContent(region-3,hyield->Integral()); + if(hyield) h->SetBinContent(region-3,hyield->Integral()); + if(h && sampleI<8) h->SetFillColor(color); + if(h && sampleI<8) h->SetLineColor(color); + if(h && sampleI<8) hs->Add(h); + if(h && region==4 && !do2l && lepFlavor==1 && sampleI<8 && sampleI>2) this_leg->AddEntry(h, legend,"f"); + if(h && region==4 && !do2l && lepFlavor==1 && sampleI<3) this_leg1->AddEntry(h, legend,"f"); + if(h && region==4 && do2l && lepFlavor==0 && sampleI<8 && sampleI>2) this_leg->AddEntry(h, legend,"f"); + if(h && region==4 && do2l && lepFlavor==0 && sampleI<3) this_leg1->AddEntry(h, legend,"f"); + + ///// SYST + + for(unsigned int syst=0; syst < systlabel.size(); syst++) { + + TString histoNameSystU = histoName + systlabel[syst].c_str() + "Up"; + TString histoNameSystD = histoName + systlabel[syst].c_str() + "Down"; + + TH1 * hyieldSystU = getHisto(fileName, "0", histoNameSystU, color, 1, 1); + TH1 * hyieldSystD = getHisto(fileName, "0", histoNameSystD, color, 1, 1); + TH1D *hU = new TH1D(Form("h_region%d_sampleMC%d_lepCat%d%s",region,sampleI,lepFlavor,histoNameSystU.Data()), "histogram title", 9, 0., 9.); + TH1D *hD = new TH1D(Form("h_region%d_sampleMC%d_lepCat%d%s",region,sampleI,lepFlavor,histoNameSystD.Data()), "histogram title", 9, 0., 9.); + + if(hyieldSystU) { double deltaUp=(hyieldSystU->Integral() - hyield->Integral()); hU->SetBinContent(region-3, deltaUp*deltaUp); } + if(hyieldSystD) { double deltaDown=(hyieldSystD->Integral() - hyield->Integral()); hD->SetBinContent(region-3, deltaDown*deltaDown); } + + if(hU && (sampleI<3 || sampleI>7) && histoNameSystU.Contains("CMS_HPTB_FSR")) continue; + if(hU && (sampleI<3 || sampleI>7) && histoNameSystU.Contains("CMS_HPTB_ISR")) continue; + if(hU && (sampleI<3 || sampleI>7) && histoNameSystU.Contains("CMS_HPTB_HDAMP")) continue; + if(hU && (sampleI<3 || sampleI>7) && histoNameSystU.Contains("QCDscaleTTbar")) continue; + + if(hU && sampleI<8) { hU->Scale(3/2); hsUp->Add(hU); } + if(hD && sampleI<8) { hD->Scale(3/2); hsDown->Add(hD);} + + if(region==4 && sampleI<8 ) { + cout << " region==4 histoName=" << histoNameSystU.Data(); // << endl; + cout << " hyieldSystU->Integral()=" << hU->Integral();// << endl; + cout << " hyieldSystD->Integral()=" << hD->Integral();// << endl; + cout << " hsUp=" << hsUp << " hsDown=" << hsDown << endl; + } + + /* + delete hyieldSystU; + delete hU; + delete hyieldSystD; + delete hD; + */ + + } + + ///// DATA + + if(sampleI==8 && hyield) { + TH1D *hYIELD_sig3000_ = new TH1D("h1", "histogram title", 9, 0., 9.); + if(hyield) hYIELD_sig3000_->SetBinContent(region-3,hyield->Integral()); + if(hyield) hYIELD_sig3000->Add(hYIELD_sig3000_); + } + + if(sampleI==9) { + TH1D *hYIELD_sig500_ = new TH1D("h1", "histogram title", 9, 0., 9.); + TH1 * hyield2 = getHisto(fileName2, "0", histoName, color, 1, 1); + if(hyield2) hYIELD_sig500_->SetBinContent(region-3,hyield2->Integral()); + if(hyield2) hYIELD_sig500->Add(hYIELD_sig500_); + } + if(sampleI==10) { + + cout << "DOING DATA sampleI=" << sampleI << " histoName=" << histoName << " region=" << region << endl; + cout << "DOING DATA sampleI=" << sampleI << " histoName=" << histoName << " region=" << region <SetBinContent(region-3,hyield3->Integral()); + if(hyield3) hYIELD_data_->Sumw2(); + if(hyield3) hYIELD_data->Add(hYIELD_data_); + } + } + } + } + + } + + ///// + ///// + ///// histogram builded, now only drawing + ///// + ///// + + TCanvas *c = new TCanvas("","",0,0,800,800); + c->cd(); + const double ydiv = 0.25; + TPad *pad1 = new TPad("pad1", "",0.05,ydiv,1,1); + // pad1->SetLogy(); + + pad1->SetTickx(1); + pad1->SetTicky(1); + pad1->SetBottomMargin(0.05); + pad1->SetTopMargin(0.075); + pad1->Draw(); + + TPad *pad2 = new TPad("pad2", "",0.05,0,1,ydiv); + pad2->SetTickx(1); + pad2->SetTicky(1); + pad2->SetTopMargin(0.05); + pad2->SetBottomMargin(0.35); + pad2->Draw(); + + ///// + ///// + pad1->cd(); + + hs->SetMaximum(1.4*hs->GetMaximum()); + hs->Draw(); + // hs->GetYaxis()->SetNdivisions(505); + // hs->SetMaxDigits(3); + if(do2l) TGaxis::SetMaxDigits(3); + hs->GetXaxis()->SetLabelOffset(999); + hs->GetXaxis()->SetLabelSize(0); + hs->GetYaxis()->SetTitle("Events"); + hs->GetYaxis()->SetTitleSize(0.06); + hs->GetYaxis()->SetTitleOffset(1.2); + hs->GetYaxis()->SetLabelSize(0.06); + + pad1->RedrawAxis(); + c->Modified(); + hYIELD_sig3000->SetLineColor(kBlack); + hYIELD_sig3000->SetLineWidth(3); + hYIELD_sig3000->Scale(100); + hYIELD_sig3000->Draw("hist same"); + hYIELD_sig500->SetLineColor(kBlack); + hYIELD_sig500->SetLineStyle(kDashed); + hYIELD_sig500->SetLineWidth(3); + hYIELD_sig500->Scale(100); + hYIELD_sig500->Draw("hist same"); + hYIELD_data->SetMarkerStyle(20); + hYIELD_data->Draw("p e same"); + this_leg1->SetTextSize(0.03); + this_leg1->AddEntry(hYIELD_sig3000, "H^{#pm}(3TeV)=1pb^{-1}x100","l"); + this_leg1->AddEntry(hYIELD_sig500, "H^{#pm}(500GeV)=1pb^{-1}x100","l"); + + this_leg->Draw(""); + this_leg1->Draw(""); + + TLatex *latex = new TLatex(); + latex->SetNDC(); + latex->SetTextSize(0.04); + latex->SetTextColor(1); + latex->SetTextFont(42); + latex->SetTextAlign(33); + latex->DrawLatex(0.9, 0.98, "35.9 fb^{-1} (13 TeV)"); + latex->SetTextFont(62); + latex->DrawLatex(0.22, 0.88, "CMS"); + latex->SetTextSize(0.04); + latex->SetTextFont(52); + latex->DrawLatex(0.30, 0.83, "Preliminary"); + + latex->SetTextFont(72); + latex->SetTextSize(0.035); + if(!do2l) latex->DrawLatex(0.30, 0.78, "single-lepton"); + if(do2l) latex->DrawLatex(0.30, 0.78, "di-lepton"); + // latex.SetTextAlign(22) + // latex.DrawLatex(0.5, 0.85, text) + + pad2->cd(); + + TH1 *mcTOT = ((TH1 *)(hs->GetStack()->Last())); // the "SUM" + TH1F *hdataRatio = (TH1F*) hYIELD_data->Clone(); + hdataRatio->Divide(mcTOT); + // hdataRatio->GetXaxis()->SetNdivisions(414); + hdataRatio->GetYaxis()->SetLabelSize(0.085*1.5); + hdataRatio->GetYaxis()->SetTitleSize(0.085*1.7); + hdataRatio->GetYaxis()->SetRangeUser(0.8,1.2); + hdataRatio->GetYaxis()->SetNdivisions(-502); + hdataRatio->GetYaxis()->SetTitle("data/MC"); + for(int region=4; region<13; region++) if(!do2l) hdataRatio->GetXaxis()->SetBinLabel(region-3,labels1l[region-3-1]); + for(int region=4; region<13; region++) if(do2l) hdataRatio->GetXaxis()->SetBinLabel(region-3,labels2l[region-3-1]); + hdataRatio->GetXaxis()->SetLabelSize(0.085*1.7); + hdataRatio->GetYaxis()->SetTitleOffset(0.45); + hdataRatio->SetTitle(""); + hdataRatio->Draw("p e"); + + if(hsUp && hsDown) { + TH1 *mcD = ((TH1 *)(hsDown->GetStack()->Last())); // the "SUM" in quadrature of the delta errors (xUp - xCentral)^2 + TH1 *mcU = ((TH1 *)(hsUp->GetStack()->Last())); // the "SUM" in quadrature of the delta errors (xUp - xCentral)^2 + for( unsigned int bin=1; binGetNbinsX(); bin++) { + if(mcTOT->GetBinContent(bin)!=0) mcU->SetBinContent(bin, ( (mcTOT->GetBinContent(bin) + sqrt(0.1*0.1 + mcU->GetBinContent(bin)))/mcTOT->GetBinContent(bin))); + if(mcTOT->GetBinContent(bin)!=0) mcD->SetBinContent(bin, ( (mcTOT->GetBinContent(bin) - sqrt(0.1*0.1 + mcD->GetBinContent(bin)))/mcTOT->GetBinContent(bin))); + } + + if(mcU) cout << " mcU->Integral()=" << mcU->Integral() << " mcD->Integral()=" << mcD->Integral() << " central=" << mcTOT->Integral() << endl; + // if(mcU) mcU->SetLineColor(kRed); + // if(mcD) mcD->SetLineColor(kBlue); + // if(mcU) mcU->Divide(mcTOT); + // if(mcD) mcD->Divide(mcTOT); + if(mcU) mcU->SetFillColor(kGray); + // if(mcU) mcU->SetFillStyle(3010); + if(mcD) mcD->SetFillColor(10); + // if(mcD) mcD->SetFillStyle(1001); + + if(mcU) mcU->Draw("hist sames"); + if(mcD) mcD->Draw("hist sames"); + hdataRatio->Draw("p e sames"); + + } + + pad2->RedrawAxis(); + + // getFillColor(kGray+3); + // toterree->SetLineColor(kGray+3); + // toterree->SetFillStyle(3010); + // toterree->Draw("2 same"); + // toterree->Draw("p"); + + TLine *lineZero = new TLine(mcTOT->GetXaxis()->GetXmin(), 1., mcTOT->GetXaxis()->GetXmax(), 1.); + lineZero->SetLineColor(11); + lineZero->Draw("same"); + + if(!do2l) c->SaveAs("Counting_1l.png"); + if(do2l) c->SaveAs("Counting_2l.png"); + + +} From ae293db7a490ceaaa65cb7f25e53df11a233c979 Mon Sep 17 00:00:00 2001 From: maria Date: Thu, 24 May 2018 21:12:46 +0200 Subject: [PATCH 10/60] fix 1L card MAY24 --- script/bwsTB.py | 19 +++++++++++-------- 1 file changed, 11 insertions(+), 8 deletions(-) diff --git a/script/bwsTB.py b/script/bwsTB.py index 7b4bd670..cede45d1 100644 --- a/script/bwsTB.py +++ b/script/bwsTB.py @@ -11,8 +11,7 @@ #maxStat=0.13 maxStat=0.3 -LikeBins=50 -#LikeBins=1 +LikeBins=100 doSyst = False @@ -377,7 +376,8 @@ def RebinN(h,nBin): "ttbb":{ "name":"ttbb","hist":["tt2b_TT_TuneCUETP8M2T4_13TeV-powheg-pythia8","tt2bMerged_TT_TuneCUETP8M2T4_13TeV-powheg-pythia8"],"num":3}, "ttcc":{ "name":"ttcc","hist":["ttc_TT_TuneCUETP8M2T4_13TeV-powheg-pythia8"],"num":4}, # "ewk":{ "name":"ewk","hist":["WJetsToLNu_HT","DYJetsToLL_M-50_HT","DYJetsToLL_M-5to50_HT","ZZTo","WWTo","WZTo","ZZZ","WZZ","WWZ","WWW","VHToNonbb_M125","WH_HToBB_WToLNu_M125","ZH_HToBB_ZToLL"],"num":6}, - "ewk":{ "name":"ewk","hist":["WJetsToLNu_HT","DYJetsToLL_M-50_HT","DYJetsToLL_M-5to50_HT","ZZTo","WZTo","ZZZ","WZZ","WWZ","WWW","WH_HToBB_WToLNu_M125","ZH_HToBB_ZToLL"],"num":5}, +# "ewk":{ "name":"ewk","hist":["WJetsToLNu_HT","DYJetsToLL_M-50_HT","DYJetsToLL_M-5to50_HT","ZZTo","WZTo","ZZZ","WZZ","WWZ","WWW","WH_HToBB_WToLNu_M125","ZH_HToBB_ZToLL"],"num":5}, + "ewk":{ "name":"ewk","hist":["WJetsToLNu_HT","DYJetsToLL_M-50_HT","DYJetsToLL_M-5to50_HT"],"num":5}, "top":{ "name":"top","hist":["TTZ","TTW","TTG","ttH","TTTT","ST"],"num":6} # "qcd":{ "name":"top","hist":["QCD_HT"],"num":8} } @@ -483,12 +483,12 @@ def RebinN(h,nBin): #print "---------------------- --------" #fileTmp="AUG6_HT/"+label+VarTest+opts.output -fileTmp="MAY4/"+ label + VarTest + str(opts.kMass) + opts.output +fileTmp="MAY23/"+ label + VarTest + str(opts.kMass) + opts.output w = ROOT.RooWorkspace("w","w") datNameTmp = opts.datCardName #datName = "AUG6_HT/"+ label + VarTest + datNameTmp -datName = "MAY4/"+ label + VarTest + str(opts.kMass) + datNameTmp +datName = "MAY23/"+ label + VarTest + str(opts.kMass) + datNameTmp datacard=open(datName,"w") datacard.write("-------------------------------------\n") @@ -893,8 +893,11 @@ def importStat(): if systStore[syst]["type"] == "lnN": if "CMS_eff_m" in systStore[syst]["wsname"]: writeNormSyst(syst,systStore[syst]["value"],systStore[syst]["proc"],["1Mu"]) + writeNormSyst(syst,systStore[syst]["value"],systStore[syst]["proc"],["1Mu1Ele"]) + writeNormSyst(syst,systStore[syst]["value"],systStore[syst]["proc"],["2Mu"]) elif "CMS_eff_e" in systStore[syst]["wsname"]: writeNormSyst(syst,systStore[syst]["value"],systStore[syst]["proc"],["1Ele"]) + writeNormSyst(syst,systStore[syst]["value"],systStore[syst]["proc"],["2Ele"]) elif "CMS_eff_l" in systStore[syst]["wsname"]: writeNormSyst(syst,systStore[syst]["value"],systStore[syst]["proc"],["2L"]) elif "CMS_eff_t_veto" in systStore[syst]["wsname"]: @@ -925,8 +928,8 @@ def importStat(): ###if doSyst: writeNormSyst("CMS_HPTB_QCDscale_ttlf",["1.50"],["ttlf"]) if doSyst: writeNormSyst("bgnorm_ttcc",["1.50"],["ttcc"]) -if doSyst: writeNormSyst("bgnorm_ttb",["1.50"],["ttb"]) -if doSyst: writeNormSyst("bgnorm_ttbb",["1.50"],["ttbb"]) +if doSyst: writeNormSyst("bgnorm_ttb",["1.50"],["ttb$"]) +if doSyst: writeNormSyst("bgnorm_ttbb",["1.50"],["ttbb$"]) ##if doSyst: writeNormSyst("bgnorm_tt2b",["1.50"],["tt2b"]) ## "top" get the value od the single top @@ -1210,7 +1213,7 @@ def importPdfFromTH1(cat,mc,myBin,LikelihoodMapping,syst=None): if hTmp!= None: print "<*> Reading Hist '"+toget+"' integral=",hTmp.Integral(),' nBin=',hTmp.GetNbinsX(), 'underflow=',hTmp.GetBinContent(0), 'overflow=',hTmp.GetBinContent(hTmp.GetNbinsX()+1),' entries=',hTmp.GetEntries() ### SCALE for the 2/3 - if mc["name"]!="qcd" and not "ZZTo" in mc["hist"] and not "WWTo" in mc["hist"] and not "WZTo" in mc["hist"] and not "ZZZ" in mc["hist"] and not "WZZ" in mc["hist"] and not "WWZ" in mc["hist"] and not "WWW" in mc["hist"] and not "VHToNonbb_M125" in mc["hist"] and not "WH_HToBB_WToLNu_M125" in mc["hist"] and not "ZH_HToBB_ZToLL" in mc["hist"]: + if mc["name"]!="qcd" and not "ZZTo" in hname and not "WWTo" in hname and not "WZTo" in hname and not "ZZZ" in hname and not "WZZ" in hname and not "WWZ" in hname and not "WWW" in hname and not "VHToNonbb_M125" in hname and not "WH_HToBB_WToLNu_M125" in hname and not "ZH_HToBB_ZToLL" in hname: hTmp.Scale(1.5) ### -- MC -- From c6900727fc0a27d93edb24a6c9109eb5093c9f39 Mon Sep 17 00:00:00 2001 From: maria Date: Thu, 24 May 2018 23:12:13 +0200 Subject: [PATCH 11/60] script fullHad card MAY24 --- script/bwsFullHadTB.py | 90 +++++++++++++++++++++++++----------------- 1 file changed, 53 insertions(+), 37 deletions(-) diff --git a/script/bwsFullHadTB.py b/script/bwsFullHadTB.py index 9ca50b6f..86434cb5 100644 --- a/script/bwsFullHadTB.py +++ b/script/bwsFullHadTB.py @@ -241,7 +241,7 @@ def mergeCategory(tfile,toget): ] else: basecat = ["OneBOneFat_one_highj","OneBOneFat_two_highj","OneBOneFat_three_highj", "OneBOneFat_one_lowj","OneBOneFat_two_lowj","OneBOneFat_three_lowj" - ## ,"OneBOneFat1l_one","OneBOneFat1l_two","OneBOneFat1l_three" + ,"OneBOneFat1l_one","OneBOneFat1l_two","OneBOneFat1l_three" ,"OneBOneMirrorFat_one_highj","OneBOneMirrorFat_two_highj","OneBOneMirrorFat_three_highj", "OneBOneMirrorFat_one_lowj","OneBOneMirrorFat_two_lowj","OneBOneMirrorFat_three_lowj" ] @@ -338,7 +338,7 @@ def mergeCategory(tfile,toget): if "_three_lowj" in x and (y=="t0b") and "in" in reg: continue ## below are for associated only - if not doSChannel and (opts.kMass=="500" or opts.kMass=="400") and "in" in reg: + if not doSChannel and (opts.kMass=="500" or opts.kMass=="400") and "in" in reg or "below" in reg: if "_three_lowj" in x and y=="wbb": continue if "_one_lowj" in x and y=="wbj": continue @@ -465,12 +465,12 @@ def mergeCategory(tfile,toget): # catStore[name]["hasMC"]=["qcd","top","Hptb"] ### QCD uncorrelated - if ( y=="wbb" or y=="wbj") and "_one" in x: catStore[name]["hasMC"]=["qcd_wx_one","ttbar","Hptb"] - if ( y=="wbb" or y=="wbj") and "_two" in x: catStore[name]["hasMC"]=["qcd_wx_two","ttbar","Hptb"] - if ( y=="wbb" or y=="wbj") and "_three" in x: catStore[name]["hasMC"]=["qcd_wx_three","ttbar","Hptb"] - if ( y=="t0b" or y=="t1b") and "_one" in x: catStore[name]["hasMC"]=["qcd_tx_one","ttbar","Hptb"] - if ( y=="t0b" or y=="t1b") and "_two" in x: catStore[name]["hasMC"]=["qcd_tx_two","ttbar","Hptb"] - if ( y=="t0b" or y=="t1b") and "_three" in x: catStore[name]["hasMC"]=["qcd_tx_three","ttbar","Hptb"] + if ( y=="wbb" or y=="wbj") and "_one" in x: catStore[name]["hasMC"]=["qcd_wx_one","ttbar","Hptb","top","ewk"] + if ( y=="wbb" or y=="wbj") and "_two" in x: catStore[name]["hasMC"]=["qcd_wx_two","ttbar","Hptb","top","ewk"] + if ( y=="wbb" or y=="wbj") and "_three" in x: catStore[name]["hasMC"]=["qcd_wx_three","ttbar","Hptb","top","ewk"] + if ( y=="t0b" or y=="t1b") and "_one" in x: catStore[name]["hasMC"]=["qcd_tx_one","ttbar","Hptb","top","ewk"] + if ( y=="t0b" or y=="t1b") and "_two" in x: catStore[name]["hasMC"]=["qcd_tx_two","ttbar","Hptb","top","ewk"] + if ( y=="t0b" or y=="t1b") and "_three" in x: catStore[name]["hasMC"]=["qcd_tx_three","ttbar","Hptb","top","ewk"] if doSChannel: mcStore={ @@ -482,7 +482,10 @@ def mergeCategory(tfile,toget): "qcd_tx_one":{"name":"qcd_tx_one", "hist":["QCD_HT"], "num":4 }, "qcd_tx_two":{"name":"qcd_tx_two", "hist":["QCD_HT"], "num":5 }, "qcd_tx_three":{"name":"qcd_tx_three", "hist":["QCD_HT"], "num":6 }, - "ttbar":{ "name":"ttbar","hist":["TT_TuneCUETP8M2T4_13TeV-powheg-pythia8"],"num":7} + "ttbar":{ "name":"ttbar","hist":["TT_TuneCUETP8M2T4_13TeV-powheg-pythia8"],"num":7}, + "top":{ "name":"top","hist":["ST"],"num":8}, +# "ewk":{ "name":"ewk","hist":["WJets","ZJets","DYJets"],"num":9} + "ewk":{ "name":"ewk","hist":["WJets"],"num":9} } else: mcStore={ @@ -494,7 +497,10 @@ def mergeCategory(tfile,toget): "qcd_tx_one":{"name":"qcd_tx_one", "hist":["QCD_HT"], "num":4 }, "qcd_tx_two":{"name":"qcd_tx_two", "hist":["QCD_HT"], "num":5 }, "qcd_tx_three":{"name":"qcd_tx_three", "hist":["QCD_HT"], "num":6 }, - "ttbar":{ "name":"ttbar","hist":["TT_TuneCUETP8M2T4_13TeV-powheg-pythia8"],"num":7} + "ttbar":{ "name":"ttbar","hist":["TT_TuneCUETP8M2T4_13TeV-powheg-pythia8"],"num":7}, + "top":{ "name":"top","hist":["ST"],"num":8}, +# "ewk":{ "name":"ewk","hist":["WJets","ZJets","DYJets"],"num":9} + "ewk":{ "name":"ewk","hist":["WJets"],"num":9} } if doSyst: @@ -508,20 +514,20 @@ def mergeCategory(tfile,toget): "CMS_eff_trigger":{"type":"lnN", "value":["1.05"] ,"proc":[".*"],"wsname":"CMS_eff_triggger","name":"XXX"}, ### Theory modeling "CMS_topreweight":{"type":"shape", "wsname":"CMS_topreweight","name":"TOPRW","proc":["ttbar"]}, - "QCDscaleT":{"type":"shape", "wsname":"QCDscaleTTbar","name":"Scale","proc":["ttbar"]}, - "QCDscaleS":{"type":"shape", "wsname":"QCDscaleHptb","name":"Scale","proc":["Hptb"]}, + "muRF_ttbar":{"type":"shape", "wsname":"muRF_ttbar","name":"Scale","proc":["ttbar"]}, + "muRF_Hptb":{"type":"shape", "wsname":"muRF_Hptb","name":"Scale","proc":["Hptb"]}, ### MET-Jets-PU - "CMS_pileup":{"type":"shape", "wsname":"CMS_pileup","name":"PU","proc":[".*"]}, - "CMS_scale_uncluster":{"type":"shape", "wsname":"CMS_scale_uncluster","name":"UNCLUSTER","proc":[".*"]}, - "CMS_SDMassScale":{"type":"shape", "wsname":"CMS_SDMassSCALE","name":"SDMassSCALE","proc":[".*"]}, + "CMS_pileup":{"type":"shape", "wsname":"CMS_pileup","name":"PU","proc":["qcd_wx_one","qcd_wx_two","qcd_wx_three","qcd_tx_one","qcd_tx_two","qcd_tx_three","ttbar","top","Hptb"]}, + "CMS_scale_uncluster":{"type":"shape", "wsname":"CMS_scale_uncluster","name":"UNCLUSTER","proc":["qcd_wx_one","qcd_wx_two","qcd_wx_three","qcd_tx_one","qcd_tx_two","qcd_tx_three","ttbar","top","Hptb"]}, + "CMS_SDMassScale":{"type":"shape", "wsname":"CMS_SDMassSCALE","name":"SDMassSCALE","proc":["qcd_wx_one","qcd_wx_two","qcd_wx_three","qcd_tx_one","qcd_tx_two","qcd_tx_three","ttbar","top","Hptb"]}, # "CMS_res_j":{"type":"shape", "wsname":"CMS_res_j","name":"JER","proc":[".*"]}, "CMS_scale_j_qcd":{"type":"shape", "wsname":"CMS_scale_j_qcd","name":"JESANDCSV","proc":["qcd_wx_one","qcd_wx_two","qcd_wx_three","qcd_tx_one","qcd_tx_two","qcd_tx_three"]}, - "CMS_scale_j":{"type":"shape", "wsname":"CMS_scale_j","name":"JESANDCSV","proc":["Hptb","ttbar"]}, + "CMS_scale_j":{"type":"shape", "wsname":"CMS_scale_j","name":"JESANDCSV","proc":["Hptb","ttbar","top","ewk"]}, ##Light jets Heavy flavor contamination - "CMS_btag_HF":{"type":"shape", "wsname":"CMS_btag_HF","name":"CSVRHF","proc":[".*"]}, + "CMS_btag_HF":{"type":"shape", "wsname":"CMS_btag_HF","name":"CSVRHF","proc":["qcd_wx_one","qcd_wx_two","qcd_wx_three","qcd_tx_one","qcd_tx_two","qcd_tx_three","ttbar","top","Hptb"]}, ##Heavy jets light flavor contamination "CMS_btag_LF_qcd":{"type":"shape", "wsname":"CMS_btag_LF_qcd","name":"CSVRLF","proc":["qcd_wx_one","qcd_wx_two","qcd_wx_three","qcd_tx_one","qcd_tx_two","qcd_tx_three"]}, - "CMS_btag_LF":{"type":"shape", "wsname":"CMS_btag_LF","name":"CSVRLF","proc":["Hptb","ttbar"]}, + "CMS_btag_LF":{"type":"shape", "wsname":"CMS_btag_LF","name":"CSVRLF","proc":["Hptb","ttbar","top"]}, ##Linear and quadratic uncertainties "CMS_btag_HFstat1":{"type":"shape", "wsname":"CMS_btag_HFstat1","name":"CSVRHFSTAT1","proc":[".*"]}, "CMS_btag_HFstat2":{"type":"shape", "wsname":"CMS_btag_HFstat2","name":"CSVRHFSTAT2","proc":[".*"]}, @@ -541,11 +547,11 @@ def mergeCategory(tfile,toget): print "* ",cat,":",catStore[cat] print "---------------------- --------" -fileTmp="MIAO_APR16/"+label+VarTest+opts.kMass+"_"+opts.output +fileTmp="MIAO_MAY24/"+label+VarTest+opts.kMass+"_"+opts.output w = ROOT.RooWorkspace("w","w") datNameTmp = opts.datCardName -datName = "MIAO_APR16/"+label+ VarTest+opts.kMass+"_" + datNameTmp +datName = "MIAO_MAY24/"+label+ VarTest+opts.kMass+"_" + datNameTmp datacard=open(datName,"w") datacard.write("-------------------------------------\n") @@ -598,18 +604,16 @@ def skip(cat,mc): ## write shapes in histograms if False: # data - datacard.write("shapes data_obs *\t" + fileTmp +"\t") + datacard.write("shapes data_obs *\t" + fileTmp.split('/')[1] +"\t") datacard.write("data_obs_$CHANNEL") datacard.write("\n") if True: # Sig - datacard.write("shapes Hptb *\t" + fileTmp +"\t") -# datacard.write("pdf_$PROCESS_M-$MASS_$CHANNEL\t") -# datacard.write("pdf_$PROCESS_M-$MASS_$CHANNEL_$SYSTEMATIC") + datacard.write("shapes Hptb *\t" + fileTmp.split('/')[1] +"\t") datacard.write("pdf_$PROCESS_$CHANNEL\t") datacard.write("pdf_$PROCESS_$CHANNEL_$SYSTEMATIC") datacard.write("\n") if True: # bkg - datacard.write("shapes * * %s\t"%fileTmp +"\t") + datacard.write("shapes * * %s\t"%fileTmp.split('/')[1] +"\t") datacard.write("pdf_$PROCESS_$CHANNEL\t") datacard.write("pdf_$PROCESS_$CHANNEL_$SYSTEMATIC\n") datacard.write("-------------------------------------\n") @@ -779,21 +783,24 @@ def importStat(): if doSyst: writeNormSyst("pdf_gg",["1.042"],["ttbar"]) if doSyst: writeNormSyst("CMS_mass_ttbar",["1.027"],["ttbar"]) -#if doSyst: writeNormSyst("QCDscale_ttbar",["0.965/1.024","0.965/1.024","0.965/1.024","0.965/1.024","0.965/1.024"],["ttlf","ttcc","ttb","ttbb","tt2b"]) -#if doSyst: writeNormSyst("pdf_gg",["1.042","1.042","1.042","1.042","1.042"],["ttlf","ttcc","ttb","ttbb","tt2b"]) -##if doSyst: writeNormSyst("CMS_mass_ttbar",["1.027","1.027","1.027","1.027","1.027"],["ttlf","ttcc","ttb","ttbb","tt2b"]) +## "top" get the value od the single top +if doSyst: writeNormSyst("QCDscale_top",["0.977/1.028"],["top"]) +if doSyst: writeNormSyst("pdf_top",["1.026"],["top"]) +if doSyst: writeNormSyst("CMS_mass_top",["1.022"],["top"]) if doSyst: writeNormSyst("CMS_HPTB_QCDnonclosure_",["1.20","1.20","1.20"],["qcd_wx_one","qcd_wx_two","qcd_wx_three"]) if doSyst: writeNormSyst("CMS_HPTB_QCDnonclosure_",["1.20","1.20","1.20"],["qcd_tx_one","qcd_tx_two","qcd_tx_three"]) +## "ewk" get the envelop of the DY and W+jets +if doSyst: writeNormSyst("QCDscale_ewk",["0.996/1.008"],["ewk"]) +if doSyst: writeNormSyst("pdf_qqbar",["1.04"],["ewk"]) + #if doSyst: writeNormSyst("CMS_HPTB_QCDscale_ttlf",["1.50"],["ttlf"]) #if doSyst: writeNormSyst("CMS_HPTB_QCDscale_ttcc",["1.50"],["ttcc"]) #if doSyst: writeNormSyst("CMS_HPTB_QCDscale_ttb",["1.50"],["ttb"]) #if doSyst: writeNormSyst("CMS_HPTB_QCDscale_ttbb",["1.50"],["ttbb"]) #if doSyst: writeNormSyst("CMS_HPTB_QCDscale_tt2b",["1.50"],["tt2b"]) -#if doSyst: writeNormSyst("QCDscale_top",["0.90/1.10"],["top"]) -#if doSyst: writeNormSyst("pdf_top",["1.03"],["top"]) #if doSyst: writeNormSyst("QCDscale_ewk",["0.98/1.02"],["ewk"]) #if doSyst: writeNormSyst("pdf_qqbar",["1.04"],["ewk"]) @@ -881,7 +888,7 @@ def SmoothAndMergeSyst(tfile,togetNom,togetSyst,s): def envelop(tfile,togetClone, s) : hname=togetClone+'RF'+s - hTmp=MergeCategory(tfile,hname) + hTmp=mergeCategory(tfile,hname) ## if hTmp!=None: hTmp.Rebin(nRebinHT) @@ -894,7 +901,7 @@ def envelop(tfile,togetClone, s) : hnameClone=togetClone+w+var - hTmp=MergeCategory(tfile,hnameClone) + hTmp=mergeCategory(tfile,hnameClone) ## if hTmp!=None: hTmp.Rebin(nRebinHT) @@ -971,10 +978,10 @@ def importPdfFromTH1(cat,mc,myBin,LikelihoodMapping,syst=None): if m==500 and "2500" in cat["name"]: continue if myTMPmass not in cat["name"]: continue - print '==========> ' - print '==========> cat["name"] ===> ', cat["name"] - print '==========> mc["name"] ===> ',mc["name"] - print '==========> ' +# print '==========> ' +# print '==========> cat["name"] ===> ', cat["name"] +# print '==========> mc["name"] ===> ',mc["name"] +# print '==========> ' target = "pdf_" + mc["name"] +"_"+ cat["name"] if m >10 : @@ -999,7 +1006,7 @@ def importPdfFromTH1(cat,mc,myBin,LikelihoodMapping,syst=None): togetSyst = toget + "_" + syst["name"] toget += "_" + syst["name"] + s - if "Scale" in toget: + if syst != None and "muRF" in toget: if mc["name"]=="Hptb" or mc["name"]=="ttbar": hTmp = envelop(tfile,togetSyst,s) # toget = togetClone+'RF'+s @@ -1018,6 +1025,15 @@ def importPdfFromTH1(cat,mc,myBin,LikelihoodMapping,syst=None): print "<*> Hist '"+toget+"' doesn't exist" raise IOError + ## foor QCD we do not apply the tauVeto and trigger + if mc["name"]=="qcd": + hTmp.Scale(0.93) + ## top and W scale factor (for now only in ttbar later also signal) + if ( mc["name"]=="ttbar" or mc["name"]=="top") and ("t0b" in toget or "t1b" in toget): + hTmp.Scale(1.11) + if ( mc["name"]=="ttbar" or mc["name"]=="top") and ("wbb" in toget or "wbj" in toget): + hTmp.Scale(1.06) + ### -- MC -- # print 'xxxxxxxxx hname=',hname,' base=',base,'cat["dir"]',cat["dir"] #####1L From 6f6afce5f34b5abdb57344adb137ebbdde11af5e Mon Sep 17 00:00:00 2001 From: maria Date: Fri, 1 Jun 2018 20:28:34 +0200 Subject: [PATCH 12/60] fix bTagging STAT1/2 --- src/CSVHelper.cpp | 21 +++++++++++++++++---- src/Systematics.cpp | 8 ++++---- 2 files changed, 21 insertions(+), 8 deletions(-) diff --git a/src/CSVHelper.cpp b/src/CSVHelper.cpp index 55a22686..9a12eae2 100644 --- a/src/CSVHelper.cpp +++ b/src/CSVHelper.cpp @@ -85,17 +85,30 @@ CSVHelper::fillCSVHistos(TFile *fileHF, TFile *fileLF, const std::vectorGetListOfKeys()->Contains(name)) { + if(fileHF->GetListOfKeys()->Contains(name) && !(systematic_original.Contains("HF"))) { h_csv_wgt_hf.at(iSys).at(iPt) = readHistogram(fileHF,name); //std::cout << "added " << name << std::endl; } @@ -116,7 +129,7 @@ CSVHelper::fillCSVHistos(TFile *fileHF, TFile *fileLF, const std::vectorGetListOfKeys()->Contains(name)) { + if(fileLF->GetListOfKeys()->Contains(name) && !(systematic_original.Contains("LF"))) { h_csv_wgt_lf.at(iSys).at(iPt).at(iEta) = readHistogram(fileLF,name); //std::cout << "added " << name << std::endl; } diff --git a/src/Systematics.cpp b/src/Systematics.cpp index a37da448..d447ebb7 100644 --- a/src/Systematics.cpp +++ b/src/Systematics.cpp @@ -62,10 +62,10 @@ void Systematics::init() { add( JESTimeRunHup, JESTimeRunHdown, "JESTimeRunH", "TimeRunH" ); add( CSVLFup, CSVLFdown, "LF", "LF" ); add( CSVHFup, CSVHFdown, "HF", "HF" ); - add( CSVLFStats1up, CSVLFStats1down, "Stats1", "LFStats1" ); - add( CSVHFStats1up, CSVHFStats1down, "Stats1", "HFStats1" ); - add( CSVLFStats2up, CSVLFStats2down, "Stats2", "LFStats2" ); - add( CSVHFStats2up, CSVHFStats2down, "Stats2", "HFStats2" ); + add( CSVLFStats1up, CSVLFStats1down, "LFStats1", "LFStats1" ); + add( CSVHFStats1up, CSVHFStats1down, "HFStats1", "HFStats1" ); + add( CSVLFStats2up, CSVLFStats2down, "LFStats2", "LFStats2" ); + add( CSVHFStats2up, CSVHFStats2down, "HFStats2", "HFStats2" ); add( CSVCErr1up, CSVCErr1down, "cErr1", "CErr1" ); add( CSVCErr2up, CSVCErr2down, "cErr2", "CErr2" ); } From 2bf3342193a4c6a5e3b7bcda3c754f8fa2c4a013 Mon Sep 17 00:00:00 2001 From: maria Date: Fri, 1 Jun 2018 20:34:11 +0200 Subject: [PATCH 13/60] merge TTX and EWK; comment some histos; rederfine anti-iso cut QCD; --- src/AnalysisChargedHiggsTopBottom.cpp | 63 ++++++++++++++++----------- 1 file changed, 38 insertions(+), 25 deletions(-) diff --git a/src/AnalysisChargedHiggsTopBottom.cpp b/src/AnalysisChargedHiggsTopBottom.cpp index 79bcb4bf..a2aee0dd 100644 --- a/src/AnalysisChargedHiggsTopBottom.cpp +++ b/src/AnalysisChargedHiggsTopBottom.cpp @@ -1109,15 +1109,15 @@ void ChargedHiggsTopBottom::BookCutFlow(string l, string category) void ChargedHiggsTopBottom::BookFlavor(string l, string category, string phasespace, string flavor, string SR) { - AddFinalHisto("ChargedHiggsTopBottom/"+phasespace+category+"/ST_"+SR+flavor+l); + // AddFinalHisto("ChargedHiggsTopBottom/"+phasespace+category+"/ST_"+SR+flavor+l); AddFinalHisto("ChargedHiggsTopBottom/"+phasespace+category+"/HT_"+SR+flavor+l); - AddFinalHisto("ChargedHiggsTopBottom/"+phasespace+category+"/ST_zoom_"+SR+flavor+l); - AddFinalHisto("ChargedHiggsTopBottom/"+phasespace+category+"/HT_zoom_"+SR+flavor+l); + // AddFinalHisto("ChargedHiggsTopBottom/"+phasespace+category+"/ST_zoom_"+SR+flavor+l); + // AddFinalHisto("ChargedHiggsTopBottom/"+phasespace+category+"/HT_zoom_"+SR+flavor+l); Book("ChargedHiggsTopBottom/"+phasespace+category+"/HT_"+SR+flavor+l,"HT "+l+"; HT (P_{T}^{jet}>40 [GeV])",800,0,8000); - Book("ChargedHiggsTopBottom/"+phasespace+category+"/ST_"+SR+flavor+l,"ST "+l+"; ST ( HT+met+lepsPt )",800,0,8000); - Book("ChargedHiggsTopBottom/"+phasespace+category+"/HT_zoom_"+SR+flavor+l,"HT "+l+"; HT (P_{T}^{jet}>40 [GeV])",40,0,2000); - Book("ChargedHiggsTopBottom/"+phasespace+category+"/ST_zoom_"+SR+flavor+l,"ST "+l+"; ST ( HT+met+lepsPt )",50,0,2500); + // Book("ChargedHiggsTopBottom/"+phasespace+category+"/ST_"+SR+flavor+l,"ST "+l+"; ST ( HT+met+lepsPt )",800,0,8000); + // Book("ChargedHiggsTopBottom/"+phasespace+category+"/HT_zoom_"+SR+flavor+l,"HT "+l+"; HT (P_{T}^{jet}>40 [GeV])",40,0,2000); + // Book("ChargedHiggsTopBottom/"+phasespace+category+"/ST_zoom_"+SR+flavor+l,"ST "+l+"; ST ( HT+met+lepsPt )",50,0,2500); ////// @@ -1218,10 +1218,10 @@ void ChargedHiggsTopBottom::BookHisto(string l, string category, string phasespa * Final * **********************************************/ - AddFinalHisto("ChargedHiggsTopBottom/"+phasespace+category+"/ST_zoom_"+l); - AddFinalHisto("ChargedHiggsTopBottom/"+phasespace+category+"/HT_zoom_"+l); + // AddFinalHisto("ChargedHiggsTopBottom/"+phasespace+category+"/ST_zoom_"+l); + // AddFinalHisto("ChargedHiggsTopBottom/"+phasespace+category+"/HT_zoom_"+l); - AddFinalHisto("ChargedHiggsTopBottom/"+phasespace+category+"/ST_"+l); + // AddFinalHisto("ChargedHiggsTopBottom/"+phasespace+category+"/ST_"+l); AddFinalHisto("ChargedHiggsTopBottom/"+phasespace+category+"/HT_"+l); // AddFinalHisto("ChargedHiggsTopBottom/"+phasespace+category+"/HTmcweight_"+l); @@ -1415,13 +1415,13 @@ void ChargedHiggsTopBottom::BookHisto(string l, string category, string phasespa **********************************************/ ///// - Book("ChargedHiggsTopBottom/"+phasespace+category+"/HT_zoom_"+l,"HT "+l+"; HT (P_{T}^{jet}>40 [GeV])",40,0,2000); + // Book("ChargedHiggsTopBottom/"+phasespace+category+"/HT_zoom_"+l,"HT "+l+"; HT (P_{T}^{jet}>40 [GeV])",40,0,2000); Book("ChargedHiggsTopBottom/"+phasespace+category+"/HT_"+l,"HT "+l+"; HT (P_{T}^{jet}>40 [GeV])",800,0,8000); // Book("ChargedHiggsTopBottom/"+phasespace+category+"/HTmcweight_"+l,"HT (mcweight)"+l+"; HT (P_{T}^{jet}>40 [GeV])",800,0,8000); ///// - Book("ChargedHiggsTopBottom/"+phasespace+category+"/ST_zoom_"+l,"ST "+l+"; ST ( HT+met+lepsPt )",50,0,2500); - Book("ChargedHiggsTopBottom/"+phasespace+category+"/ST_"+l,"ST "+l+"; ST ( HT+MET+lepsPt )",800,0,8000); + // Book("ChargedHiggsTopBottom/"+phasespace+category+"/ST_zoom_"+l,"ST "+l+"; ST ( HT+met+lepsPt )",50,0,2500); + // Book("ChargedHiggsTopBottom/"+phasespace+category+"/ST_"+l,"ST "+l+"; ST ( HT+MET+lepsPt )",800,0,8000); //BDT plot if(do1lAnalysis and doTMVA) Book("ChargedHiggsTopBottom/"+phasespace+category+"/bdt1lh_"+l,"bdt1lh "+l+";bdt (1l high)",nbinsBDT,binMIN,binMAX); @@ -2608,8 +2608,8 @@ void ChargedHiggsTopBottom::leptonPlot(Event*e, string label, string category, s if(not (filldo1l || filldo2l)) return; - Fill("ChargedHiggsTopBottom/"+phasespace+category+"/ST_"+label,systname, evt_ST ,e->weight()); - Fill("ChargedHiggsTopBottom/"+phasespace+category+"/ST_zoom_"+label,systname, evt_ST ,e->weight()); + // Fill("ChargedHiggsTopBottom/"+phasespace+category+"/ST_"+label,systname, evt_ST ,e->weight()); + // Fill("ChargedHiggsTopBottom/"+phasespace+category+"/ST_zoom_"+label,systname, evt_ST ,e->weight()); if (doScikit) { @@ -2756,7 +2756,7 @@ void ChargedHiggsTopBottom::jetPlot(Event*e, string label, string category, stri Fill("ChargedHiggsTopBottom/"+phasespace+category+"/HT_"+label,systname, evt_HT ,e->weight()); // Fill("ChargedHiggsTopBottom/"+phasespace+category+"/HTmcweight_"+label,systname, evt_HT ,e->GetWeight()->GetBareMCWeight()); - Fill("ChargedHiggsTopBottom/"+phasespace+category+"/HT_zoom_"+label,systname, evt_HT ,e->weight()); + // Fill("ChargedHiggsTopBottom/"+phasespace+category+"/HT_zoom_"+label,systname, evt_HT ,e->weight()); if(doFinal) return; @@ -2942,11 +2942,11 @@ void ChargedHiggsTopBottom::classifyHF(Event*e, string label, string category, s - Fill("ChargedHiggsTopBottom/"+phasespace+category+"/ST_"+Sregion+LabelHF+label,systname, evt_ST ,e->weight()); + // Fill("ChargedHiggsTopBottom/"+phasespace+category+"/ST_"+Sregion+LabelHF+label,systname, evt_ST ,e->weight()); Fill("ChargedHiggsTopBottom/"+phasespace+category+"/HT_"+Sregion+LabelHF+label,systname, evt_HT ,e->weight()); - Fill("ChargedHiggsTopBottom/"+phasespace+category+"/ST_zoom_"+Sregion+LabelHF+label,systname, evt_ST ,e->weight()); - Fill("ChargedHiggsTopBottom/"+phasespace+category+"/HT_zoom_"+Sregion+LabelHF+label,systname, evt_HT ,e->weight()); + // Fill("ChargedHiggsTopBottom/"+phasespace+category+"/ST_zoom_"+Sregion+LabelHF+label,systname, evt_ST ,e->weight()); + // Fill("ChargedHiggsTopBottom/"+phasespace+category+"/HT_zoom_"+Sregion+LabelHF+label,systname, evt_HT ,e->weight()); ///// @@ -3292,6 +3292,24 @@ int ChargedHiggsTopBottom::analyze(Event*e,string systname) if(doMorePlot) { nbinsBDT=100; doFinal=false; doSplit=false;} + // redefine plots + if ( label == "TTTT") label = "TTX"; + if ( label == "TTZ") label = "TTX"; + if ( label == "TTW") label = "TTX"; + if ( label == "TTG") label = "TTX"; + if ( label == "ttH") label = "TTX"; + + if ( label == "WWTo") label = "EWK"; + if ( label == "WZTo") label = "EWK"; + if ( label == "ZZTo") label = "EWK"; + if ( label == "VHToNonbb_M125") label = "EWK"; + if ( label == "WH_HToBB_WToLNu_M125") label = "EWK"; + if ( label == "ZH_HToBB_ZToLL") label = "EWK"; + if ( label == "WWW") label = "EWK"; + if ( label == "WWZ") label = "EWK"; + if ( label == "WZZ") label = "EWK"; + if ( label == "ZZZ") label = "EWK"; + /* std::cout << e->GetName() << std::endl; if(e->GetName().find("SingleMuon")!=string::npos) std::cout << "this should be SingleMuon" << std::endl; @@ -3349,8 +3367,8 @@ int ChargedHiggsTopBottom::analyze(Event*e,string systname) bool ele=(it->IsElectron() and fabs(it->Eta())<2.1 and it->Pt()>LeadingLeptonElePt_ and it->IsEleMvaTight() and it->MiniIsolation() < 0.1 and leadLep==NULL ); if(doQCD and do1lAnalysis) { - muon=(it->IsMuon() and it->Pt()>LeadingLeptonPt_ and it->IsMedium() and it->MiniIsolation() > 0.1 and it->MiniIsolation() < 0.2 and leadLep==NULL ); - ele=(it->IsElectron() and fabs(it->Eta())<2.1 and it->Pt()>LeadingLeptonElePt_ and it->IsEleMvaTight() and it->MiniIsolation() > 0.1 and it->MiniIsolation() < 0.2 and leadLep==NULL ); + muon=(it->IsMuon() and it->Pt()>LeadingLeptonPt_ and it->IsMedium() and it->MiniIsolation() > 0.1 and it->MiniIsolation() < 0.6 and leadLep==NULL ); + ele=(it->IsElectron() and fabs(it->Eta())<2.1 and it->Pt()>LeadingLeptonElePt_ and it->IsEleMvaTight() and it->MiniIsolation() > 0.1 and it->MiniIsolation() < 0.6 and leadLep==NULL ); } if(muon or ele) { @@ -3680,11 +3698,6 @@ int ChargedHiggsTopBottom::analyze(Event*e,string systname) (label.find("DYJetsToLL_M-5to50_HT") !=string::npos) or (label.find("DYJetsToLL_M-50_HT") !=string::npos) or (label.find("WJetsToLNu_HT") !=string::npos) or - (label.find("TTTT") !=string::npos) or - (label.find("TTZ") !=string::npos) or - (label.find("TTW") !=string::npos) or - (label.find("ttH") !=string::npos) or - (label.find("TTG") !=string::npos) or (label.find("ST") !=string::npos) ) and (e->eventNum()%3)==0 ) return EVENT_NOT_USED; From 2a6531e1ae45fd51e194af89610bfc9f0237409e Mon Sep 17 00:00:00 2001 From: maria Date: Fri, 1 Jun 2018 20:37:57 +0200 Subject: [PATCH 14/60] fix ST scales --- aux/mcdb.2017.v23.txt | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/aux/mcdb.2017.v23.txt b/aux/mcdb.2017.v23.txt index a41029ef..fa5ad4c1 100644 --- a/aux/mcdb.2017.v23.txt +++ b/aux/mcdb.2017.v23.txt @@ -179,16 +179,15 @@ TTToSemilepton_ttbbFilter_TuneCUETP8M2_ttHtranche3_13TeV-powheg-pythia8 /store/g ##### SingleTop # taken from https://twiki.cern.ch/twiki/bin/view/LHCPhysics/SingleTopRefXsec#Predictions_at_7_8_13_and_14_TeV -ST_t-channel_top_4f_inclusiveDecays_13TeV-powhegV2-madspin-pythia8_TuneCUETP8M1 /store/group/phys_higgs/HiggsExo/dalfonso/80x_MC_v2/v2.3/ST_t-channel_top_4f_inclusiveDecays_13TeV-powhegV2-madspin-pythia8_TuneCUETP8M1 67240808.0 136.02 -ST_t-channel_antitop_4f_inclusiveDecays_13TeV-powhegV2-madspin-pythia8_TuneCUETP8M1 /store/group/phys_higgs/HiggsExo/dalfonso/80x_MC_v2/v2.3/ST_t-channel_antitop_4f_inclusiveDecays_13TeV-powhegV2-madspin-pythia8_TuneCUETP8M1 38811017.0 80.95 +ST_t-channel_top_4f_inclusiveDecays_13TeV-powhegV2-madspin-pythia8_TuneCUETP8M1 /store/group/phys_higgs/HiggsExo/dalfonso/80x_MC_v2/v2.3/ST_t-channel_top_4f_inclusiveDecays_13TeV-powhegV2-madspin-pythia8_TuneCUETP8M1 67240808.0 136.02 SCALES 0.997845587417 0.997455983404 1.06245090383 1.06193603855 0.941674526849 0.937058735371 PDFS 1.00040957675 1.00175941113 0.996205719521 0.998402424138 0.982595164671 0.996171974066 0.994081844556 1.01386815387 1.00117086136 1.0060151759 1.00872677849 0.991350056029 0.988463143385 1.01116030743 0.994134856321 0.998095086605 1.00218263252 1.00065396408 1.00067280785 1.0011556496 0.992037991873 1.01361531707 0.958964663592 0.997865348133 0.999006770332 0.999172074477 1.010054447 0.997849122909 1.00831571044 0.994964138413 1.00123598227 1.01202859616 0.996653355821 0.994506364402 1.00008686746 0.998555921059 1.00351733831 1.00345127139 1.00779642347 0.996705573776 0.989536545988 0.995975494333 0.999504652703 1.00320172343 0.996618098524 0.994920418716 1.01348011852 1.00559046098 0.999070978742 1.00076235034 1.00221896298 1.00579330849 0.980219457026 0.991726018154 0.999829834078 1.01020355332 0.98574690546 1.00141702079 1.0007922903 1.00736241501 0.999335493524 1.00414161805 0.981175680239 1.01752437516 1.00636705087 0.998614144187 0.968594181014 1.00935722318 1.01318916577 1.00989102567 0.989639863851 0.99877885349 1.00672575674 0.982200959211 1.00490249994 1.00762421733 0.996496300449 0.981243317347 0.997532037851 1.00227027531 1.00313688854 1.00321131034 1.00660719501 0.995383649534 1.01368125871 1.00599986791 1.00171475615 0.998035512916 0.993733111642 1.00555849224 1.01400054201 0.996968937595 1.00380460502 0.986914384984 1.01611624673 1.00283436453 0.995528524959 0.986029291878 0.99121763352 1.01341277963 -ST_tW_antitop_5f_inclusiveDecays_13TeV-powheg-pythia8_TuneCUETP8M1 /store/group/phys_higgs/HiggsExo/dalfonso/80x_MC_v2/v2.3/ST_tW_antitop_5f_inclusiveDecays_13TeV-powheg-pythia8_TuneCUETP8M1 6933094.0 35.85 +ST_t-channel_antitop_4f_inclusiveDecays_13TeV-powhegV2-madspin-pythia8_TuneCUETP8M1 /store/group/phys_higgs/HiggsExo/dalfonso/80x_MC_v2/v2.3/ST_t-channel_antitop_4f_inclusiveDecays_13TeV-powhegV2-madspin-pythia8_TuneCUETP8M1 38811017.0 80.95 SCALES 0.997023647359 0.998621289375 1.06391087512 1.0628600976 0.939837723662 0.937033482379 PDFS 1.00628071905 0.997382183023 1.00743947106 1.00565328991 1.01566624602 1.00967121837 0.999042127276 0.98374354404 1.00309691878 0.99723957711 1.00914197933 0.99314940735 0.988385807996 1.02527684055 0.986202292117 0.992023661337 0.996359631236 1.01231051511 1.00062424253 0.980827515235 0.991597931392 0.995196355539 0.956680529356 1.00692587896 0.999060926294 1.00509389301 1.01430235831 1.01126379567 0.994956061562 0.989739271851 1.00097456615 1.01059505123 0.999879716676 1.00639352368 0.999432715167 0.996422475502 0.992539528185 0.995356140297 1.01145310386 1.00424771764 1.00782546021 0.996888713849 0.995140023755 1.00229611014 0.995347039459 0.998996903657 0.997706247444 1.00721049137 1.00735373514 0.999129557745 1.00286550775 0.994934256549 0.998431519456 0.978472631103 1.00217902941 1.0126109047 1.00531654681 1.00835555507 0.985461277494 0.984667923542 0.996864099806 0.995863505325 1.006405414 0.997938182966 1.01863297818 1.0026555233 0.938544876264 1.01810879427 1.0090449882 0.997915893635 1.00144285387 1.00195037394 1.0150825215 0.993382653646 1.00344115801 1.00629273124 1.00191089304 0.978620810954 1.00466662914 0.997214479209 1.00978500133 1.00684184469 0.988552129475 1.00548839721 1.00466477729 0.993966702053 1.01107903337 1.01310600607 0.982594386059 1.00107306429 1.00074200595 0.9906659089 1.00699905527 0.981648467969 1.01073353576 1.00565802739 0.997627456414 1.00206057867 0.981095748968 1.01726769059 +ST_tW_antitop_5f_inclusiveDecays_13TeV-powheg-pythia8_TuneCUETP8M1 /store/group/phys_higgs/HiggsExo/dalfonso/80x_MC_v2/v2.3/ST_tW_antitop_5f_inclusiveDecays_13TeV-powheg-pythia8_TuneCUETP8M1 6933094.0 35.85 ST_tW_top_5f_inclusiveDecays_13TeV-powheg-pythia8_TuneCUETP8M1 /store/group/phys_higgs/HiggsExo/dalfonso/80x_MC_v2/v2.3/ST_tW_top_5f_inclusiveDecays_13TeV-powheg-pythia8_TuneCUETP8M1 6952830.0 35.85 -ST_s-channel_4f_leptonDecays_13TeV-amcatnlo-pythia8_TuneCUETP8M1 /store/group/phys_higgs/HiggsExo/dalfonso/80x_MC_v2/v2.3/ST_s-channel_4f_leptonDecays_13TeV-amcatnlo-pythia8_TuneCUETP8M1 3370668.41375 3.34368 - +ST_s-channel_4f_leptonDecays_13TeV-amcatnlo-pythia8_TuneCUETP8M1 /store/group/phys_higgs/HiggsExo/dalfonso/80x_MC_v2/v2.3/ST_s-channel_4f_leptonDecays_13TeV-amcatnlo-pythia8_TuneCUETP8M1 3370668.41375 3.45016613382 SCALES 0.98751416638 1.01584425297 1.02276331415 1.00863020643 0.973434884316 0.986809372898 PDFS 1.01566444887 1.00238108896 0.983416472213 0.981903495727 0.994396667634 1.02387977786 0.991118882762 1.00740399696 0.997189915248 0.994285042703 1.01443006362 1.00112773789 0.982230529214 1.00713555555 0.999701103809 1.00722672864 1.01426995592 1.02732852251 1.00651286322 0.995596087709 0.973672127593 0.998127108772 0.965119727889 0.982989291651 0.998802383851 0.988769923699 1.01898352027 1.00516509445 1.01212134597 0.991534161323 0.977226031279 1.00197592726 0.989637008037 0.993966407374 0.988031256075 1.00651399738 1.00916513731 1.0205621571 1.00226345054 0.995948508 0.992714834146 0.999600012703 0.993118463789 1.00278604253 0.988627923312 1.00884434648 1.01702087398 1.00755003417 1.00177975923 0.992923071667 0.999251664901 0.999655278744 0.9909491662 0.984359003288 0.993921513839 1.02128118364 0.99790052623 1.00193286843 0.996114666469 0.991722521448 1.00139643193 1.00231885159 1.0000880688 1.0304012072 0.998664916883 0.994371680132 0.971284689736 1.00102967392 1.00554573132 1.00563620952 0.994448833587 1.01258222226 1.01157894051 0.982094968144 1.00859901671 1.00496068269 0.996668474758 0.989799070388 1.0074946157 0.986783295623 0.992836523876 0.986826363206 1.02046184682 0.995824067849 1.00640733187 1.00527430103 1.00369751928 1.00259379758 1.01221845771 0.991649692836 0.994720885993 0.993420878259 1.00940294992 0.999900930603 1.02838644979 1.00855532742 0.992572265154 0.988340496354 0.993698175316 1.03462557757 ##### RARES with tops From ec47365e658fc52e53cee8106e18fd62a0c9aa8c Mon Sep 17 00:00:00 2001 From: maria Date: Fri, 1 Jun 2018 20:38:59 +0200 Subject: [PATCH 15/60] use 200 bins BDT --- interface/AnalysisChargedHiggsTopBottom.hpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/interface/AnalysisChargedHiggsTopBottom.hpp b/interface/AnalysisChargedHiggsTopBottom.hpp index 71346ca5..3d1593eb 100644 --- a/interface/AnalysisChargedHiggsTopBottom.hpp +++ b/interface/AnalysisChargedHiggsTopBottom.hpp @@ -191,8 +191,8 @@ class ChargedHiggsTopBottom: virtual public AnalysisBase // float binMIN=-1.; // Keras - // int nbinsBDT=200; - int nbinsBDT=1000; + int nbinsBDT=200; + // int nbinsBDT=1000; float binMIN=0.; float binMAX=1.; From 48bca7fac97e14cd51a8c798a9258d6d7237346c Mon Sep 17 00:00:00 2001 From: maria Date: Fri, 1 Jun 2018 20:40:22 +0200 Subject: [PATCH 16/60] merge TTX and EWK --- dat/topBot.2017.dat | 17 ++++++++++++----- dat/topBot.OnlyRares.dat | 4 ++++ 2 files changed, 16 insertions(+), 5 deletions(-) diff --git a/dat/topBot.2017.dat b/dat/topBot.2017.dat index 268aaae7..86b1f9cc 100644 --- a/dat/topBot.2017.dat +++ b/dat/topBot.2017.dat @@ -44,6 +44,15 @@ addConfig=ChargedHiggsTopBottom|AddLabel('TTTo2L2Nu_ttbbFilter') addConfig=ChargedHiggsTopBottom|AddLabel('TTToSemilepton_ttbbFilter') addConfig=ChargedHiggsTopBottom|AddLabel('ST') + +## placeholder for all the di/triboson +addConfig=ChargedHiggsTopBottom|AddLabel('EWK') + +## triboson +addConfig=ChargedHiggsTopBottom|AddLabel('WWW') +addConfig=ChargedHiggsTopBottom|AddLabel('WWZ') +addConfig=ChargedHiggsTopBottom|AddLabel('WZZ') +addConfig=ChargedHiggsTopBottom|AddLabel('ZZZ') ##WWTo2L2Nu,WWToLNuQQ addConfig=ChargedHiggsTopBottom|AddLabel('WWTo') ##WZTo1L1Nu2Q,WZTo1L3Nu,WZTo2L2Q,WZTo3LNu @@ -58,6 +67,9 @@ addConfig=ChargedHiggsTopBottom|AddLabel('DYJetsToLL_M-5to50_HT') addConfig=ChargedHiggsTopBottom|AddLabel('DYJetsToLL_M-50_HT') addConfig=ChargedHiggsTopBottom|AddLabel('WJetsToLNu_HT') +## placeholder for all the tt+X +addConfig=ChargedHiggsTopBottom|AddLabel('TTX') + addConfig=ChargedHiggsTopBottom|AddLabel('TTTT') ##TTZToQQ, TTZToLLNuNu, TTZH addConfig=ChargedHiggsTopBottom|AddLabel('TTZ') @@ -69,11 +81,6 @@ addConfig=ChargedHiggsTopBottom|AddLabel('ttH') addConfig=ChargedHiggsTopBottom|AddLabel('TTG') ##tZq_ll_4f,tZq_nunu_4f #addConfig=ChargedHiggsTopBottom|AddLabel('tZq') -## triboson -addConfig=ChargedHiggsTopBottom|AddLabel('WWW') -addConfig=ChargedHiggsTopBottom|AddLabel('WWZ') -addConfig=ChargedHiggsTopBottom|AddLabel('WZZ') -addConfig=ChargedHiggsTopBottom|AddLabel('ZZZ') ## QCD addConfig=ChargedHiggsTopBottom|AddLabel('QCD_HT') diff --git a/dat/topBot.OnlyRares.dat b/dat/topBot.OnlyRares.dat index 6e6b3f5a..13221b30 100644 --- a/dat/topBot.OnlyRares.dat +++ b/dat/topBot.OnlyRares.dat @@ -13,6 +13,10 @@ addConfig=ChargedHiggsTopBottom|AddLabel('ttH') ##TTGJets addConfig=ChargedHiggsTopBottom|AddLabel('TTG') +addConfig=ChargedHiggsTopBottom|AddLabel('TTX') + +addConfig=ChargedHiggsTopBottom|AddLabel('EWK') + addConfig=ChargedHiggsTopBottom|AddLabel('WWTo') ###WZTo1L1Nu2Q,WZTo1L3Nu,WZTo2L2Q,WZTo3LNu addConfig=ChargedHiggsTopBottom|AddLabel('WZTo') From 808a6a9c222f1bd282f5a5f2252c50133bcb691e Mon Sep 17 00:00:00 2001 From: maria Date: Fri, 1 Jun 2018 22:19:13 +0200 Subject: [PATCH 17/60] get Hadronic card MAY30 --- script/bwsFullHadTB.py | 218 +++++++++++++++++++++++++++++++---------- 1 file changed, 166 insertions(+), 52 deletions(-) diff --git a/script/bwsFullHadTB.py b/script/bwsFullHadTB.py index 86434cb5..14afab68 100644 --- a/script/bwsFullHadTB.py +++ b/script/bwsFullHadTB.py @@ -12,7 +12,7 @@ # original binning is 10GeV nRebinHT=1 -##LikeBins=1 +##nRebinHT=5 LikeBins=10 doRebin = False @@ -69,8 +69,13 @@ #parser.add_option("","--inputBin",type='string',help="Input ROOT file. [%default]", default="/afs/cern.ch/user/h/hum/work/public/CMSSW_8_0_26_patch1/src/ChargedHiggs/ntufile/post0systlimit.root") # new fixed (minor SYST only) -parser.add_option("","--input",type='string',help="Input ROOT file. [%default]", default="/afs/cern.ch/user/h/hum/work/public/CMSSW_8_0_26_patch1/src/ChargedHiggs/ntufile/post0systlimit_ALL.root") -parser.add_option("","--inputBin",type='string',help="Input ROOT file. [%default]", default="/afs/cern.ch/user/h/hum/work/public/CMSSW_8_0_26_patch1/src/ChargedHiggs/ntufile/post0systlimit_ALL.root") +### USED MIT meeting +#parser.add_option("","--input",type='string',help="Input ROOT file. [%default]", default="/afs/cern.ch/user/h/hum/work/public/CMSSW_8_0_26_patch1/src/ChargedHiggs/ntufile/post0systlimit_ALL.root") +#parser.add_option("","--inputBin",type='string',help="Input ROOT file. [%default]", default="/afs/cern.ch/user/h/hum/work/public/CMSSW_8_0_26_patch1/src/ChargedHiggs/ntufile/post0systlimit_ALL.root") + +### NEW TO BE USED +parser.add_option("","--input",type='string',help="Input ROOT file. [%default]", default="/afs/cern.ch/user/h/hum/work/public/CMSSW_8_0_26_patch1/src/ChargedHiggs/ntufile/preapp0syst.root") +parser.add_option("","--inputBin",type='string',help="Input ROOT file. [%default]", default="/afs/cern.ch/user/h/hum/work/public/CMSSW_8_0_26_patch1/src/ChargedHiggs/ntufile/preapp0syst.root") ## fixed mass window for 400-500 + lowered the bjet PT 40->30 #parser.add_option("","--input",type='string',help="Input ROOT file. [%default]", default="/afs/cern.ch/user/h/hum/work/public/CMSSW_8_0_26_patch1/src/ChargedHiggs/ntufile/finaltry.root") @@ -218,6 +223,9 @@ def mergeCategory(tfile,toget): else: hTmp = tfile.Get(toget) + + if hTmp!=None: hTmp.Rebin(nRebinHT) + return hTmp @@ -235,25 +243,40 @@ def mergeCategory(tfile,toget): ### FINAL conf if doSChannel: - basecat = ["OneBOneFat_one_highj","OneBOneFat_two_highj", "OneBOneFat_one_lowj","OneBOneFat_two_lowj" - ## ,"OneBOneFat1l_one","OneBOneFat1l_two","OneBOneFat1l_three" + basecat = [ "OneBOneFat_one_highj","OneBOneFat_two_highj", "OneBOneFat_one_lowj","OneBOneFat_two_lowj" + ,"OneBOneFat1l_one","OneBOneFat1l_two","OneBOneFat1l_three" ,"OneBOneMirrorFat_one_highj","OneBOneMirrorFat_two_highj", "OneBOneMirrorFat_one_lowj","OneBOneMirrorFat_two_lowj" ] else: - basecat = ["OneBOneFat_one_highj","OneBOneFat_two_highj","OneBOneFat_three_highj", "OneBOneFat_one_lowj","OneBOneFat_two_lowj","OneBOneFat_three_lowj" + basecat = [ "OneBOneFat_one_highj","OneBOneFat_two_highj","OneBOneFat_three_highj", "OneBOneFat_one_lowj","OneBOneFat_two_lowj","OneBOneFat_three_lowj" ,"OneBOneFat1l_one","OneBOneFat1l_two","OneBOneFat1l_three" ,"OneBOneMirrorFat_one_highj","OneBOneMirrorFat_two_highj","OneBOneMirrorFat_three_highj", "OneBOneMirrorFat_one_lowj","OneBOneMirrorFat_two_lowj","OneBOneMirrorFat_three_lowj" ] - if doSChannel: - channel = ["t0b","t1b","wbb","wbj"] + if opts.kCat==0: + channel = ["t0b","t1b","wbb","wbj"] + label="sChan_" + if opts.kCat==1: + channel = ["t0b"] + label="t0b_sChan_" + if opts.kCat==2: + channel = ["t1b"] + label="t1b_sChan_" + if opts.kCat==3: + channel = ["wbb"] + label="wbb_sChan_" + if opts.kCat==4: + channel = ["wbj"] + label="wbj_sChan_" + ## channel = ["wbj"] ## channel = ["t1b"] ## label="sChan_" ## label="sChan_sronly_" ## label="sChan_inonly_" - label="sChan_" +## label="sChan_" + else: if opts.kCat==0: @@ -319,26 +342,37 @@ def mergeCategory(tfile,toget): ## generally BKG very rare if "_three_lowj" in x and y=="wbj": continue + if "OneBOneFat1l_three" in x and y=="wbj": continue + if "_three_highj" in x and y=="wbj": continue + if "OneBOneFat1l_two" in x and y=="wbj": continue + +## if doSChannel and "OneBOneFat1l_three" in x: continue ## very rare if opts.kMass=="400": + ## wbj if "_three_highj" in x and y=="wbj": continue if "_two_lowj" in x and y=="wbj": continue + ## wbb if "_two_lowj" in x and y=="wbb": continue + ## t0b and t1b + if "_two_highj" in x and y=="t0b" and "below" in reg: continue if "_three_lowj" in x and y=="t0b" and "in" in reg: continue if "_one_highj" in x and (y=="t1b" or y=="t0b") and "in" in reg: continue + if "_one_lowj" in x and (y=="t1b") and "below" in reg: continue + if "_three" in x and y=="t0b" and "below" in reg: continue if opts.kMass=="3000": ## if "_two_highj" in x and y=="wbb": continue ## if "_three_lowj" in x and (y=="t0b") and "above" in reg: continue if "_three_lowj" in x and (y=="t1b") and "in" in reg: continue - # strange with systematics if opts.kMass=="2500": if "_three_lowj" in x and (y=="t0b") and "in" in reg: continue ## below are for associated only - if not doSChannel and (opts.kMass=="500" or opts.kMass=="400") and "in" in reg or "below" in reg: +# if not doSChannel and (opts.kMass=="500" or opts.kMass=="400") and "in" in reg or "below" in reg: + if not doSChannel and (opts.kMass=="500" or opts.kMass=="400") and "below" in reg or "in" in reg: if "_three_lowj" in x and y=="wbb": continue if "_one_lowj" in x and y=="wbj": continue @@ -361,6 +395,8 @@ def mergeCategory(tfile,toget): if not doSChannel and (opts.kMass=="2000" or opts.kMass=="2500" or opts.kMass=="3000") and "in" in reg: if "_one_highj" in x and y=="wbj": continue if "_two_highj" in x and y=="wbj": continue + if "_three_lowj" in x and y=="wbb": continue + if "_three_highj" in x and y=="wbb": continue if not doSChannel and (opts.kMass=="2500" or opts.kMass=="3000") and "in" in reg: if "_two_lowj" in x and y=="wbb": continue @@ -465,12 +501,19 @@ def mergeCategory(tfile,toget): # catStore[name]["hasMC"]=["qcd","top","Hptb"] ### QCD uncorrelated - if ( y=="wbb" or y=="wbj") and "_one" in x: catStore[name]["hasMC"]=["qcd_wx_one","ttbar","Hptb","top","ewk"] - if ( y=="wbb" or y=="wbj") and "_two" in x: catStore[name]["hasMC"]=["qcd_wx_two","ttbar","Hptb","top","ewk"] - if ( y=="wbb" or y=="wbj") and "_three" in x: catStore[name]["hasMC"]=["qcd_wx_three","ttbar","Hptb","top","ewk"] - if ( y=="t0b" or y=="t1b") and "_one" in x: catStore[name]["hasMC"]=["qcd_tx_one","ttbar","Hptb","top","ewk"] - if ( y=="t0b" or y=="t1b") and "_two" in x: catStore[name]["hasMC"]=["qcd_tx_two","ttbar","Hptb","top","ewk"] - if ( y=="t0b" or y=="t1b") and "_three" in x: catStore[name]["hasMC"]=["qcd_tx_three","ttbar","Hptb","top","ewk"] +# if ( y=="wbb" or y=="wbj") and "_one" in x: catStore[name]["hasMC"]=["qcd_wx_one","ttbar","Hptb","top","ewk"] +# if ( y=="wbb" or y=="wbj") and "_two" in x: catStore[name]["hasMC"]=["qcd_wx_two","ttbar","Hptb","top","ewk"] +# if ( y=="wbb" or y=="wbj") and "_three" in x: catStore[name]["hasMC"]=["qcd_wx_three","ttbar","Hptb","top","ewk"] +# if ( y=="t0b" or y=="t1b") and "_one" in x: catStore[name]["hasMC"]=["qcd_tx_one","ttbar","Hptb","top","ewk"] +# if ( y=="t0b" or y=="t1b") and "_two" in x: catStore[name]["hasMC"]=["qcd_tx_two","ttbar","Hptb","top","ewk"] +# if ( y=="t0b" or y=="t1b") and "_three" in x: catStore[name]["hasMC"]=["qcd_tx_three","ttbar","Hptb","top","ewk"] + + if ( y=="wbb" or y=="wbj") and "_one" in x: catStore[name]["hasMC"]=["qcd_wx_one","ttbar","Hptb"] + if ( y=="wbb" or y=="wbj") and "_two" in x: catStore[name]["hasMC"]=["qcd_wx_two","ttbar","Hptb"] + if ( y=="wbb" or y=="wbj") and "_three" in x: catStore[name]["hasMC"]=["qcd_wx_three","ttbar","Hptb"] + if ( y=="t0b" or y=="t1b") and "_one" in x: catStore[name]["hasMC"]=["qcd_tx_one","ttbar","Hptb"] + if ( y=="t0b" or y=="t1b") and "_two" in x: catStore[name]["hasMC"]=["qcd_tx_two","ttbar","Hptb"] + if ( y=="t0b" or y=="t1b") and "_three" in x: catStore[name]["hasMC"]=["qcd_tx_three","ttbar","Hptb"] if doSChannel: mcStore={ @@ -524,9 +567,9 @@ def mergeCategory(tfile,toget): "CMS_scale_j_qcd":{"type":"shape", "wsname":"CMS_scale_j_qcd","name":"JESANDCSV","proc":["qcd_wx_one","qcd_wx_two","qcd_wx_three","qcd_tx_one","qcd_tx_two","qcd_tx_three"]}, "CMS_scale_j":{"type":"shape", "wsname":"CMS_scale_j","name":"JESANDCSV","proc":["Hptb","ttbar","top","ewk"]}, ##Light jets Heavy flavor contamination + "CMS_btag_HF_qcd":{"type":"shape", "wsname":"CMS_btag_HF_qcd","name":"CSVRHF","proc":["qcd_wx_one","qcd_wx_two","qcd_wx_three","qcd_tx_one","qcd_tx_two","qcd_tx_three","ttbar","top","Hptb"]}, "CMS_btag_HF":{"type":"shape", "wsname":"CMS_btag_HF","name":"CSVRHF","proc":["qcd_wx_one","qcd_wx_two","qcd_wx_three","qcd_tx_one","qcd_tx_two","qcd_tx_three","ttbar","top","Hptb"]}, ##Heavy jets light flavor contamination - "CMS_btag_LF_qcd":{"type":"shape", "wsname":"CMS_btag_LF_qcd","name":"CSVRLF","proc":["qcd_wx_one","qcd_wx_two","qcd_wx_three","qcd_tx_one","qcd_tx_two","qcd_tx_three"]}, "CMS_btag_LF":{"type":"shape", "wsname":"CMS_btag_LF","name":"CSVRLF","proc":["Hptb","ttbar","top"]}, ##Linear and quadratic uncertainties "CMS_btag_HFstat1":{"type":"shape", "wsname":"CMS_btag_HFstat1","name":"CSVRHFSTAT1","proc":[".*"]}, @@ -547,11 +590,11 @@ def mergeCategory(tfile,toget): print "* ",cat,":",catStore[cat] print "---------------------- --------" -fileTmp="MIAO_MAY24/"+label+VarTest+opts.kMass+"_"+opts.output +fileTmp="MIAO_MAY30/"+label+VarTest+opts.kMass+"_"+opts.output w = ROOT.RooWorkspace("w","w") datNameTmp = opts.datCardName -datName = "MIAO_MAY24/"+label+ VarTest+opts.kMass+"_" + datNameTmp +datName = "MIAO_MAY30/"+label+ VarTest+opts.kMass+"_" + datNameTmp datacard=open(datName,"w") datacard.write("-------------------------------------\n") @@ -604,16 +647,25 @@ def skip(cat,mc): ## write shapes in histograms if False: # data - datacard.write("shapes data_obs *\t" + fileTmp.split('/')[1] +"\t") +# for MARIA + datacard.write("shapes data_obs *\t" + fileTmp +"\t") +# for JAN +# datacard.write("shapes data_obs *\t" + fileTmp.split('/')[1] +"\t") datacard.write("data_obs_$CHANNEL") datacard.write("\n") if True: # Sig - datacard.write("shapes Hptb *\t" + fileTmp.split('/')[1] +"\t") +# for MARIA + datacard.write("shapes Hptb *\t" + fileTmp +"\t") +# for JAN +# datacard.write("shapes Hptb *\t" + fileTmp.split('/')[1] +"\t") datacard.write("pdf_$PROCESS_$CHANNEL\t") datacard.write("pdf_$PROCESS_$CHANNEL_$SYSTEMATIC") datacard.write("\n") if True: # bkg - datacard.write("shapes * * %s\t"%fileTmp.split('/')[1] +"\t") +# for MARIA + datacard.write("shapes * * %s\t"%fileTmp +"\t") +# for JAN +# datacard.write("shapes * * %s\t"%fileTmp.split('/')[1] +"\t") datacard.write("pdf_$PROCESS_$CHANNEL\t") datacard.write("pdf_$PROCESS_$CHANNEL_$SYSTEMATIC\n") datacard.write("-------------------------------------\n") @@ -663,6 +715,32 @@ def skip(cat,mc): # write systematics ## +def writeNormSystLU(name="lumi",valueL=["1.027","1.026"], regexpL=["TT","ST",""]): +##def writeNormSyst(name="lumi",valueL=["1.027","1.026"], regexpL=["TT"]): + datacard.write(name+"\tlnU") + invert=False + + for cat in catStore: + for proc in mcStore: + if skip(catStore[cat],mcStore[proc]): continue + idx=-1 + invert=False + for i,regexp in enumerate(regexpL): + match=re.search(regexp,proc) + if regexp != "" and regexp[0] == '!': + invert=True + regexp=regexp[1:] + if (match and not invert) or (not match and invert): + idx=i + break + + if (idx>=0): + datacard.write("\t"+valueL[idx]) + else: + datacard.write("\t-") + datacard.write("\n") + + def writeNormSyst(name="lumi",valueL=["1.027","1.026"], regexpL=["TT","ST",""]): ##def writeNormSyst(name="lumi",valueL=["1.027","1.026"], regexpL=["TT"]): datacard.write(name+"\tlnN") @@ -777,7 +855,10 @@ def importStat(): if systStore[syst]["type"] == "lnN": writeNormSyst(syst,systStore[syst]["value"],systStore[syst]["proc"]) if systStore[syst]["type"] == "shape": - writeSystShape(systStore[syst],systStore[syst]["proc"]) + if "muRF" in systStore[syst]["wsname"]: + if not doSChannel: writeSystShape(systStore[syst],systStore[syst]["proc"]) + else: + writeSystShape(systStore[syst],systStore[syst]["proc"]) if doSyst: writeNormSyst("QCDscale_ttbar",["0.965/1.024"],["ttbar"]) if doSyst: writeNormSyst("pdf_gg",["1.042"],["ttbar"]) @@ -788,8 +869,10 @@ def importStat(): if doSyst: writeNormSyst("pdf_top",["1.026"],["top"]) if doSyst: writeNormSyst("CMS_mass_top",["1.022"],["top"]) -if doSyst: writeNormSyst("CMS_HPTB_QCDnonclosure_",["1.20","1.20","1.20"],["qcd_wx_one","qcd_wx_two","qcd_wx_three"]) -if doSyst: writeNormSyst("CMS_HPTB_QCDnonclosure_",["1.20","1.20","1.20"],["qcd_tx_one","qcd_tx_two","qcd_tx_three"]) +#if doSyst: writeNormSyst("CMS_HPTB_QCDnonclosure_",["1.20","1.20","1.20"],["qcd_wx_one","qcd_wx_two","qcd_wx_three"]) +#if doSyst: writeNormSyst("CMS_HPTB_QCDnonclosure_",["1.20","1.20","1.20"],["qcd_tx_one","qcd_tx_two","qcd_tx_three"]) +if doSyst: writeNormSystLU("CMS_HPTB_QCDnonclosure_",["2.","2.","2."],["qcd_wx_one","qcd_wx_two","qcd_wx_three"]) +if doSyst: writeNormSystLU("CMS_HPTB_QCDnonclosure_",["2.","2.","2."],["qcd_tx_one","qcd_tx_two","qcd_tx_three"]) ## "ewk" get the envelop of the DY and W+jets if doSyst: writeNormSyst("QCDscale_ewk",["0.996/1.008"],["ewk"]) @@ -890,7 +973,7 @@ def envelop(tfile,togetClone, s) : hname=togetClone+'RF'+s hTmp=mergeCategory(tfile,hname) -## if hTmp!=None: hTmp.Rebin(nRebinHT) +# if hTmp!=None: hTmp.Rebin(nRebinHT) h=hTmp.Clone() @@ -903,7 +986,7 @@ def envelop(tfile,togetClone, s) : hTmp=mergeCategory(tfile,hnameClone) -## if hTmp!=None: hTmp.Rebin(nRebinHT) +# if hTmp!=None: hTmp.Rebin(nRebinHT) for iBin in range(1,h.GetNbinsX()+1): c= h.GetBinContent(iBin) @@ -963,25 +1046,26 @@ def importPdfFromTH1(cat,mc,myBin,LikelihoodMapping,syst=None): hTmpSum=None for m in masses: +# print '==========> ' +# print '==========> cat["name"] ===> ', cat["name"] +# print '==========> mc["name"] ===> ', mc["name"] +# print '==========> m ===> ', m +# print '==========> ' if not "OneBOneFat1l" in cat["name"]: # print '1/3 mass now is =', str(m) -# if m==500 and "1500" in cat["name"]: continue -# if m==500 and "2500" in cat["name"]: continue -# if str(m) not in cat["name"]: continue +## if m==500 and "1500" in cat["name"]: continue +## if m==500 and "2500" in cat["name"]: continue +## if str(m) not in cat["name"]: continue -# if mc["name"]=="Hptb": -# toget=toget%m +## if mc["name"]=="Hptb": +## toget=toget%m myTMPmass = "%d_"%m if m==500 and "1500" in cat["name"]: continue if m==500 and "2500" in cat["name"]: continue if myTMPmass not in cat["name"]: continue -# print '==========> ' -# print '==========> cat["name"] ===> ', cat["name"] -# print '==========> mc["name"] ===> ',mc["name"] -# print '==========> ' target = "pdf_" + mc["name"] +"_"+ cat["name"] if m >10 : @@ -999,6 +1083,24 @@ def importPdfFromTH1(cat,mc,myBin,LikelihoodMapping,syst=None): if mc["name"]=="Hptb": toget=toget%m + if mc["name"]=="Hptb": + if "OneBOneFat1l" in cat["name"]: + + stringToParce="_M-"+opts.kMass + + if stringToParce in toget: + myTMPmass = "%d_"%m + print 'here is the one I want', stringToParce, ' to check inside',toget + else: + continue + +# print '==========> ' +# print '==========> toget ===> ', toget +# print '==========> hname ===> ', hname +# print '==========> cat["name"] ===> ', cat["name"] +# print '==========> mc["name"] ===> ', mc["name"] +# print '==========> ' +# print 'here is the one I want', opts.kMass togetNom = toget togetSyst = '' @@ -1006,7 +1108,7 @@ def importPdfFromTH1(cat,mc,myBin,LikelihoodMapping,syst=None): togetSyst = toget + "_" + syst["name"] toget += "_" + syst["name"] + s - if syst != None and "muRF" in toget: + if syst != None and "muRF" in syst["wsname"] and not doSChannel: if mc["name"]=="Hptb" or mc["name"]=="ttbar": hTmp = envelop(tfile,togetSyst,s) # toget = togetClone+'RF'+s @@ -1014,11 +1116,12 @@ def importPdfFromTH1(cat,mc,myBin,LikelihoodMapping,syst=None): elif syst != None: hTmp = SmoothAndMergeSyst(tfile,togetNom,togetSyst,s) -## hTmp = MergeCategory(tfile,togetSyst+s) +## hTmp = MergeCategory(tfile,togetSyst+s) + else: hTmp = mergeCategory(tfile,togetNom) - if hTmp!=None: hTmp.Rebin(nRebinHT) +## if hTmp!=None: hTmp.Rebin(nRebinHT) if hTmp!=None: print "<*> Reading Hist '"+toget+"'",hTmp.Integral() if hTmp == None: @@ -1026,12 +1129,12 @@ def importPdfFromTH1(cat,mc,myBin,LikelihoodMapping,syst=None): raise IOError ## foor QCD we do not apply the tauVeto and trigger - if mc["name"]=="qcd": + if mc["name"]=="qcd" and hTmp: hTmp.Scale(0.93) ## top and W scale factor (for now only in ttbar later also signal) - if ( mc["name"]=="ttbar" or mc["name"]=="top") and ("t0b" in toget or "t1b" in toget): + if ( mc["name"]=="ttbar" or mc["name"]=="top") and ("t0b" in toget or "t1b" in toget) and hTmp: hTmp.Scale(1.11) - if ( mc["name"]=="ttbar" or mc["name"]=="top") and ("wbb" in toget or "wbj" in toget): + if ( mc["name"]=="ttbar" or mc["name"]=="top") and ("wbb" in toget or "wbj" in toget) and hTmp: hTmp.Scale(1.06) ### -- MC -- @@ -1171,6 +1274,15 @@ def importPdfFromTH1SumBKG(cat,mc,syst=None,do1Third=False): if mc["name"]=="Hptb": toget=toget%m + stringToParce="_M-"+opts.kMass + + if stringToParce in toget: + myTMPmass = "%d_"%m + print '1/3 here is the one I want', stringToParce, ' to check inside',toget + else: + continue + + else: # print '1/3 mass now is =', str(m) if m==500 and "1500" in cat["name"]: continue @@ -1341,15 +1453,17 @@ def importPdfFromTH1SumBKG(cat,mc,syst=None,do1Third=False): if cat["name"] in arglist_obs.at(i).GetName(): al = arglist_obs.at(i) - if h != None: - roo_data= ROOT.RooDataHist("data_obs_%s"%c,"Mass",ROOT.RooArgList(al),h) - getattr(w,'import')(roo_data,ROOT.RooCmdArg()) ## import is a reserved word in python :(, the cmdArg is there to solve a disambiguate issue - g.extend([h,roo_data]) - f = ROOT.TFile.Open(fileTmp,"update") - h.SetName(target) - h.Write() - f.Write() - f.Close() +### comment data for may25 + +# if h != None: +# roo_data= ROOT.RooDataHist("data_obs_%s"%c,"Mass",ROOT.RooArgList(al),h) +# getattr(w,'import')(roo_data,ROOT.RooCmdArg()) ## import is a reserved word in python :(, the cmdArg is there to solve a disambiguate issue +# g.extend([h,roo_data]) +# f = ROOT.TFile.Open(fileTmp,"update") +# h.SetName(target) +# h.Write() +# f.Write() +# f.Close() ## import and write statistical uncertainties From 6f6d4f5743d10519607ce6e8eed2ae20f7639a01 Mon Sep 17 00:00:00 2001 From: maria Date: Thu, 21 Jun 2018 23:15:48 +0200 Subject: [PATCH 18/60] fixnames, fix smoothing; add TAU32,Tau21 unc; add ST bkg --- script/bwsFullHadTB.py | 134 +++++++++++++++++++++++------------------ 1 file changed, 77 insertions(+), 57 deletions(-) diff --git a/script/bwsFullHadTB.py b/script/bwsFullHadTB.py index 14afab68..7711f223 100644 --- a/script/bwsFullHadTB.py +++ b/script/bwsFullHadTB.py @@ -12,8 +12,9 @@ # original binning is 10GeV nRebinHT=1 -##nRebinHT=5 +#nRebinHT=5 LikeBins=10 +#LikeBins=1 doRebin = False applyLikelihoodRebinBin = True @@ -249,8 +250,8 @@ def mergeCategory(tfile,toget): ] else: basecat = [ "OneBOneFat_one_highj","OneBOneFat_two_highj","OneBOneFat_three_highj", "OneBOneFat_one_lowj","OneBOneFat_two_lowj","OneBOneFat_three_lowj" - ,"OneBOneFat1l_one","OneBOneFat1l_two","OneBOneFat1l_three" - ,"OneBOneMirrorFat_one_highj","OneBOneMirrorFat_two_highj","OneBOneMirrorFat_three_highj", "OneBOneMirrorFat_one_lowj","OneBOneMirrorFat_two_lowj","OneBOneMirrorFat_three_lowj" + ,"OneBOneFat1l_one","OneBOneFat1l_two","OneBOneFat1l_three" + ,"OneBOneMirrorFat_one_highj","OneBOneMirrorFat_two_highj","OneBOneMirrorFat_three_highj", "OneBOneMirrorFat_one_lowj","OneBOneMirrorFat_two_lowj","OneBOneMirrorFat_three_lowj" ] if doSChannel: @@ -501,19 +502,12 @@ def mergeCategory(tfile,toget): # catStore[name]["hasMC"]=["qcd","top","Hptb"] ### QCD uncorrelated -# if ( y=="wbb" or y=="wbj") and "_one" in x: catStore[name]["hasMC"]=["qcd_wx_one","ttbar","Hptb","top","ewk"] -# if ( y=="wbb" or y=="wbj") and "_two" in x: catStore[name]["hasMC"]=["qcd_wx_two","ttbar","Hptb","top","ewk"] -# if ( y=="wbb" or y=="wbj") and "_three" in x: catStore[name]["hasMC"]=["qcd_wx_three","ttbar","Hptb","top","ewk"] -# if ( y=="t0b" or y=="t1b") and "_one" in x: catStore[name]["hasMC"]=["qcd_tx_one","ttbar","Hptb","top","ewk"] -# if ( y=="t0b" or y=="t1b") and "_two" in x: catStore[name]["hasMC"]=["qcd_tx_two","ttbar","Hptb","top","ewk"] -# if ( y=="t0b" or y=="t1b") and "_three" in x: catStore[name]["hasMC"]=["qcd_tx_three","ttbar","Hptb","top","ewk"] - - if ( y=="wbb" or y=="wbj") and "_one" in x: catStore[name]["hasMC"]=["qcd_wx_one","ttbar","Hptb"] - if ( y=="wbb" or y=="wbj") and "_two" in x: catStore[name]["hasMC"]=["qcd_wx_two","ttbar","Hptb"] - if ( y=="wbb" or y=="wbj") and "_three" in x: catStore[name]["hasMC"]=["qcd_wx_three","ttbar","Hptb"] - if ( y=="t0b" or y=="t1b") and "_one" in x: catStore[name]["hasMC"]=["qcd_tx_one","ttbar","Hptb"] - if ( y=="t0b" or y=="t1b") and "_two" in x: catStore[name]["hasMC"]=["qcd_tx_two","ttbar","Hptb"] - if ( y=="t0b" or y=="t1b") and "_three" in x: catStore[name]["hasMC"]=["qcd_tx_three","ttbar","Hptb"] + if ( y=="wbb" or y=="wbj") and "_one" in x: catStore[name]["hasMC"]=["qcd_wx_one","ttbar","Hptb","top","ewk"] + if ( y=="wbb" or y=="wbj") and "_two" in x: catStore[name]["hasMC"]=["qcd_wx_two","ttbar","Hptb","top","ewk"] + if ( y=="wbb" or y=="wbj") and "_three" in x: catStore[name]["hasMC"]=["qcd_wx_three","ttbar","Hptb","top","ewk"] + if ( y=="t0b" or y=="t1b") and "_one" in x: catStore[name]["hasMC"]=["qcd_tx_one","ttbar","Hptb","top","ewk"] + if ( y=="t0b" or y=="t1b") and "_two" in x: catStore[name]["hasMC"]=["qcd_tx_two","ttbar","Hptb","top","ewk"] + if ( y=="t0b" or y=="t1b") and "_three" in x: catStore[name]["hasMC"]=["qcd_tx_three","ttbar","Hptb","top","ewk"] if doSChannel: mcStore={ @@ -562,16 +556,19 @@ def mergeCategory(tfile,toget): ### MET-Jets-PU "CMS_pileup":{"type":"shape", "wsname":"CMS_pileup","name":"PU","proc":["qcd_wx_one","qcd_wx_two","qcd_wx_three","qcd_tx_one","qcd_tx_two","qcd_tx_three","ttbar","top","Hptb"]}, "CMS_scale_uncluster":{"type":"shape", "wsname":"CMS_scale_uncluster","name":"UNCLUSTER","proc":["qcd_wx_one","qcd_wx_two","qcd_wx_three","qcd_tx_one","qcd_tx_two","qcd_tx_three","ttbar","top","Hptb"]}, - "CMS_SDMassScale":{"type":"shape", "wsname":"CMS_SDMassSCALE","name":"SDMassSCALE","proc":["qcd_wx_one","qcd_wx_two","qcd_wx_three","qcd_tx_one","qcd_tx_two","qcd_tx_three","ttbar","top","Hptb"]}, + "CMS_scale_SDMass":{"type":"shape", "wsname":"CMS_scale_SDMass","name":"SDMassSCALE","proc":["qcd_wx_one","qcd_wx_two","qcd_wx_three","qcd_tx_one","qcd_tx_two","qcd_tx_three","ttbar","top","Hptb"]}, + "CMS_eff_Tau21":{"type":"lnN", "value":["1.08","1.08"] ,"proc":["ttbar","Hptb"],"wsname":"CMS_eff_Tau21","name":"XXX"}, ## name used for shape + "CMS_eff_Tau32":{"type":"lnN", "value":["1.02","1.02"] ,"proc":["ttbar","Hptb"],"wsname":"CMS_eff_Tau32","name":"XXX"}, ## name used for shape # "CMS_res_j":{"type":"shape", "wsname":"CMS_res_j","name":"JER","proc":[".*"]}, "CMS_scale_j_qcd":{"type":"shape", "wsname":"CMS_scale_j_qcd","name":"JESANDCSV","proc":["qcd_wx_one","qcd_wx_two","qcd_wx_three","qcd_tx_one","qcd_tx_two","qcd_tx_three"]}, "CMS_scale_j":{"type":"shape", "wsname":"CMS_scale_j","name":"JESANDCSV","proc":["Hptb","ttbar","top","ewk"]}, ##Light jets Heavy flavor contamination - "CMS_btag_HF_qcd":{"type":"shape", "wsname":"CMS_btag_HF_qcd","name":"CSVRHF","proc":["qcd_wx_one","qcd_wx_two","qcd_wx_three","qcd_tx_one","qcd_tx_two","qcd_tx_three","ttbar","top","Hptb"]}, - "CMS_btag_HF":{"type":"shape", "wsname":"CMS_btag_HF","name":"CSVRHF","proc":["qcd_wx_one","qcd_wx_two","qcd_wx_three","qcd_tx_one","qcd_tx_two","qcd_tx_three","ttbar","top","Hptb"]}, + "CMS_btag_HF_qcd":{"type":"shape", "wsname":"CMS_btag_HF_qcd","name":"CSVRHF","proc":["qcd_wx_one","qcd_wx_two","qcd_wx_three","qcd_tx_one","qcd_tx_two","qcd_tx_three"]}, + "CMS_btag_HF":{"type":"shape", "wsname":"CMS_btag_HF","name":"CSVRHF","proc":["ttbar","top","Hptb"]}, ##Heavy jets light flavor contamination - "CMS_btag_LF":{"type":"shape", "wsname":"CMS_btag_LF","name":"CSVRLF","proc":["Hptb","ttbar","top"]}, + "CMS_btag_LF":{"type":"shape", "wsname":"CMS_btag_LF","name":"CSVRLF","proc":["qcd_wx_one","qcd_wx_two","qcd_wx_three","qcd_tx_one","qcd_tx_two","qcd_tx_three","Hptb","ttbar","top"]}, ##Linear and quadratic uncertainties + # note decouple the qcd "CMS_btag_HFstat1":{"type":"shape", "wsname":"CMS_btag_HFstat1","name":"CSVRHFSTAT1","proc":[".*"]}, "CMS_btag_HFstat2":{"type":"shape", "wsname":"CMS_btag_HFstat2","name":"CSVRHFSTAT2","proc":[".*"]}, "CMS_btag_LFstat1":{"type":"shape", "wsname":"CMS_btag_LFstat1","name":"CSVRLFSTAT1","proc":[".*"]}, @@ -590,11 +587,11 @@ def mergeCategory(tfile,toget): print "* ",cat,":",catStore[cat] print "---------------------- --------" -fileTmp="MIAO_MAY30/"+label+VarTest+opts.kMass+"_"+opts.output +fileTmp="MIAO_JUNE21/"+label+VarTest+opts.kMass+"_"+opts.output w = ROOT.RooWorkspace("w","w") datNameTmp = opts.datCardName -datName = "MIAO_MAY30/"+label+ VarTest+opts.kMass+"_" + datNameTmp +datName = "MIAO_JUNE21/"+label+ VarTest+opts.kMass+"_" + datNameTmp datacard=open(datName,"w") datacard.write("-------------------------------------\n") @@ -716,7 +713,6 @@ def skip(cat,mc): ## def writeNormSystLU(name="lumi",valueL=["1.027","1.026"], regexpL=["TT","ST",""]): -##def writeNormSyst(name="lumi",valueL=["1.027","1.026"], regexpL=["TT"]): datacard.write(name+"\tlnU") invert=False @@ -740,30 +736,45 @@ def writeNormSystLU(name="lumi",valueL=["1.027","1.026"], regexpL=["TT","ST",""] datacard.write("\t-") datacard.write("\n") - -def writeNormSyst(name="lumi",valueL=["1.027","1.026"], regexpL=["TT","ST",""]): -##def writeNormSyst(name="lumi",valueL=["1.027","1.026"], regexpL=["TT"]): - datacard.write(name+"\tlnN") - invert=False - - for cat in catStore: - for proc in mcStore: - if skip(catStore[cat],mcStore[proc]): continue - idx=-1 - invert=False - for i,regexp in enumerate(regexpL): - match=re.search(regexp,proc) - if regexp != "" and regexp[0] == '!': - invert=True - regexp=regexp[1:] - if (match and not invert) or (not match and invert): - idx=i - break - - if (idx>=0): - datacard.write("\t"+valueL[idx]) - else: - datacard.write("\t-") +def writeNormSyst(name="lumi",valueL=["1.027","1.026"], regexpL=["TT","ST",""],regexpCat=[]): + datacard.write(name+"\tlnN") + invert=False + + for cat in catStore: + print cat + for proc in mcStore: + print proc + if skip(catStore[cat],mcStore[proc]): continue + idx=-1 + invert=False + for i,regexp in enumerate(regexpL): + print 'regexp',regexp,' proc',proc + match=re.search(regexp,proc) + if regexp != "" and regexp[0] == '!': + invert=True + regexp=regexp[1:] + if (match and not invert) or (not match and invert): + idx=i + break + idx2=-1 + invert=False + for i,regexp in enumerate(regexpCat): + print 'regexp',regexp,' proc',cat + match=re.search(regexp,cat) + if regexp != "" and regexp[0] == '!': + invert=True + regexp=regexp[1:] + if (match and not invert) or (not match and invert): + idx2=i + break + + print cat, proc + if (idx>=0 and (idx2>=0 or len(regexpCat)==0 )): + print 'idx',idx,' valueL[idx]=' ,valueL + print 'idx2',idx2, ' valueL[idx]=',valueL + datacard.write("\t"+valueL[idx]) + else: + datacard.write("\t-") datacard.write("\n") def writeSystShape(syst,regexpL=[],regexpCat=None): @@ -853,7 +864,12 @@ def importStat(): for syst in systStore: if syst == "None": continue if systStore[syst]["type"] == "lnN": - writeNormSyst(syst,systStore[syst]["value"],systStore[syst]["proc"]) + if "CMS_eff_Tau21" in systStore[syst]["wsname"]: + writeNormSyst(syst,systStore[syst]["value"],systStore[syst]["proc"],["wbb","wbj"]) + elif "CMS_eff_Tau32" in systStore[syst]["wsname"]: + writeNormSyst(syst,systStore[syst]["value"],systStore[syst]["proc"],["t0b","t1b"]) + else: + writeNormSyst(syst,systStore[syst]["value"],systStore[syst]["proc"]) if systStore[syst]["type"] == "shape": if "muRF" in systStore[syst]["wsname"]: if not doSChannel: writeSystShape(systStore[syst],systStore[syst]["proc"]) @@ -862,7 +878,7 @@ def importStat(): if doSyst: writeNormSyst("QCDscale_ttbar",["0.965/1.024"],["ttbar"]) if doSyst: writeNormSyst("pdf_gg",["1.042"],["ttbar"]) -if doSyst: writeNormSyst("CMS_mass_ttbar",["1.027"],["ttbar"]) +if doSyst: writeNormSyst("CMS_mass_top",["1.027"],["ttbar"]) ## "top" get the value od the single top if doSyst: writeNormSyst("QCDscale_top",["0.977/1.028"],["top"]) @@ -871,8 +887,8 @@ def importStat(): #if doSyst: writeNormSyst("CMS_HPTB_QCDnonclosure_",["1.20","1.20","1.20"],["qcd_wx_one","qcd_wx_two","qcd_wx_three"]) #if doSyst: writeNormSyst("CMS_HPTB_QCDnonclosure_",["1.20","1.20","1.20"],["qcd_tx_one","qcd_tx_two","qcd_tx_three"]) -if doSyst: writeNormSystLU("CMS_HPTB_QCDnonclosure_",["2.","2.","2."],["qcd_wx_one","qcd_wx_two","qcd_wx_three"]) -if doSyst: writeNormSystLU("CMS_HPTB_QCDnonclosure_",["2.","2.","2."],["qcd_tx_one","qcd_tx_two","qcd_tx_three"]) +if doSyst: writeNormSystLU("CMS_HPTB_QCDnonclosure",["2.","2.","2."],["qcd_wx_one","qcd_wx_two","qcd_wx_three"]) +if doSyst: writeNormSystLU("CMS_HPTB_QCDnonclosure",["2.","2.","2."],["qcd_tx_one","qcd_tx_two","qcd_tx_three"]) ## "ewk" get the envelop of the DY and W+jets if doSyst: writeNormSyst("QCDscale_ewk",["0.996/1.008"],["ewk"]) @@ -954,9 +970,9 @@ def SmoothAndMergeSyst(tfile,togetNom,togetSyst,s): c= hTmpUp.SetBinError(iBin,0) c= hTmpDown.SetBinError(iBin,0) - if 'JESANDCSV' in togetSyst or "PU" in togetSyst or "JER" in togetSyst or "SDMassScale" in togetSyst: -# return hTmpNom - hUp, hDown = SS.SystematicSmoother(hTmpNom, hTmpUp, hTmpDown,"~/www/forMIAO/APR16/SYST").smooth() + if ('CSV' in togetSyst and not "CSVRHF" in togetSyst) or "PU" in togetSyst or "JER" in togetSyst or "SDMassScale" in togetSyst: + return hTmpNom + hUp, hDown = SS.SystematicSmoother(hTmpNom, hTmpUp, hTmpDown,"~/www/forMIAO/JUNE14/SYST").smooth() else: hUp = hTmpUp hDown = hTmpDown @@ -1132,10 +1148,14 @@ def importPdfFromTH1(cat,mc,myBin,LikelihoodMapping,syst=None): if mc["name"]=="qcd" and hTmp: hTmp.Scale(0.93) ## top and W scale factor (for now only in ttbar later also signal) + ## https://twiki.cern.ch/twiki/bin/view/CMS/JetTopTagging#13_TeV_working_points_CMSSW_8_0 + ## https://twiki.cern.ch/twiki/bin/view/CMS/JetWtagging if ( mc["name"]=="ttbar" or mc["name"]=="top") and ("t0b" in toget or "t1b" in toget) and hTmp: - hTmp.Scale(1.11) - if ( mc["name"]=="ttbar" or mc["name"]=="top") and ("wbb" in toget or "wbj" in toget) and hTmp: hTmp.Scale(1.06) + # uncertainties +0.08 -0.04 + if ( mc["name"]=="ttbar" or mc["name"]=="top") and ("wbb" in toget or "wbj" in toget) and hTmp: + hTmp.Scale(1.11) + ## need to have an uncetainty of 0.08 ### -- MC -- # print 'xxxxxxxxx hname=',hname,' base=',base,'cat["dir"]',cat["dir"] @@ -1275,7 +1295,7 @@ def importPdfFromTH1SumBKG(cat,mc,syst=None,do1Third=False): toget=toget%m stringToParce="_M-"+opts.kMass - + if stringToParce in toget: myTMPmass = "%d_"%m print '1/3 here is the one I want', stringToParce, ' to check inside',toget From 62e086003af33dac50a82c66494bec2e52445f95 Mon Sep 17 00:00:00 2001 From: maria Date: Sun, 24 Jun 2018 11:16:09 +0200 Subject: [PATCH 19/60] bwsFullHadTB: add the Data in the card --- script/bwsFullHadTB.py | 61 +++++++++++++++++++++--------------------- 1 file changed, 30 insertions(+), 31 deletions(-) diff --git a/script/bwsFullHadTB.py b/script/bwsFullHadTB.py index 7711f223..57e3a90b 100644 --- a/script/bwsFullHadTB.py +++ b/script/bwsFullHadTB.py @@ -252,7 +252,7 @@ def mergeCategory(tfile,toget): basecat = [ "OneBOneFat_one_highj","OneBOneFat_two_highj","OneBOneFat_three_highj", "OneBOneFat_one_lowj","OneBOneFat_two_lowj","OneBOneFat_three_lowj" ,"OneBOneFat1l_one","OneBOneFat1l_two","OneBOneFat1l_three" ,"OneBOneMirrorFat_one_highj","OneBOneMirrorFat_two_highj","OneBOneMirrorFat_three_highj", "OneBOneMirrorFat_one_lowj","OneBOneMirrorFat_two_lowj","OneBOneMirrorFat_three_lowj" - ] + ] if doSChannel: if opts.kCat==0: @@ -587,11 +587,11 @@ def mergeCategory(tfile,toget): print "* ",cat,":",catStore[cat] print "---------------------- --------" -fileTmp="MIAO_JUNE21/"+label+VarTest+opts.kMass+"_"+opts.output +fileTmp="MIAO_JUNE22/"+label+VarTest+opts.kMass+"_"+opts.output w = ROOT.RooWorkspace("w","w") datNameTmp = opts.datCardName -datName = "MIAO_JUNE21/"+label+ VarTest+opts.kMass+"_" + datNameTmp +datName = "MIAO_JUNE22/"+label+ VarTest+opts.kMass+"_" + datNameTmp datacard=open(datName,"w") datacard.write("-------------------------------------\n") @@ -643,7 +643,7 @@ def skip(cat,mc): #datacard.write("## Observation\n") ## write shapes in histograms -if False: # data +if True: # data # for MARIA datacard.write("shapes data_obs *\t" + fileTmp +"\t") # for JAN @@ -668,13 +668,12 @@ def skip(cat,mc): datacard.write("-------------------------------------\n") datacard.write("## Observation\n") - # write observation datacard.write("bin\t") for cat in catStore: datacard.write("%s\t"%cat) datacard.write("\n") -datacard.write("bin\t") +datacard.write("observation\t") for cat in catStore: datacard.write("-1\t") datacard.write("\n") @@ -970,12 +969,18 @@ def SmoothAndMergeSyst(tfile,togetNom,togetSyst,s): c= hTmpUp.SetBinError(iBin,0) c= hTmpDown.SetBinError(iBin,0) - if ('CSV' in togetSyst and not "CSVRHF" in togetSyst) or "PU" in togetSyst or "JER" in togetSyst or "SDMassScale" in togetSyst: - return hTmpNom - hUp, hDown = SS.SystematicSmoother(hTmpNom, hTmpUp, hTmpDown,"~/www/forMIAO/JUNE14/SYST").smooth() - else: - hUp = hTmpUp - hDown = hTmpDown + if LikeBins==1: + + hUp = hTmpUp + hDown = hTmpDown + + else: + + if ('CSV' in togetSyst and not "CSVRHF" in togetSyst) or "PU" in togetSyst or "JER" in togetSyst or "SDMassScale" in togetSyst: + hUp, hDown = SS.SystematicSmoother(hTmpNom, hTmpUp, hTmpDown,"~/www/forMIAO/JUNE14/SYST").smooth() + else: + hUp = hTmpUp + hDown = hTmpDown if 'Up' in s: return hUp @@ -1316,9 +1321,10 @@ def importPdfFromTH1SumBKG(cat,mc,syst=None,do1Third=False): ## togetClone = toget + "_" + syst["name"] toget += "_" + syst["name"] + s - hTmp=tfile.Get(toget) +# hTmp=tfile.Get(toget) +# if hTmp!= None: hTmp.Rebin(nRebinHT) + hTmp=mergeCategory(tfile,toget) - if hTmp!= None: hTmp.Rebin(nRebinHT) if hTmp!= None: print "<*> 1/3 Reading Hist '"+toget+"'",hTmp.Integral(),' nBin=',hTmp.GetNbinsX() if hTmp == None: @@ -1439,19 +1445,13 @@ def importPdfFromTH1SumBKG(cat,mc,syst=None,do1Third=False): raise IOError base="ChargedHiggsTopBottom" target = "data_obs_"+ cat["name"] -## MARIA temporaty fix since the data histo is not filled toget=base + "/" +cat["dir"] + "/" + cat["var"] +"_Data" -# toget=base + "/" +cat["dir"] + "/" + cat["var"] + "_QCD_HT" -# if ("1Ele" in cat["dir"] or "2Ele" in cat["dir"]) and not ("1Mu1Ele" in cat["dir"]): toget+="_SingleElectron" -# elif "1Mu" in cat["dir"] or "2Mu" in cat["dir"] or "1Mu1Ele" in cat["dir"]: toget+="_SingleMuon" - ## MARIA REMEMBER TO MERGE THE CATEGORY - h=tfile.Get(toget) - if h!= None: h.Rebin(nRebinHT) + h=mergeCategory(tfile,toget) + if h == None: print "<*> Hist do not exists ",toget - ### MARIA COMMENT THIS FOR NOW -## raise IOError + raise IOError if h != None: h = likelihoodBinning.applyMapping(LikelihoodMapping, h) @@ -1473,17 +1473,16 @@ def importPdfFromTH1SumBKG(cat,mc,syst=None,do1Third=False): if cat["name"] in arglist_obs.at(i).GetName(): al = arglist_obs.at(i) -### comment data for may25 - -# if h != None: + if h != None: +# comment the roofit part # roo_data= ROOT.RooDataHist("data_obs_%s"%c,"Mass",ROOT.RooArgList(al),h) # getattr(w,'import')(roo_data,ROOT.RooCmdArg()) ## import is a reserved word in python :(, the cmdArg is there to solve a disambiguate issue # g.extend([h,roo_data]) -# f = ROOT.TFile.Open(fileTmp,"update") -# h.SetName(target) -# h.Write() -# f.Write() -# f.Close() + f = ROOT.TFile.Open(fileTmp,"update") + h.SetName(target) + h.Write() + f.Write() + f.Close() ## import and write statistical uncertainties From 3dc1d2f8dc84d2d214dfcf4d1b7710511fde54cb Mon Sep 17 00:00:00 2001 From: maria Date: Tue, 26 Jun 2018 23:40:36 +0200 Subject: [PATCH 20/60] add filterbadPFMuon and filterbadChHadrons for DATA --- dat/branches.txt | 1 + interface/Met.hpp | 2 ++ src/Loader.cpp | 2 ++ src/MetFilters.cpp | 3 ++- 4 files changed, 7 insertions(+), 1 deletion(-) diff --git a/dat/branches.txt b/dat/branches.txt index 66de414b..b88de0da 100644 --- a/dat/branches.txt +++ b/dat/branches.txt @@ -71,6 +71,7 @@ r1f5 r5f5 pdfRwgt filterSelBits +filter* ## TRIGGER triggerFired triggerTaus diff --git a/interface/Met.hpp b/interface/Met.hpp index f72172d3..ff2ef7af 100644 --- a/interface/Met.hpp +++ b/interface/Met.hpp @@ -19,6 +19,8 @@ class Met : public: Met() : Object(), SmearableComplex() {syst = 0 ;} float gen ; + bool filterbadPFMuon{false}; + bool filterbadChHadrons{false}; inline bool passFullRecommendation()const { return FullRecommendation;} inline void setFullRecommendation(bool value){ FullRecommendation=value;} diff --git a/src/Loader.cpp b/src/Loader.cpp index 867916d4..78ca7bdf 100644 --- a/src/Loader.cpp +++ b/src/Loader.cpp @@ -97,6 +97,8 @@ void LoadNero::FillEventInfo(){ event_ -> rho_ = e->rho; event_ -> met_ . setFullRecommendation ( e->selBits & BareEvent::FullRecommendation ); + event_ -> met_ . filterbadPFMuon = e->filterbadPFMuon; + event_ -> met_ . filterbadChHadrons = e->filterbadChCandidate; BareVertex *v = dynamic_cast ( bare_ [names_["BareVertex"] ] ) ; assert(v!=NULL); event_ -> npv_ = v->npv; diff --git a/src/MetFilters.cpp b/src/MetFilters.cpp index cde0160c..02be6dcb 100644 --- a/src/MetFilters.cpp +++ b/src/MetFilters.cpp @@ -15,7 +15,8 @@ int MetFiltersAnalysis::analyze(Event *e,string systname) //if (not e->IsRealData() ) return MET_EVENT_PASS; if (e->IsRealData()) Fill("MetFilters/CutFlow/CutFlow_Data",systname,0,1); - if (e->GetMet() . passFullRecommendation()) { + // if (e->GetMet() . passFullRecommendation()) { + if (e->GetMet() . passFullRecommendation() and ( not e->IsRealData() or ( e->GetMet() . filterbadPFMuon and e->GetMet() . filterbadChHadrons)) ) { if(VERBOSE>0)Log(__FUNCTION__,"INFO",Form("Event (%d,%d,%u) PASS met filters",e->runNum(),e->lumiNum(),e->eventNum())); if (e->IsRealData() ) Fill("MetFilters/CutFlow/CutFlow_Data",systname,1,1); return MET_EVENT_PASS; From 17a7ad0be116cd65b68c3309496360d4e4c83bf5 Mon Sep 17 00:00:00 2001 From: maria Date: Fri, 6 Jul 2018 19:24:16 +0200 Subject: [PATCH 21/60] re-enable the undefined regions; fix the qcd scaling; fix the parenthesis in the loo[ --- script/bwsFullHadTB.py | 12 +++++------- 1 file changed, 5 insertions(+), 7 deletions(-) diff --git a/script/bwsFullHadTB.py b/script/bwsFullHadTB.py index 57e3a90b..9c55a3f2 100644 --- a/script/bwsFullHadTB.py +++ b/script/bwsFullHadTB.py @@ -337,9 +337,9 @@ def mergeCategory(tfile,toget): # UNDEFINED - if "OneBOneFat_one" in x and y=="wbb": continue - if "OneBOneMirrorFat_one" in x and y=="wbb": continue - if "OneBOneFat1l_one" in x and y=="wbb": continue +# if "OneBOneFat_one" in x and y=="wbb": continue +# if "OneBOneMirrorFat_one" in x and y=="wbb": continue +# if "OneBOneFat1l_one" in x and y=="wbb": continue ## generally BKG very rare if "_three_lowj" in x and y=="wbj": continue @@ -373,7 +373,7 @@ def mergeCategory(tfile,toget): ## below are for associated only # if not doSChannel and (opts.kMass=="500" or opts.kMass=="400") and "in" in reg or "below" in reg: - if not doSChannel and (opts.kMass=="500" or opts.kMass=="400") and "below" in reg or "in" in reg: + if not doSChannel and (opts.kMass=="500" or opts.kMass=="400") and ("below" in reg or "in" in reg): if "_three_lowj" in x and y=="wbb": continue if "_one_lowj" in x and y=="wbj": continue @@ -1150,7 +1150,7 @@ def importPdfFromTH1(cat,mc,myBin,LikelihoodMapping,syst=None): raise IOError ## foor QCD we do not apply the tauVeto and trigger - if mc["name"]=="qcd" and hTmp: + if "qcd" in mc["name"] and hTmp: hTmp.Scale(0.93) ## top and W scale factor (for now only in ttbar later also signal) ## https://twiki.cern.ch/twiki/bin/view/CMS/JetTopTagging#13_TeV_working_points_CMSSW_8_0 @@ -1321,8 +1321,6 @@ def importPdfFromTH1SumBKG(cat,mc,syst=None,do1Third=False): ## togetClone = toget + "_" + syst["name"] toget += "_" + syst["name"] + s -# hTmp=tfile.Get(toget) -# if hTmp!= None: hTmp.Rebin(nRebinHT) hTmp=mergeCategory(tfile,toget) if hTmp!= None: print "<*> 1/3 Reading Hist '"+toget+"'",hTmp.Integral(),' nBin=',hTmp.GetNbinsX() From 36f43e485a7c6020cc9edfaa8be86957de350621 Mon Sep 17 00:00:00 2001 From: maria Date: Fri, 13 Jul 2018 18:52:11 +0200 Subject: [PATCH 22/60] cards with new files --- script/bwsTB.py | 78 ++++++++++++++++++++++++++++--------------------- 1 file changed, 45 insertions(+), 33 deletions(-) diff --git a/script/bwsTB.py b/script/bwsTB.py index cede45d1..5ccdb750 100644 --- a/script/bwsTB.py +++ b/script/bwsTB.py @@ -12,6 +12,10 @@ maxStat=0.3 LikeBins=100 +# in the histos nbin=1000 then rebin5, those with +nBinsHT=1 +#nBinsHT=2 +#nBinsHT=5 doSyst = False @@ -19,11 +23,11 @@ parser= OptionParser() -parser.add_option("","--input1L",type='string',help="Input ROOT file. [%default]", default="/afs/cern.ch/work/d/dalfonso/CMSSW_9_1_0_pre2_ReTestNERO/src/ChargedHiggs/MARCH15_FINAL_2ThirdSYST_KerasV5_bin1000_wDATA_1l.root") -parser.add_option("","--input2L",type='string',help="Input ROOT file. [%default]", default="/afs/cern.ch/work/d/dalfonso/CMSSW_9_1_0_pre2_ReTestNERO/src/ChargedHiggs/MARCH15_FINAL_2ThirdSYST_KerasV5_bin1000_wDATA_2l.root") +parser.add_option("","--input1L",type='string',help="Input ROOT file. [%default]", default="/afs/cern.ch/work/d/dalfonso/CMSSW_9_1_0_pre2_ReTestNERO/src/ChargedHiggs/JUNE29_FINAL_2ThirdSYST_bin200_wDATA_1l.root") +parser.add_option("","--input2L",type='string',help="Input ROOT file. [%default]", default="/afs/cern.ch/work/d/dalfonso/CMSSW_9_1_0_pre2_ReTestNERO/src/ChargedHiggs/JUNE29_FINAL_2ThirdSYST_bin200_wDATA_2l.root") -parser.add_option("","--input1LBin",type='string',help="Input ROOT file. [%default]", default="/afs/cern.ch/work/d/dalfonso/CMSSW_9_1_0_pre2_ReTestNERO/src/ChargedHiggs/MARCH15_FINAL_1Third_bin1000_1l.root") -parser.add_option("","--input2LBin",type='string',help="Input ROOT file. [%default]", default="/afs/cern.ch/work/d/dalfonso/CMSSW_9_1_0_pre2_ReTestNERO/src/ChargedHiggs/MARCH15_FINAL_1Third_bin1000_2l.root") +parser.add_option("","--input1LBin",type='string',help="Input ROOT file. [%default]", default="/afs/cern.ch/work/d/dalfonso/CMSSW_9_1_0_pre2_ReTestNERO/src/ChargedHiggs/JUNE1_1l_1Third.root") +parser.add_option("","--input2LBin",type='string',help="Input ROOT file. [%default]", default="/afs/cern.ch/work/d/dalfonso/CMSSW_9_1_0_pre2_ReTestNERO/src/ChargedHiggs/JUNE1_2l_1Third.root") ###### ###### @@ -377,8 +381,8 @@ def RebinN(h,nBin): "ttcc":{ "name":"ttcc","hist":["ttc_TT_TuneCUETP8M2T4_13TeV-powheg-pythia8"],"num":4}, # "ewk":{ "name":"ewk","hist":["WJetsToLNu_HT","DYJetsToLL_M-50_HT","DYJetsToLL_M-5to50_HT","ZZTo","WWTo","WZTo","ZZZ","WZZ","WWZ","WWW","VHToNonbb_M125","WH_HToBB_WToLNu_M125","ZH_HToBB_ZToLL"],"num":6}, # "ewk":{ "name":"ewk","hist":["WJetsToLNu_HT","DYJetsToLL_M-50_HT","DYJetsToLL_M-5to50_HT","ZZTo","WZTo","ZZZ","WZZ","WWZ","WWW","WH_HToBB_WToLNu_M125","ZH_HToBB_ZToLL"],"num":5}, - "ewk":{ "name":"ewk","hist":["WJetsToLNu_HT","DYJetsToLL_M-50_HT","DYJetsToLL_M-5to50_HT"],"num":5}, - "top":{ "name":"top","hist":["TTZ","TTW","TTG","ttH","TTTT","ST"],"num":6} + "ewk":{ "name":"ewk","hist":["WJetsToLNu_HT","DYJetsToLL_M-50_HT","DYJetsToLL_M-5to50_HT","EWK"],"num":5}, + "top":{ "name":"top","hist":["TTX","ST"],"num":6} # "qcd":{ "name":"top","hist":["QCD_HT"],"num":8} } else: @@ -390,9 +394,8 @@ def RebinN(h,nBin): # "tt2b":{ "name":"tt2b","hist":["tt2bMerged_TT_TuneCUETP8M2T4_13TeV-powheg-pythia8"],"num":4}, "ttbb":{ "name":"ttbb","hist":["tt2b_TT_TuneCUETP8M2T4_13TeV-powheg-pythia8","tt2bMerged_TT_TuneCUETP8M2T4_13TeV-powheg-pythia8"],"num":3}, "ttcc":{ "name":"ttcc","hist":["ttc_TT_TuneCUETP8M2T4_13TeV-powheg-pythia8"],"num":4}, -# "ewk":{ "name":"ewk","hist":["WJetsToLNu_HT","DYJetsToLL_M-50_HT","DYJetsToLL_M-5to50_HT","ZZTo","WWTo","WZTo","ZZZ","WZZ","WWZ","WWW","VHToNonbb_M125","WH_HToBB_WToLNu_M125","ZH_HToBB_ZToLL"],"num":6}, - "ewk":{ "name":"ewk","hist":["WJetsToLNu_HT","DYJetsToLL_M-50_HT","ZZTo"],"num":5}, - "top":{ "name":"top","hist":["TTZ","TTW","TTG","ttH","TTTT","ST"],"num":6} + "ewk":{ "name":"ewk","hist":["WJetsToLNu_HT","DYJetsToLL_M-50_HT","EWK"],"num":5}, + "top":{ "name":"top","hist":["TTX","ST"],"num":6} # "qcd":{ "name":"top","hist":["QCD_HT"],"num":8} } @@ -417,9 +420,22 @@ def RebinN(h,nBin): "CMS_topreweight":{"type":"shape", "wsname":"CMS_topreweight","name":"TOPRW","proc":["ttlf","ttb","ttbb","tt2b","ttcc"]}, ## name used for shape "CMS_HPTB_mcreweight_ewk":{"type":"shape", "wsname":"CMS_HPTB_mcreweight_ewk","name":"htRECO","proc":["ewk"]}, ## name used for shape ## "QCDscale":{"type":"shape", "wsname":"QCDscale","name":"ScaleRF","proc":["Hptb","ttlf","ttb","ttbb","tt2b","ttcc"]} ## name used for shape - "muRF_ttbar":{"type":"shape", "wsname":"muRF_ttbar","name":"Scale","proc":["ttlf","ttb","ttbb","tt2b","ttcc"]}, ## name used for shape - "muRF_ewk":{"type":"shape", "wsname":"muRF_ewk","name":"Scale","proc":["ewk"]}, ## name used for shape - "muRF_Hptb":{"type":"shape", "wsname":"muRF_Hptb","name":"Scale","proc":["Hptb"]}, ## name used for shape + "muRFenv_ttbar":{"type":"shape", "wsname":"muRFenv_ttbar","name":"Scale","proc":["ttlf","ttb","ttbb","tt2b","ttcc"]}, ## name used for shape +# "muRF_ttbar":{"type":"shape", "wsname":"muRF_ttbar","name":"Scale","proc":["ttlf","ttb","ttbb","tt2b","ttcc"]}, ## name used for shape +# "muR_ttbar":{"type":"shape", "wsname":"muR_ttbar","name":"Scale","proc":["ttlf","ttb","ttbb","tt2b","ttcc"]}, ## name used for shape +# "muF_ttbar":{"type":"shape", "wsname":"muF_ttbar","name":"Scale","proc":["ttlf","ttb","ttbb","tt2b","ttcc"]}, ## name used for shape + "muRFenv_ewk":{"type":"shape", "wsname":"muRFenv_ewk","name":"Scale","proc":["ewk"]}, ## name used for shape +# "muRF_ewk":{"type":"shape", "wsname":"muRF_ewk","name":"Scale","proc":["ewk"]}, ## name used for shape +# "muR_ewk":{"type":"shape", "wsname":"muR_ewk","name":"Scale","proc":["ewk"]}, ## name used for shape +# "muF_ewk":{"type":"shape", "wsname":"muF_ewk","name":"Scale","proc":["ewk"]}, ## name used for shape + "muRFenv_Hptb":{"type":"shape", "wsname":"muRFenv_Hptb","name":"Scale","proc":["Hptb"]}, ## name used for shape +# "muRF_Hptb":{"type":"shape", "wsname":"muRF_Hptb","name":"Scale","proc":["Hptb"]}, ## name used for shape +# "muR_Hptb":{"type":"shape", "wsname":"muR_Hptb","name":"Scale","proc":["Hptb"]}, ## name used for shape +# "muF_Hptb":{"type":"shape", "wsname":"muF_Hptb","name":"Scale","proc":["Hptb"]}, ## name used for shape + "muRFenv_top":{"type":"shape", "wsname":"muRFenv_top","name":"Scale","proc":["top"]}, ## name used for shape +# "muRF_top":{"type":"shape", "wsname":"muRF_top","name":"Scale","proc":["top"]}, ## name used for shape +# "muR_top":{"type":"shape", "wsname":"muR_top","name":"Scale","proc":["top"]}, ## name used for shape +# "muF_top":{"type":"shape", "wsname":"muF_top","name":"Scale","proc":["top"]}, ## name used for shape "CMS_res_j":{"type":"shape", "wsname":"CMS_res_j","name":"JER","proc":[".*"]}, ## name used for shape #### #### JEC sources @@ -483,12 +499,12 @@ def RebinN(h,nBin): #print "---------------------- --------" #fileTmp="AUG6_HT/"+label+VarTest+opts.output -fileTmp="MAY23/"+ label + VarTest + str(opts.kMass) + opts.output +fileTmp="JULY5/"+ label + VarTest + str(opts.kMass) + opts.output w = ROOT.RooWorkspace("w","w") datNameTmp = opts.datCardName #datName = "AUG6_HT/"+ label + VarTest + datNameTmp -datName = "MAY23/"+ label + VarTest + str(opts.kMass) + datNameTmp +datName = "JULY5/"+ label + VarTest + str(opts.kMass) + datNameTmp datacard=open(datName,"w") datacard.write("-------------------------------------\n") @@ -753,8 +769,8 @@ def writeSystISRFSR(name="test",valueL=["1.027","1.026"], regexpL=["TT","ST",""] ## -def writeNormSyst(name="lumi",valueL=["1.027","1.026"], regexpL=["TT","ST",""],regexpCat=[]): ##def writeNormSyst(name="lumi",valueL=["1.027","1.026"], regexpL=["TT"]): +def writeNormSyst(name="lumi",valueL=["1.027","1.026"], regexpL=["TT","ST",""],regexpCat=[]): datacard.write(name+"\tlnN") invert=False @@ -1032,12 +1048,9 @@ def MergeCategory(tfile,hname): #nominal if hTmp!= None and "bdt" in hname: - # in the histos nbin=1000 then rebin5 - hTmp.Rebin(5) + hTmp.Rebin(nBinsHT) elif hTmp!= None: - # in the histos nbin=10GeV bin then rebin5 - hTmp.Rebin(5) - #hTmp.Rebin(800) + hTmp.Rebin(nBinsHT) return hTmp @@ -1060,13 +1073,15 @@ def SmoothAndMergeSyst(tfile,togetNom,togetSyst,s): c= hTmpUp.SetBinError(iBin,0) c= hTmpDown.SetBinError(iBin,0) - if 'JESANDCSV' in togetSyst or 'JES_' in togetSyst or "PU" in togetSyst or "JER" in togetSyst: -## if 'typo' in togetSyst: -## return hTmpNom + if LikeBins==1 or LikeBins==2: + + hUp = hTmpUp + hDown = hTmpDown + + else: + + # SMOOTH ALL hUp, hDown = SS.SystematicSmoother(hTmpNom, hTmpUp, hTmpDown,"~/www/ChargedHiggsTB/MAY3/SYST/").smooth() - else: - hUp = hTmpUp - hDown = hTmpDown if 'Up' in s: return hUp @@ -1186,8 +1201,8 @@ def importPdfFromTH1(cat,mc,myBin,LikelihoodMapping,syst=None): ### ## if syst != None and "QCDscale" in target: - if syst != None and "muRF" in target: - if mc["name"]=="Hptb" or "WJetsToLNu_HT" in togetSyst or "DYJetsToLL_M-50_HT" in togetSyst or "DYJetsToLL_M-5to50_HT" in togetSyst or "ttlf" in mc["name"] or "ttb" in mc["name"] or "ttbb" in mc["name"] or "tt2b" in mc["name"] or "ttcc" in mc["name"]: + if syst != None and "muRFenv" in target: + if mc["name"]=="Hptb" or "WJetsToLNu_HT" in togetSyst or "DYJetsToLL_M-50_HT" in togetSyst or "DYJetsToLL_M-5to50_HT" in togetSyst or "ttlf" in mc["name"] or "ttb" in mc["name"] or "ttbb" in mc["name"] or "tt2b" in mc["name"] or "ttcc" in mc["name"] or "ST" in togetSyst: hTmp = envelop(tfile,togetSyst,s) @@ -1580,12 +1595,9 @@ def importPdfFromTH1SumBKG(cat,mc,syst=None,do1Third=False): h=tfile.Get(toget) if h != None and "bdt" in cat["var"]: - # in the histos nbin=1000 then rebin5 - h.Rebin(5) + h.Rebin(nBinsHT) elif h != None: - # in the histos nbin=10GeV bin then rebin5 - h.Rebin(5) - #h.Rebin(800) + h.Rebin(nBinsHT) if h == None: print "<*> Hist do not exists ",toget From 8be6b3b153b7767720ebd0a4107f9e5c65096346 Mon Sep 17 00:00:00 2001 From: maria Date: Wed, 18 Jul 2018 15:35:54 +0200 Subject: [PATCH 23/60] added 20% safety --- script/FwBinning.py | 106 +++++++++++++++++++++++++++++++------------- 1 file changed, 74 insertions(+), 32 deletions(-) diff --git a/script/FwBinning.py b/script/FwBinning.py index 6931537c..5b35a3c7 100644 --- a/script/FwBinning.py +++ b/script/FwBinning.py @@ -12,7 +12,7 @@ class Rebin: binMin = 0 binMax = 0 - + def __init__(self, h, h_ref, maxStat): self.h = h @@ -29,7 +29,7 @@ def getHist(self): def mergeCriteria(self, i): - + #if self.h.GetBinContent(i) == 0 or self.h.GetBinError(i) / self.h.GetBinContent(i) > maxStat: return True if self.h.GetBinContent(i) == 0 or self.h_ref.GetBinContent(i) == 0 or self.h.GetBinError(i) / self.h_ref.GetBinContent(i) > self.maxStat: return True else: return False @@ -288,7 +288,7 @@ def getHist(self): def mergeCriteria(self, i): - + #if self.h.GetBinContent(i) == 0 or self.h.GetBinError(i) / self.h.GetBinContent(i) > maxStat: return True if self.h.GetBinContent(i) == 0 or self.h_ref.GetBinContent(i) == 0 or self.h.GetBinError(i) / self.h_ref.GetBinContent(i) > self.maxStat: return True else: return False @@ -420,28 +420,29 @@ class RebinLikelihood: binMin = 0 binMax = 0 + maxSigStat = 0.2 + maxStat = 0.2 + def __init__(self, lbins): + self.lbins = lbins + # rebin signal such that no negative entries are present - def preRebin(self): + def preRebin(self): b = self.h_bkg.GetNbinsX() pos = self.getZeroContentBin() while pos != -1: - if pos == self.h_bkg.GetNbinsX(): self.mergeBins(pos) # merge pos and pos-1 else: self.mergeBins(pos+1) # merge pos and pos+1 pos = self.getZeroContentBin() # update a = self.h_bkg.GetNbinsX() print "Remove empty events of background by rebinning (from %d bins to %d bins)" % (b, a) - - b = self.h_sig.GetNbinsX() pos = self.getNegativeContentBin() while pos != -1: - if pos == self.h_sig.GetNbinsX(): self.mergeBins(pos) # merge pos and pos-1 else: self.mergeBins(pos+1) # merge pos and pos+1 pos = self.getNegativeContentBin() # update @@ -449,26 +450,52 @@ def preRebin(self): a = self.h_sig.GetNbinsX() print "Remove negative events of signal by rebinning (from %d bins to %d bins)" % (b, a) - def createMapping(self, h_bkg, h_sig): -# self.h_bkg = h_bkg -# self.h_sig = h_sig -# h_sig_copy = h_sig.Clone("orig") + def mergeCriteria(self, i): + + if self.h_bkg.GetBinContent(i) == 0 or self.h_bkg.GetBinError(i) / self.h_bkg.GetBinContent(i) > self.maxStat or self.h_sig.GetBinContent(i) <= 0 or self.h_sig.GetBinError(i) / self.h_sig.GetBinContent(i) > self.maxSigStat: return True + else: return False + # Recursive rebin function + def directionalRebin(self, direction = ""): + if direction == "": + + self.directionalRebin("right") + self.directionalRebin("left") + return + + if direction == "left" : r = range(1, self.h.GetNbinsX()) # do not include the last bin + if direction == "right" : r = reversed(range(2, self.h.GetNbinsX()+1)) # start from the right bin towards the left (do not include the zero!) + for i in r: + if self.mergeCriteria(i): + if direction == "left": + self.mergeBins(i+1) + self.directionalRebin(direction) + return + + else : + self.mergeBins(i) + self.directionalRebin(direction) + return + + return + + + def createMapping(self, h_bkg, h_sig): + + print h_bkg.GetEntries(), h_bkg.Integral() self.h_bkg = h_bkg self.h_sig = h_sig self.h_bkg.Scale(1.0/self.h_bkg.Integral()) self.h_sig.Scale(1.0/self.h_sig.Integral()) h_sig_copy = h_sig.Clone("orig") # needed for original HT/BDT binning - - self.binMin = float(self.h_bkg.GetBinLowEdge(1)) # min bin self.binMax = float(self.h_bkg.GetBinLowEdge(self.h_bkg.GetNbinsX()+1)) # max bin - self.preRebin() # this rebins both signal and background + self.directionalRebin() + #self.preRebin() # this rebins both signal and background likelihood = ROOT.TH1D("likelihood", "likelihood", self.lbins, 0, 1) # likelihood histogram - likelihood.Sumw2() for i in range(1, self.h_sig.GetNbinsX()+1): # map HT distributions to likelihood if self.h_sig.GetBinContent(i) == 0.0 and self.h_bkg.GetBinContent(i) == 0.0: continue # no interest in empty bins @@ -482,36 +509,57 @@ def createMapping(self, h_bkg, h_sig): ht = h_sig_copy.GetBinCenter(i) # get the current HT value b = self.h_sig.FindBin(ht) # this is the bin of the raw HT value after pre-rebinning - if self.h_sig.GetBinContent(b) == 0.0 and self.h_bkg.GetBinContent(b) == 0.0: mapping.append(1) # zero bins go to the zero likelihood else: x = self.h_sig.GetBinContent(b) / (self.h_sig.GetBinContent(b) + self.h_bkg.GetBinContent(b)) mapping.append(likelihood.FindBin(x)) + return mapping + def applyMapping(self, mapping, h): + #return self.applyMappingTrimmed(mapping, h) + hNew = ROOT.TH1D("", "", self.lbins, 0, 1) # likelihood histogram hNew.Sumw2() - for lb in range(1,self.lbins):hNew.SetBinError(lb,0); + for b in range(1, self.lbins+1): hNew.SetBinError(b, 0); for b in range(1, h.GetNbinsX()+1): x = int(h.GetBinCenter(b)) - lbin = mapping[b-1] # arrays start from zero, bins from 1 #print x, lbin -## if lbin == 101: lbin = 100 hNew.SetBinContent(lbin, hNew.GetBinContent(lbin) + h.GetBinContent(b)) hNew.SetBinError(lbin, math.sqrt(hNew.GetBinError(lbin)*hNew.GetBinError(lbin) + h.GetBinError(b)*h.GetBinError(b))) - + if abs(h.Integral()-hNew.Integral()) > 0.0001: + print "NOT EQUAL",before, after + sys.exit() hNew.SetName(h.GetName()) return hNew + def applyMappingTrimmed(self, mapping, h): + smapping = sorted(list(set(mapping))) # sorted list of unique mapping values + hNew = ROOT.TH1D("", "", len(smapping), 0, len(smapping)) # likelihood histogram + hNew.Sumw2() + for b in range(1, len(smapping)+1): hNew.SetBinError(b, 0); + for b in range(1, h.GetNbinsX()+1): + + x = int(h.GetBinCenter(b)) # return HT/BDT value + lbin = smapping.index(mapping[b-1])+1 # mapping[b-1] returns the likelihood bin number + #print "dddd",x, mapping[b-1], lbin + hNew.SetBinContent(lbin, hNew.GetBinContent(lbin) + h.GetBinContent(b)) + hNew.SetBinError(lbin, math.sqrt(hNew.GetBinError(lbin)*hNew.GetBinError(lbin) + h.GetBinError(b)*h.GetBinError(b))) + if abs(h.Integral()-hNew.Integral()) > 0.0001: + print "NOT EQUAL",before, after + sys.exit() + + hNew.SetName(h.GetName()) + return hNew def getNegativeContentBin(self): @@ -534,22 +582,17 @@ def getZeroContentBin(self): # function which merges bin i with the left adjecent bin - def mergeBins(self, i): + def mergeBins(self, i): arr = self.getBinArray() - ''' - ARR INDEX 0 1 2 3 4 5 6 + ARR INDEX 0 1 2 3 4 5 6 [0, 100, 500, 1000, 2000, 5000, 8000] - BIN NUMBER 1 2 3 4 5 6 + BIN NUMBER 1 2 3 4 5 6 ''' - - # i represents the bin number, so do i-1 - - # construct array of bins from the histo + # i represents the bin number, so do i-1 construct array of bins from the histo arr_new = [] for j in range(0, len(arr)): - if j == i-1: continue arr_new.append(arr[j]) @@ -560,10 +603,9 @@ def mergeBins(self, i): def getBinArray(self): - ret = [self.binMin] - for i in range(2, self.h_bkg.GetNbinsX()+1): + for i in range(2, self.h_bkg.GetNbinsX()+1): x = float(self.h_bkg.GetBinLowEdge(i)) ret.append(x) From e15f93e6ab4e703539a1d17ef90ac4191a75b252 Mon Sep 17 00:00:00 2001 From: maria Date: Wed, 18 Jul 2018 17:33:00 +0200 Subject: [PATCH 24/60] added 20% safety --- script/FwBinning.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/script/FwBinning.py b/script/FwBinning.py index 5b35a3c7..b25fc49c 100644 --- a/script/FwBinning.py +++ b/script/FwBinning.py @@ -463,8 +463,8 @@ def directionalRebin(self, direction = ""): self.directionalRebin("left") return - if direction == "left" : r = range(1, self.h.GetNbinsX()) # do not include the last bin - if direction == "right" : r = reversed(range(2, self.h.GetNbinsX()+1)) # start from the right bin towards the left (do not include the zero!) + if direction == "left" : r = range(1, self.h_bkg.GetNbinsX()) # do not include the last bin + if direction == "right" : r = reversed(range(2, self.h_bkg.GetNbinsX()+1)) # start from the right bin towards the left (do not include the zero!) for i in r: if self.mergeCriteria(i): if direction == "left": From ba2e0dd7375bddefecf127f89a8fd9beea8644ea Mon Sep 17 00:00:00 2001 From: maria Date: Fri, 20 Jul 2018 20:15:27 +0200 Subject: [PATCH 25/60] apply filters to MC as well --- src/MetFilters.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/MetFilters.cpp b/src/MetFilters.cpp index 02be6dcb..bda0491c 100644 --- a/src/MetFilters.cpp +++ b/src/MetFilters.cpp @@ -16,7 +16,7 @@ int MetFiltersAnalysis::analyze(Event *e,string systname) if (e->IsRealData()) Fill("MetFilters/CutFlow/CutFlow_Data",systname,0,1); // if (e->GetMet() . passFullRecommendation()) { - if (e->GetMet() . passFullRecommendation() and ( not e->IsRealData() or ( e->GetMet() . filterbadPFMuon and e->GetMet() . filterbadChHadrons)) ) { + if (e->GetMet() . passFullRecommendation() and ( e->GetMet() . filterbadPFMuon and e->GetMet() . filterbadChHadrons)) { if(VERBOSE>0)Log(__FUNCTION__,"INFO",Form("Event (%d,%d,%u) PASS met filters",e->runNum(),e->lumiNum(),e->eventNum())); if (e->IsRealData() ) Fill("MetFilters/CutFlow/CutFlow_Data",systname,1,1); return MET_EVENT_PASS; From 5bd58f8d4356da10501e01bb6e96cbdacb8b52c9 Mon Sep 17 00:00:00 2001 From: maria Date: Fri, 27 Jul 2018 15:49:13 +0200 Subject: [PATCH 26/60] JULY27 files --- script/bwsFullHadTB.py | 144 ++++++++++++++++++++++------------------- 1 file changed, 77 insertions(+), 67 deletions(-) diff --git a/script/bwsFullHadTB.py b/script/bwsFullHadTB.py index 9c55a3f2..d87c5e25 100644 --- a/script/bwsFullHadTB.py +++ b/script/bwsFullHadTB.py @@ -75,8 +75,15 @@ #parser.add_option("","--inputBin",type='string',help="Input ROOT file. [%default]", default="/afs/cern.ch/user/h/hum/work/public/CMSSW_8_0_26_patch1/src/ChargedHiggs/ntufile/post0systlimit_ALL.root") ### NEW TO BE USED -parser.add_option("","--input",type='string',help="Input ROOT file. [%default]", default="/afs/cern.ch/user/h/hum/work/public/CMSSW_8_0_26_patch1/src/ChargedHiggs/ntufile/preapp0syst.root") -parser.add_option("","--inputBin",type='string',help="Input ROOT file. [%default]", default="/afs/cern.ch/user/h/hum/work/public/CMSSW_8_0_26_patch1/src/ChargedHiggs/ntufile/preapp0syst.root") +#parser.add_option("","--input",type='string',help="Input ROOT file. [%default]", default="/afs/cern.ch/user/h/hum/work/public/CMSSW_8_0_26_patch1/src/ChargedHiggs/ntufile/preapp0syst.root") +#parser.add_option("","--inputBin",type='string',help="Input ROOT file. [%default]", default="/afs/cern.ch/user/h/hum/work/public/CMSSW_8_0_26_patch1/src/ChargedHiggs/ntufile/preapp0syst.root") + +parser.add_option("","--input",type='string',help="Input ROOT file. [%default]", default="/afs/cern.ch/user/h/hum/work/public/CMSSW_8_0_26_patch1/src/ChargedHiggs/ntufile/preapp2twothird.root") +parser.add_option("","--inputBin",type='string',help="Input ROOT file. [%default]", default="/afs/cern.ch/user/h/hum/work/public/CMSSW_8_0_26_patch1/src/ChargedHiggs/ntufile/preapp2onethird.root") + +## REMEMBER TO: +# a) change the rebin 20% to 50% Inf +# b) gaussian kernel ## fixed mass window for 400-500 + lowered the bjet PT 40->30 #parser.add_option("","--input",type='string',help="Input ROOT file. [%default]", default="/afs/cern.ch/user/h/hum/work/public/CMSSW_8_0_26_patch1/src/ChargedHiggs/ntufile/finaltry.root") @@ -224,7 +231,6 @@ def mergeCategory(tfile,toget): else: hTmp = tfile.Get(toget) - if hTmp!=None: hTmp.Rebin(nRebinHT) return hTmp @@ -363,13 +369,18 @@ def mergeCategory(tfile,toget): if "_one_lowj" in x and (y=="t1b") and "below" in reg: continue if "_three" in x and y=="t0b" and "below" in reg: continue +#2500,3000 if "_three_highj" in x and (y=="t0b") and "in" in reg missing ST + if opts.kMass=="3000": ## if "_two_highj" in x and y=="wbb": continue ## if "_three_lowj" in x and (y=="t0b") and "above" in reg: continue if "_three_lowj" in x and (y=="t1b") and "in" in reg: continue + if "_three_highj" in x and (y=="t0b") and "in" in reg: continue + if "_three_lowj" in x and (y=="t0b") and "in" in reg: continue if opts.kMass=="2500": if "_three_lowj" in x and (y=="t0b") and "in" in reg: continue + if "_three_highj" in x and (y=="t0b") and "in" in reg: continue ## below are for associated only # if not doSChannel and (opts.kMass=="500" or opts.kMass=="400") and "in" in reg or "below" in reg: @@ -491,10 +502,10 @@ def mergeCategory(tfile,toget): # if "OneBOneFat1l_three" in x and ( y=="wbb" or y=="t1b" or y=="t0b"): continue if "OneBOneFat1l" in x: - catStore [ name ] = { "name": name,"dir": x+ "_" + y,"file": None, "hasMC":["ttbar"],"var":"HT"+reg} + catStore [ name ] = { "name": name,"dir": x+ "_" + y,"file": None, "hasMC":["all"],"var":"HT"+reg} name = x+ "_" + y else: - catStore [ name ] = { "name": name,"dir": x+ "_" + y,"file": None, "hasMC":["ttbar"],"var":"HT_"+mas+reg} + catStore [ name ] = { "name": name,"dir": x+ "_" + y,"file": None, "hasMC":["all"],"var":"HT_"+mas+reg} catStore[name]['file'] = fIn @@ -502,12 +513,12 @@ def mergeCategory(tfile,toget): # catStore[name]["hasMC"]=["qcd","top","Hptb"] ### QCD uncorrelated - if ( y=="wbb" or y=="wbj") and "_one" in x: catStore[name]["hasMC"]=["qcd_wx_one","ttbar","Hptb","top","ewk"] - if ( y=="wbb" or y=="wbj") and "_two" in x: catStore[name]["hasMC"]=["qcd_wx_two","ttbar","Hptb","top","ewk"] - if ( y=="wbb" or y=="wbj") and "_three" in x: catStore[name]["hasMC"]=["qcd_wx_three","ttbar","Hptb","top","ewk"] - if ( y=="t0b" or y=="t1b") and "_one" in x: catStore[name]["hasMC"]=["qcd_tx_one","ttbar","Hptb","top","ewk"] - if ( y=="t0b" or y=="t1b") and "_two" in x: catStore[name]["hasMC"]=["qcd_tx_two","ttbar","Hptb","top","ewk"] - if ( y=="t0b" or y=="t1b") and "_three" in x: catStore[name]["hasMC"]=["qcd_tx_three","ttbar","Hptb","top","ewk"] + if ( y=="wbb" or y=="wbj") and "_one" in x: catStore[name]["hasMC"]=["qcd_wx_one","ttb","ttc","ttlight","Hptb","top","ewk"] + if ( y=="wbb" or y=="wbj") and "_two" in x: catStore[name]["hasMC"]=["qcd_wx_two","ttb","ttc","ttlight","Hptb","top","ewk"] + if ( y=="wbb" or y=="wbj") and "_three" in x: catStore[name]["hasMC"]=["qcd_wx_three","ttb","ttc","ttlight","Hptb","top","ewk"] + if ( y=="t0b" or y=="t1b") and "_one" in x: catStore[name]["hasMC"]=["qcd_tx_one","ttb","ttc","ttlight","Hptb","top","ewk"] + if ( y=="t0b" or y=="t1b") and "_two" in x: catStore[name]["hasMC"]=["qcd_tx_two","ttb","ttc","ttlight","Hptb","top","ewk"] + if ( y=="t0b" or y=="t1b") and "_three" in x: catStore[name]["hasMC"]=["qcd_tx_three","ttb","ttc","ttlight","Hptb","top","ewk"] if doSChannel: mcStore={ @@ -519,10 +530,11 @@ def mergeCategory(tfile,toget): "qcd_tx_one":{"name":"qcd_tx_one", "hist":["QCD_HT"], "num":4 }, "qcd_tx_two":{"name":"qcd_tx_two", "hist":["QCD_HT"], "num":5 }, "qcd_tx_three":{"name":"qcd_tx_three", "hist":["QCD_HT"], "num":6 }, - "ttbar":{ "name":"ttbar","hist":["TT_TuneCUETP8M2T4_13TeV-powheg-pythia8"],"num":7}, - "top":{ "name":"top","hist":["ST"],"num":8}, -# "ewk":{ "name":"ewk","hist":["WJets","ZJets","DYJets"],"num":9} - "ewk":{ "name":"ewk","hist":["WJets"],"num":9} + "ttb":{ "name":"ttb","hist":["ttb_TT_TuneCUETP8M2T4"],"num":7}, + "ttc":{ "name":"ttc","hist":["ttc_TT_TuneCUETP8M2T4"],"num":8}, + "ttlight":{ "name":"ttlight","hist":["ttlight_TT_TuneCUETP8M2T4"],"num":9}, + "top":{ "name":"top","hist":["ST","TTX"],"num":10}, + "ewk":{ "name":"ewk","hist":["ewk"],"num":11} } else: mcStore={ @@ -534,10 +546,11 @@ def mergeCategory(tfile,toget): "qcd_tx_one":{"name":"qcd_tx_one", "hist":["QCD_HT"], "num":4 }, "qcd_tx_two":{"name":"qcd_tx_two", "hist":["QCD_HT"], "num":5 }, "qcd_tx_three":{"name":"qcd_tx_three", "hist":["QCD_HT"], "num":6 }, - "ttbar":{ "name":"ttbar","hist":["TT_TuneCUETP8M2T4_13TeV-powheg-pythia8"],"num":7}, - "top":{ "name":"top","hist":["ST"],"num":8}, -# "ewk":{ "name":"ewk","hist":["WJets","ZJets","DYJets"],"num":9} - "ewk":{ "name":"ewk","hist":["WJets"],"num":9} + "ttb":{ "name":"ttb","hist":["ttb_TT_TuneCUETP8M2T4"],"num":7}, + "ttc":{ "name":"ttc","hist":["ttc_TT_TuneCUETP8M2T4"],"num":8}, + "ttlight":{ "name":"ttlight","hist":["ttlight_TT_TuneCUETP8M2T4"],"num":9}, + "top":{ "name":"top","hist":["ST","TTX"],"num":10}, + "ewk":{ "name":"ewk","hist":["ewk"],"num":11} } if doSyst: @@ -550,31 +563,31 @@ def mergeCategory(tfile,toget): ### trigger efficiency "CMS_eff_trigger":{"type":"lnN", "value":["1.05"] ,"proc":[".*"],"wsname":"CMS_eff_triggger","name":"XXX"}, ### Theory modeling - "CMS_topreweight":{"type":"shape", "wsname":"CMS_topreweight","name":"TOPRW","proc":["ttbar"]}, - "muRF_ttbar":{"type":"shape", "wsname":"muRF_ttbar","name":"Scale","proc":["ttbar"]}, + "CMS_topreweight":{"type":"shape", "wsname":"CMS_topreweight","name":"TOPRW","proc":["ttb","ttc","ttlight"]}, + "muRF_ttbar":{"type":"shape", "wsname":"muRF_ttbar","name":"Scale","proc":["ttb","ttc","ttlight"]}, "muRF_Hptb":{"type":"shape", "wsname":"muRF_Hptb","name":"Scale","proc":["Hptb"]}, ### MET-Jets-PU - "CMS_pileup":{"type":"shape", "wsname":"CMS_pileup","name":"PU","proc":["qcd_wx_one","qcd_wx_two","qcd_wx_three","qcd_tx_one","qcd_tx_two","qcd_tx_three","ttbar","top","Hptb"]}, - "CMS_scale_uncluster":{"type":"shape", "wsname":"CMS_scale_uncluster","name":"UNCLUSTER","proc":["qcd_wx_one","qcd_wx_two","qcd_wx_three","qcd_tx_one","qcd_tx_two","qcd_tx_three","ttbar","top","Hptb"]}, - "CMS_scale_SDMass":{"type":"shape", "wsname":"CMS_scale_SDMass","name":"SDMassSCALE","proc":["qcd_wx_one","qcd_wx_two","qcd_wx_three","qcd_tx_one","qcd_tx_two","qcd_tx_three","ttbar","top","Hptb"]}, - "CMS_eff_Tau21":{"type":"lnN", "value":["1.08","1.08"] ,"proc":["ttbar","Hptb"],"wsname":"CMS_eff_Tau21","name":"XXX"}, ## name used for shape - "CMS_eff_Tau32":{"type":"lnN", "value":["1.02","1.02"] ,"proc":["ttbar","Hptb"],"wsname":"CMS_eff_Tau32","name":"XXX"}, ## name used for shape -# "CMS_res_j":{"type":"shape", "wsname":"CMS_res_j","name":"JER","proc":[".*"]}, + "CMS_pileup":{"type":"shape", "wsname":"CMS_pileup","name":"PU","proc":["qcd_wx_one","qcd_wx_two","qcd_wx_three","qcd_tx_one","qcd_tx_two","qcd_tx_three","ttb","ttc","ttlight","top","Hptb"]}, + "CMS_scale_uncluster":{"type":"shape", "wsname":"CMS_scale_uncluster","name":"UNCLUSTER","proc":["qcd_wx_one","qcd_wx_two","qcd_wx_three","qcd_tx_one","qcd_tx_two","qcd_tx_three","ttb","ttc","ttlight","top","Hptb"]}, + "CMS_scale_SDMass":{"type":"shape", "wsname":"CMS_scale_SDMass","name":"SDMassSCALE","proc":["qcd_wx_one","qcd_wx_two","qcd_wx_three","qcd_tx_one","qcd_tx_two","qcd_tx_three","ttb","ttc","ttlight","top","Hptb"]}, + "CMS_eff_Tau21":{"type":"lnN", "value":["1.08","1.08","1.08","1.08"] ,"proc":["ttb","ttc","ttlight","Hptb"],"wsname":"CMS_eff_Tau21","name":"XXX"}, ## name used for shape + "CMS_eff_Tau32":{"type":"lnN", "value":["1.02","1.02","1.02","1.02"] ,"proc":["ttb","ttc","ttlight","Hptb"],"wsname":"CMS_eff_Tau32","name":"XXX"}, ## name used for shape + "CMS_res_j":{"type":"shape", "wsname":"CMS_res_j","name":"JER","proc":[".*"]}, "CMS_scale_j_qcd":{"type":"shape", "wsname":"CMS_scale_j_qcd","name":"JESANDCSV","proc":["qcd_wx_one","qcd_wx_two","qcd_wx_three","qcd_tx_one","qcd_tx_two","qcd_tx_three"]}, - "CMS_scale_j":{"type":"shape", "wsname":"CMS_scale_j","name":"JESANDCSV","proc":["Hptb","ttbar","top","ewk"]}, + "CMS_scale_j":{"type":"shape", "wsname":"CMS_scale_j","name":"JESANDCSV","proc":["Hptb","ttb","ttc","ttlight","top"]}, ##Light jets Heavy flavor contamination "CMS_btag_HF_qcd":{"type":"shape", "wsname":"CMS_btag_HF_qcd","name":"CSVRHF","proc":["qcd_wx_one","qcd_wx_two","qcd_wx_three","qcd_tx_one","qcd_tx_two","qcd_tx_three"]}, - "CMS_btag_HF":{"type":"shape", "wsname":"CMS_btag_HF","name":"CSVRHF","proc":["ttbar","top","Hptb"]}, + "CMS_btag_HF":{"type":"shape", "wsname":"CMS_btag_HF","name":"CSVRHF","proc":["ttb","ttc","ttlight","top","Hptb"]}, ##Heavy jets light flavor contamination - "CMS_btag_LF":{"type":"shape", "wsname":"CMS_btag_LF","name":"CSVRLF","proc":["qcd_wx_one","qcd_wx_two","qcd_wx_three","qcd_tx_one","qcd_tx_two","qcd_tx_three","Hptb","ttbar","top"]}, + "CMS_btag_LF":{"type":"shape", "wsname":"CMS_btag_LF","name":"CSVRLF","proc":["qcd_wx_one","qcd_wx_two","qcd_wx_three","qcd_tx_one","qcd_tx_two","qcd_tx_three","Hptb","ttb","ttc","ttlight","top"]}, ##Linear and quadratic uncertainties # note decouple the qcd - "CMS_btag_HFstat1":{"type":"shape", "wsname":"CMS_btag_HFstat1","name":"CSVRHFSTAT1","proc":[".*"]}, - "CMS_btag_HFstat2":{"type":"shape", "wsname":"CMS_btag_HFstat2","name":"CSVRHFSTAT2","proc":[".*"]}, - "CMS_btag_LFstat1":{"type":"shape", "wsname":"CMS_btag_LFstat1","name":"CSVRLFSTAT1","proc":[".*"]}, - "CMS_btag_LFstat2":{"type":"shape", "wsname":"CMS_btag_LFstat2","name":"CSVRLFSTAT2","proc":[".*"]}, - "CMS_btag_CFerr1":{"type":"shape", "wsname":"CMS_btag_CFerr1","name":"CSVRCERR1","proc":[".*"]}, - "CMS_btag_CFerr2":{"type":"shape", "wsname":"CMS_btag_CFerr2","name":"CSVRCERR2","proc":[".*"]} + "CMS_btag_HFstat1":{"type":"shape", "wsname":"CMS_btag_HFstat1","name":"CSVRHFSTAT1","proc":["ttb","ttc","ttlight","top","Hptb","top"]}, + "CMS_btag_HFstat2":{"type":"shape", "wsname":"CMS_btag_HFstat2","name":"CSVRHFSTAT2","proc":["ttb","ttc","ttlight","top","Hptb","top"]}, + "CMS_btag_LFstat1":{"type":"shape", "wsname":"CMS_btag_LFstat1","name":"CSVRLFSTAT1","proc":["ttb","ttc","ttlight","top","Hptb","top"]}, + "CMS_btag_LFstat2":{"type":"shape", "wsname":"CMS_btag_LFstat2","name":"CSVRLFSTAT2","proc":["ttb","ttc","ttlight","top","Hptb","top"]}, + "CMS_btag_CFerr1":{"type":"shape", "wsname":"CMS_btag_CFerr1","name":"CSVRCERR1","proc":["ttb","ttc","ttlight","top","Hptb","top"]}, + "CMS_btag_CFerr2":{"type":"shape", "wsname":"CMS_btag_CFerr2","name":"CSVRCERR2","proc":["ttb","ttc","ttlight","top","Hptb","top"]} #### } else: @@ -587,11 +600,11 @@ def mergeCategory(tfile,toget): print "* ",cat,":",catStore[cat] print "---------------------- --------" -fileTmp="MIAO_JUNE22/"+label+VarTest+opts.kMass+"_"+opts.output +fileTmp="MIAO_JULY27/"+label+VarTest+opts.kMass+"_"+opts.output w = ROOT.RooWorkspace("w","w") datNameTmp = opts.datCardName -datName = "MIAO_JUNE22/"+label+ VarTest+opts.kMass+"_" + datNameTmp +datName = "MIAO_JULY27/"+label+ VarTest+opts.kMass+"_" + datNameTmp datacard=open(datName,"w") datacard.write("-------------------------------------\n") @@ -735,19 +748,17 @@ def writeNormSystLU(name="lumi",valueL=["1.027","1.026"], regexpL=["TT","ST",""] datacard.write("\t-") datacard.write("\n") + def writeNormSyst(name="lumi",valueL=["1.027","1.026"], regexpL=["TT","ST",""],regexpCat=[]): datacard.write(name+"\tlnN") invert=False for cat in catStore: - print cat for proc in mcStore: - print proc if skip(catStore[cat],mcStore[proc]): continue idx=-1 invert=False for i,regexp in enumerate(regexpL): - print 'regexp',regexp,' proc',proc match=re.search(regexp,proc) if regexp != "" and regexp[0] == '!': invert=True @@ -758,7 +769,6 @@ def writeNormSyst(name="lumi",valueL=["1.027","1.026"], regexpL=["TT","ST",""],r idx2=-1 invert=False for i,regexp in enumerate(regexpCat): - print 'regexp',regexp,' proc',cat match=re.search(regexp,cat) if regexp != "" and regexp[0] == '!': invert=True @@ -767,10 +777,7 @@ def writeNormSyst(name="lumi",valueL=["1.027","1.026"], regexpL=["TT","ST",""],r idx2=i break - print cat, proc if (idx>=0 and (idx2>=0 or len(regexpCat)==0 )): - print 'idx',idx,' valueL[idx]=' ,valueL - print 'idx2',idx2, ' valueL[idx]=',valueL datacard.write("\t"+valueL[idx]) else: datacard.write("\t-") @@ -875,9 +882,9 @@ def importStat(): else: writeSystShape(systStore[syst],systStore[syst]["proc"]) -if doSyst: writeNormSyst("QCDscale_ttbar",["0.965/1.024"],["ttbar"]) -if doSyst: writeNormSyst("pdf_gg",["1.042"],["ttbar"]) -if doSyst: writeNormSyst("CMS_mass_top",["1.027"],["ttbar"]) +if doSyst: writeNormSyst("QCDscale_ttbar",["0.965/1.024","0.965/1.024","0.965/1.024"],["ttb","ttc","ttlight"]) +if doSyst: writeNormSyst("pdf_gg",["1.042","1.042","1.042"],["ttb","ttc","ttlight"]) +if doSyst: writeNormSyst("CMS_mass_top",["1.027","1.027","1.027"],["ttb","ttc","ttlight"]) ## "top" get the value od the single top if doSyst: writeNormSyst("QCDscale_top",["0.977/1.028"],["top"]) @@ -969,18 +976,23 @@ def SmoothAndMergeSyst(tfile,togetNom,togetSyst,s): c= hTmpUp.SetBinError(iBin,0) c= hTmpDown.SetBinError(iBin,0) - if LikeBins==1: + if LikeBins==1 or LikeBins==2: hUp = hTmpUp hDown = hTmpDown else: - if ('CSV' in togetSyst and not "CSVRHF" in togetSyst) or "PU" in togetSyst or "JER" in togetSyst or "SDMassScale" in togetSyst: - hUp, hDown = SS.SystematicSmoother(hTmpNom, hTmpUp, hTmpDown,"~/www/forMIAO/JUNE14/SYST").smooth() - else: - hUp = hTmpUp - hDown = hTmpDown +# if ('CSV' in togetSyst and not "CSVRHF" in togetSyst) or "PU" in togetSyst or "JER" in togetSyst or "SDMassScale" in togetSyst: +# # return hTmpNom +# hUp, hDown = SS.SystematicSmoother(hTmpNom, hTmpUp, hTmpDown,"~/www/forMIAO/JUNE14/SYST").smooth() +# else: +# hUp = hTmpUp +# hDown = hTmpDown + + hUp, hDown = SS.SystematicSmoother(hTmpNom, hTmpUp, hTmpDown,"~/www/forMIAO/JUNE14/SYST").smooth() + hUp = hTmpUp + hDown = hTmpDown if 'Up' in s: return hUp @@ -994,8 +1006,6 @@ def envelop(tfile,togetClone, s) : hname=togetClone+'RF'+s hTmp=mergeCategory(tfile,hname) -# if hTmp!=None: hTmp.Rebin(nRebinHT) - h=hTmp.Clone() if hTmp==None: return @@ -1007,8 +1017,6 @@ def envelop(tfile,togetClone, s) : hTmp=mergeCategory(tfile,hnameClone) -# if hTmp!=None: hTmp.Rebin(nRebinHT) - for iBin in range(1,h.GetNbinsX()+1): c= h.GetBinContent(iBin) @@ -1130,7 +1138,7 @@ def importPdfFromTH1(cat,mc,myBin,LikelihoodMapping,syst=None): toget += "_" + syst["name"] + s if syst != None and "muRF" in syst["wsname"] and not doSChannel: - if mc["name"]=="Hptb" or mc["name"]=="ttbar": + if mc["name"]=="Hptb" or mc["name"]=="ttb" or mc["name"]=="ttc" or mc["name"]=="ttlight": hTmp = envelop(tfile,togetSyst,s) # toget = togetClone+'RF'+s @@ -1142,23 +1150,25 @@ def importPdfFromTH1(cat,mc,myBin,LikelihoodMapping,syst=None): else: hTmp = mergeCategory(tfile,togetNom) -## if hTmp!=None: hTmp.Rebin(nRebinHT) if hTmp!=None: print "<*> Reading Hist '"+toget+"'",hTmp.Integral() if hTmp == None: print "<*> Hist '"+toget+"' doesn't exist" raise IOError - ## foor QCD we do not apply the tauVeto and trigger - if "qcd" in mc["name"] and hTmp: - hTmp.Scale(0.93) + if ( mc["name"]=="ttb" or mc["name"]=="ttc" or mc["name"]=="ttlight" or "qcd" in mc["name"] ) and hTmp: + hTmp.Scale(1.50) + +# ## foor QCD we do not apply the tauVeto and trigger +# if "qcd" in mc["name"] and hTmp: +# hTmp.Scale(0.93) ## top and W scale factor (for now only in ttbar later also signal) ## https://twiki.cern.ch/twiki/bin/view/CMS/JetTopTagging#13_TeV_working_points_CMSSW_8_0 ## https://twiki.cern.ch/twiki/bin/view/CMS/JetWtagging - if ( mc["name"]=="ttbar" or mc["name"]=="top") and ("t0b" in toget or "t1b" in toget) and hTmp: + if ( mc["name"]=="ttb" or mc["name"]=="ttc" or mc["name"]=="ttlight" or mc["name"]=="top") and ("t0b" in toget or "t1b" in toget) and hTmp: hTmp.Scale(1.06) # uncertainties +0.08 -0.04 - if ( mc["name"]=="ttbar" or mc["name"]=="top") and ("wbb" in toget or "wbj" in toget) and hTmp: + if ( mc["name"]=="ttb" or mc["name"]=="ttc" or mc["name"]=="ttlight" or mc["name"]=="top") and ("wbb" in toget or "wbj" in toget) and hTmp: hTmp.Scale(1.11) ## need to have an uncetainty of 0.08 @@ -1232,7 +1242,7 @@ def importPdfFromTH1(cat,mc,myBin,LikelihoodMapping,syst=None): else: statStore[histName]["hist"] . Add (h ) ## ::: FIXME ::: TEMPORARY: the top is not laways the MAIN BKG - if mc["name"] == 'qcd': ## put TT and reference + if 'qcd' in mc["name"]: ## put TT and reference statStore[histName]["mc"]= mc["name"] statStore[histName]["target"]= target statStore[histName]["hist0"] . Delete() @@ -1339,7 +1349,7 @@ def importPdfFromTH1SumBKG(cat,mc,syst=None,do1Third=False): # print 'going to add = ',hTmp.GetName() hSum.Add(hTmp) - if mc["name"]=="ttbar" and hTmp!=None: hRef=hTmp.Clone() + if mc["name"]=="ttlight" and hTmp!=None: hRef=hTmp.Clone() if mc["name"]=="Hptb" and hTmp!= None: hSig=hTmp.Clone() From 925f62bac44523d5eebf6d0cf61b69e68b0e285e Mon Sep 17 00:00:00 2001 From: maria Date: Sun, 29 Jul 2018 15:57:38 +0200 Subject: [PATCH 27/60] updated signal normalization with the non-ext samples --- aux/mcdb.2017.v23.txt | 31 ++++++++++++++++--------------- 1 file changed, 16 insertions(+), 15 deletions(-) diff --git a/aux/mcdb.2017.v23.txt b/aux/mcdb.2017.v23.txt index fa5ad4c1..f3f7190f 100644 --- a/aux/mcdb.2017.v23.txt +++ b/aux/mcdb.2017.v23.txt @@ -1,45 +1,45 @@ ### TB -ChargedHiggs_HplusTB_HplusToTB_M-180_13TeV_amcatnlo_pythia8 /store/group/phys_higgs/HiggsExo/jaeyserm/80x_MC_v2/v2.3/ChargedHiggs_HplusTB_HplusToTB_M-180_13TeV_amcatnlo_pythia8/ChargedHiggs_HplusTB_HplusToTB_M-180_13TeV_amcatnlo_pythia8-ext 5383010.94055 1 SCALES 1.02085217422 0.975350459299 1.11763569141 1.14940178553 0.897344250305 0.884477248555 PDFS 0.984191440516 0.980411164697 0.999804325743 1.02271617339 0.994490385861 0.981507748229 1.00367026926 0.982794618475 1.00510249688 1.01869786765 1.04138487542 0.991014692679 0.980884515976 1.00741703043 0.973758568081 0.986271820193 0.951269609797 0.970127192468 1.00049611826 0.977409253592 1.01453971394 1.03648568758 0.983269013406 1.03351307731 1.0001278542 1.0123999162 0.962629564824 0.984099973435 0.971698680363 0.995595779307 1.02148186093 1.04163793647 1.01550801032 1.03929780246 1.00080502527 0.99719709603 0.969392159805 1.00122959805 1.01510047151 1.01432714938 1.01256905878 1.00695821329 1.03017556955 1.00906293231 1.02177941049 1.02481172702 0.984744375138 0.987941284121 0.983945914624 1.00222207906 1.00862473817 1.00764923468 1.01074279852 0.989455283625 1.01490505346 0.976394182299 0.989138660259 1.00482341645 0.980857752676 1.0087160729 1.00159633932 0.999546335616 1.01065523646 0.972500321732 1.0463923608 1.00987219175 0.961859871892 1.02209364113 1.019617649 0.997042096266 1.02734384993 1.00314843766 1.01597915934 0.991177979239 0.993025806667 1.04892092948 1.02627765302 0.986223787748 1.00364366988 1.00629952775 1.03396806828 1.01548820646 0.966444760596 1.00016912251 0.988110532012 0.98855523584 1.00009567253 0.990704782813 0.967980782476 1.00836086857 0.999287804638 1.01234684546 0.978859693269 0.999571042887 0.958366263554 1.01822343338 0.995941545267 1.02665877745 0.973410863931 0.95829002898 +ChargedHiggs_HplusTB_HplusToTB_M-180_13TeV_amcatnlo_pythia8 /store/group/phys_higgs/HiggsExo/jaeyserm/80x_MC_v2/v2.3/ChargedHiggs_HplusTB_HplusToTB_M-180_13TeV_amcatnlo_pythia8 6226386.18048 1 SCALES 1.02076568648 0.975441768387 1.1175678705 1.14925151464 0.897422387931 0.884660390571 PDFS 0.984197121166 0.980382924045 0.999830651913 1.02268791895 0.994443203052 0.981489056961 1.00362447849 0.982864941862 1.00503187791 1.01871570518 1.04141685545 0.991027014597 0.980866089477 1.00741193155 0.973732998817 0.986254923299 0.951209931317 0.970090034449 1.0005130389 0.977418658308 1.01454370429 1.03648429214 0.983285037318 1.03359451318 1.00007768214 1.01239863467 0.962597046188 0.984048623192 0.971726545591 0.995676515021 1.02149785821 1.04156244574 1.01546549764 1.03933706092 1.00078263025 0.997173075595 0.969374217362 1.00123995405 1.01521079961 1.01437594718 1.01259070394 1.00700869568 1.03025441095 1.00914415694 1.02188449272 1.02493159399 0.984743058373 0.987913753675 0.983940195905 1.00224343879 1.00868502746 1.00762953443 1.01076247361 0.989440169285 1.01490492087 0.976376760608 0.989080376343 1.00486297758 0.980859696086 1.00873720077 1.00160476144 0.999618291645 1.01059210712 0.972505828521 1.04638827753 1.00987082311 0.961864742427 1.02210140046 1.0195637201 0.997054367955 1.02735830598 1.00312802567 1.01590959221 0.991143952812 0.99297582905 1.04898083743 1.02628197093 0.98622836764 1.00371631542 1.00631193806 1.03397042679 1.01542192872 0.966462445587 1.00013968009 0.98805609836 0.988530527633 1.00008243703 0.99065706037 0.967982058987 1.00834106347 0.999254136249 1.01234233388 0.978808770766 0.999748783935 0.958288202026 1.01819938887 0.995970252543 1.0266484279 0.973408857927 0.958233845259 -ChargedHiggs_HplusTB_HplusToTB_M-200_13TeV_amcatnlo_pythia8 /store/group/phys_higgs/HiggsExo/jaeyserm/80x_MC_v2/v2.3/ChargedHiggs_HplusTB_HplusToTB_M-200_13TeV_amcatnlo_pythia8/ChargedHiggs_HplusTB_HplusToTB_M-200_13TeV_amcatnlo_pythia8-ext 4896898.92524 1 SCALES 1.02295627705 0.973323137014 1.11929212308 1.15364151666 0.895168855135 0.880741441175 PDFS 0.983095818415 0.979050022263 0.999676444773 1.02342795693 0.993840310595 0.9806033811 1.00421598544 0.98229566915 1.00519824362 1.01820529029 1.04132901667 0.991449303656 0.980315701448 1.00585879123 0.972552372227 0.986391911298 0.947686253259 0.968077195842 1.00119971743 0.977963827759 1.01598305103 1.03826155807 0.985732328893 1.03590328904 1.00012839237 1.0129154352 0.959495798909 0.98242721246 0.970025777756 0.997148449084 1.02283879472 1.04216524635 1.01645763653 1.04242838086 1.00049439716 0.997948790662 0.968134146443 1.00160347637 1.0159035729 1.01544263076 1.01387924857 1.00761815681 1.03261142768 1.00935614825 1.02431441168 1.02789190867 0.982836281474 0.986522090075 0.98322530971 1.00228623925 1.00907292887 1.00756813128 1.01242253214 0.988827098929 1.01542244426 0.973922013409 0.989912728648 1.00419591926 0.980596100927 1.00962469495 1.00242251692 1.00022042429 1.0112808066 0.969581620735 1.04796806631 1.01036931369 0.962448046306 1.02234926392 1.01867565701 0.996184204185 1.02956061206 1.00307224825 1.01454866721 0.990881126798 0.991949329011 1.05046437935 1.02773485098 0.986653152277 1.00407518263 1.0072445902 1.03552773866 1.01560608629 0.965372840032 1.00042574279 0.986168561365 0.987334037172 0.999405586515 0.989626640537 0.967489691622 1.00825041178 0.998466549287 1.01392293626 0.977367755625 1.00153177971 0.954661053851 1.0191249984 0.996207577593 1.0293716383 0.972974417917 0.955489850715 +ChargedHiggs_HplusTB_HplusToTB_M-200_13TeV_amcatnlo_pythia8 /store/group/phys_higgs/HiggsExo/jaeyserm/80x_MC_v2/v2.3/ChargedHiggs_HplusTB_HplusToTB_M-200_13TeV_amcatnlo_pythia8 5645075.38739 1 SCALES 1.02299132621 0.973290135835 1.11944625446 1.15382506913 0.894996920736 0.880521976944 PDFS 0.983080475912 0.978997392497 0.999696544909 1.02339514193 0.993779653474 0.980593902749 1.00418644884 0.982276063804 1.00513670412 1.01821062374 1.04144161127 0.991437405105 0.980305171212 1.00584316252 0.972501244431 0.986420843393 0.947646897306 0.967999630696 1.00124489411 0.978019001158 1.0160262969 1.03831224329 0.98574102663 1.03601159002 1.0001126755 1.01289636063 0.959453644608 0.982385817498 0.97005157137 0.997226387733 1.02286546189 1.04209229627 1.01645157363 1.04252656399 1.00046182447 0.997923137693 0.968119954158 1.00166370283 1.01593610765 1.01549218639 1.01391525148 1.00765974173 1.03273562354 1.0094551164 1.02438308501 1.02803554378 0.982795314194 0.9864980468 0.983192930602 1.00232181491 1.00913994276 1.00750795434 1.01246694884 0.988815114193 1.01545032459 0.973889739333 0.989867147214 1.00424430052 0.980605948025 1.00966139492 1.0024880176 1.00023863589 1.01124327021 0.969566828656 1.04794045006 1.01039426188 0.96244899942 1.02236362345 1.01860181494 0.99618509267 1.02958104796 1.00304235086 1.01445565236 0.990821351527 0.991884953445 1.05054584597 1.0277564482 0.986677268717 1.00413519555 1.00725214844 1.03553467643 1.0155449413 0.965375864784 1.00042477819 0.986085178958 0.987325379404 0.99934771959 0.989586605513 0.967481038723 1.00820237058 0.998423239936 1.01392957648 0.977317525593 1.00173621823 0.95455563877 1.01911950285 0.996108609052 1.02936528475 0.972966082065 0.955436356622 ###ChargedHiggs_HplusTB_HplusToTB_M-200_13TeV_amcatnlo_pythia8 /store/group/phys_higgs/HiggsExo/jaeyserm/80x_MC_v2/v2.3/ChargedHiggs_HplusTB_HplusToTB_M-200_13TeV_amcatnlo_pythia8/ChargedHiggs_HplusTB_HplusToTB_M-200_13TeV_amcatnlo_pythia8/171006_163527/0000 748176.462146 1 SCALES 1.02322078627 0.973074194662 1.12045611072 1.15502788435 0.893873219555 0.879088255131 PDFS 0.982980069327 0.978653064437 0.999828122513 1.02318041601 0.993382828558 0.980531870402 1.00399317139 0.982147763934 1.00473410713 1.01824553313 1.04217915722 0.991359534805 0.980236255225 1.00574088281 0.972166739955 0.986610249119 0.94738938887 0.967492264851 1.00154068122 0.978380271022 1.01630943689 1.03864410597 0.985797958084 1.03672099163 1.00000981901 1.01277153316 0.959177831408 0.982114968939 0.970220427346 0.997736805925 1.02304003584 1.04161508183 1.01641189309 1.04316964057 1.00024868488 0.997755268694 0.968027074333 1.00205807063 1.01614910269 1.01581665298 1.01415095771 1.0079320045 1.03354923764 1.01010335359 1.0248327871 1.02897664383 0.982527263052 0.986340709796 0.982981058354 1.00255472398 1.00957877607 1.00711426693 1.01275775735 0.988736679927 1.0156328423 0.973678554682 0.98956891523 1.00456107642 0.98067040327 1.00990166624 1.00291693836 1.00035784925 1.01099765912 0.969470023987 1.04775973457 1.01055758105 0.962455237705 1.02245761815 1.01811877456 0.996190907943 1.02971482327 1.00284671313 1.0138472806 0.990430293675 0.991463814366 1.05107936634 1.02789782687 0.986835142637 1.00452816401 1.00730162077 1.03558008723 1.01514492221 0.965395662593 1.00041846485 0.985539779709 0.98726871709 0.998969139471 0.989324651746 0.967424408355 1.00788804852 0.998139868123 1.01397303962 0.976988891831 1.0030763549 0.953866259645 1.0190835353 0.99546133407 1.02932370194 0.9729115265 0.955086379624 -ChargedHiggs_HplusTB_HplusToTB_M-220_13TeV_amcatnlo_pythia8 /store/group/phys_higgs/HiggsExo/jaeyserm/80x_MC_v2/v2.3/ChargedHiggs_HplusTB_HplusToTB_M-220_13TeV_amcatnlo_pythia8/ChargedHiggs_HplusTB_HplusToTB_M-220_13TeV_amcatnlo_pythia8-ext 3086297.76564 1 SCALES 1.02477535324 0.971530062994 1.12027338222 1.15678909949 0.89381785113 0.877922791049 PDFS 0.982419991188 0.978011032092 0.999700481608 1.02406537066 0.993270068908 0.980169770239 1.00500045529 0.981416160129 1.00528879148 1.01748815065 1.04100431495 0.991736561022 0.980227427574 1.00452423836 0.971891110631 0.986146984853 0.94470812993 0.966608670106 1.00210341432 0.978112123569 1.01714810888 1.03925627134 0.988245322911 1.0378375176 1.00021966084 1.01336837689 0.957157072208 0.981114598985 0.968731179073 0.998147027838 1.02369785827 1.04238253902 1.01740101803 1.04470581046 1.00039259587 0.998828354834 0.967222079199 1.00215250554 1.01580650498 1.01642098735 1.01497581725 1.00791111033 1.03418500585 1.00960317425 1.02550705437 1.02965379049 0.981371420074 0.985582689137 0.982580197469 1.00204256227 1.00923023766 1.00742713453 1.01393798444 0.988336082749 1.01583800351 0.971814527603 0.990843991286 1.00374982421 0.9806651544 1.00975021678 1.00313620146 1.00059826309 1.01178477214 0.967325001111 1.04926274514 1.01092115798 0.963406195104 1.02253574634 1.01807328903 0.995332067091 1.031655098 1.00307722501 1.01305887861 0.990748449119 0.991489082403 1.05154177172 1.02911057936 0.987314074599 1.00404535512 1.0075972939 1.03691001023 1.01585252384 0.964434509556 1.00050087939 0.984740485274 0.986376756134 0.998637552683 0.988935037962 0.967191331393 1.00821507129 0.99780715078 1.01544489393 0.976422158583 1.00209405774 0.95191883749 1.02022374589 0.996214086253 1.03217305874 0.972757681858 0.95358934538 +ChargedHiggs_HplusTB_HplusToTB_M-220_13TeV_amcatnlo_pythia8 /store/group/phys_higgs/HiggsExo/jaeyserm/80x_MC_v2/v2.3/ChargedHiggs_HplusTB_HplusToTB_M-220_13TeV_amcatnlo_pythia8 3591262.80889 1 SCALES 1.02473309979 0.971576424903 1.12021737533 1.15669297211 0.893881749762 0.878040942048 PDFS 0.982394295381 0.977997321873 0.999698990951 1.02404146018 0.993221310047 0.980169012752 1.00494860589 0.981511813056 1.0052705877 1.01749047881 1.04106220483 0.99172504405 0.980226444555 1.00453577285 0.971881855346 0.986194058452 0.944763856158 0.966598605774 1.0021022428 0.978058708117 1.01712290213 1.03927344937 0.988195594955 1.03781860321 1.00023064678 1.01333595486 0.957189248424 0.981115417384 0.968741593917 0.998147811755 1.023673904 1.04233149696 1.01735846745 1.04466517483 1.00037833312 0.998779923246 0.967235634783 1.00213330416 1.01590128384 1.01644356941 1.0149566328 1.00797675684 1.03420126103 1.00962945593 1.02554078995 1.0297205371 0.981396421684 0.985585428002 0.98262302378 1.00206008595 1.00927023955 1.00740681399 1.01391656312 0.988368810968 1.01583981296 0.971813502166 0.990796450892 1.00379754891 0.980672096539 1.00982039481 1.00312378954 1.00064367236 1.01176579113 0.967361631349 1.04926599216 1.01090177862 0.963364265003 1.02252032435 1.0180731294 0.995355235576 1.03159727463 1.00306483327 1.0130448548 0.990739638401 0.991428701596 1.05154334977 1.02910393751 0.987312525214 1.00409560333 1.00758250652 1.03686668952 1.01579479962 0.964442614848 1.00050589654 0.984743355485 0.986384312893 0.998623154386 0.988949933109 0.967186567824 1.008201539 0.997782085538 1.01539808738 0.976405667905 1.00218351788 0.951937973717 1.02018613372 0.996250766578 1.03210849998 0.972754447437 0.953601263727 #ChargedHiggs_HplusTB_HplusToTB_M-220_13TeV_amcatnlo_pythia8 /store/group/phys_higgs/HiggsExo/jaeyserm/80x_MC_v2/v2.3/ChargedHiggs_HplusTB_HplusToTB_M-220_13TeV_amcatnlo_pythia8/ChargedHiggs_HplusTB_HplusToTB_M-220_13TeV_amcatnlo_pythia8/171009_230116/0000 504965.043252 1 SCALES 1.02447492646 0.971859880624 1.11987518824 1.15610579787 0.894272490702 0.878763761321 PDFS 0.98223727429 0.977913534688 0.999689880294 1.02389534583 0.992923404584 0.980164383091 1.00463182361 0.98209684002 1.00515934228 1.01750470855 1.04141616218 0.991654659235 0.980220436475 1.00460627632 0.971825291767 0.98648186546 0.945104592433 0.966537098097 1.00209508267 0.97773236477 1.01696886805 1.03937845215 0.987891771204 1.03770301531 1.00029779702 1.01313783962 0.957385953386 0.981120419391 0.968805253309 0.998152603006 1.02352752217 1.04201964135 1.01709847977 1.04441688244 1.00029116943 0.998484016086 0.967318493467 1.00201596316 1.01648094773 1.01658161061 1.01483939503 1.0083781679 1.03430062219 1.00979011677 1.02574702685 1.0301286741 0.981549256808 0.985602168008 0.982884855228 1.00216720233 1.00951479619 1.00728263465 1.01378565772 0.988568889816 1.01585087224 0.971807234843 0.990505987699 1.00408933632 0.980714528356 1.01024952827 1.00304793579 1.00092129904 1.01164979648 0.967585572147 1.04928583809 1.01078334996 0.963108071563 1.02242607673 1.01807215378 0.99549686257 1.03124400455 1.00298910279 1.01295915105 0.990685791543 0.991059819688 1.05155299477 1.029063345 0.987303055628 1.00440282489 1.0074921369 1.03660199622 1.01544213723 0.964492156571 1.000536562 0.9847608983 0.986430501596 0.9985351624 0.989040980569 0.967157454369 1.00811883882 0.997628916554 1.015112104 0.976304890568 1.00273063699 0.952054949219 1.01995631203 0.996475011911 1.03171409844 0.972734679438 0.95367411399 -ChargedHiggs_HplusTB_HplusToTB_M-250_13TeV_amcatnlo_pythia8 /store/group/phys_higgs/HiggsExo/jaeyserm/80x_MC_v2/v2.3/ChargedHiggs_HplusTB_HplusToTB_M-250_13TeV_amcatnlo_pythia8/ChargedHiggs_HplusTB_HplusToTB_M-250_13TeV_amcatnlo_pythia8-ext 1235881.79842 1 SCALES 1.02677967124 0.96955818887 1.11971928829 1.15872811177 0.894063567668 0.876749594637 PDFS 0.981468806672 0.976656418223 0.99950365559 1.02486289208 0.992284261058 0.97960964505 1.00581076754 0.980263821189 1.00560227896 1.01638759248 1.04035002428 0.992645748555 0.979921538743 1.00250754556 0.970837083842 0.986467082728 0.940741139474 0.964703000012 1.00327674523 0.978993952982 1.01868046213 1.04094565105 0.991795213265 1.03991386303 1.00062129028 1.01385365399 0.953823176624 0.979353757572 0.966965576166 0.999582924169 1.02482652926 1.0424034339 1.01868683097 1.04780913271 1.00008303762 1.0002059178 0.966110678178 1.00277743317 1.01558019827 1.01762639542 1.01625930342 1.00834919253 1.03652687396 1.00964065535 1.02685175556 1.03240726934 0.979499768482 0.984193789839 0.981470782269 1.00239445 1.00956580604 1.0073314861 1.01581168575 0.98757866264 1.01636451155 0.969087261927 0.992295816496 1.00341447927 0.980348698059 1.010261941 1.00392333144 1.00075620523 1.01235423598 0.964432842443 1.05109505847 1.01156923995 0.964953946311 1.02278352326 1.01674376619 0.994400501742 1.03472851994 1.00321176748 1.01084929877 0.990389146864 0.990600353283 1.05311509276 1.03099015021 0.98785111323 1.00417097639 1.00819126043 1.03886012751 1.01582595242 0.963935109091 1.00039633573 0.982488883232 0.984918581913 0.997432991032 0.988027007672 0.967358630201 1.00804165014 0.997021293261 1.01756640746 0.975024831767 1.00336417951 0.947947716072 1.0215373833 0.996072784065 1.03587243235 0.97274835306 0.950906779192 +ChargedHiggs_HplusTB_HplusToTB_M-250_13TeV_amcatnlo_pythia8 /store/group/phys_higgs/HiggsExo/jaeyserm/80x_MC_v2/v2.3/ChargedHiggs_HplusTB_HplusToTB_M-250_13TeV_amcatnlo_pythia8 1423793.26498 1 SCALES 1.02677106128 0.969568260555 1.11977231363 1.15877345802 0.894002087059 0.87669801353 PDFS 0.981458047977 0.976653427514 0.999488136647 1.02487024118 0.992323407977 0.979589860462 1.00581900208 0.980253760059 1.0056439784 1.01640865247 1.0403133077 0.992636249315 0.979845668588 1.00250424049 0.970837836498 0.986505968283 0.940693372875 0.964700856454 1.00325127466 0.979048615361 1.01868619196 1.04105624897 0.99181860368 1.03993994115 1.00063289071 1.01386309465 0.953726467084 0.979329987871 0.966943129323 0.99961060342 1.02483787878 1.04243797795 1.01868489925 1.04783718511 1.00006545908 1.00020814844 0.966091397264 1.00279447676 1.0156047721 1.01761207059 1.01628180448 1.00832696849 1.03654075526 1.00961212556 1.02692253943 1.03250655669 0.979468375632 0.984166515456 0.981475650882 1.00238591665 1.00954508498 1.00736502656 1.01582653723 0.987549480798 1.01636517884 0.969069680192 0.992314899571 1.00334485966 0.980367811826 1.01035462823 1.00394562781 1.00077415113 1.01236375865 0.964384376403 1.05107660015 1.01158277705 0.964949803294 1.02278724731 1.01672585443 0.994373865816 1.03472736957 1.00322704577 1.01086515066 0.990363532569 0.990584412343 1.05310087153 1.03099144626 0.987797787329 1.00416050503 1.00820814445 1.03887520028 1.0158413608 0.96387558119 1.00045628325 0.982497043755 0.984882486153 0.997508228965 0.987981035268 0.967368534799 1.00804208368 0.997001816773 1.0175641355 0.975005719343 1.00335982175 0.947930502873 1.02153619112 0.996089058944 1.0358948126 0.972705155389 0.950903967539 -ChargedHiggs_HplusTB_HplusToTB_M-300_13TeV_amcatnlo_pythia8 /store/group/phys_higgs/HiggsExo/jaeyserm/80x_MC_v2/v2.3/ChargedHiggs_HplusTB_HplusToTB_M-300_13TeV_amcatnlo_pythia8/ChargedHiggs_HplusTB_HplusToTB_M-300_13TeV_amcatnlo_pythia8-ext 463135.224643 1 SCALES 1.02983298387 0.966612531437 1.11832087313 1.16108876714 0.895062822246 0.875614628174 PDFS 0.980117871152 0.974051196615 0.999238993955 1.0256407113 0.990673166255 0.978782632526 1.00715318262 0.97906771961 1.00631970264 1.01435173758 1.03839480877 0.993876630634 0.978651657172 0.998942887503 0.969179650945 0.98760295985 0.933505016969 0.961434461276 1.00556203814 0.980774820027 1.02154604001 1.0449546171 0.998058055565 1.04404938129 1.00127323187 1.01480662525 0.947318942858 0.975808522649 0.964003933516 1.00278634456 1.0266919083 1.0419012306 1.02032235648 1.05334457076 0.999132413077 1.00236207449 0.964090905827 1.00443092949 1.0163269733 1.01988251973 1.01935398118 1.00931341243 1.0403971897 1.01004984383 1.03049377087 1.03878986786 0.975950747843 0.981585389058 0.979875432742 1.00250477546 1.01013396641 1.00723718556 1.01945969162 0.985679736231 1.01707002546 0.963986126531 0.994680574129 1.00196632088 0.980679269243 1.01225272726 1.00559639114 1.00237589333 1.01294411114 0.958839644646 1.05336500823 1.0126755405 0.967906027368 1.02297156379 1.01367394525 0.992109265001 1.03981309684 1.00367274835 1.0066859038 0.989411590144 0.989016492455 1.05553962934 1.03403645532 0.988280205328 1.00455832594 1.00883003413 1.04203465083 1.01536767265 0.9626684002 1.00093018735 0.978526350529 0.982059472765 0.995805586314 0.986001299464 0.967878311015 1.00748372672 0.995455572824 1.02092979947 0.97267665796 1.00607245848 0.941058457547 1.02384261574 0.996667161434 1.04230846615 0.972260931128 0.946418476995 +ChargedHiggs_HplusTB_HplusToTB_M-300_13TeV_amcatnlo_pythia8 /store/group/phys_higgs/HiggsExo/jaeyserm/80x_MC_v2/v2.3/ChargedHiggs_HplusTB_HplusToTB_M-300_13TeV_amcatnlo_pythia8 532889.33091 1 SCALES 1.02976546154 0.966684158959 1.11835528255 1.16105621986 0.89502325122 0.875650784853 PDFS 0.98008649295 0.974010372068 0.999238409706 1.02558277334 0.99065091217 0.978753253492 1.00713207635 0.979132969024 1.00630409441 1.01435172711 1.03841010865 0.993845368801 0.978600236121 0.998908792646 0.96913816415 0.987654010719 0.933496423323 0.961396580679 1.0055962718 0.980840758941 1.02153817009 1.0450116541 0.998039991582 1.04416133064 1.00124047924 1.01477017433 0.947295808519 0.975749450193 0.9639943593 1.0028843952 1.02671866284 1.04187861593 1.02029139372 1.05344687684 0.999093915638 1.00232314559 0.964099927326 1.00446733199 1.01643659184 1.0198963012 1.01940404995 1.00935529835 1.04052409956 1.01011259571 1.03069484418 1.03900351684 0.975885650033 0.981551981333 0.979901358206 1.00247109981 1.01016667475 1.00718821037 1.01948497618 0.985630832132 1.01705114048 0.963963258114 0.994661093286 1.00192870771 0.980720218028 1.01232429181 1.00562766648 1.00247246402 1.01287939802 0.958809993743 1.05334651265 1.0126457028 0.967874470158 1.02295102637 1.01361626752 0.992049143969 1.03976952071 1.0036315724 1.00666380302 0.989342356341 0.988960944608 1.05553548429 1.03402954247 0.988315386028 1.00463061573 1.00888351459 1.04201317318 1.0153169952 0.962660615927 1.00097812209 0.978501493593 0.9820570892 0.995802054659 0.985967545616 0.967845688235 1.00743445694 0.995393328408 1.02090245824 0.97263958669 1.00630082172 0.94100778918 1.02381512545 0.996646608794 1.04228471146 0.972208105335 0.946429587186 -ChargedHiggs_HplusTB_HplusToTB_M-350_13TeV_amcatnlo_pythia8 /store/group/phys_higgs/HiggsExo/jaeyserm/80x_MC_v2/v2.3/ChargedHiggs_HplusTB_HplusToTB_M-350_13TeV_amcatnlo_pythia8/ChargedHiggs_HplusTB_HplusToTB_M-350_13TeV_amcatnlo_pythia8-ext 214362.930603 1 SCALES 1.03236328417 0.964236123189 1.11708144353 1.16298474424 0.895942544108 0.87482013686 PDFS 0.979181363824 0.971738975368 0.999104974242 1.02655580172 0.989508305519 0.978142880421 1.00884655053 0.976878834377 1.00733773342 1.01229031554 1.03624593203 0.994990646408 0.977447339916 0.995400832749 0.967754018345 0.988243225082 0.9267326134 0.958734598956 1.00785100374 0.983031674472 1.02406270245 1.0481993485 1.0043743509 1.0481863791 1.00169647396 1.01597563465 0.941497350782 0.972582808417 0.96136384741 1.00572538666 1.02830741123 1.04188695237 1.02205174572 1.0588996241 0.998242808024 1.00460626131 0.96217176933 1.00611681934 1.01631143606 1.02166021726 1.02235855706 1.00966622329 1.04414411339 1.01051237812 1.03304915701 1.04472411888 0.97255778256 0.979417562344 0.977853688332 1.00227110621 1.01045238002 1.00665030965 1.02327266028 0.98382400085 1.01758420141 0.959563905257 0.997411645414 1.00057085555 0.980866065173 1.01343265951 1.00736793721 1.00306484948 1.01361294282 0.953828085733 1.05571270136 1.01384446534 0.97114193619 1.02323516636 1.01103519969 0.989570127354 1.04460000075 1.00423428487 1.00291828537 0.988571338249 0.987701748484 1.05757758194 1.03682695045 0.98889108379 1.00469760439 1.00953278973 1.04526995197 1.01521375078 0.961708311841 1.00154449287 0.974954720056 0.97947677346 0.994192249018 0.984306568565 0.968453263214 1.00684270334 0.993971693561 1.02430413014 0.97080530978 1.00797778441 0.934333468133 1.026141499 0.996454307171 1.04879511196 0.971800634022 0.942480813559 +ChargedHiggs_HplusTB_HplusToTB_M-350_13TeV_amcatnlo_pythia8 /store/group/phys_higgs/HiggsExo/jaeyserm/80x_MC_v2/v2.3/ChargedHiggs_HplusTB_HplusToTB_M-350_13TeV_amcatnlo_pythia8 247032.316489 1 SCALES 1.03234600629 0.964255847175 1.11705731143 1.16294051718 0.895967689048 0.87486334944 PDFS 0.979168496415 0.971717662836 0.999096397323 1.02653292111 0.989502565132 0.97812553919 1.00884435704 0.976972130178 1.00733698259 1.01227136292 1.03618524376 0.994985777947 0.977385127687 0.995380921516 0.967730074099 0.988307404574 0.926658959952 0.958712935705 1.00787302736 0.982999866106 1.02404728268 1.04831954225 1.00439747823 1.04820817714 1.00168169649 1.01597690527 0.941416130511 0.972523847516 0.961331769168 1.00578388809 1.02832057104 1.04188324118 1.0220342849 1.05893947405 0.998217427633 1.00460488654 0.962139180973 1.00611057146 1.01645923332 1.02169067311 1.02240983083 1.00970090014 1.04416929968 1.01050919815 1.03321960666 1.04489279416 0.972530136128 0.979390111306 0.977880552576 1.00225236062 1.01047408361 1.00664182025 1.02328964861 0.983770545317 1.01755624592 0.959534694646 0.997405689465 1.00053623705 0.980862209965 1.01352325222 1.00739701308 1.00316672409 1.01356519649 0.953779346057 1.05566687801 1.01381347046 0.971160938794 1.02321438905 1.01098186658 0.989520984075 1.04461106624 1.00425924587 1.00289713394 0.988536739357 0.987675289742 1.05757195479 1.03683842735 0.988854384931 1.00475613969 1.00957008292 1.04527336916 1.0151977313 0.961707690805 1.00159004273 0.974908324326 0.979442384583 0.994189560631 0.984281158841 0.968442836384 1.00681866817 0.993947758549 1.02430168182 0.970780644613 1.00809376125 0.934267589282 1.02612183661 0.996563457417 1.04882657642 0.971775708276 0.942424845414 ##ChargedHiggs_HplusTB_HplusToTB_M-300_13TeV_amcatnlo_pythia8 /store/group/phys_higgs/HiggsExo/jaeyserm/80x_MC_v2/v2.3/ChargedHiggs_HplusTB_HplusToTB_M-300_13TeV_amcatnlo_pythia8/ChargedHiggs_HplusTB_HplusToTB_M-300_13TeV_amcatnlo_pythia8/171009_230234/0000 69754.1062671 1 SCALES 1.02931736874 0.967160002161 1.11858379896 1.16084016712 0.894760606499 0.875890924341 PDFS 0.97987820705 0.973739402595 0.999234530583 1.02519825785 0.990503180615 0.978558234921 1.00699196287 0.979566415831 1.00620047521 1.01435165759 1.03851170432 0.993637854457 0.978258960957 0.998682477469 0.968862800942 0.987993098943 0.933439369475 0.961145146601 1.00582362665 0.981278788 1.02148592048 1.04539051152 0.997920071612 1.04490523218 1.00102307113 1.01452822335 0.947142235787 0.975357417538 0.963930795731 1.00353589299 1.02689633607 1.04172848987 1.02008586282 1.05412664653 0.998838385546 1.00206475224 0.96415983022 1.00470909486 1.01716500879 1.01998781327 1.01973660832 1.00963348982 1.0413675086 1.0105294372 1.03203187124 1.04042427987 0.975453650625 0.981330227046 0.98007352618 1.00224756637 1.01038389682 1.00686315839 1.01965288582 0.985306254411 1.01692577069 0.963811449846 0.99453176879 1.00167904515 0.980992185905 1.01279970431 1.00583536972 1.00311412125 1.01244994222 0.958613171868 1.053223727 1.01244763874 0.967664996951 1.02281468828 1.01323348033 0.991650152653 1.03948028776 1.00335826863 1.0065170886 0.988882921305 0.988592290604 1.05550796391 1.03398364666 0.988549033259 1.00511085068 1.0092387441 1.04187059386 1.01498064843 0.962608935122 1.00129650322 0.97833648698 0.982041263713 0.995778606726 0.985743494169 0.967629143723 1.00710745042 0.994980251408 1.02072096217 0.972393522133 1.00781968195 0.940671512827 1.02363264003 0.996510170206 1.04212701874 0.971857511863 0.94650336037 ##ChargedHiggs_HplusTB_HplusToTB_M-350_13TeV_amcatnlo_pythia8 /store/group/phys_higgs/HiggsExo/jaeyserm/80x_MC_v2/v2.3/ChargedHiggs_HplusTB_HplusToTB_M-350_13TeV_amcatnlo_pythia8/ChargedHiggs_HplusTB_HplusToTB_M-350_13TeV_amcatnlo_pythia8/171006_164204/0000 32669.3858868 1 SCALES 1.03223265039 0.964385287797 1.11689899244 1.16265040102 0.89613271471 0.875146998367 PDFS 0.979084074215 0.971577842044 0.999040122802 1.02638281337 0.989464900751 0.978011768487 1.00882996453 0.977584740809 1.00733205601 1.01214702132 1.03578720879 0.994953834317 0.97697711328 0.99525029204 0.967572991296 0.988728730612 0.92617596693 0.958570814741 1.0080175611 0.982791203886 1.02394611607 1.04910888804 1.0045492566 1.0483512293 1.00158474373 1.01598524257 0.940883544295 0.972137147869 0.961121338171 1.0061679191 1.02840692857 1.04185889057 1.02191972909 1.05920102727 0.998050924069 1.00459586595 0.961925404476 1.00606957743 1.01743008497 1.02189055683 1.02274639567 1.0099284943 1.04433459178 1.01048833301 1.03433942324 1.04600092387 0.972348770721 0.979210027169 0.978056861204 1.00212937728 1.01061651669 1.0065861199 1.02340113295 0.983419936381 1.01737285172 0.959343070866 0.997366610765 1.00030914431 0.980836914445 1.01411808593 1.0075878385 1.00383569661 1.01325201646 0.953459660096 1.05536630286 1.01361014196 0.971285644429 1.02307807794 1.01063205641 0.989198647353 1.04468367916 1.00442306038 1.00275836917 0.988309775881 0.987501713641 1.05753503321 1.03691374035 0.988613649832 1.00514039324 1.00981485368 1.04529579188 1.01509263064 0.961703615847 1.00188902482 0.97460400434 0.979216798954 0.994171920915 0.984114463336 0.968374425429 1.00666098783 0.993790735542 1.02428561724 0.970618833128 1.00885541569 0.933835550007 1.02599283885 0.997280249607 1.04903307998 0.971612187612 0.942057770548 -ChargedHiggs_HplusTB_HplusToTB_M-400_13TeV_amcatnlo_pythia8 /store/group/phys_higgs/HiggsExo/jaeyserm/80x_MC_v2/v2.3/ChargedHiggs_HplusTB_HplusToTB_M-400_13TeV_amcatnlo_pythia8/ChargedHiggs_HplusTB_HplusToTB_M-400_13TeV_amcatnlo_pythia8-ext 103934.459007 1 SCALES 1.03505030574 0.961683911507 1.11621328742 1.16532179251 0.896463851107 0.873342145999 PDFS 0.978354530345 0.968892180257 0.998970853564 1.02701090765 0.988196093045 0.977240210731 1.01016670101 0.976245109601 1.00759879642 1.00996505062 1.0338528376 0.995938839859 0.976112391771 0.991722993537 0.965953859326 0.989106635338 0.91940646063 0.955584926363 1.01089422989 0.985432976671 1.02669812747 1.05167285688 1.01065148793 1.05302908787 1.00149028379 1.01699837071 0.935502422384 0.968630191186 0.958793338652 1.00987386301 1.03017064369 1.04132301685 1.02316231134 1.06533131963 0.996986175217 1.00655291361 0.960201087438 1.00831619455 1.01841185915 1.02388766366 1.02626078995 1.01041398789 1.0483847189 1.0116223569 1.03800359611 1.05266919783 0.968849091205 0.976954492183 0.976178532251 1.00179297 1.01095854352 1.00576198904 1.02704555987 0.981402568659 1.01767565977 0.95473834043 0.99954923466 0.999110242119 0.981535982666 1.01499721459 1.00965242582 1.00543904632 1.01342452921 0.948443718045 1.05718394249 1.01466801641 0.97459593752 1.02316246081 1.00760084248 0.986358318771 1.0494445978 1.00452576689 0.998721037706 0.987052440024 0.986402592541 1.05993106298 1.03969452758 0.989786355618 1.00589054738 1.01063350494 1.04824357794 1.01449730819 0.960967858649 1.00230217604 0.970861463277 0.976585427835 0.992164639738 0.982140417296 0.968661097249 1.00560354202 0.992254692286 1.02740334899 0.968605538357 1.01269213395 0.927020059688 1.02830182178 0.996921756729 1.0550222297 0.971054406662 0.937894039631 +ChargedHiggs_HplusTB_HplusToTB_M-400_13TeV_amcatnlo_pythia8 /store/group/phys_higgs/HiggsExo/jaeyserm/80x_MC_v2/v2.3/ChargedHiggs_HplusTB_HplusToTB_M-400_13TeV_amcatnlo_pythia8 120735.143181 1 SCALES 1.03502973342 0.961697766334 1.11616098143 1.16525109605 0.896519774046 0.87341781605 PDFS 0.978319823155 0.96884100124 0.998939867487 1.02695894144 0.988187046098 0.97723272894 1.01016422601 0.976304946738 1.00759599325 1.00994871359 1.03384896813 0.995953637401 0.97605899752 0.991703888072 0.965967658006 0.989173902531 0.919346776586 0.955537181368 1.010900691 0.985428747461 1.0267350083 1.05179454236 1.01065500884 1.05307507623 1.00151433083 1.01698764191 0.935401406915 0.968593266111 0.958753472109 1.00992477174 1.03018253814 1.04132194611 1.02313699918 1.06537596359 0.996933585651 1.00653543396 0.96018937947 1.00834499973 1.01847919494 1.02390010762 1.02629659674 1.01045302692 1.04842149845 1.01159732586 1.03812342111 1.05282284791 0.968797508877 0.97691796607 0.976220672002 1.0017797837 1.01098620746 1.00575575186 1.02708117845 0.981385945853 1.0176935378 0.95465285652 0.999563944643 0.99905180086 0.98157339751 1.01512010631 1.00968033178 1.00551371353 1.01342536657 0.948358912037 1.05714979293 1.01467403951 0.974591285729 1.02314877042 1.00758674404 0.986332230866 1.04943640697 1.00453900518 0.998714766595 0.987027841543 0.986334743978 1.05993175996 1.0397060846 0.989786055452 1.00590228063 1.01062567019 1.0482617061 1.01446298325 0.960905081831 1.00235133279 0.970836716221 0.976579253105 0.9921698031 0.98211699351 0.968668566944 1.00560315597 0.992211985881 1.02739904157 0.968596036703 1.01278635991 0.927007000883 1.02829809655 0.996952143192 1.0550569303 0.971015657807 0.937894084709 -ChargedHiggs_HplusTB_HplusToTB_M-500_13TeV_amcatnlo_pythia8 /store/group/phys_higgs/HiggsExo/jaeyserm/80x_MC_v2/v2.3/ChargedHiggs_HplusTB_HplusToTB_M-500_13TeV_amcatnlo_pythia8/ChargedHiggs_HplusTB_HplusToTB_M-500_13TeV_amcatnlo_pythia8-ext 34978.4521053 1 SCALES 1.04127557967 0.955764938702 1.11838546463 1.17452535416 0.893327688058 0.864841815222 PDFS 0.977356195878 0.963848628265 0.999226404908 1.02779990345 0.986629498447 0.975902219968 1.01289617526 0.973702083356 1.00944090411 1.0061510706 1.02823764855 0.998192210743 0.97259975002 0.985013276973 0.963441928134 0.991417228046 0.905864848672 0.950417634564 1.01601567495 0.991049265332 1.03183674094 1.05957352881 1.02302637216 1.06209002497 1.00160346668 1.01945982105 0.923632422098 0.961479345645 0.954207689297 1.01712820547 1.0334691042 1.04053204296 1.02523729969 1.07708629082 0.994558666938 1.01041633301 0.956475401302 1.01266801709 1.02070450111 1.02727656575 1.03339988549 1.01098530309 1.05584889298 1.01285210511 1.04511580934 1.06753070337 0.961872259981 0.97247823589 0.972466665082 1.0011947779 1.01160898601 1.00461186613 1.03464296641 0.976530533345 1.01808683268 0.94611406563 1.00408298148 0.995843307136 0.982789749969 1.01858375695 1.01345515771 1.0088410966 1.0127870068 0.93830051042 1.06018491822 1.01653864447 0.981945357692 1.02343665102 1.00106077188 0.98015889856 1.05888145277 1.00600385584 0.991198949633 0.984529864686 0.983786870585 1.06426344288 1.04509524648 0.990090501511 1.00698518959 1.01185506534 1.05459429919 1.01335076947 0.959898149441 1.0035757919 0.963762357334 0.970816053803 0.988804638105 0.978050193084 0.970146019261 1.00364488051 0.989518918431 1.03350965548 0.964785237171 1.01879688622 0.913773508763 1.03244425072 0.997510824453 1.0674195752 0.969506425839 0.93022390231 +ChargedHiggs_HplusTB_HplusToTB_M-500_13TeV_amcatnlo_pythia8 /store/group/phys_higgs/HiggsExo/jaeyserm/80x_MC_v2/v2.3/ChargedHiggs_HplusTB_HplusToTB_M-500_13TeV_amcatnlo_pythia8 40438.8390426 1 SCALES 1.0412703212 0.955773051792 1.11845518705 1.17458911115 0.893252282483 0.86477133444 PDFS 0.97735802789 0.963857562894 0.999198695488 1.02783563029 0.986668681122 0.975874559459 1.0129515411 0.973701328876 1.00949299293 1.00612654581 1.02818215544 0.998121216608 0.972614541589 0.985022842687 0.963418107385 0.991397816457 0.905848148427 0.95043625517 1.0160384 0.991051564834 1.03182511055 1.05957962413 1.02303582017 1.06211449184 1.00162586889 1.0194559551 0.923663153226 0.961473763374 0.954156976206 1.01711514004 1.03347072474 1.04056240758 1.02525343493 1.07706805604 0.994574814336 1.01041598556 0.956427914368 1.01265036145 1.02074949121 1.02731550775 1.03345974706 1.01095768119 1.05582181391 1.01287105572 1.04522645736 1.06754253975 0.961864379215 0.972486432218 0.972473928507 1.00112106409 1.01154883211 1.00463776278 1.03464550942 0.976503538569 1.01803289857 0.946082001517 1.00411547517 0.995810581161 0.982794667265 1.01859354371 1.01341056288 1.00884993479 1.01279873413 0.93828921578 1.06014390125 1.01651836144 0.981941440079 1.02339092844 1.00109259354 0.980094355758 1.058874102 1.00597802022 0.991238496854 0.984539227619 0.983873433229 1.0642010031 1.04508729663 0.990121960212 1.00698063898 1.01186142677 1.05457763443 1.01341037587 0.959801454117 1.00368569747 0.963769511605 0.970812683567 0.988897779659 0.978079773921 0.970093885099 1.00365801401 0.989510212015 1.03349083427 0.964808095177 1.01878871577 0.913803321822 1.03245949378 0.997518177456 1.06744105081 0.969455276417 0.930221255809 -ChargedHiggs_HplusTB_HplusToTB_M-650_13TeV_amcatnlo_pythia8 /store/group/phys_higgs/HiggsExo/jaeyserm/80x_MC_v2/v2.3/ChargedHiggs_HplusTB_HplusToTB_M-650_13TeV_amcatnlo_pythia8/ChargedHiggs_HplusTB_HplusToTB_M-650_13TeV_amcatnlo_pythia8 393831.432793 1 SCALES 1.1129011114 0.898499328518 1.0457620674 1.17461142728 0.951866837203 0.867488305327 PDFS 1.00000090923 0.977163908593 0.956101720365 1.00012325736 1.02817673845 0.986079483479 0.973436328973 1.01763278555 0.969577050946 1.01212375449 1.00105735337 1.0194891703 1.00126621347 0.967004063495 0.97591702483 0.959956124714 0.994629105548 0.885016367381 0.942632841202 1.0243389759 1.00046822875 1.04062042654 1.07237267168 1.04200649318 1.07673557125 1.00101197627 1.02372025552 0.905844019131 0.950269950916 0.947926367452 1.02856883053 1.03855906252 1.04039624569 1.02790217798 1.09660206846 0.990543940045 1.01574878443 0.950647643701 1.02071196826 1.02510970877 1.03187096534 1.04579608313 1.01052089112 1.06578107292 1.01503083646 1.05637418403 1.09194556362 0.950901769867 0.965951540294 0.966568958257 0.999723156382 1.01157317501 1.00242259777 1.04686740355 0.968332385164 1.018054347 0.933277874536 1.01039910656 0.991024613749 0.985776051768 1.02378658594 1.02029294163 1.01511651758 1.01080469627 0.923009011542 1.06223717673 1.02000999882 0.99436549663 1.02384812335 0.990841174991 0.96906440905 1.07350942618 1.00856970161 0.980829602593 0.980192744831 0.980787882205 1.07150131265 1.05327687117 0.989663845079 1.00893902028 1.01339369894 1.06487597895 1.01204613155 0.957934420843 1.00594106518 0.953503590215 0.961590279861 0.982929388783 0.971475300414 0.971715305592 1.00028464213 0.985680965947 1.04246201476 0.95980470081 1.02903001107 0.89380310841 1.03841109804 0.997955300937 1.08666216531 0.966444829738 +ChargedHiggs_HplusTB_HplusToTB_M-650_13TeV_amcatnlo_pythia8 /store/group/phys_higgs/HiggsExo/jaeyserm/80x_MC_v2/v2.3/ChargedHiggs_HplusTB_HplusToTB_M-650_13TeV_amcatnlo_pythia8 393831.432793 1 SCALES 1.1129011114 0.898499328518 1.0457620674 1.17461142728 0.951866837203 0.867488305327 PDFS 1.00000090923 0.977163908593 0.956101720365 1.00012325736 1.02817673845 0.986079483479 0.973436328973 1.01763278555 0.969577050946 1.01212375449 1.00105735337 1.0194891703 1.00126621347 0.967004063495 0.97591702483 0.959956124714 0.994629105548 0.885016367381 0.942632841202 1.0243389759 1.00046822875 1.04062042654 1.07237267168 1.04200649318 1.07673557125 1.00101197627 1.02372025552 0.905844019131 0.950269950916 0.947926367452 1.02856883053 1.03855906252 1.04039624569 1.02790217798 1.09660206846 0.990543940045 1.01574878443 0.950647643701 1.02071196826 1.02510970877 1.03187096534 1.04579608313 1.01052089112 1.06578107292 1.01503083646 1.05637418403 1.09194556362 0.950901769867 0.965951540294 0.966568958257 0.999723156382 1.01157317501 1.00242259777 1.04686740355 0.968332385164 1.018054347 0.933277874536 1.01039910656 0.991024613749 0.985776051768 1.02378658594 1.02029294163 1.01511651758 1.01080469627 0.923009011542 1.06223717673 1.02000999882 0.99436549663 1.02384812335 0.990841174991 0.96906440905 1.07350942618 1.00856970161 0.980829602593 0.980192744831 0.980787882205 1.07150131265 1.05327687117 0.989663845079 1.00893902028 1.01339369894 1.06487597895 1.01204613155 0.957934420843 1.00594106518 0.953503590215 0.961590279861 0.982929388783 0.971475300414 0.971715305592 1.00028464213 0.985680965947 1.04246201476 0.95980470081 1.02903001107 0.89380310841 1.03841109804 0.997955300937 1.08666216531 0.966444829738 -ChargedHiggs_HplusTB_HplusToTB_M-800_13TeV_amcatnlo_pythia8 /store/group/phys_higgs/HiggsExo/jaeyserm/80x_MC_v2/v2.3/ChargedHiggs_HplusTB_HplusToTB_M-800_13TeV_amcatnlo_pythia8/ChargedHiggs_HplusTB_HplusToTB_M-800_13TeV_amcatnlo_pythia8-ext 321671.270197 1 SCALES 1.0507507892 0.947438549998 1.11137062789 1.17890078078 0.899501068741 0.864876208327 PDFS 0.977217107718 0.947769366387 1.00117455376 1.02697266711 0.986869012035 0.969857126335 1.02232742668 0.96667092145 1.01487996608 0.99696342283 1.01099247131 1.00309176115 0.958737173566 0.967386393883 0.955966444814 0.999868976061 0.863659901968 0.934572678771 1.03339154303 1.01229405526 1.04924345452 1.08958435586 1.06018257062 1.09404466299 0.999526212598 1.02767733638 0.887230244674 0.937917200817 0.94203122649 1.04289356678 1.04419201269 1.04031378596 1.02950533893 1.11960643356 0.985381562529 1.0197628476 0.944408981017 1.0301232556 1.03361446877 1.03638190252 1.06053949569 1.0100460433 1.07735500791 1.01836476546 1.0737682289 1.12436508253 0.938663842869 0.958693648978 0.961176965356 0.997599265194 1.01166918409 0.999497244037 1.060251111 0.957853830558 1.01703695393 0.920698218322 1.01568953911 0.984910782483 0.990130090017 1.03175782496 1.02901628386 1.02416430194 1.00653326095 0.907435918101 1.06121818399 1.02348421489 1.00711312765 1.02381769768 0.979170492978 0.955930930496 1.0876998414 1.011034588 0.97125388039 0.974061497607 0.977123580768 1.07914731541 1.06136943103 0.988170119295 1.0127394252 1.01603798533 1.07516165407 1.0100060321 0.955403093906 1.01045866881 0.942963471709 0.951858953002 0.977605391801 0.963663408485 0.972226300311 0.995389803067 0.980740066074 1.05057581925 0.954503995896 1.04520334532 0.873342621411 1.04330634414 0.998864401541 1.10535226094 0.961252173922 0.906122830207 +ChargedHiggs_HplusTB_HplusToTB_M-800_13TeV_amcatnlo_pythia8 /store/group/phys_higgs/HiggsExo/jaeyserm/80x_MC_v2/v2.3/ChargedHiggs_HplusTB_HplusToTB_M-800_13TeV_amcatnlo_pythia8 372257.918488 1 SCALES 1.05076601421 0.947425895208 1.11143445277 1.17897926519 0.899431105143 0.864788477402 PDFS 0.977233665127 0.947743006858 1.00122557123 1.02695138455 0.986827927452 0.969877384812 1.02226852671 0.966669894305 1.01473047238 0.99698679474 1.01110295342 1.00313196825 0.958807465278 0.967389806739 0.955974652991 0.999781515392 0.86367996795 0.934561275473 1.03340357543 1.01219357025 1.04921042299 1.08942657615 1.06017762529 1.09413574072 0.999448942088 1.02765171677 0.88733137026 0.937903497944 0.942085023737 1.04288437156 1.04419052595 1.04026492644 1.02945810733 1.1196076016 0.985390815915 1.01975348502 0.94441559371 1.0301303989 1.03362755382 1.03637901971 1.06049677054 1.01009110956 1.0774656492 1.01844404084 1.07376533699 1.12434215746 0.9386977433 0.958713686857 0.961160441628 0.99759218526 1.01171727128 0.999445622377 1.06020610071 0.957911666571 1.01706996193 0.920726770131 1.01563801238 0.984972607421 0.990103551604 1.03161215599 1.02900181772 1.02414203313 1.00646551642 0.907501574004 1.06127332888 1.02345081351 1.00709605586 1.02383666363 0.979214711312 0.955983759581 1.08771484905 1.01100489595 0.971270830907 0.974045506178 0.97703324109 1.07919674113 1.06139865095 0.98827943762 1.01277421924 1.01605411455 1.07514764397 1.00995719574 0.95546011329 1.01034003435 0.942959770413 0.951902422952 0.977526534118 0.96367999338 0.972187607565 0.995381316864 0.980742840548 1.05058233981 0.954481188311 1.04528112022 0.873323577347 1.04328833596 0.998837277487 1.10533753315 0.961289485584 0.906137266193 ##ChargedHiggs_HplusTB_HplusToTB_M-800_13TeV_amcatnlo_pythia8 /store/group/phys_higgs/HiggsExo/jaeyserm/80x_MC_v2/v2.3/ChargedHiggs_HplusTB_HplusToTB_M-800_13TeV_amcatnlo_pythia8/ChargedHiggs_HplusTB_HplusToTB_M-800_13TeV_amcatnlo_pythia8/171006_201740/0000 50586.6482911 1 SCALES 1.05086283754 0.947345433611 1.11184047508 1.17947857784 0.898986473899 0.864231028606 PDFS 0.977338963794 0.947575425721 1.00155010371 1.02681607328 0.986566758094 0.970006224575 1.02189415128 0.966663362927 1.01378089861 0.997135438094 1.01180605433 1.00338771331 0.959254678724 0.967411509031 0.956026850588 0.999225726742 0.863807585689 0.934488770493 1.03348009382 1.01155507084 1.04900043016 1.08842435189 1.06014617989 1.09471524239 0.998957872391 1.0274888362 0.887974949155 0.937816373239 0.94242725443 1.04282590462 1.04418107209 1.03995434501 1.02915787152 1.11961502902 0.985449660572 1.01969395409 0.944457644786 1.03017582414 1.03371076706 1.03636068884 1.06022516963 1.01037777183 1.07816972905 1.01894842746 1.07374694823 1.12419640302 0.938913367262 0.95884112368 0.961055383546 0.997547167599 1.01202315591 0.999117494371 1.05991997788 0.958279598701 1.01727990387 0.920908367311 1.01531048561 0.985365922603 0.989934831951 1.03068683508 1.02890983975 1.02400045251 1.00603495462 0.90791929031 1.06162411931 1.02323847118 1.00698751301 1.02395728111 0.979495981097 0.956319826759 1.08781028966 1.01081613045 0.971378629994 0.97394383188 0.976459178162 1.07951113621 1.06158449274 0.988975139209 1.0129955242 1.01615668928 1.07505856484 1.00964676466 0.955822848445 1.00958631075 0.942936235228 0.95217893336 0.977025389997 0.963785467059 0.971941639492 0.995327358033 0.980760483293 1.05062380475 0.954336184531 1.04577594757 0.873202499049 1.04317383972 0.998664835035 1.10524389096 0.961526811429 0.906229072759 -ChargedHiggs_HplusTB_HplusToTB_M-1000_13TeV_amcatnlo_pythia8 /store/group/phys_higgs/HiggsExo/jaeyserm/80x_MC_v2/v2.3/ChargedHiggs_HplusTB_HplusToTB_M-1000_13TeV_amcatnlo_pythia8/ChargedHiggs_HplusTB_HplusToTB_M-1000_13TeV_amcatnlo_pythia8-ext 119530.70685 1 SCALES 1.05738371317 0.94150886563 1.11147158052 1.18651260886 0.898698232879 0.858804128439 PDFS 0.978990911799 0.937598604535 1.00406412685 1.02440008552 0.989586144731 0.9649751606 1.02934388002 0.961681026593 1.01689377394 0.993872352623 1.00067116078 1.0060425338 0.949167681153 0.958837671886 0.952062097622 1.00515772429 0.836993658673 0.924774492712 1.04491674367 1.02697302947 1.06131310955 1.11123885692 1.08472430397 1.11689197539 0.996842481315 1.03302777811 0.86493255737 0.922545566047 0.935457076061 1.06015480687 1.05111892766 1.04046813562 1.03104803374 1.14884532855 0.979198530846 1.02469424779 0.936421561902 1.04333278381 1.04280899624 1.04158489765 1.07961722421 1.00780072781 1.0904812881 1.02273008112 1.09435162936 1.16503388155 0.923725207576 0.950067510518 0.954180741776 0.995607569909 1.01135547831 0.996810953359 1.0778171747 0.944104476519 1.01592678249 0.905146908343 1.02137872216 0.97923371145 0.996209652694 1.03947715241 1.04009978184 1.03605453174 0.998666597993 0.889070506705 1.05787694491 1.02881803761 1.02602731058 1.02436778529 0.964277265789 0.938906468335 1.10824881335 1.01456884727 0.96039610064 0.966186464724 0.973866222625 1.09119328775 1.07240710065 0.985033628759 1.01702639192 1.01763843359 1.09027624038 1.00794910285 0.952130102072 1.01458930026 0.93046113643 0.939026390428 0.969932987755 0.954115939802 0.972426029832 0.989742161207 0.975284614853 1.0615173714 0.948715506501 1.0645977374 0.848677930789 1.04891631788 0.998875250966 1.13108389177 0.955026201796 0.890584629704 +ChargedHiggs_HplusTB_HplusToTB_M-1000_13TeV_amcatnlo_pythia8 /store/group/phys_higgs/HiggsExo/jaeyserm/80x_MC_v2/v2.3/ChargedHiggs_HplusTB_HplusToTB_M-1000_13TeV_amcatnlo_pythia8 137865.288156 1 SCALES 1.05730434978 0.941589318685 1.11146544683 1.18642863587 0.898704983924 0.858899227559 PDFS 0.978912458836 0.937522808184 1.00399890775 1.02430316459 0.98954763398 0.96491465608 1.02927392316 0.961780936149 1.0169270907 0.993859877478 1.00069938282 1.00602861938 0.948951487056 0.958741936056 0.951992980509 1.00533808814 0.836882569633 0.924685916047 1.0449257152 1.02712823564 1.0613556672 1.11160897605 1.08470820587 1.11703092348 0.996837783144 1.03300078597 0.864712705262 0.92243497008 0.935419805016 1.06037769999 1.0511868636 1.040459401 1.03102679901 1.14914725826 0.979072837689 1.02466403709 0.936411638054 1.04342626961 1.04309534389 1.04161808887 1.07977830353 1.00791815246 1.09066811661 1.02276869803 1.0947975722 1.16571640721 0.923580961992 0.949941455343 0.954209226872 0.995601850596 1.01141841727 0.996725574115 1.07791849349 0.944012917256 1.01593283416 0.905100234441 1.02141358139 0.979068350143 0.996263779335 1.03982974794 1.04026843832 1.03623683453 0.998674940858 0.888934215325 1.05780363892 1.0288481767 1.02593084156 1.02436505471 0.964135076529 0.938833507985 1.10818897277 1.01455417642 0.960316637717 0.966055784691 0.973684894099 1.09116485499 1.07239563517 0.984963078734 1.01716163567 1.01777735787 1.09025190419 1.00784122283 0.952074144966 1.01477300724 0.93036802221 0.9389726638 0.969935832293 0.953975909028 0.972447729351 0.989644316251 0.975167752194 1.06149212769 0.948617018893 1.06502367415 0.848533173135 1.04886636994 0.998957829084 1.13103315225 0.954925173936 0.890517949812 -ChargedHiggs_HplusTB_HplusToTB_M-1500_13TeV_amcatnlo_pythia8 /store/group/phys_higgs/HiggsExo/jaeyserm/80x_MC_v2/v2.3/ChargedHiggs_HplusTB_HplusToTB_M-1500_13TeV_amcatnlo_pythia8/ChargedHiggs_HplusTB_HplusToTB_M-1500_13TeV_amcatnlo_pythia8-ext 6468.55319934 1 SCALES 1.108408125 0.900855072901 1.06913135946 1.19691654389 0.931487582816 0.852482687688 PDFS 1.00000300364 0.982694859416 0.909521876005 1.00765741278 1.00893754066 1.00301788715 0.944567366477 1.05031349983 0.953046927552 1.01877535917 0.990687319523 0.981323296916 1.00812573379 0.913120638435 0.940785251796 0.938311588745 1.02865913411 0.766861549512 0.896351045343 1.0772942644 1.0741498533 1.09522038267 1.19808828397 1.14362592758 1.18623807085 0.98710804321 1.04415849522 0.803840098983 0.880028671307 0.917941402351 1.11696679806 1.07299787744 1.04681862835 1.03574651473 1.25303958021 0.957127192937 1.03505721766 0.9141238546 1.08747603245 1.08667004396 1.05520413628 1.14472509317 1.00210777118 1.12840781658 1.0351928674 1.18582287955 1.32591902572 0.878414944896 0.923420689519 0.940337348978 0.989264314915 1.00855542335 0.985166959747 1.13085775987 0.900059330518 1.011440386 0.866349998584 1.03555492082 0.959602553996 1.01788622063 1.07605947138 1.08749103541 1.08036091132 0.972959746319 0.841175888631 1.03134962175 1.04658580312 1.07151863247 1.02531741702 0.921199257864 0.888299024198 1.16457992181 1.02200225344 0.936282433093 0.936568931143 0.963026789632 1.12348657201 1.10231929201 0.970989290517 1.03773065551 1.02921703743 1.13202261343 1.00278915792 0.936971200537 1.04030115017 0.896229244027 0.903937671109 0.948113341798 0.923588415079 0.964705125726 0.968562138214 0.955469597489 1.08869773221 0.93328524083 1.14807991133 0.785845594323 1.05709983116 1.00190107505 1.19952099191 0.930675560059 +ChargedHiggs_HplusTB_HplusToTB_M-1500_13TeV_amcatnlo_pythia8 /store/group/phys_higgs/HiggsExo/jaeyserm/80x_MC_v2/v2.3/ChargedHiggs_HplusTB_HplusToTB_M-1500_13TeV_amcatnlo_pythia8 7486.12368069 1 SCALES 1.10843700097 0.900824715345 1.06911233379 1.19692559469 0.931506949785 0.852470322263 PDFS 1.00000241224 0.982775754651 0.909643622626 1.00779879126 1.00907240909 1.00315664383 0.944633260889 1.0504136023 0.952612866745 1.01889790329 0.990792574682 0.981358961746 1.00817960477 0.913158714615 0.940838466481 0.938453931563 1.02849842033 0.766986997027 0.89646201856 1.07715323054 1.0741609894 1.09520568172 1.19790355764 1.14369661696 1.18611080056 0.987165354657 1.04421759937 0.803927805329 0.880162821819 0.918008390549 1.11658531254 1.07291190319 1.0469537992 1.03586962035 1.25275807125 0.95724150939 1.03514941653 0.914165833551 1.08740836733 1.08608517134 1.05506153427 1.1445408014 1.00193468035 1.12823480079 1.03512278082 1.18498617005 1.32512832178 0.878466162617 0.92352435029 0.940221145172 0.989312900148 1.00845202898 0.985212713817 1.13083198115 0.900145893222 1.0115237595 0.866479894781 1.03562726468 0.959627307527 1.01784863936 1.07576145607 1.08745005321 1.07992588731 0.973063392104 0.841271736085 1.03151622987 1.04667652288 1.07160598663 1.02541681199 0.921353617421 0.888388520394 1.16462202423 1.02208336901 0.936345994778 0.93667817767 0.963079434194 1.12348961828 1.10235121283 0.970949000108 1.03744414181 1.02907553816 1.13210121726 1.00293558652 0.936989028961 1.0401999017 0.896380109105 0.903971117144 0.948100119671 0.923681761117 0.964783118138 0.968649380641 0.955565490896 1.08879644039 0.933355197009 1.14719767799 0.785955950319 1.05720202661 1.00167047538 1.19957961396 0.930731633693 -ChargedHiggs_HplusTB_HplusToTB_M-2000_13TeV_amcatnlo_pythia8 /store/group/phys_higgs/HiggsExo/jaeyserm/80x_MC_v2/v2.3/ChargedHiggs_HplusTB_HplusToTB_M-2000_13TeV_amcatnlo_pythia8/ChargedHiggs_HplusTB_HplusToTB_M-2000_13TeV_amcatnlo_pythia8-ext 2128.14564629 1 SCALES 1.08004708985 0.922290414966 1.10725531001 1.2080850447 0.901374337615 0.844870827644 PDFS 0.98665421868 0.878218796523 1.00539778539 0.985374051673 1.02111151758 0.916229153766 1.07827771977 0.946084263559 1.01008770534 0.988034527969 0.974526952569 1.00429548978 0.87354142161 0.927001137116 0.921213114252 1.05806514981 0.696301112341 0.863172471211 1.11984018069 1.1278291064 1.1364229379 1.32195300943 1.20218558689 1.27181349374 0.973198129073 1.05255572193 0.744247873674 0.836035872454 0.900006497889 1.18872661101 1.09976516311 1.05834676112 1.04386180841 1.40720011682 0.928920212286 1.04560664143 0.890786522829 1.15123661164 1.15464992848 1.073589854 1.23631412831 0.99567509622 1.17095349401 1.05049992434 1.32805584206 1.58653140802 0.828177100096 0.894010319995 0.929934523077 0.98265716715 1.00359093699 0.964352049499 1.19666832266 0.849940687739 1.00600075715 0.827355776787 1.05096972168 0.941877339089 1.04656324969 1.12508403102 1.1682307864 1.1394146912 0.941147925412 0.79427588912 0.985798674654 1.07208231577 1.11732689226 1.02657582406 0.875223621209 0.832846487487 1.23328981413 1.02640839047 0.912517412789 0.897906693823 0.953462782471 1.16233034281 1.13872275738 0.956753167258 1.07211760241 1.04834676961 1.18051360476 0.99898251457 0.91483809191 1.08227393181 0.858221550327 0.86698428954 0.916394915759 0.888992887721 0.946101990318 0.940161171152 0.930530906188 1.11898792341 0.918857200801 1.28829837519 0.724901675198 1.06017406905 1.00304313653 1.27885428871 0.901623894477 0.795225982949 +ChargedHiggs_HplusTB_HplusToTB_M-2000_13TeV_amcatnlo_pythia8 /store/group/phys_higgs/HiggsExo/jaeyserm/80x_MC_v2/v2.3/ChargedHiggs_HplusTB_HplusToTB_M-2000_13TeV_amcatnlo_pythia8 2452.63069304 1 SCALES 1.07998807163 0.922356578564 1.10711584983 1.2078846589 0.901520798557 0.845094631574 PDFS 0.986702950873 0.878242373789 1.00542936705 0.985450625862 1.02109697433 0.91624126169 1.07830216504 0.946107443448 1.01005155689 0.98799167149 0.974518403849 1.00427481175 0.873708534114 0.927014889718 0.921207032986 1.05788458219 0.696377531745 0.863207594056 1.11995155944 1.12776121926 1.13633101658 1.3213249301 1.2021308677 1.27181796793 0.973124786352 1.05250662181 0.744462934119 0.83608256209 0.900027874887 1.18863228313 1.09971176454 1.05838376649 1.04386109133 1.40715282973 0.928984085269 1.04561409051 0.890823045114 1.15122936755 1.15452172094 1.07361185816 1.23618260362 0.995582699312 1.17091791037 1.05054816817 1.3278692664 1.58592702141 0.828256329951 0.894082239794 0.929908094749 0.982575814332 1.00358010427 0.964325611095 1.19652812653 0.849987357739 1.0059200074 0.82738941951 1.05090653172 0.94201806271 1.04646088224 1.12469283795 1.16808015169 1.13933653039 0.941141122111 0.794360496711 0.985900273671 1.07199454853 1.11730346346 1.02653279017 0.875327445958 0.832854039776 1.23327060127 1.02632440344 0.9125643097 0.897978830754 0.953685395004 1.16233111157 1.13867824669 0.956963053066 1.07213998961 1.04838399521 1.18047280443 0.999054581412 0.914906969527 1.08209135356 0.858271519462 0.867043018429 0.916307933168 0.889041750613 0.946014750319 0.940176146477 0.930588556901 1.11896447054 0.918896779487 1.28846567434 0.724989925312 1.06023101315 1.00292633411 1.27881575881 0.901660438095 0.795312679399 -ChargedHiggs_HplusTB_HplusToTB_M-2500_13TeV_amcatnlo_pythia8 /store/group/phys_higgs/HiggsExo/jaeyserm/80x_MC_v2/v2.3/ChargedHiggs_HplusTB_HplusToTB_M-2500_13TeV_amcatnlo_pythia8/ChargedHiggs_HplusTB_HplusToTB_M-2500_13TeV_amcatnlo_pythia8-ext 186.438459477 1 SCALES 1.10735080941 0.900763820756 1.09058740409 1.2200127995 0.91355063542 0.836389139199 PDFS 1.00000016109 0.987470928183 0.841388526131 0.992849669037 0.955029389173 1.04096627744 0.882130444721 1.11132536622 0.944255094755 0.992414610461 0.978568047773 0.979215008239 0.993968703263 0.829204449222 0.910934913175 0.899283316516 1.10084020242 0.625265047046 0.823191658615 1.18060298407 1.19597067472 1.192001867 1.51338936706 1.25929116563 1.3805908793 0.95689611119 1.05929690732 0.682106891831 0.789225535288 0.879657484986 1.29137087423 1.13514939669 1.07338775762 1.05636643187 1.66542785603 0.891619649966 1.05597313285 0.867567276056 1.24158293856 1.27188151275 1.10008347586 1.37558032801 0.993640856472 1.22527730136 1.06917188574 1.56846799143 2.10791778818 0.77174376717 0.860196267785 0.921901266767 0.975213238564 0.996844428409 0.930045340831 1.28134734907 0.796081123636 0.998968047053 0.786496557551 1.07199522211 0.920222666144 1.08480339715 1.20315486617 1.3070547339 1.220447442 0.907509941003 0.744536474718 0.923725814271 1.10630443516 1.15942027069 1.02715547767 0.823968982427 0.773975675646 1.31048523279 1.0281797787 0.883606769872 0.849392687878 0.940334420451 1.20466873972 1.18459100861 0.944863567095 1.12774710273 1.08284988053 1.23268713082 0.992497008489 0.886556950222 1.15223474088 0.812823882345 0.827512747848 0.874451333674 0.848184692205 0.919991306937 0.902357650186 0.898944382911 1.15063374299 0.903649376174 1.54912412737 0.663187360375 1.05917166112 1.00516965234 1.36739854217 0.867460600386 +ChargedHiggs_HplusTB_HplusToTB_M-2500_13TeV_amcatnlo_pythia8 /store/group/phys_higgs/HiggsExo/jaeyserm/80x_MC_v2/v2.3/ChargedHiggs_HplusTB_HplusToTB_M-2500_13TeV_amcatnlo_pythia8 216.571296966 1 SCALES 1.1073781709 0.900735265783 1.09056115712 1.2200135778 0.91358224444 0.836392102476 PDFS 1.00000014877 0.987302463486 0.841234877112 0.992603100811 0.954922208168 1.04082942386 0.882007726553 1.11120319811 0.945075738262 0.992288479418 0.978388247912 0.979088004526 0.993720066581 0.829002960537 0.910802130113 0.899083046047 1.101117262 0.625133088849 0.823091015173 1.18093262857 1.19565994926 1.19176976702 1.51409703636 1.25909093357 1.38098179538 0.956787362948 1.05912127773 0.682012529912 0.78905910964 0.879500279717 1.29207271675 1.13517912679 1.07327307075 1.05615023173 1.66593926346 0.891478919008 1.05581410892 0.867491824116 1.24167277092 1.27355641515 1.10041637996 1.3762220706 0.993973192141 1.22556331149 1.06928033947 1.57120194355 2.11204770345 0.771630033141 0.860076803709 0.922234726846 0.974941952106 0.996973432314 0.92990174651 1.28135798591 0.795891454723 0.998738268899 0.786303910509 1.07194401833 0.920039474173 1.08498966461 1.20398100134 1.30739006797 1.22153151722 0.907377458851 0.74437396073 0.923549214677 1.10606259526 1.1592193478 1.02690635888 0.823890939365 0.77378266635 1.31017323221 1.02802162831 0.883547994208 0.849217181214 0.940308877213 1.20442019976 1.18455736634 0.945070781638 1.12830581345 1.08310837132 1.23240477249 0.992368848006 0.886353232809 1.15280906265 0.812694869135 0.827490576032 0.874539309142 0.848064501341 0.919786104399 0.902170114925 0.898692224143 1.15039799982 0.903563208825 1.55189914168 0.663102260131 1.05905229814 1.00577086939 1.36721182351 0.867226785043 #ChargedHiggs_HplusTB_HplusToTB_M-2500_13TeV_amcatnlo_pythia8 /store/group/phys_higgs/HiggsExo/jaeyserm/80x_MC_v2/v2.3/ChargedHiggs_HplusTB_HplusToTB_M-2500_13TeV_amcatnlo_pythia8/ChargedHiggs_HplusTB_HplusToTB_M-2500_13TeV_amcatnlo_pythia8/171010_125635/0000 30.1328374889 1 SCALES 1.10754749248 0.900558630161 1.09039878947 1.22001839335 0.913777865005 0.836410437384 PDFS 1.00000007251 0.986261412246 0.840285463327 0.991080248064 0.95425959037 1.03998348029 0.881249200919 1.11044791412 0.950185126518 0.991508791362 0.977277254232 0.978302936679 0.992184458503 0.827758479872 0.909981432182 0.89784590943 1.10283459591 0.624317871403 0.822468858935 1.18297631133 1.19374100709 1.19033572091 1.51849029907 1.25785346845 1.38340540956 0.956115062978 1.05803591259 0.68142927207 0.788030956319 0.878528864266 1.29643218953 1.13536310806 1.07256402254 1.0548145193 1.66911044975 0.890609172578 1.054831257 0.867025278103 1.24222887251 1.28401829037 1.10248061877 1.38020602453 0.99603437879 1.22733589184 1.06995185595 1.58833172936 2.13796462805 0.77092708049 0.859338390486 0.924303292996 0.973266793595 0.997772350697 0.929014281969 1.28142380233 0.794719938208 0.997318928135 0.78511405631 1.07162731805 0.918907645085 1.08614356595 1.20911781337 1.30946868507 1.22828198543 0.906558622049 0.743370026429 0.922458053958 1.10456862664 1.15797774065 1.02536768914 0.823408398382 0.772590612657 1.30824611468 1.02704419794 0.883184510095 0.848132893653 0.94015086646 1.20288470596 1.18434925676 0.94635488693 1.13177502563 1.0847104584 1.23066063176 0.991576626395 0.885094867279 1.15637528645 0.811897545885 0.827353420572 0.875084026448 0.847321610869 0.91851850393 0.901011524181 0.897135202585 1.14894155034 0.903030437738 1.56929229508 0.662576211518 1.05831437103 1.00950678139 1.36605768717 0.865782916229 -ChargedHiggs_HplusTB_HplusToTB_M-3000_13TeV_amcatnlo_pythia8 /store/group/phys_higgs/HiggsExo/jaeyserm/80x_MC_v2/v2.3/ChargedHiggs_HplusTB_HplusToTB_M-3000_13TeV_amcatnlo_pythia8/ChargedHiggs_HplusTB_HplusToTB_M-3000_13TeV_amcatnlo_pythia8-ext 82.3552376787 1 SCALES 1.10028330819 0.905811878554 1.10714909532 1.23074548034 0.900634491128 0.829394352748 PDFS 0.983633579367 0.795970687331 0.967256418141 0.918221316274 1.05769012839 0.843246451667 1.14380770972 0.961148362377 0.962578086763 0.955579850449 0.996428748394 0.974649636105 0.778121158823 0.885839675187 0.867854950372 1.16295559882 0.553049526821 0.773729686158 1.27957605332 1.28533401407 1.2673717204 1.81967156324 1.30942470921 1.53345454169 0.933066521846 1.06662781478 0.617740233291 0.737166658488 0.858570717133 1.46718199539 1.1840891194 1.08889603594 1.07110909928 2.20033341824 0.843206194317 1.06169032184 0.844470884528 1.37035090319 1.51381407528 1.14143829225 1.60722470099 1.00624168495 1.30336300891 1.09743965657 2.05350505967 3.64409019441 0.708054763698 0.821092999333 0.917281627644 0.961909819828 0.990539628393 0.875520889637 1.40457542909 0.738479755649 0.985733666897 0.742086429308 1.0959407458 0.892435280135 1.1415828512 1.32953368196 1.56459369854 1.35331945443 0.872752780323 0.689630741813 0.847415041415 1.14767518998 1.19261622439 1.02479531312 0.766416952505 0.709889725444 1.38923991982 1.02559408783 0.844438767961 0.792135415561 0.917919306041 1.24998106017 1.24341684459 0.944461975532 1.22598486418 1.1429265567 1.28292468034 0.977276663634 0.860063344254 1.26306399428 0.756772759072 0.784889024144 0.817596291245 0.799135141296 0.884509385742 0.851206940004 0.857198265096 1.18061300507 0.884691270182 2.20266791218 0.596797264026 1.05509778666 1.01542337577 1.45636151626 0.826142104977 0.673737613461 +ChargedHiggs_HplusTB_HplusToTB_M-3000_13TeV_amcatnlo_pythia8 /store/group/phys_higgs/HiggsExo/jaeyserm/80x_MC_v2/v2.3/ChargedHiggs_HplusTB_HplusToTB_M-3000_13TeV_amcatnlo_pythia8 95.0697348805 1 SCALES 1.10038901398 0.905699703875 1.1071713916 1.2308738457 0.900611351586 0.829250313264 PDFS 0.983959934638 0.796127532624 0.967543228279 0.918527028361 1.05776285916 0.843391516917 1.14407361425 0.960483303725 0.962411862779 0.955636203148 0.99665749393 0.974837510144 0.778679212206 0.886115441742 0.868196498135 1.16182994996 0.553238145614 0.773905771718 1.27960755113 1.28460647997 1.26746862281 1.81577583306 1.30968801491 1.5327272768 0.933019934255 1.06676636319 0.618189314866 0.737424543079 0.858781667236 1.46557047559 1.18374634786 1.08889456622 1.07114774525 2.19727642948 0.843435860971 1.06179785494 0.844654176722 1.37018013925 1.51113545241 1.14140095288 1.60603682151 1.00586881935 1.30250670516 1.09750705697 2.04582702315 3.62135931998 0.708298569982 0.821380594071 0.917073147008 0.961962677702 0.990350566278 0.875640554084 1.40435142201 0.738740142101 0.985800639156 0.742225236345 1.095812992 0.893114007505 1.1414679516 1.32737880595 1.56378173147 1.35207040463 0.872813473534 0.689972841732 0.847605209062 1.14790005804 1.19308711415 1.02492565891 0.766709231308 0.710009464928 1.38963792124 1.02563098494 0.844464589084 0.792454034833 0.918547016459 1.25045219991 1.24348166722 0.944922086049 1.22523003693 1.14220520148 1.28315392691 0.977518810967 0.860204399907 1.26186652034 0.757014916268 0.785007003925 0.81733752743 0.799423161641 0.884607894305 0.851451992875 0.857461455442 1.18081404654 0.884904720663 2.1969286319 0.597085395383 1.0553220047 1.01473777705 1.45653157225 0.826484163634 0.673892634031 ###ChargedHiggs_HplusTB_HplusToTB_M-3000_13TeV_amcatnlo_pythia8 /store/group/phys_higgs/HiggsExo/jaeyserm/80x_MC_v2/v2.3/ChargedHiggs_HplusTB_HplusToTB_M-3000_13TeV_amcatnlo_pythia8/ChargedHiggs_HplusTB_HplusToTB_M-3000_13TeV_amcatnlo_pythia8/171006_163921/0000 12.7144972018 1 SCALES 1.10107419113 0.904973790399 1.10731583237 1.23170595168 0.900461499298 0.828318540738 PDFS 0.986079081552 0.797144960787 0.969405101967 0.92051214851 1.05823419835 0.844332353801 1.14579894821 0.956197727155 0.961336573747 0.956001375836 0.998141687709 0.976056177264 0.782313349207 0.88790582251 0.870415322169 1.1545912579 0.554463003053 0.775048269244 1.27981160853 1.27991391655 1.26809664496 1.79094055274 1.31139608483 1.52803323934 0.932718286452 1.06766465111 0.621114024253 0.739099310637 0.860150562375 1.45521734827 1.18153092063 1.08888504657 1.07139813316 2.17767935182 0.844926509051 1.06249490381 0.845843339365 1.3690750848 1.49401224081 1.14115915482 1.59838492319 1.00346034372 1.29698732605 1.09794382815 1.99745182641 3.48072579227 0.709881844231 0.823248312786 0.915725053063 0.962305193179 0.989127705385 0.876416445913 1.40290219604 0.740431192418 0.986234657072 0.743125586085 1.09498621684 0.897535432572 1.14072427556 1.31358848704 1.55854274127 1.34403547285 0.87320680439 0.692196961044 0.848839046223 1.14935872586 1.19614622234 1.02577074752 0.768607811936 0.710786029204 1.39222141679 1.0258700418 0.844631877733 0.794524041231 0.922633748881 1.25351252115 1.24390170464 0.94791323682 1.22036323567 1.13755474913 1.28464080528 0.979090175293 0.861119177146 1.25416480684 0.758587194603 0.785772050622 0.815665402557 0.801293786695 0.885246492645 0.853042689792 0.859170132059 1.18211790639 0.886289795303 2.16046601107 0.598958458615 1.05677663653 1.01031929069 1.45763403332 0.828706647856 0.674898474294 @@ -254,3 +254,4 @@ DYJetsToQQ_HT180_13TeV-madgraphMLM-pythia8 /store/group/phys_higgs/HiggsExo/dalf ## cross section from AN2016-366 WJetsToQQ_HT180_13TeV-madgraphMLM-pythia8 /store/group/phys_higgs/HiggsExo/dalfonso/80x_MC_v2/v2.3/WJetsToQQ_HT180_13TeV-madgraphMLM-pythia8 22402469.0 2788 SCALES 1.68573280767 1.64231912904 1.7400027893 1.76652079515 1.56765571952 1.55020943378 PDFS 1.65952533886 1.6778930528 1.67848491516 1.63481819574 1.67479353407 1.66952507197 1.68199603003 1.62955807473 1.6562572292 1.7124892926 1.69644407544 1.64614781978 1.66823399992 1.70232012448 1.47784709708 1.66616587662 1.66148509095 1.69651349989 1.46417256777 1.73437684342 1.65540262429 1.68295825189 1.66771599481 1.72789939618 1.66307682379 1.50619883151 1.59543147053 1.69924222684 1.599473765 1.70256292773 1.68392476822 1.66344139739 1.63511122262 1.6861057666 1.66217765297 1.65216116171 1.68521320396 1.67266454388 1.65748171083 1.69231506901 1.66083918335 1.67625317792 1.68235384499 1.69806787386 1.66035152687 1.70282690053 1.58431285077 1.65675488786 1.69856569734 1.63474592117 1.47440424977 1.69248276942 1.64129918211 1.7098133783 1.38043238983 1.67856380139 1.42616005314 1.67254634562 1.53313363831 1.70711957353 1.63988911775 1.69388814519 1.67592957991 1.70594751759 1.69113437218 1.6796006727 1.69791346559 1.5348414053 1.58702437017 1.69301156434 1.63477574977 1.69407241047 1.71216124322 1.69338343854 1.57112166343 1.73645723009 1.7453734867 1.77006797579 1.647382092 1.68329461558 1.69028386058 1.67307767039 1.65931436419 1.66184855315 1.69325837187 1.68615609021 1.66142377076 1.71061234185 1.84962905166 1.69272441861 1.67493718192 1.66162541919 1.67020189339 1.69948478421 1.70612019014 1.68041564474 1.69671353605 1.66899224328 1.69974671423 1.69961285484 + From 8d90c0a55ceeab64fed8b29054b3171edbf4fc39 Mon Sep 17 00:00:00 2001 From: maria Date: Mon, 30 Jul 2018 14:53:01 +0200 Subject: [PATCH 28/60] card tb leptonic: merge ttb,ttbb,tt2b --- script/bwsTB.py | 79 ++++++++++++++++++++++++++++--------------------- 1 file changed, 45 insertions(+), 34 deletions(-) diff --git a/script/bwsTB.py b/script/bwsTB.py index 5ccdb750..9aa21f25 100644 --- a/script/bwsTB.py +++ b/script/bwsTB.py @@ -15,6 +15,7 @@ # in the histos nbin=1000 then rebin5, those with nBinsHT=1 #nBinsHT=2 +#nBinsHT=4 #nBinsHT=5 doSyst = False @@ -29,6 +30,12 @@ parser.add_option("","--input1LBin",type='string',help="Input ROOT file. [%default]", default="/afs/cern.ch/work/d/dalfonso/CMSSW_9_1_0_pre2_ReTestNERO/src/ChargedHiggs/JUNE1_1l_1Third.root") parser.add_option("","--input2LBin",type='string',help="Input ROOT file. [%default]", default="/afs/cern.ch/work/d/dalfonso/CMSSW_9_1_0_pre2_ReTestNERO/src/ChargedHiggs/JUNE1_2l_1Third.root") +#parser.add_option("","--input1L",type='string',help="Input ROOT file. [%default]", default="/afs/cern.ch/work/d/dalfonso/CMSSW_9_1_0_pre2_ReTestNERO/src/ChargedHiggs/JUNE29_FINAL_2ThirdSYST_bin200_wDATA_1l.root") +#parser.add_option("","--input2L",type='string',help="Input ROOT file. [%default]", default="/afs/cern.ch/work/d/dalfonso/CMSSW_9_1_0_pre2_ReTestNERO/src/ChargedHiggs/JULY29_FINAL_2ThirdSYST_bin200_wDATA_2l.root") + +#parser.add_option("","--input1LBin",type='string',help="Input ROOT file. [%default]", default="/afs/cern.ch/work/d/dalfonso/CMSSW_9_1_0_pre2_ReTestNERO/src/ChargedHiggs/JUNE1_1l_1Third.root") +#parser.add_option("","--input2LBin",type='string',help="Input ROOT file. [%default]", default="/afs/cern.ch/work/d/dalfonso/CMSSW_9_1_0_pre2_ReTestNERO/src/ChargedHiggs/JULY29_2l_1Third.root") + ###### ###### ###### @@ -131,7 +138,7 @@ def RebinN(h,nBin): #1l if opts.kTest==0 or opts.kTest==1 or opts.kTest==2 or opts.kTest==3 or opts.kTest==4 or opts.kTest==5 or opts.kTest==6 or opts.kTest==7 or opts.kTest==8 or opts.kTest==9 or opts.kTest==10 or opts.kTest==11 or opts.kTest==12 or opts.kTest==13 or opts.kTest==14 or opts.kTest==15 or opts.kTest==16 or opts.kTest==100 or opts.kTest==101 or opts.kTest==102: - channel = ["1Mu","1Ele"] + channel = ["1Mu","1ele"] # channel = ["1L"] basecat = ["Baseline","topCRR4","topCRR5","extraRadCRR10","extraRadCRR7","charmCR"] @@ -362,40 +369,42 @@ def RebinN(h,nBin): ## set the MC sample if x=="charmCR": - catStore[name]["hasMC"]=["ttlf","ttb","ttbb","tt2b","ttcc","top","ewk","Hptb"] + catStore[name]["hasMC"]=["ttlf","ttb","ttcc","top","ewk","Hptb"] if "extraRadCR" in x: - catStore[name]["hasMC"]=["ttlf","ttb","ttbb","tt2b","ttcc","top","ewk","Hptb"] + catStore[name]["hasMC"]=["ttlf","ttb","ttcc","top","ewk","Hptb"] if "topCR" in x: - catStore[name]["hasMC"]=["ttlf","ttb","ttbb","tt2b","ttcc","top","ewk","Hptb"] + catStore[name]["hasMC"]=["ttlf","ttb","ttcc","top","ewk","Hptb"] if x=="Baseline": - catStore[name]["hasMC"]=["ttlf","ttb","ttbb","tt2b","ttcc","top","ewk","Hptb"] + catStore[name]["hasMC"]=["ttlf","ttb","ttcc","top","ewk","Hptb"] if y == "1Ele" or y == "1Mu" or y == "1L": mcStore={ "Hptb":{"name":"Hptb", "hist":["ChargedHiggs_HplusTB_HplusToTB_M-%d_13TeV_amcatnlo_pythia8"], "num":0 }, "ttlf":{ "name":"ttlf","hist":["ttlight_TT_TuneCUETP8M2T4_13TeV-powheg-pythia8"],"num":1}, - "ttb":{ "name":"ttb","hist":["tt1b_TT_TuneCUETP8M2T4_13TeV-powheg-pythia8"],"num":2}, +### "ttb":{ "name":"ttb","hist":["tt1b_TT_TuneCUETP8M2T4_13TeV-powheg-pythia8"],"num":2}, ### "ttbb":{ "name":"ttbb","hist":["tt2b_TT_TuneCUETP8M2T4_13TeV-powheg-pythia8"],"num":3}, ### "tt2b":{ "name":"tt2b","hist":["tt2bMerged_TT_TuneCUETP8M2T4_13TeV-powheg-pythia8"],"num":4}, - "ttbb":{ "name":"ttbb","hist":["tt2b_TT_TuneCUETP8M2T4_13TeV-powheg-pythia8","tt2bMerged_TT_TuneCUETP8M2T4_13TeV-powheg-pythia8"],"num":3}, - "ttcc":{ "name":"ttcc","hist":["ttc_TT_TuneCUETP8M2T4_13TeV-powheg-pythia8"],"num":4}, +### "ttbb":{ "name":"ttbb","hist":["tt2b_TT_TuneCUETP8M2T4_13TeV-powheg-pythia8","tt2bMerged_TT_TuneCUETP8M2T4_13TeV-powheg-pythia8"],"num":3}, + "ttb":{ "name":"ttb","hist":["tt2b_TT_TuneCUETP8M2T4_13TeV-powheg-pythia8","tt2bMerged_TT_TuneCUETP8M2T4_13TeV-powheg-pythia8","tt1b_TT_TuneCUETP8M2T4_13TeV-powheg-pythia8"],"num":2}, + "ttcc":{ "name":"ttcc","hist":["ttc_TT_TuneCUETP8M2T4_13TeV-powheg-pythia8"],"num":3}, # "ewk":{ "name":"ewk","hist":["WJetsToLNu_HT","DYJetsToLL_M-50_HT","DYJetsToLL_M-5to50_HT","ZZTo","WWTo","WZTo","ZZZ","WZZ","WWZ","WWW","VHToNonbb_M125","WH_HToBB_WToLNu_M125","ZH_HToBB_ZToLL"],"num":6}, # "ewk":{ "name":"ewk","hist":["WJetsToLNu_HT","DYJetsToLL_M-50_HT","DYJetsToLL_M-5to50_HT","ZZTo","WZTo","ZZZ","WZZ","WWZ","WWW","WH_HToBB_WToLNu_M125","ZH_HToBB_ZToLL"],"num":5}, - "ewk":{ "name":"ewk","hist":["WJetsToLNu_HT","DYJetsToLL_M-50_HT","DYJetsToLL_M-5to50_HT","EWK"],"num":5}, - "top":{ "name":"top","hist":["TTX","ST"],"num":6} + "ewk":{ "name":"ewk","hist":["WJetsToLNu_HT","DYJetsToLL_M-50_HT","DYJetsToLL_M-5to50_HT","EWK"],"num":4}, + "top":{ "name":"top","hist":["TTX","ST"],"num":5} # "qcd":{ "name":"top","hist":["QCD_HT"],"num":8} } else: mcStore={ "Hptb":{"name":"Hptb", "hist":["ChargedHiggs_HplusTB_HplusToTB_M-%d_13TeV_amcatnlo_pythia8"], "num":0 }, "ttlf":{ "name":"ttlf","hist":["ttlight_TT_TuneCUETP8M2T4_13TeV-powheg-pythia8"],"num":1}, - "ttb":{ "name":"ttb","hist":["tt1b_TT_TuneCUETP8M2T4_13TeV-powheg-pythia8"],"num":2}, -# "ttbb":{ "name":"ttbb","hist":["tt2b_TT_TuneCUETP8M2T4_13TeV-powheg-pythia8"],"num":3}, -# "tt2b":{ "name":"tt2b","hist":["tt2bMerged_TT_TuneCUETP8M2T4_13TeV-powheg-pythia8"],"num":4}, - "ttbb":{ "name":"ttbb","hist":["tt2b_TT_TuneCUETP8M2T4_13TeV-powheg-pythia8","tt2bMerged_TT_TuneCUETP8M2T4_13TeV-powheg-pythia8"],"num":3}, - "ttcc":{ "name":"ttcc","hist":["ttc_TT_TuneCUETP8M2T4_13TeV-powheg-pythia8"],"num":4}, - "ewk":{ "name":"ewk","hist":["WJetsToLNu_HT","DYJetsToLL_M-50_HT","EWK"],"num":5}, - "top":{ "name":"top","hist":["TTX","ST"],"num":6} +### "ttb":{ "name":"ttb","hist":["tt1b_TT_TuneCUETP8M2T4_13TeV-powheg-pythia8"],"num":2}, +### "ttbb":{ "name":"ttbb","hist":["tt2b_TT_TuneCUETP8M2T4_13TeV-powheg-pythia8"],"num":3}, +### "tt2b":{ "name":"tt2b","hist":["tt2bMerged_TT_TuneCUETP8M2T4_13TeV-powheg-pythia8"],"num":4}, +### "ttbb":{ "name":"ttbb","hist":["tt2b_TT_TuneCUETP8M2T4_13TeV-powheg-pythia8","tt2bMerged_TT_TuneCUETP8M2T4_13TeV-powheg-pythia8"],"num":3}, + "ttb":{ "name":"ttb","hist":["tt2b_TT_TuneCUETP8M2T4_13TeV-powheg-pythia8","tt2bMerged_TT_TuneCUETP8M2T4_13TeV-powheg-pythia8","tt1b_TT_TuneCUETP8M2T4_13TeV-powheg-pythia8"],"num":2}, + "ttcc":{ "name":"ttcc","hist":["ttc_TT_TuneCUETP8M2T4_13TeV-powheg-pythia8"],"num":3}, + "ewk":{ "name":"ewk","hist":["WJetsToLNu_HT","DYJetsToLL_M-50_HT","EWK"],"num":4}, + "top":{ "name":"top","hist":["TTX","ST"],"num":5} # "qcd":{ "name":"top","hist":["QCD_HT"],"num":8} } @@ -417,22 +426,24 @@ def RebinN(h,nBin): #### #### Theo #### - "CMS_topreweight":{"type":"shape", "wsname":"CMS_topreweight","name":"TOPRW","proc":["ttlf","ttb","ttbb","tt2b","ttcc"]}, ## name used for shape + "CMS_topreweight":{"type":"shape", "wsname":"CMS_topreweight","name":"TOPRW","proc":["ttlf","ttb","ttcc"]}, ## name used for shape "CMS_HPTB_mcreweight_ewk":{"type":"shape", "wsname":"CMS_HPTB_mcreweight_ewk","name":"htRECO","proc":["ewk"]}, ## name used for shape ## "QCDscale":{"type":"shape", "wsname":"QCDscale","name":"ScaleRF","proc":["Hptb","ttlf","ttb","ttbb","tt2b","ttcc"]} ## name used for shape - "muRFenv_ttbar":{"type":"shape", "wsname":"muRFenv_ttbar","name":"Scale","proc":["ttlf","ttb","ttbb","tt2b","ttcc"]}, ## name used for shape -# "muRF_ttbar":{"type":"shape", "wsname":"muRF_ttbar","name":"Scale","proc":["ttlf","ttb","ttbb","tt2b","ttcc"]}, ## name used for shape -# "muR_ttbar":{"type":"shape", "wsname":"muR_ttbar","name":"Scale","proc":["ttlf","ttb","ttbb","tt2b","ttcc"]}, ## name used for shape -# "muF_ttbar":{"type":"shape", "wsname":"muF_ttbar","name":"Scale","proc":["ttlf","ttb","ttbb","tt2b","ttcc"]}, ## name used for shape + "muRFenv_ttbar":{"type":"shape", "wsname":"muRFenv_ttbar","name":"Scale","proc":["ttlf","ttb","ttcc"]}, ## name used for shape +# "muRF_ttbar":{"type":"shape", "wsname":"muRF_ttbar","name":"Scale","proc":["ttlf","ttb","ttcc"]}, ## name used for shape +# "muR_ttbar":{"type":"shape", "wsname":"muR_ttbar","name":"Scale","proc":["ttlf","ttb","ttcc"]}, ## name used for shape +# "muF_ttbar":{"type":"shape", "wsname":"muF_ttbar","name":"Scale","proc":["ttlf","ttb","ttcc"]}, ## name used for shape + "muRFenv_ewk":{"type":"shape", "wsname":"muRFenv_ewk","name":"Scale","proc":["ewk"]}, ## name used for shape # "muRF_ewk":{"type":"shape", "wsname":"muRF_ewk","name":"Scale","proc":["ewk"]}, ## name used for shape # "muR_ewk":{"type":"shape", "wsname":"muR_ewk","name":"Scale","proc":["ewk"]}, ## name used for shape # "muF_ewk":{"type":"shape", "wsname":"muF_ewk","name":"Scale","proc":["ewk"]}, ## name used for shape + "muRFenv_Hptb":{"type":"shape", "wsname":"muRFenv_Hptb","name":"Scale","proc":["Hptb"]}, ## name used for shape # "muRF_Hptb":{"type":"shape", "wsname":"muRF_Hptb","name":"Scale","proc":["Hptb"]}, ## name used for shape # "muR_Hptb":{"type":"shape", "wsname":"muR_Hptb","name":"Scale","proc":["Hptb"]}, ## name used for shape # "muF_Hptb":{"type":"shape", "wsname":"muF_Hptb","name":"Scale","proc":["Hptb"]}, ## name used for shape - "muRFenv_top":{"type":"shape", "wsname":"muRFenv_top","name":"Scale","proc":["top"]}, ## name used for shape +# "muRFenv_top":{"type":"shape", "wsname":"muRFenv_top","name":"Scale","proc":["top"]}, ## name used for shape # "muRF_top":{"type":"shape", "wsname":"muRF_top","name":"Scale","proc":["top"]}, ## name used for shape # "muR_top":{"type":"shape", "wsname":"muR_top","name":"Scale","proc":["top"]}, ## name used for shape # "muF_top":{"type":"shape", "wsname":"muF_top","name":"Scale","proc":["top"]}, ## name used for shape @@ -499,12 +510,12 @@ def RebinN(h,nBin): #print "---------------------- --------" #fileTmp="AUG6_HT/"+label+VarTest+opts.output -fileTmp="JULY5/"+ label + VarTest + str(opts.kMass) + opts.output +fileTmp="JULY29_HT200_like100/"+ label + VarTest + str(opts.kMass) + opts.output w = ROOT.RooWorkspace("w","w") datNameTmp = opts.datCardName #datName = "AUG6_HT/"+ label + VarTest + datNameTmp -datName = "JULY5/"+ label + VarTest + str(opts.kMass) + datNameTmp +datName = "JULY29_HT200_like100/"+ label + VarTest + str(opts.kMass) + datNameTmp datacard=open(datName,"w") datacard.write("-------------------------------------\n") @@ -916,6 +927,7 @@ def importStat(): writeNormSyst(syst,systStore[syst]["value"],systStore[syst]["proc"],["2Ele"]) elif "CMS_eff_l" in systStore[syst]["wsname"]: writeNormSyst(syst,systStore[syst]["value"],systStore[syst]["proc"],["2L"]) + writeNormSyst(syst,systStore[syst]["value"],systStore[syst]["proc"],["1L"]) elif "CMS_eff_t_veto" in systStore[syst]["wsname"]: writeNormSyst(syst,systStore[syst]["value"],systStore[syst]["proc"],["1Mu","1Ele"]) else: @@ -938,14 +950,14 @@ def importStat(): -if doSyst: writeNormSyst("QCDscale_ttbar",["0.965/1.024","0.965/1.024","0.965/1.024","0.965/1.024","0.965/1.024"],["ttlf","ttcc","ttb","ttbb","tt2b"]) -if doSyst: writeNormSyst("pdf_gg",["1.042","1.042","1.042","1.042","1.042"],["ttlf","ttcc","ttb","ttbb","tt2b"]) -if doSyst: writeNormSyst("CMS_mass_ttbar",["1.027","1.027","1.027","1.027","1.027"],["ttlf","ttb","ttbb","tt2b","ttcc"]) +if doSyst: writeNormSyst("QCDscale_ttbar",["0.965/1.024","0.965/1.024","0.965/1.024","0.965/1.024","0.965/1.024"],["ttlf","ttcc","ttb"]) +if doSyst: writeNormSyst("pdf_gg",["1.042","1.042","1.042","1.042","1.042"],["ttlf","ttcc","ttb"]) +if doSyst: writeNormSyst("CMS_mass_ttbar",["1.027","1.027","1.027","1.027","1.027"],["ttlf","ttcc","ttb"]) ###if doSyst: writeNormSyst("CMS_HPTB_QCDscale_ttlf",["1.50"],["ttlf"]) if doSyst: writeNormSyst("bgnorm_ttcc",["1.50"],["ttcc"]) if doSyst: writeNormSyst("bgnorm_ttb",["1.50"],["ttb$"]) -if doSyst: writeNormSyst("bgnorm_ttbb",["1.50"],["ttbb$"]) +#if doSyst: writeNormSyst("bgnorm_ttbb",["1.50"],["ttbb$"]) ##if doSyst: writeNormSyst("bgnorm_tt2b",["1.50"],["tt2b"]) ## "top" get the value od the single top @@ -957,9 +969,9 @@ def importStat(): if doSyst: writeNormSyst("QCDscale_ewk",["0.996/1.008"],["ewk"]) if doSyst: writeNormSyst("pdf_qqbar",["1.04"],["ewk"]) -if doSyst: writeSystISRFSR(name="CMS_HPTB_ISR",valueL=["-999","999"], regexpL=["ttlf","ttb","ttbb","tt2b","ttcc"]) -if doSyst: writeSystISRFSR(name="CMS_HPTB_FSR",valueL=["-999","999"], regexpL=["ttlf","ttb","ttbb","tt2b","ttcc"]) -if doSyst: writeSystISRFSR(name="CMS_HPTB_HDAMP",valueL=["-999","999"], regexpL=["ttlf","ttb","ttbb","tt2b","ttcc"]) +if doSyst: writeSystISRFSR(name="CMS_HPTB_ISR",valueL=["-999","999"], regexpL=["ttlf","ttb","ttcc"]) +if doSyst: writeSystISRFSR(name="CMS_HPTB_FSR",valueL=["-999","999"], regexpL=["ttlf","ttb","ttcc"]) +if doSyst: writeSystISRFSR(name="CMS_HPTB_HDAMP",valueL=["-999","999"], regexpL=["ttlf","ttb","ttcc"]) ## "ISR/FSR" #if opts.kTest==0 or opts.kTest==1 or opts.kTest==2 or opts.kTest==3 or opts.kTest==4 or opts.kTest==5 or opts.kTest==6 or opts.kTest==7 or opts.kTest==8 or opts.kTest==9 or opts.kTest==10 or opts.kTest==11 or opts.kTest==12 or opts.kTest==13 or opts.kTest==14 or opts.kTest==15 or opts.kTest==16 or opts.kTest==100 or opts.kTest==101 or opts.kTest==102: @@ -1209,7 +1221,6 @@ def importPdfFromTH1(cat,mc,myBin,LikelihoodMapping,syst=None): elif syst != None: hTmp = SmoothAndMergeSyst(tfile,togetNom,togetSyst,s) -## hTmp = MergeCategory(tfile,togetSyst+s) else: hTmp = MergeCategory(tfile,togetNom) ###### @@ -1541,7 +1552,7 @@ def importPdfFromTH1SumBKG(cat,mc,syst=None,do1Third=False): # b2.rebin() # myBin = b2.getBinArray() - +# LikelihoodMapping = [] LikelihoodMapping = likelihoodBinning.createMapping(hSumAll1Third, hSig1Third) # print LikelihoodMapping From 92606e1d613381902c5de9113e9d80e39aac2d3c Mon Sep 17 00:00:00 2001 From: maria Date: Tue, 31 Jul 2018 21:51:43 +0200 Subject: [PATCH 29/60] card tb leptonic: fix envelop --- script/bwsTB.py | 51 +++++++++++++++++++++++++++++++++---------------- 1 file changed, 35 insertions(+), 16 deletions(-) diff --git a/script/bwsTB.py b/script/bwsTB.py index 9aa21f25..8b5fae22 100644 --- a/script/bwsTB.py +++ b/script/bwsTB.py @@ -30,10 +30,10 @@ parser.add_option("","--input1LBin",type='string',help="Input ROOT file. [%default]", default="/afs/cern.ch/work/d/dalfonso/CMSSW_9_1_0_pre2_ReTestNERO/src/ChargedHiggs/JUNE1_1l_1Third.root") parser.add_option("","--input2LBin",type='string',help="Input ROOT file. [%default]", default="/afs/cern.ch/work/d/dalfonso/CMSSW_9_1_0_pre2_ReTestNERO/src/ChargedHiggs/JUNE1_2l_1Third.root") -#parser.add_option("","--input1L",type='string',help="Input ROOT file. [%default]", default="/afs/cern.ch/work/d/dalfonso/CMSSW_9_1_0_pre2_ReTestNERO/src/ChargedHiggs/JUNE29_FINAL_2ThirdSYST_bin200_wDATA_1l.root") +#parser.add_option("","--input1L",type='string',help="Input ROOT file. [%default]", default="/afs/cern.ch/work/d/dalfonso/CMSSW_9_1_0_pre2_ReTestNERO/src/ChargedHiggs/JULY29_FINAL_2ThirdSYST_bin200_wDATA_1l.root") #parser.add_option("","--input2L",type='string',help="Input ROOT file. [%default]", default="/afs/cern.ch/work/d/dalfonso/CMSSW_9_1_0_pre2_ReTestNERO/src/ChargedHiggs/JULY29_FINAL_2ThirdSYST_bin200_wDATA_2l.root") -#parser.add_option("","--input1LBin",type='string',help="Input ROOT file. [%default]", default="/afs/cern.ch/work/d/dalfonso/CMSSW_9_1_0_pre2_ReTestNERO/src/ChargedHiggs/JUNE1_1l_1Third.root") +#parser.add_option("","--input1LBin",type='string',help="Input ROOT file. [%default]", default="/afs/cern.ch/work/d/dalfonso/CMSSW_9_1_0_pre2_ReTestNERO/src/ChargedHiggs/JULY29_1l_1Third.root") #parser.add_option("","--input2LBin",type='string',help="Input ROOT file. [%default]", default="/afs/cern.ch/work/d/dalfonso/CMSSW_9_1_0_pre2_ReTestNERO/src/ChargedHiggs/JULY29_2l_1Third.root") ###### @@ -138,7 +138,7 @@ def RebinN(h,nBin): #1l if opts.kTest==0 or opts.kTest==1 or opts.kTest==2 or opts.kTest==3 or opts.kTest==4 or opts.kTest==5 or opts.kTest==6 or opts.kTest==7 or opts.kTest==8 or opts.kTest==9 or opts.kTest==10 or opts.kTest==11 or opts.kTest==12 or opts.kTest==13 or opts.kTest==14 or opts.kTest==15 or opts.kTest==16 or opts.kTest==100 or opts.kTest==101 or opts.kTest==102: - channel = ["1Mu","1ele"] + channel = ["1Mu","1Ele"] # channel = ["1L"] basecat = ["Baseline","topCRR4","topCRR5","extraRadCRR10","extraRadCRR7","charmCR"] @@ -176,6 +176,8 @@ def RebinN(h,nBin): label="2l_" if y == "1L": label="1L_" if y == "1Ele" or y == "1Mu": label="1l_" +## if y == "1Ele" or y == "1Mu": label="1Mu_" +## if y == "1Ele" or y == "1Mu": label="1Ele_" if y == "2L": label="2L_" ## if opts.kTest==20: label="combined_" @@ -475,7 +477,7 @@ def RebinN(h,nBin): # "CMS_scale_PileUpDataMC_j":{"type":"shape", "wsname":"CMS_scale_PileUpDataMC_j","name":"JES_PileUpDataMC","proc":[".*"]}, ## name used for shape # "CMS_scale_PileUpPtRef_j":{"type":"shape", "wsname":"CMS_scale_PileUpPtRef_j","name":"JES_PileUpPtRef","proc":[".*"]}, ## name used for shape ##### comment since are null -# "CMS_scale_RelativeJEREC2_j":{"type":"shape", "wsname":"CMS_scale_RelativeJEREC2_j","name":"JES_RelativeJEREC2","proc":[".*"]}, ## name used for shape # "CMS_scale_RelativePtEC2_j":{"type":"shape", "wsname":"CMS_scale_RelativePtEC2_j","name":"JES_RelativePtEC2","proc":[".*"]}, ## name used for shape +# "CMS_scale_RelativeJEREC2_j":{"type":"shape", "wsname":"CMS_scale_RelativeJEREC2_j","name":"JES_RelativeJEREC2","proc":[".*"]}, ## name used for shape # "CMS_scale_PileUpPtEC2_j":{"type":"shape", "wsname":"CMS_scale_PileUpPtEC2_j","name":"JES_PileUpPtEC2","proc":[".*"]}, ## name used for shape # "CMS_scale_RelativeJERHF_j":{"type":"shape", "wsname":"CMS_scale_RelativeJERHF_j","name":"JES_RelativeJERHF","proc":[".*"]}, ## name used for shape # "CMS_scale_RelativePtHF_j":{"type":"shape", "wsname":"CMS_scale_RelativePtHF_j","name":"JES_RelativePtHF","proc":[".*"]}, ## name used for shape @@ -510,12 +512,12 @@ def RebinN(h,nBin): #print "---------------------- --------" #fileTmp="AUG6_HT/"+label+VarTest+opts.output -fileTmp="JULY29_HT200_like100/"+ label + VarTest + str(opts.kMass) + opts.output +fileTmp="JULY30_TEST/"+ label + VarTest + str(opts.kMass) + opts.output w = ROOT.RooWorkspace("w","w") datNameTmp = opts.datCardName #datName = "AUG6_HT/"+ label + VarTest + datNameTmp -datName = "JULY29_HT200_like100/"+ label + VarTest + str(opts.kMass) + datNameTmp +datName = "JULY30_TEST/"+ label + VarTest + str(opts.kMass) + datNameTmp datacard=open(datName,"w") datacard.write("-------------------------------------\n") @@ -950,9 +952,9 @@ def importStat(): -if doSyst: writeNormSyst("QCDscale_ttbar",["0.965/1.024","0.965/1.024","0.965/1.024","0.965/1.024","0.965/1.024"],["ttlf","ttcc","ttb"]) -if doSyst: writeNormSyst("pdf_gg",["1.042","1.042","1.042","1.042","1.042"],["ttlf","ttcc","ttb"]) -if doSyst: writeNormSyst("CMS_mass_ttbar",["1.027","1.027","1.027","1.027","1.027"],["ttlf","ttcc","ttb"]) +if doSyst: writeNormSyst("QCDscale_ttbar",["0.965/1.024","0.965/1.024","0.965/1.024"],["ttlf","ttcc","ttb"]) +if doSyst: writeNormSyst("pdf_gg",["1.042","1.042","1.042"],["ttlf","ttcc","ttb"]) +if doSyst: writeNormSyst("CMS_mass_ttbar",["1.027","1.027","1.027"],["ttlf","ttcc","ttb"]) ###if doSyst: writeNormSyst("CMS_HPTB_QCDscale_ttlf",["1.50"],["ttlf"]) if doSyst: writeNormSyst("bgnorm_ttcc",["1.50"],["ttcc"]) @@ -1101,9 +1103,11 @@ def SmoothAndMergeSyst(tfile,togetNom,togetSyst,s): if 'Down' in s: return hDown -def envelop(tfile,togetClone, s) : +def envelop(tfile,togetNom, togetSyst, s) : - hname=togetClone+'RF'+s + hTmpNom=MergeCategory(tfile,togetNom) + + hname=togetSyst+'RF'+s hTmp=MergeCategory(tfile,hname) h=hTmp.Clone() @@ -1112,21 +1116,36 @@ def envelop(tfile,togetClone, s) : for w in [ 'R','F','RF']: for var in [ 'Up','Down']: - hnameClone=togetClone+w+var + hnameSyst=togetSyst+w+var - hTmp=MergeCategory(tfile,hnameClone) + hTmp=MergeCategory(tfile,hnameSyst) for iBin in range(1,h.GetNbinsX()+1): c= h.GetBinContent(iBin) - ## take the maximum for the Up and Down + ## take the maximum for the Up if 'Up' in s and hTmp.GetBinContent(iBin)>c: h.SetBinContent(iBin,hTmp.GetBinContent(iBin)) ## take the minimum for the Down if 'Down' in s and hTmp.GetBinContent(iBin) Date: Wed, 1 Aug 2018 21:03:31 +0200 Subject: [PATCH 30/60] card tb leptonic: fix envelop --- script/bwsTB.py | 35 +++++++++++++++-------------------- 1 file changed, 15 insertions(+), 20 deletions(-) diff --git a/script/bwsTB.py b/script/bwsTB.py index 8b5fae22..c12d452c 100644 --- a/script/bwsTB.py +++ b/script/bwsTB.py @@ -18,23 +18,23 @@ #nBinsHT=4 #nBinsHT=5 -doSyst = False +doSyst = True likelihoodBinning = FwRebin.RebinLikelihood(LikeBins) parser= OptionParser() -parser.add_option("","--input1L",type='string',help="Input ROOT file. [%default]", default="/afs/cern.ch/work/d/dalfonso/CMSSW_9_1_0_pre2_ReTestNERO/src/ChargedHiggs/JUNE29_FINAL_2ThirdSYST_bin200_wDATA_1l.root") -parser.add_option("","--input2L",type='string',help="Input ROOT file. [%default]", default="/afs/cern.ch/work/d/dalfonso/CMSSW_9_1_0_pre2_ReTestNERO/src/ChargedHiggs/JUNE29_FINAL_2ThirdSYST_bin200_wDATA_2l.root") +#parser.add_option("","--input1L",type='string',help="Input ROOT file. [%default]", default="/afs/cern.ch/work/d/dalfonso/CMSSW_9_1_0_pre2_ReTestNERO/src/ChargedHiggs/JUNE29_FINAL_2ThirdSYST_bin200_wDATA_1l.root") +#parser.add_option("","--input2L",type='string',help="Input ROOT file. [%default]", default="/afs/cern.ch/work/d/dalfonso/CMSSW_9_1_0_pre2_ReTestNERO/src/ChargedHiggs/JUNE29_FINAL_2ThirdSYST_bin200_wDATA_2l.root") -parser.add_option("","--input1LBin",type='string',help="Input ROOT file. [%default]", default="/afs/cern.ch/work/d/dalfonso/CMSSW_9_1_0_pre2_ReTestNERO/src/ChargedHiggs/JUNE1_1l_1Third.root") -parser.add_option("","--input2LBin",type='string',help="Input ROOT file. [%default]", default="/afs/cern.ch/work/d/dalfonso/CMSSW_9_1_0_pre2_ReTestNERO/src/ChargedHiggs/JUNE1_2l_1Third.root") +#parser.add_option("","--input1LBin",type='string',help="Input ROOT file. [%default]", default="/afs/cern.ch/work/d/dalfonso/CMSSW_9_1_0_pre2_ReTestNERO/src/ChargedHiggs/JUNE1_1l_1Third.root") +#parser.add_option("","--input2LBin",type='string',help="Input ROOT file. [%default]", default="/afs/cern.ch/work/d/dalfonso/CMSSW_9_1_0_pre2_ReTestNERO/src/ChargedHiggs/JUNE1_2l_1Third.root") -#parser.add_option("","--input1L",type='string',help="Input ROOT file. [%default]", default="/afs/cern.ch/work/d/dalfonso/CMSSW_9_1_0_pre2_ReTestNERO/src/ChargedHiggs/JULY29_FINAL_2ThirdSYST_bin200_wDATA_1l.root") -#parser.add_option("","--input2L",type='string',help="Input ROOT file. [%default]", default="/afs/cern.ch/work/d/dalfonso/CMSSW_9_1_0_pre2_ReTestNERO/src/ChargedHiggs/JULY29_FINAL_2ThirdSYST_bin200_wDATA_2l.root") +parser.add_option("","--input1L",type='string',help="Input ROOT file. [%default]", default="/afs/cern.ch/work/d/dalfonso/CMSSW_9_1_0_pre2_ReTestNERO/src/ChargedHiggs/JULY29_FINAL_2ThirdSYST_bin200_wDATA_1l.root") +parser.add_option("","--input2L",type='string',help="Input ROOT file. [%default]", default="/afs/cern.ch/work/d/dalfonso/CMSSW_9_1_0_pre2_ReTestNERO/src/ChargedHiggs/JULY29_FINAL_2ThirdSYST_bin200_wDATA_2l.root") -#parser.add_option("","--input1LBin",type='string',help="Input ROOT file. [%default]", default="/afs/cern.ch/work/d/dalfonso/CMSSW_9_1_0_pre2_ReTestNERO/src/ChargedHiggs/JULY29_1l_1Third.root") -#parser.add_option("","--input2LBin",type='string',help="Input ROOT file. [%default]", default="/afs/cern.ch/work/d/dalfonso/CMSSW_9_1_0_pre2_ReTestNERO/src/ChargedHiggs/JULY29_2l_1Third.root") +parser.add_option("","--input1LBin",type='string',help="Input ROOT file. [%default]", default="/afs/cern.ch/work/d/dalfonso/CMSSW_9_1_0_pre2_ReTestNERO/src/ChargedHiggs/JULY29_1l_1Third.root") +parser.add_option("","--input2LBin",type='string',help="Input ROOT file. [%default]", default="/afs/cern.ch/work/d/dalfonso/CMSSW_9_1_0_pre2_ReTestNERO/src/ChargedHiggs/JULY29_2l_1Third.root") ###### ###### @@ -512,12 +512,12 @@ def RebinN(h,nBin): #print "---------------------- --------" #fileTmp="AUG6_HT/"+label+VarTest+opts.output -fileTmp="JULY30_TEST/"+ label + VarTest + str(opts.kMass) + opts.output +fileTmp="AUG1_HT200_like100/"+ label + VarTest + str(opts.kMass) + opts.output w = ROOT.RooWorkspace("w","w") datNameTmp = opts.datCardName #datName = "AUG6_HT/"+ label + VarTest + datNameTmp -datName = "JULY30_TEST/"+ label + VarTest + str(opts.kMass) + datNameTmp +datName = "AUG1_HT200_like100/"+ label + VarTest + str(opts.kMass) + datNameTmp datacard=open(datName,"w") datacard.write("-------------------------------------\n") @@ -1133,20 +1133,15 @@ def envelop(tfile,togetNom, togetSyst, s) : if 'Up' in s: hTmpUp = h - hTmpDown = hTmpNom - - if 'Down' in s: - hTmpUp = hTmpNom - hTmpDown = h - - hUp, hDown = SS.SystematicSmoother(hTmpNom, hTmpUp, hTmpDown,"~/www/ChargedHiggsTB/JULY30/SYST/").smooth() - - if 'Up' in s: + hUp, hDown = SS.SystematicSmoother(hTmpNom, hTmpUp, hTmpUp.Clone("test1"),"~/www/ChargedHiggsTB/JULY30/SYST/").smooth() return hUp if 'Down' in s: + hTmpDown = h + hUp, hDown = SS.SystematicSmoother(hTmpNom, hTmpDown.Clone("test1"), hTmpDown,"~/www/ChargedHiggsTB/JULY30/SYST/").smooth() return hDown + ## import Everything in ws TODO def importPdfFromTH1(cat,mc,myBin,LikelihoodMapping,syst=None): From 25e82495ce4061d43b769c311a0d275ba5eb4c77 Mon Sep 17 00:00:00 2001 From: maria Date: Mon, 6 Aug 2018 18:19:11 +0200 Subject: [PATCH 31/60] add one nuissance for highPT --- interface/SF_CSVReweight.hpp | 3 ++- interface/Smearer.hpp | 6 ++++++ src/SF_CSVReweight.cpp | 1 + src/Smearer.cpp | 1 + 4 files changed, 10 insertions(+), 1 deletion(-) diff --git a/interface/SF_CSVReweight.hpp b/interface/SF_CSVReweight.hpp index 4266485e..36b5d16b 100644 --- a/interface/SF_CSVReweight.hpp +++ b/interface/SF_CSVReweight.hpp @@ -22,6 +22,7 @@ class SF_CSVReweight : public SF_Asymm public: Systematics::Type systType=Systematics::NA; // I'll use this one + int highPt{0}; SF_CSVReweight(){} void print(){}; @@ -30,7 +31,7 @@ class SF_CSVReweight : public SF_Asymm void add_to_sf( float pt, float eta, float csv, int flavor); const string name() const override {return "SF_CSVReweight";} void clearEvent() override { pt_.clear(); eta_.clear(); csv_.clear(); flavor_.clear(); } - void clearSyst()override { syst=0; systType=Systematics::NA;} // reset systs. called in clearSyst + void clearSyst()override { syst=0; systType=Systematics::NA;highPt=0;} // reset systs. called in clearSyst }; diff --git a/interface/Smearer.hpp b/interface/Smearer.hpp index 52d6c682..e56f9c21 100644 --- a/interface/Smearer.hpp +++ b/interface/Smearer.hpp @@ -64,6 +64,7 @@ class SmearJesAndCSV : virtual public SmearBase std::unique_ptr jes; //int num_; // this follow the CSV Reweight skim, while the constructor is 1->5 Systematics::Type num_; + int highPt{0}; public: SmearJesAndCSV() : SmearBase(){ @@ -73,6 +74,7 @@ class SmearJesAndCSV : virtual public SmearBase SmearJesAndCSV(int num) : SmearBase(){ // num -> 1,5 (1 is JES num_ = Systematics::NA; + highPt=0; if (num == 1){num_=Systematics::JESup;name_="JESANDCSV";} if (num == 2){num_=Systematics::CSVHFup;name_="CSVRHF";} if (num == 3){num_=Systematics::CSVLFup;name_="CSVRLF";} @@ -82,6 +84,10 @@ class SmearJesAndCSV : virtual public SmearBase if (num == 7){num_=Systematics::CSVLFStats2up; name_="CSVRLFSTAT2";} if (num == 8){num_=Systematics::CSVCErr1up; name_="CSVRCERR1";} if (num == 9){num_=Systematics::CSVCErr2up; name_="CSVRCERR2";} + if (num == 10){num_=Systematics::JESup;highPt=1;name_="JESANDCSVHighPt";} + if (num == 11){num_=Systematics::CSVHFup;highPt=1;name_="CSVRHFHighPt";} + if (num == 12){num_=Systematics::CSVLFup;highPt=1;name_="CSVRLFHighPt";} + if (num == 13){num_=Systematics::CSVCErr1up; highPt=1;name_="CSVRCERR1HighPt";} jes . reset (new SmearJes()); } diff --git a/src/SF_CSVReweight.cpp b/src/SF_CSVReweight.cpp index 435fc0e8..197e96a0 100644 --- a/src/SF_CSVReweight.cpp +++ b/src/SF_CSVReweight.cpp @@ -22,6 +22,7 @@ void SF_CSVReweight::set(){ void SF_CSVReweight::add_to_sf(float pt, float eta, float csv, int flavor) { + if (highPt and pt< 160 ) return; //MARIA_HIGHPT_HARDCODED pt_.push_back( pt ); eta_.push_back( eta ); csv_.push_back( csv ); diff --git a/src/Smearer.cpp b/src/Smearer.cpp index cd43a737..5c8e6ced 100644 --- a/src/Smearer.cpp +++ b/src/Smearer.cpp @@ -35,6 +35,7 @@ int SmearJesAndCSV::smear(Event *e) jes->smear(e); SF_CSVReweight * sf= dynamic_cast(e->GetWeight()->GetSF("btag-reweight")); + sf->highPt=highPt; switch( num_ ) { case Systematics::JESup : From e528b3ba33318b21d068afeae8e2773bc9447462 Mon Sep 17 00:00:00 2001 From: maria Date: Fri, 10 Aug 2018 19:08:37 +0200 Subject: [PATCH 32/60] back to one ttbar process; decorrelate the SDmass and jes; fix envelop & smooth --- script/bwsFullHadTB.py | 185 ++++++++++++++++++++++++----------------- 1 file changed, 111 insertions(+), 74 deletions(-) diff --git a/script/bwsFullHadTB.py b/script/bwsFullHadTB.py index d87c5e25..1b522864 100644 --- a/script/bwsFullHadTB.py +++ b/script/bwsFullHadTB.py @@ -13,8 +13,9 @@ # original binning is 10GeV nRebinHT=1 #nRebinHT=5 -LikeBins=10 -#LikeBins=1 +#LikeBins=10 +LikeBins=1 +#LikeBins=2 doRebin = False applyLikelihoodRebinBin = True @@ -74,12 +75,19 @@ #parser.add_option("","--input",type='string',help="Input ROOT file. [%default]", default="/afs/cern.ch/user/h/hum/work/public/CMSSW_8_0_26_patch1/src/ChargedHiggs/ntufile/post0systlimit_ALL.root") #parser.add_option("","--inputBin",type='string',help="Input ROOT file. [%default]", default="/afs/cern.ch/user/h/hum/work/public/CMSSW_8_0_26_patch1/src/ChargedHiggs/ntufile/post0systlimit_ALL.root") -### NEW TO BE USED +### USED at the pre-approval #parser.add_option("","--input",type='string',help="Input ROOT file. [%default]", default="/afs/cern.ch/user/h/hum/work/public/CMSSW_8_0_26_patch1/src/ChargedHiggs/ntufile/preapp0syst.root") #parser.add_option("","--inputBin",type='string',help="Input ROOT file. [%default]", default="/afs/cern.ch/user/h/hum/work/public/CMSSW_8_0_26_patch1/src/ChargedHiggs/ntufile/preapp0syst.root") -parser.add_option("","--input",type='string',help="Input ROOT file. [%default]", default="/afs/cern.ch/user/h/hum/work/public/CMSSW_8_0_26_patch1/src/ChargedHiggs/ntufile/preapp2twothird.root") -parser.add_option("","--inputBin",type='string',help="Input ROOT file. [%default]", default="/afs/cern.ch/user/h/hum/work/public/CMSSW_8_0_26_patch1/src/ChargedHiggs/ntufile/preapp2onethird.root") +### removing spikes and without low HT cut +#parser.add_option("","--input",type='string',help="Input ROOT file. [%default]", default="/afs/cern.ch/user/h/hum/work/public/CMSSW_8_0_26_patch1/src/ChargedHiggs/ntufile/preapp2twothird.root") +#parser.add_option("","--inputBin",type='string',help="Input ROOT file. [%default]", default="/afs/cern.ch/user/h/hum/work/public/CMSSW_8_0_26_patch1/src/ChargedHiggs/ntufile/preapp2onethird.root") + +#parser.add_option("","--input",type='string',help="Input ROOT file. [%default]", default="/afs/cern.ch/user/h/hum/work/public/CMSSW_8_0_26_patch1/src/ChargedHiggs/ntufile/preapp2systNoSpi.root") +#parser.add_option("","--inputBin",type='string',help="Input ROOT file. [%default]", default="/afs/cern.ch/user/h/hum/work/public/CMSSW_8_0_26_patch1/src/ChargedHiggs/ntufile/preapp2systNoSpi.root") + +parser.add_option("","--input",type='string',help="Input ROOT file. [%default]", default="/afs/cern.ch/user/h/hum/work/public/CMSSW_8_0_26_patch1/src/ChargedHiggs/ntufile/preapp2systttb70.root") +parser.add_option("","--inputBin",type='string',help="Input ROOT file. [%default]", default="/afs/cern.ch/user/h/hum/work/public/CMSSW_8_0_26_patch1/src/ChargedHiggs/ntufile/preapp2systttb70.root") ## REMEMBER TO: # a) change the rebin 20% to 50% Inf @@ -513,12 +521,12 @@ def mergeCategory(tfile,toget): # catStore[name]["hasMC"]=["qcd","top","Hptb"] ### QCD uncorrelated - if ( y=="wbb" or y=="wbj") and "_one" in x: catStore[name]["hasMC"]=["qcd_wx_one","ttb","ttc","ttlight","Hptb","top","ewk"] - if ( y=="wbb" or y=="wbj") and "_two" in x: catStore[name]["hasMC"]=["qcd_wx_two","ttb","ttc","ttlight","Hptb","top","ewk"] - if ( y=="wbb" or y=="wbj") and "_three" in x: catStore[name]["hasMC"]=["qcd_wx_three","ttb","ttc","ttlight","Hptb","top","ewk"] - if ( y=="t0b" or y=="t1b") and "_one" in x: catStore[name]["hasMC"]=["qcd_tx_one","ttb","ttc","ttlight","Hptb","top","ewk"] - if ( y=="t0b" or y=="t1b") and "_two" in x: catStore[name]["hasMC"]=["qcd_tx_two","ttb","ttc","ttlight","Hptb","top","ewk"] - if ( y=="t0b" or y=="t1b") and "_three" in x: catStore[name]["hasMC"]=["qcd_tx_three","ttb","ttc","ttlight","Hptb","top","ewk"] + if ( y=="wbb" or y=="wbj") and "_one" in x: catStore[name]["hasMC"]=["qcd_wx_one","ttbar","Hptb","top","ewk"] + if ( y=="wbb" or y=="wbj") and "_two" in x: catStore[name]["hasMC"]=["qcd_wx_two","ttbar","Hptb","top","ewk"] + if ( y=="wbb" or y=="wbj") and "_three" in x: catStore[name]["hasMC"]=["qcd_wx_three","ttbar","Hptb","top","ewk"] + if ( y=="t0b" or y=="t1b") and "_one" in x: catStore[name]["hasMC"]=["qcd_tx_one","ttbar","Hptb","top","ewk"] + if ( y=="t0b" or y=="t1b") and "_two" in x: catStore[name]["hasMC"]=["qcd_tx_two","ttbar","Hptb","top","ewk"] + if ( y=="t0b" or y=="t1b") and "_three" in x: catStore[name]["hasMC"]=["qcd_tx_three","ttbar","Hptb","top","ewk"] if doSChannel: mcStore={ @@ -530,11 +538,10 @@ def mergeCategory(tfile,toget): "qcd_tx_one":{"name":"qcd_tx_one", "hist":["QCD_HT"], "num":4 }, "qcd_tx_two":{"name":"qcd_tx_two", "hist":["QCD_HT"], "num":5 }, "qcd_tx_three":{"name":"qcd_tx_three", "hist":["QCD_HT"], "num":6 }, - "ttb":{ "name":"ttb","hist":["ttb_TT_TuneCUETP8M2T4"],"num":7}, - "ttc":{ "name":"ttc","hist":["ttc_TT_TuneCUETP8M2T4"],"num":8}, - "ttlight":{ "name":"ttlight","hist":["ttlight_TT_TuneCUETP8M2T4"],"num":9}, - "top":{ "name":"top","hist":["ST","TTX"],"num":10}, - "ewk":{ "name":"ewk","hist":["ewk"],"num":11} +## "ttbar":{ "name":"ttbar","hist":["ttb_TT_TuneCUETP8M2T4","ttc_TT_TuneCUETP8M2T4","ttlight_TT_TuneCUETP8M2T4"],"num":7}, + "ttbar":{ "name":"ttbar","hist":["TT_TuneCUETP8M2T4_13TeV-powheg-pythia8"],"num":7}, + "top":{ "name":"top","hist":["ST","TTX"],"num":8}, + "ewk":{ "name":"ewk","hist":["ewk"],"num":9} } else: mcStore={ @@ -546,11 +553,10 @@ def mergeCategory(tfile,toget): "qcd_tx_one":{"name":"qcd_tx_one", "hist":["QCD_HT"], "num":4 }, "qcd_tx_two":{"name":"qcd_tx_two", "hist":["QCD_HT"], "num":5 }, "qcd_tx_three":{"name":"qcd_tx_three", "hist":["QCD_HT"], "num":6 }, - "ttb":{ "name":"ttb","hist":["ttb_TT_TuneCUETP8M2T4"],"num":7}, - "ttc":{ "name":"ttc","hist":["ttc_TT_TuneCUETP8M2T4"],"num":8}, - "ttlight":{ "name":"ttlight","hist":["ttlight_TT_TuneCUETP8M2T4"],"num":9}, - "top":{ "name":"top","hist":["ST","TTX"],"num":10}, - "ewk":{ "name":"ewk","hist":["ewk"],"num":11} +# "ttbar":{ "name":"ttbar","hist":["ttb_TT_TuneCUETP8M2T4","ttc_TT_TuneCUETP8M2T4","ttlight_TT_TuneCUETP8M2T4"],"num":7}, + "ttbar":{ "name":"ttbar","hist":["TT_TuneCUETP8M2T4_13TeV-powheg-pythia8"],"num":7}, + "top":{ "name":"top","hist":["ST","TTX"],"num":8}, + "ewk":{ "name":"ewk","hist":["ewk"],"num":9} } if doSyst: @@ -563,31 +569,44 @@ def mergeCategory(tfile,toget): ### trigger efficiency "CMS_eff_trigger":{"type":"lnN", "value":["1.05"] ,"proc":[".*"],"wsname":"CMS_eff_triggger","name":"XXX"}, ### Theory modeling - "CMS_topreweight":{"type":"shape", "wsname":"CMS_topreweight","name":"TOPRW","proc":["ttb","ttc","ttlight"]}, - "muRF_ttbar":{"type":"shape", "wsname":"muRF_ttbar","name":"Scale","proc":["ttb","ttc","ttlight"]}, + "CMS_topreweight":{"type":"shape", "wsname":"CMS_topreweight","name":"TOPRW","proc":["ttbar"]}, + "muRF_ttbar":{"type":"shape", "wsname":"muRF_ttbar","name":"Scale","proc":["ttbar"]}, "muRF_Hptb":{"type":"shape", "wsname":"muRF_Hptb","name":"Scale","proc":["Hptb"]}, ### MET-Jets-PU - "CMS_pileup":{"type":"shape", "wsname":"CMS_pileup","name":"PU","proc":["qcd_wx_one","qcd_wx_two","qcd_wx_three","qcd_tx_one","qcd_tx_two","qcd_tx_three","ttb","ttc","ttlight","top","Hptb"]}, - "CMS_scale_uncluster":{"type":"shape", "wsname":"CMS_scale_uncluster","name":"UNCLUSTER","proc":["qcd_wx_one","qcd_wx_two","qcd_wx_three","qcd_tx_one","qcd_tx_two","qcd_tx_three","ttb","ttc","ttlight","top","Hptb"]}, - "CMS_scale_SDMass":{"type":"shape", "wsname":"CMS_scale_SDMass","name":"SDMassSCALE","proc":["qcd_wx_one","qcd_wx_two","qcd_wx_three","qcd_tx_one","qcd_tx_two","qcd_tx_three","ttb","ttc","ttlight","top","Hptb"]}, - "CMS_eff_Tau21":{"type":"lnN", "value":["1.08","1.08","1.08","1.08"] ,"proc":["ttb","ttc","ttlight","Hptb"],"wsname":"CMS_eff_Tau21","name":"XXX"}, ## name used for shape - "CMS_eff_Tau32":{"type":"lnN", "value":["1.02","1.02","1.02","1.02"] ,"proc":["ttb","ttc","ttlight","Hptb"],"wsname":"CMS_eff_Tau32","name":"XXX"}, ## name used for shape + "CMS_pileup":{"type":"shape", "wsname":"CMS_pileup","name":"PU","proc":["qcd_wx_one","qcd_wx_two","qcd_wx_three","qcd_tx_one","qcd_tx_two","qcd_tx_three""ttbar","top","Hptb"]}, + "CMS_scale_uncluster":{"type":"shape", "wsname":"CMS_scale_uncluster","name":"UNCLUSTER","proc":["qcd_wx_one","qcd_wx_two","qcd_wx_three","qcd_tx_one","qcd_tx_two","qcd_tx_three","ttbar","top","Hptb"]}, + ## SDmass + "CMS_scale_SDMass":{"type":"shape", "wsname":"CMS_scale_SDMass","name":"SDMassSCALE","proc":["ttbar","top","Hptb"]}, + "CMS_scale_SDMass_qcd_wx":{"type":"shape", "wsname":"CMS_scale_SDMass_qcd_wx","name":"SDMassSCALE","proc":["qcd_wx_one","qcd_wx_two","qcd_wx_three"]}, + "CMS_scale_SDMass_qcd_tx":{"type":"shape", "wsname":"CMS_scale_SDMass_qcd_tx","name":"SDMassSCALE","proc":["qcd_tx_one","qcd_tx_two","qcd_tx_three"]}, + ## Taus + "CMS_eff_Tau21":{"type":"lnN", "value":["1.08","1.08","1.08"] ,"proc":["ttbar","top","Hptb"],"wsname":"CMS_eff_Tau21","name":"XXX"}, ## name used for shape + "CMS_eff_Tau32":{"type":"lnN", "value":["1.02","1.02","1.02"] ,"proc":["ttbar","top","Hptb"],"wsname":"CMS_eff_Tau32","name":"XXX"}, ## name used for shape + ## JER/S "CMS_res_j":{"type":"shape", "wsname":"CMS_res_j","name":"JER","proc":[".*"]}, - "CMS_scale_j_qcd":{"type":"shape", "wsname":"CMS_scale_j_qcd","name":"JESANDCSV","proc":["qcd_wx_one","qcd_wx_two","qcd_wx_three","qcd_tx_one","qcd_tx_two","qcd_tx_three"]}, - "CMS_scale_j":{"type":"shape", "wsname":"CMS_scale_j","name":"JESANDCSV","proc":["Hptb","ttb","ttc","ttlight","top"]}, + "CMS_scale_j":{"type":"shape", "wsname":"CMS_scale_j","name":"JESANDCSV","proc":["Hptb","ttbar","top"]}, + "CMS_scale_j_qcd_wx":{"type":"shape", "wsname":"CMS_scale_j_qcd_wx","name":"JESANDCSV","proc":["qcd_wx_one","qcd_wx_two","qcd_wx_three"]}, + "CMS_scale_j_qcd_tx":{"type":"shape", "wsname":"CMS_scale_j_qcd_tx","name":"JESANDCSV","proc":["qcd_tx_one","qcd_tx_two","qcd_tx_three"]}, ##Light jets Heavy flavor contamination "CMS_btag_HF_qcd":{"type":"shape", "wsname":"CMS_btag_HF_qcd","name":"CSVRHF","proc":["qcd_wx_one","qcd_wx_two","qcd_wx_three","qcd_tx_one","qcd_tx_two","qcd_tx_three"]}, - "CMS_btag_HF":{"type":"shape", "wsname":"CMS_btag_HF","name":"CSVRHF","proc":["ttb","ttc","ttlight","top","Hptb"]}, + "CMS_btag_HF":{"type":"shape", "wsname":"CMS_btag_HF","name":"CSVRHF","proc":["ttbar","top","Hptb"]}, ##Heavy jets light flavor contamination - "CMS_btag_LF":{"type":"shape", "wsname":"CMS_btag_LF","name":"CSVRLF","proc":["qcd_wx_one","qcd_wx_two","qcd_wx_three","qcd_tx_one","qcd_tx_two","qcd_tx_three","Hptb","ttb","ttc","ttlight","top"]}, + "CMS_btag_LF":{"type":"shape", "wsname":"CMS_btag_LF","name":"CSVRLF","proc":["ttbar","top","Hptb"]}, + "CMS_btag_LF_qcd":{"type":"shape", "wsname":"CMS_btag_LF","name":"CSVRLF","proc":["qcd_wx_one","qcd_wx_two","qcd_wx_three","qcd_tx_one","qcd_tx_two","qcd_tx_three"]}, ##Linear and quadratic uncertainties # note decouple the qcd - "CMS_btag_HFstat1":{"type":"shape", "wsname":"CMS_btag_HFstat1","name":"CSVRHFSTAT1","proc":["ttb","ttc","ttlight","top","Hptb","top"]}, - "CMS_btag_HFstat2":{"type":"shape", "wsname":"CMS_btag_HFstat2","name":"CSVRHFSTAT2","proc":["ttb","ttc","ttlight","top","Hptb","top"]}, - "CMS_btag_LFstat1":{"type":"shape", "wsname":"CMS_btag_LFstat1","name":"CSVRLFSTAT1","proc":["ttb","ttc","ttlight","top","Hptb","top"]}, - "CMS_btag_LFstat2":{"type":"shape", "wsname":"CMS_btag_LFstat2","name":"CSVRLFSTAT2","proc":["ttb","ttc","ttlight","top","Hptb","top"]}, - "CMS_btag_CFerr1":{"type":"shape", "wsname":"CMS_btag_CFerr1","name":"CSVRCERR1","proc":["ttb","ttc","ttlight","top","Hptb","top"]}, - "CMS_btag_CFerr2":{"type":"shape", "wsname":"CMS_btag_CFerr2","name":"CSVRCERR2","proc":["ttb","ttc","ttlight","top","Hptb","top"]} + "CMS_btag_HFstat1":{"type":"shape", "wsname":"CMS_btag_HFstat1","name":"CSVRHFSTAT1","proc":["ttbar","top","Hptb","top"]}, + "CMS_btag_HFstat2":{"type":"shape", "wsname":"CMS_btag_HFstat2","name":"CSVRHFSTAT2","proc":["ttbar","top","Hptb","top"]}, + "CMS_btag_LFstat1":{"type":"shape", "wsname":"CMS_btag_LFstat1","name":"CSVRLFSTAT1","proc":["ttbar","top","Hptb","top"]}, + "CMS_btag_LFstat2":{"type":"shape", "wsname":"CMS_btag_LFstat2","name":"CSVRLFSTAT2","proc":["ttbar","top","Hptb","top"]}, + "CMS_btag_CFerr1":{"type":"shape", "wsname":"CMS_btag_CFerr1","name":"CSVRCERR1","proc":["ttbar","top","Hptb","top"]}, + "CMS_btag_CFerr2":{"type":"shape", "wsname":"CMS_btag_CFerr2","name":"CSVRCERR2","proc":["ttbar","top","Hptb","top"]}, + "CMS_btag_HFstat1_qcd":{"type":"shape", "wsname":"CMS_btag_HFstat1_qcd","name":"CSVRHFSTAT1","proc":["qcd_wx_one","qcd_wx_two","qcd_wx_three","qcd_tx_one","qcd_tx_two","qcd_tx_three"]}, + "CMS_btag_HFstat2_qcd":{"type":"shape", "wsname":"CMS_btag_HFstat2_qcd","name":"CSVRHFSTAT2","proc":["qcd_wx_one","qcd_wx_two","qcd_wx_three","qcd_tx_one","qcd_tx_two","qcd_tx_three"]}, + "CMS_btag_LFstat1_qcd":{"type":"shape", "wsname":"CMS_btag_LFstat1_qcd","name":"CSVRLFSTAT1","proc":["qcd_wx_one","qcd_wx_two","qcd_wx_three","qcd_tx_one","qcd_tx_two","qcd_tx_three"]}, + "CMS_btag_LFstat2_qcd":{"type":"shape", "wsname":"CMS_btag_LFstat2_qcd","name":"CSVRLFSTAT2","proc":["qcd_wx_one","qcd_wx_two","qcd_wx_three","qcd_tx_one","qcd_tx_two","qcd_tx_three"]}, + "CMS_btag_CFerr1_qcd":{"type":"shape", "wsname":"CMS_btag_CFerr1_qcd","name":"CSVRCERR1","proc":["qcd_wx_one","qcd_wx_two","qcd_wx_three","qcd_tx_one","qcd_tx_two","qcd_tx_three"]}, + "CMS_btag_CFerr2_qcd":{"type":"shape", "wsname":"CMS_btag_CFerr2_qcd","name":"CSVRCERR2","proc":["qcd_wx_one","qcd_wx_two","qcd_wx_three","qcd_tx_one","qcd_tx_two","qcd_tx_three"]} #### } else: @@ -600,11 +619,11 @@ def mergeCategory(tfile,toget): print "* ",cat,":",catStore[cat] print "---------------------- --------" -fileTmp="MIAO_JULY27/"+label+VarTest+opts.kMass+"_"+opts.output +fileTmp="MIAO_AUG10/"+label+VarTest+opts.kMass+"_"+opts.output w = ROOT.RooWorkspace("w","w") datNameTmp = opts.datCardName -datName = "MIAO_JULY27/"+label+ VarTest+opts.kMass+"_" + datNameTmp +datName = "MIAO_AUG10/"+label+ VarTest+opts.kMass+"_" + datNameTmp datacard=open(datName,"w") datacard.write("-------------------------------------\n") @@ -729,7 +748,9 @@ def writeNormSystLU(name="lumi",valueL=["1.027","1.026"], regexpL=["TT","ST",""] invert=False for cat in catStore: + for proc in mcStore: + if skip(catStore[cat],mcStore[proc]): continue idx=-1 invert=False @@ -882,19 +903,29 @@ def importStat(): else: writeSystShape(systStore[syst],systStore[syst]["proc"]) -if doSyst: writeNormSyst("QCDscale_ttbar",["0.965/1.024","0.965/1.024","0.965/1.024"],["ttb","ttc","ttlight"]) -if doSyst: writeNormSyst("pdf_gg",["1.042","1.042","1.042"],["ttb","ttc","ttlight"]) -if doSyst: writeNormSyst("CMS_mass_top",["1.027","1.027","1.027"],["ttb","ttc","ttlight"]) +if doSyst: writeNormSyst("QCDscale_ttbar",["0.965/1.024"],["ttbar"]) +if doSyst: writeNormSyst("pdf_gg",["1.042"],["ttbar"]) +if doSyst: writeNormSyst("CMS_mass_top",["1.027"],["ttbar"]) ## "top" get the value od the single top if doSyst: writeNormSyst("QCDscale_top",["0.977/1.028"],["top"]) if doSyst: writeNormSyst("pdf_top",["1.026"],["top"]) if doSyst: writeNormSyst("CMS_mass_top",["1.022"],["top"]) +#if doSyst: writeNormSyst("bgnorm_tt2b",["1.50"],["tt2b"]) +#if doSyst: writeNormSyst("bgnorm_ttb",["1.30"],["ttb"]) +#if doSyst: writeNormSyst("bgnorm_ttc",["1.50"],["ttc"]) +#if doSyst: writeNormSyst("bgnorm_ttlight",["1.50"],["ttlight"]) + #if doSyst: writeNormSyst("CMS_HPTB_QCDnonclosure_",["1.20","1.20","1.20"],["qcd_wx_one","qcd_wx_two","qcd_wx_three"]) #if doSyst: writeNormSyst("CMS_HPTB_QCDnonclosure_",["1.20","1.20","1.20"],["qcd_tx_one","qcd_tx_two","qcd_tx_three"]) -if doSyst: writeNormSystLU("CMS_HPTB_QCDnonclosure",["2.","2.","2."],["qcd_wx_one","qcd_wx_two","qcd_wx_three"]) -if doSyst: writeNormSystLU("CMS_HPTB_QCDnonclosure",["2.","2.","2."],["qcd_tx_one","qcd_tx_two","qcd_tx_three"]) + +if doSyst: writeNormSystLU("CMS_HPTB_QCDnonclosure_wx_one",["2."],["qcd_wx_one"]) +if doSyst: writeNormSystLU("CMS_HPTB_QCDnonclosure_wx_two",["2."],["qcd_wx_two"]) +if doSyst: writeNormSystLU("CMS_HPTB_QCDnonclosure_wx_three",["2."],["qcd_wx_three"]) +if doSyst: writeNormSystLU("CMS_HPTB_QCDnonclosure_tx_one",["2."],["qcd_tx_one"]) +if doSyst: writeNormSystLU("CMS_HPTB_QCDnonclosure_tx_two",["2."],["qcd_tx_two"]) +if doSyst: writeNormSystLU("CMS_HPTB_QCDnonclosure_tx_three",["2."],["qcd_tx_three"]) ## "ewk" get the envelop of the DY and W+jets if doSyst: writeNormSyst("QCDscale_ewk",["0.996/1.008"],["ewk"]) @@ -906,7 +937,6 @@ def importStat(): #if doSyst: writeNormSyst("CMS_HPTB_QCDscale_ttbb",["1.50"],["ttbb"]) #if doSyst: writeNormSyst("CMS_HPTB_QCDscale_tt2b",["1.50"],["tt2b"]) - #if doSyst: writeNormSyst("QCDscale_ewk",["0.98/1.02"],["ewk"]) #if doSyst: writeNormSyst("pdf_qqbar",["1.04"],["ewk"]) @@ -991,8 +1021,6 @@ def SmoothAndMergeSyst(tfile,togetNom,togetSyst,s): # hDown = hTmpDown hUp, hDown = SS.SystematicSmoother(hTmpNom, hTmpUp, hTmpDown,"~/www/forMIAO/JUNE14/SYST").smooth() - hUp = hTmpUp - hDown = hTmpDown if 'Up' in s: return hUp @@ -1000,34 +1028,44 @@ def SmoothAndMergeSyst(tfile,togetNom,togetSyst,s): if 'Down' in s: return hDown +## Envelop+Smooth +def envelop(tfile,togetNom, togetSyst, s) : -def envelop(tfile,togetClone, s) : + hTmpNom=mergeCategory(tfile,togetNom) - hname=togetClone+'RF'+s - hTmp=mergeCategory(tfile,hname) + hname=togetSyst+'RF'+s + hTmp=mergeCategory(tfile,hname) + h=hTmp.Clone() - h=hTmp.Clone() + if hTmp==None: return - if hTmp==None: return + for w in [ 'R','F','RF']: + for var in [ 'Up','Down']: - for w in [ 'R','F','RF']: - for var in [ 'Up','Down']: + hnameSyst=togetSyst+w+var - hnameClone=togetClone+w+var + hTmp=mergeCategory(tfile,hnameSyst) - hTmp=mergeCategory(tfile,hnameClone) + for iBin in range(1,h.GetNbinsX()+1): + c= h.GetBinContent(iBin) - for iBin in range(1,h.GetNbinsX()+1): - c= h.GetBinContent(iBin) + ## take the maximum for the Up + if 'Up' in s and hTmp.GetBinContent(iBin)>c: + h.SetBinContent(iBin,hTmp.GetBinContent(iBin)) - ## take the maximum for the Up and Down - if 'Up' in s and hTmp.GetBinContent(iBin)>c: - h.SetBinContent(iBin,hTmp.GetBinContent(iBin)) + ## take the minimum for the Down + if 'Down' in s and hTmp.GetBinContent(iBin) Hist '"+toget+"' doesn't exist" raise IOError - if ( mc["name"]=="ttb" or mc["name"]=="ttc" or mc["name"]=="ttlight" or "qcd" in mc["name"] ) and hTmp: - hTmp.Scale(1.50) +# not using the 1/3 and 2/3 +# if ( mc["name"]=="ttbar" or mc["name"]=="ttb" or mc["name"]=="ttc" or mc["name"]=="ttlight" or "qcd" in mc["name"] ) and hTmp: +# hTmp.Scale(1.50) # ## foor QCD we do not apply the tauVeto and trigger # if "qcd" in mc["name"] and hTmp: @@ -1165,10 +1202,10 @@ def importPdfFromTH1(cat,mc,myBin,LikelihoodMapping,syst=None): ## top and W scale factor (for now only in ttbar later also signal) ## https://twiki.cern.ch/twiki/bin/view/CMS/JetTopTagging#13_TeV_working_points_CMSSW_8_0 ## https://twiki.cern.ch/twiki/bin/view/CMS/JetWtagging - if ( mc["name"]=="ttb" or mc["name"]=="ttc" or mc["name"]=="ttlight" or mc["name"]=="top") and ("t0b" in toget or "t1b" in toget) and hTmp: + if ( mc["name"]=="ttbar" or mc["name"]=="ttb" or mc["name"]=="ttc" or mc["name"]=="ttlight" or mc["name"]=="top") and ("t0b" in toget or "t1b" in toget) and hTmp: hTmp.Scale(1.06) # uncertainties +0.08 -0.04 - if ( mc["name"]=="ttb" or mc["name"]=="ttc" or mc["name"]=="ttlight" or mc["name"]=="top") and ("wbb" in toget or "wbj" in toget) and hTmp: + if ( mc["name"]=="ttbar" or mc["name"]=="ttb" or mc["name"]=="ttc" or mc["name"]=="ttlight" or mc["name"]=="top") and ("wbb" in toget or "wbj" in toget) and hTmp: hTmp.Scale(1.11) ## need to have an uncetainty of 0.08 From 61e89d34c3e7954736591a6ddb85a5eb121b7b25 Mon Sep 17 00:00:00 2001 From: maria Date: Fri, 10 Aug 2018 21:06:54 +0200 Subject: [PATCH 33/60] merge and scale ttb; fix EWK; add bTag highPT --- script/bwsTB.py | 52 +++++++++++++++++++++++++++++++++++++------------ 1 file changed, 40 insertions(+), 12 deletions(-) diff --git a/script/bwsTB.py b/script/bwsTB.py index c12d452c..3451b562 100644 --- a/script/bwsTB.py +++ b/script/bwsTB.py @@ -30,11 +30,23 @@ #parser.add_option("","--input1LBin",type='string',help="Input ROOT file. [%default]", default="/afs/cern.ch/work/d/dalfonso/CMSSW_9_1_0_pre2_ReTestNERO/src/ChargedHiggs/JUNE1_1l_1Third.root") #parser.add_option("","--input2LBin",type='string',help="Input ROOT file. [%default]", default="/afs/cern.ch/work/d/dalfonso/CMSSW_9_1_0_pre2_ReTestNERO/src/ChargedHiggs/JUNE1_2l_1Third.root") -parser.add_option("","--input1L",type='string',help="Input ROOT file. [%default]", default="/afs/cern.ch/work/d/dalfonso/CMSSW_9_1_0_pre2_ReTestNERO/src/ChargedHiggs/JULY29_FINAL_2ThirdSYST_bin200_wDATA_1l.root") -parser.add_option("","--input2L",type='string',help="Input ROOT file. [%default]", default="/afs/cern.ch/work/d/dalfonso/CMSSW_9_1_0_pre2_ReTestNERO/src/ChargedHiggs/JULY29_FINAL_2ThirdSYST_bin200_wDATA_2l.root") +## 650 missing, more signal stat +#parser.add_option("","--input1L",type='string',help="Input ROOT file. [%default]", default="/afs/cern.ch/work/d/dalfonso/CMSSW_9_1_0_pre2_ReTestNERO/src/ChargedHiggs/JULY29_FINAL_2ThirdSYST_bin200_wDATA_1l.root") +#parser.add_option("","--input2L",type='string',help="Input ROOT file. [%default]", default="/afs/cern.ch/work/d/dalfonso/CMSSW_9_1_0_pre2_ReTestNERO/src/ChargedHiggs/JULY29_FINAL_2ThirdSYST_bin200_wDATA_2l.root") + +#parser.add_option("","--input1LBin",type='string',help="Input ROOT file. [%default]", default="/afs/cern.ch/work/d/dalfonso/CMSSW_9_1_0_pre2_ReTestNERO/src/ChargedHiggs/JULY29_1l_1Third.root") +#parser.add_option("","--input2LBin",type='string',help="Input ROOT file. [%default]", default="/afs/cern.ch/work/d/dalfonso/CMSSW_9_1_0_pre2_ReTestNERO/src/ChargedHiggs/JULY29_2l_1Third.root") + + +##more signal stat , 2L bTag for signal and top + +parser.add_option("","--input1L",type='string',help="Input ROOT file. [%default]", default="/afs/cern.ch/work/d/dalfonso/CMSSW_9_1_0_pre2_ReTestNERO/src/ChargedHiggs/AUG6_FINAL_2ThirdSYST_bin200_wDATA_1l.root") +##parser.add_option("","--input2L",type='string',help="Input ROOT file. [%default]", default="/afs/cern.ch/work/d/dalfonso/CMSSW_9_1_0_pre2_ReTestNERO/src/ChargedHiggs/AUG6_FINAL_2ThirdSYST_bin200_wDATA_2l.root") +parser.add_option("","--input2L",type='string',help="Input ROOT file. [%default]", default="/afs/cern.ch/work/d/dalfonso/CMSSW_9_1_0_pre2_ReTestNERO/src/ChargedHiggs/AUG6_FINAL_2ThirdSYST_bTag_bin200_wDATA_2l.root") + +parser.add_option("","--input1LBin",type='string',help="Input ROOT file. [%default]", default="/afs/cern.ch/work/d/dalfonso/CMSSW_9_1_0_pre2_ReTestNERO/src/ChargedHiggs/AUG6_1l_1Third.root") +parser.add_option("","--input2LBin",type='string',help="Input ROOT file. [%default]", default="/afs/cern.ch/work/d/dalfonso/CMSSW_9_1_0_pre2_ReTestNERO/src/ChargedHiggs/AUG6_2l_1Third.root") -parser.add_option("","--input1LBin",type='string',help="Input ROOT file. [%default]", default="/afs/cern.ch/work/d/dalfonso/CMSSW_9_1_0_pre2_ReTestNERO/src/ChargedHiggs/JULY29_1l_1Third.root") -parser.add_option("","--input2LBin",type='string',help="Input ROOT file. [%default]", default="/afs/cern.ch/work/d/dalfonso/CMSSW_9_1_0_pre2_ReTestNERO/src/ChargedHiggs/JULY29_2l_1Third.root") ###### ###### @@ -382,13 +394,18 @@ def RebinN(h,nBin): if y == "1Ele" or y == "1Mu" or y == "1L": mcStore={ "Hptb":{"name":"Hptb", "hist":["ChargedHiggs_HplusTB_HplusToTB_M-%d_13TeV_amcatnlo_pythia8"], "num":0 }, - "ttlf":{ "name":"ttlf","hist":["ttlight_TT_TuneCUETP8M2T4_13TeV-powheg-pythia8"],"num":1}, +##MADGAPH +# "ttb":{ "name":"ttb","hist":["tt2b_TTJets_TuneCUETP8M2T4_13TeV-amcatnloFXFX-pythia8","tt2bMerged_TTJets_TuneCUETP8M2T4_13TeV-amcatnloFXFX-pythia8","tt1b_TTJets_TuneCUETP8M2T4_13TeV-amcatnloFXFX-pythia8"],"num":2}, +# "ttcc":{ "name":"ttcc","hist":["ttc_TT_TuneCUETP8M2T4_13TeV-powheg-pythia8"],"num":3}, +# "ttlf":{ "name":"ttlf","hist":["ttlight_TT_TuneCUETP8M2T4_13TeV-powheg-pythia8"],"num":1}, +##POWHEG ### "ttb":{ "name":"ttb","hist":["tt1b_TT_TuneCUETP8M2T4_13TeV-powheg-pythia8"],"num":2}, ### "ttbb":{ "name":"ttbb","hist":["tt2b_TT_TuneCUETP8M2T4_13TeV-powheg-pythia8"],"num":3}, ### "tt2b":{ "name":"tt2b","hist":["tt2bMerged_TT_TuneCUETP8M2T4_13TeV-powheg-pythia8"],"num":4}, ### "ttbb":{ "name":"ttbb","hist":["tt2b_TT_TuneCUETP8M2T4_13TeV-powheg-pythia8","tt2bMerged_TT_TuneCUETP8M2T4_13TeV-powheg-pythia8"],"num":3}, "ttb":{ "name":"ttb","hist":["tt2b_TT_TuneCUETP8M2T4_13TeV-powheg-pythia8","tt2bMerged_TT_TuneCUETP8M2T4_13TeV-powheg-pythia8","tt1b_TT_TuneCUETP8M2T4_13TeV-powheg-pythia8"],"num":2}, "ttcc":{ "name":"ttcc","hist":["ttc_TT_TuneCUETP8M2T4_13TeV-powheg-pythia8"],"num":3}, + "ttlf":{ "name":"ttlf","hist":["ttlight_TT_TuneCUETP8M2T4_13TeV-powheg-pythia8"],"num":1}, # "ewk":{ "name":"ewk","hist":["WJetsToLNu_HT","DYJetsToLL_M-50_HT","DYJetsToLL_M-5to50_HT","ZZTo","WWTo","WZTo","ZZZ","WZZ","WWZ","WWW","VHToNonbb_M125","WH_HToBB_WToLNu_M125","ZH_HToBB_ZToLL"],"num":6}, # "ewk":{ "name":"ewk","hist":["WJetsToLNu_HT","DYJetsToLL_M-50_HT","DYJetsToLL_M-5to50_HT","ZZTo","WZTo","ZZZ","WZZ","WWZ","WWW","WH_HToBB_WToLNu_M125","ZH_HToBB_ZToLL"],"num":5}, "ewk":{ "name":"ewk","hist":["WJetsToLNu_HT","DYJetsToLL_M-50_HT","DYJetsToLL_M-5to50_HT","EWK"],"num":4}, @@ -398,13 +415,18 @@ def RebinN(h,nBin): else: mcStore={ "Hptb":{"name":"Hptb", "hist":["ChargedHiggs_HplusTB_HplusToTB_M-%d_13TeV_amcatnlo_pythia8"], "num":0 }, - "ttlf":{ "name":"ttlf","hist":["ttlight_TT_TuneCUETP8M2T4_13TeV-powheg-pythia8"],"num":1}, +##MADGAPH +# "ttb":{ "name":"ttb","hist":["tt2b_TTJets_TuneCUETP8M2T4_13TeV-amcatnloFXFX-pythia8","tt2bMerged_TTJets_TuneCUETP8M2T4_13TeV-amcatnloFXFX-pythia8","tt1b_TTJets_TuneCUETP8M2T4_13TeV-amcatnloFXFX-pythia8"],"num":2}, +# "ttcc":{ "name":"ttcc","hist":["ttc_TT_TuneCUETP8M2T4_13TeV-powheg-pythia8"],"num":3}, +# "ttlf":{ "name":"ttlf","hist":["ttlight_TT_TuneCUETP8M2T4_13TeV-powheg-pythia8"],"num":1}, +##POWHEG ### "ttb":{ "name":"ttb","hist":["tt1b_TT_TuneCUETP8M2T4_13TeV-powheg-pythia8"],"num":2}, ### "ttbb":{ "name":"ttbb","hist":["tt2b_TT_TuneCUETP8M2T4_13TeV-powheg-pythia8"],"num":3}, ### "tt2b":{ "name":"tt2b","hist":["tt2bMerged_TT_TuneCUETP8M2T4_13TeV-powheg-pythia8"],"num":4}, ### "ttbb":{ "name":"ttbb","hist":["tt2b_TT_TuneCUETP8M2T4_13TeV-powheg-pythia8","tt2bMerged_TT_TuneCUETP8M2T4_13TeV-powheg-pythia8"],"num":3}, "ttb":{ "name":"ttb","hist":["tt2b_TT_TuneCUETP8M2T4_13TeV-powheg-pythia8","tt2bMerged_TT_TuneCUETP8M2T4_13TeV-powheg-pythia8","tt1b_TT_TuneCUETP8M2T4_13TeV-powheg-pythia8"],"num":2}, "ttcc":{ "name":"ttcc","hist":["ttc_TT_TuneCUETP8M2T4_13TeV-powheg-pythia8"],"num":3}, + "ttlf":{ "name":"ttlf","hist":["ttlight_TT_TuneCUETP8M2T4_13TeV-powheg-pythia8"],"num":1}, "ewk":{ "name":"ewk","hist":["WJetsToLNu_HT","DYJetsToLL_M-50_HT","EWK"],"num":4}, "top":{ "name":"top","hist":["TTX","ST"],"num":5} # "qcd":{ "name":"top","hist":["QCD_HT"],"num":8} @@ -497,7 +519,11 @@ def RebinN(h,nBin): "CMS_btag_LFstat1":{"type":"shape", "wsname":"CMS_btag_LFstat1","name":"CSVRLFSTAT1","proc":[".*"]}, ## name used for shape "CMS_btag_LFstat2":{"type":"shape", "wsname":"CMS_btag_LFstat2","name":"CSVRLFSTAT2","proc":[".*"]}, ## name used for shape "CMS_btag_CFerr1":{"type":"shape", "wsname":"CMS_btag_CFerr1","name":"CSVRCERR1","proc":[".*"]}, ## name used for shape - "CMS_btag_CFerr2":{"type":"shape", "wsname":"CMS_btag_CFerr2","name":"CSVRCERR2","proc":[".*"]} ## name used for shape + "CMS_btag_CFerr2":{"type":"shape", "wsname":"CMS_btag_CFerr2","name":"CSVRCERR2","proc":[".*"]}, ## name used for shape + "CMS_scale_jHighPtDown":{"type":"shape", "wsname":"CMS_scale_j_HighPtDown","name":"JESANDCSVHighPtDown","proc":["Hptb","ttlf","ttb","ttcc"]}, ## name used for shape + "CMS_btag_HFHighPtDown":{"type":"shape", "wsname":"CMS_btag_HFHighPtDown","name":"CSVRHFHighPtDown","proc":["Hptb","ttlf","ttb","ttcc"]}, ## name used for shape + "CMS_btag_LFHighPtDown":{"type":"shape", "wsname":"CMS_btag_LFHighPtDown","name":"CSVRLFHighPtDown","proc":["Hptb","ttlf","ttb","ttcc"]}, ## name used for shape + "CMS_btag_CFerr1HighPtDown":{"type":"shape", "wsname":"CMS_btag_CFerr1HighPtDown","name":"CSVRCERR1HighPtDown","proc":["Hptb","ttlf","ttb","ttcc"]} ## name used for shape #### } else: @@ -512,12 +538,12 @@ def RebinN(h,nBin): #print "---------------------- --------" #fileTmp="AUG6_HT/"+label+VarTest+opts.output -fileTmp="AUG1_HT200_like100/"+ label + VarTest + str(opts.kMass) + opts.output +fileTmp="AUG8_HT200_bTag/"+ label + VarTest + str(opts.kMass) + opts.output w = ROOT.RooWorkspace("w","w") datNameTmp = opts.datCardName #datName = "AUG6_HT/"+ label + VarTest + datNameTmp -datName = "AUG1_HT200_like100/"+ label + VarTest + str(opts.kMass) + datNameTmp +datName = "AUG8_HT200_bTag/"+ label + VarTest + str(opts.kMass) + datNameTmp datacard=open(datName,"w") datacard.write("-------------------------------------\n") @@ -958,7 +984,7 @@ def importStat(): ###if doSyst: writeNormSyst("CMS_HPTB_QCDscale_ttlf",["1.50"],["ttlf"]) if doSyst: writeNormSyst("bgnorm_ttcc",["1.50"],["ttcc"]) -if doSyst: writeNormSyst("bgnorm_ttb",["1.50"],["ttb$"]) +if doSyst: writeNormSyst("bgnorm_ttb",["1.30"],["ttb$"]) #if doSyst: writeNormSyst("bgnorm_ttbb",["1.50"],["ttbb$"]) ##if doSyst: writeNormSyst("bgnorm_tt2b",["1.50"],["tt2b"]) @@ -1252,14 +1278,16 @@ def importPdfFromTH1(cat,mc,myBin,LikelihoodMapping,syst=None): if hTmp!= None: print "<*> Reading Hist '"+toget+"' integral=",hTmp.Integral(),' nBin=',hTmp.GetNbinsX(), 'underflow=',hTmp.GetBinContent(0), 'overflow=',hTmp.GetBinContent(hTmp.GetNbinsX()+1),' entries=',hTmp.GetEntries() + if mc["name"]=="ttb": + hTmp.Scale(1.83) + ### SCALE for the 2/3 - if mc["name"]!="qcd" and not "ZZTo" in hname and not "WWTo" in hname and not "WZTo" in hname and not "ZZZ" in hname and not "WZZ" in hname and not "WWZ" in hname and not "WWW" in hname and not "VHToNonbb_M125" in hname and not "WH_HToBB_WToLNu_M125" in hname and not "ZH_HToBB_ZToLL" in hname: + if mc["name"]!="qcd" and not "EWK" in hname: hTmp.Scale(1.5) ### -- MC -- ## print 'xxxxxxxxx hname=',hname,' base=',base,'cat["dir"]',cat["dir"] #####1L - ## tranform the HT into the likelihood hTmp = likelihoodBinning.applyMapping(LikelihoodMapping, hTmp) # print LikelihoodMapping From e99b635a475fbb247ed300c30d963dda92fee4e8 Mon Sep 17 00:00:00 2001 From: maria Date: Wed, 15 Aug 2018 09:18:41 +0200 Subject: [PATCH 34/60] card leptonic: fix highPT, 1Mu1Ele normalization --- script/bwsTB.py | 32 ++++++++++++++++++++++---------- 1 file changed, 22 insertions(+), 10 deletions(-) diff --git a/script/bwsTB.py b/script/bwsTB.py index 3451b562..aa9862e5 100644 --- a/script/bwsTB.py +++ b/script/bwsTB.py @@ -40,8 +40,9 @@ ##more signal stat , 2L bTag for signal and top -parser.add_option("","--input1L",type='string',help="Input ROOT file. [%default]", default="/afs/cern.ch/work/d/dalfonso/CMSSW_9_1_0_pre2_ReTestNERO/src/ChargedHiggs/AUG6_FINAL_2ThirdSYST_bin200_wDATA_1l.root") +#parser.add_option("","--input1L",type='string',help="Input ROOT file. [%default]", default="/afs/cern.ch/work/d/dalfonso/CMSSW_9_1_0_pre2_ReTestNERO/src/ChargedHiggs/AUG6_FINAL_2ThirdSYST_bin200_wDATA_1l.root") ##parser.add_option("","--input2L",type='string',help="Input ROOT file. [%default]", default="/afs/cern.ch/work/d/dalfonso/CMSSW_9_1_0_pre2_ReTestNERO/src/ChargedHiggs/AUG6_FINAL_2ThirdSYST_bin200_wDATA_2l.root") +parser.add_option("","--input1L",type='string',help="Input ROOT file. [%default]", default="/afs/cern.ch/work/d/dalfonso/CMSSW_9_1_0_pre2_ReTestNERO/src/ChargedHiggs/AUG6_FINAL_2ThirdSYST_bTag_bin200_wDATA_1l.root") parser.add_option("","--input2L",type='string',help="Input ROOT file. [%default]", default="/afs/cern.ch/work/d/dalfonso/CMSSW_9_1_0_pre2_ReTestNERO/src/ChargedHiggs/AUG6_FINAL_2ThirdSYST_bTag_bin200_wDATA_2l.root") parser.add_option("","--input1LBin",type='string',help="Input ROOT file. [%default]", default="/afs/cern.ch/work/d/dalfonso/CMSSW_9_1_0_pre2_ReTestNERO/src/ChargedHiggs/AUG6_1l_1Third.root") @@ -190,6 +191,9 @@ def RebinN(h,nBin): if y == "1Ele" or y == "1Mu": label="1l_" ## if y == "1Ele" or y == "1Mu": label="1Mu_" ## if y == "1Ele" or y == "1Mu": label="1Ele_" + if y == "2Ele": label="2Ele_" + if y == "2Mu": label="2Mu_" + if y == "1Mu1Ele": label="1Mu1Ele_" if y == "2L": label="2L_" ## if opts.kTest==20: label="combined_" @@ -520,10 +524,10 @@ def RebinN(h,nBin): "CMS_btag_LFstat2":{"type":"shape", "wsname":"CMS_btag_LFstat2","name":"CSVRLFSTAT2","proc":[".*"]}, ## name used for shape "CMS_btag_CFerr1":{"type":"shape", "wsname":"CMS_btag_CFerr1","name":"CSVRCERR1","proc":[".*"]}, ## name used for shape "CMS_btag_CFerr2":{"type":"shape", "wsname":"CMS_btag_CFerr2","name":"CSVRCERR2","proc":[".*"]}, ## name used for shape - "CMS_scale_jHighPtDown":{"type":"shape", "wsname":"CMS_scale_j_HighPtDown","name":"JESANDCSVHighPtDown","proc":["Hptb","ttlf","ttb","ttcc"]}, ## name used for shape - "CMS_btag_HFHighPtDown":{"type":"shape", "wsname":"CMS_btag_HFHighPtDown","name":"CSVRHFHighPtDown","proc":["Hptb","ttlf","ttb","ttcc"]}, ## name used for shape - "CMS_btag_LFHighPtDown":{"type":"shape", "wsname":"CMS_btag_LFHighPtDown","name":"CSVRLFHighPtDown","proc":["Hptb","ttlf","ttb","ttcc"]}, ## name used for shape - "CMS_btag_CFerr1HighPtDown":{"type":"shape", "wsname":"CMS_btag_CFerr1HighPtDown","name":"CSVRCERR1HighPtDown","proc":["Hptb","ttlf","ttb","ttcc"]} ## name used for shape + "CMS_scale_jHighPt":{"type":"shape", "wsname":"CMS_scale_j_HighPt","name":"JESANDCSVHighPt","proc":["Hptb","ttlf","ttb","ttcc"]}, ## name used for shape + "CMS_btag_HFHighPt":{"type":"shape", "wsname":"CMS_btag_HFHighPt","name":"CSVRHFHighPt","proc":["Hptb","ttlf","ttb","ttcc"]}, ## name used for shape + "CMS_btag_LFHighPt":{"type":"shape", "wsname":"CMS_btag_LFHighPt","name":"CSVRLFHighPt","proc":["Hptb","ttlf","ttb","ttcc"]}, ## name used for shape + "CMS_btag_CFerr1HighPt":{"type":"shape", "wsname":"CMS_btag_CFerr1HighPt","name":"CSVRCERR1HighPt","proc":["Hptb","ttlf","ttb","ttcc"]} ## name used for shape #### } else: @@ -538,12 +542,12 @@ def RebinN(h,nBin): #print "---------------------- --------" #fileTmp="AUG6_HT/"+label+VarTest+opts.output -fileTmp="AUG8_HT200_bTag/"+ label + VarTest + str(opts.kMass) + opts.output +fileTmp="AUG12_HT200_bTag/"+ label + VarTest + str(opts.kMass) + opts.output w = ROOT.RooWorkspace("w","w") datNameTmp = opts.datCardName #datName = "AUG6_HT/"+ label + VarTest + datNameTmp -datName = "AUG8_HT200_bTag/"+ label + VarTest + str(opts.kMass) + datNameTmp +datName = "AUG12_HT200_bTag/"+ label + VarTest + str(opts.kMass) + datNameTmp datacard=open(datName,"w") datacard.write("-------------------------------------\n") @@ -1619,11 +1623,16 @@ def importPdfFromTH1SumBKG(cat,mc,syst=None,do1Third=False): base="ChargedHiggsTopBottom" target = "data_obs_"+ cat["name"] # toget=base + "/" +cat["dir"] + "/" + cat["var"] +"_Data" - ## PRELIMINARY + toget=base + "/" +cat["dir"] + "/" + cat["var"] if ("1Ele" in cat["dir"] or "2Ele" in cat["dir"]) and not ("1Mu1Ele" in cat["dir"]): toget+="_SingleElectron" elif "1Mu" in cat["dir"] or "2Mu" in cat["dir"] or "1Mu1Ele" in cat["dir"]: toget+="_SingleMuon" + if "1Mu1Ele" in cat["dir"]: + h=tfile.Get(toget) + toget_2=toget.replace("_SingleMuon", "_SingleElectron") + hTmp2=tfile.Get(toget_2) + if h!= None and hTmp2: h.Add(hTmp2) if "1L" in cat["dir"]: toget_1=toget.replace("_1L", "_1Mu") toget_1+="_SingleMuon" @@ -1639,11 +1648,15 @@ def importPdfFromTH1SumBKG(cat,mc,syst=None,do1Third=False): toget_2+="_SingleElectron" toget_3=toget.replace("_2L", "_1Mu1Ele") toget_3+="_SingleMuon" + toget_4=toget.replace("_2L", "_1Mu1Ele") + toget_4+="_SingleElectron" h=tfile.Get(toget_1) hTmp2=tfile.Get(toget_2) hTmp3=tfile.Get(toget_3) + hTmp4=tfile.Get(toget_4) if h!= None and hTmp2: h.Add(hTmp2) if h!= None and hTmp3: h.Add(hTmp3) + if h!= None and hTmp4: h.Add(hTmp4) else: h=tfile.Get(toget) @@ -1654,8 +1667,7 @@ def importPdfFromTH1SumBKG(cat,mc,syst=None,do1Third=False): if h == None: print "<*> Hist do not exists ",toget - ### MARIA COMMENT THIS FOR NOW -## raise IOError + raise IOError ####This is the data ####1L From 25ae45dc68b5fc7a05c6d2983fe0782b69d67042 Mon Sep 17 00:00:00 2001 From: maria Date: Wed, 15 Aug 2018 19:13:42 +0200 Subject: [PATCH 35/60] fix norm of the ttX --- aux/mcdb.2017.v23.txt | 26 +++++++++++++++++--------- 1 file changed, 17 insertions(+), 9 deletions(-) diff --git a/aux/mcdb.2017.v23.txt b/aux/mcdb.2017.v23.txt index f3f7190f..ff9422a4 100644 --- a/aux/mcdb.2017.v23.txt +++ b/aux/mcdb.2017.v23.txt @@ -171,7 +171,9 @@ TT_TuneCUETP8M2T4_13TeV-powheg-isrdown-pythia8 /store/group/phys_higgs/HiggsExo/ TT_TuneCUETP8M2T4_13TeV-powheg-isrup-pythia8 /store/group/phys_higgs/HiggsExo/dalfonso/80x_MC_v2/v2.3/TT_TuneCUETP8M2T4_13TeV-powheg-isrup-pythia8 59033604.0 831.0 SCALES 1.019769132 0.975128486522 1.11529529646 1.14334624169 0.897558033916 0.880435246352 PDFS 1.02841573878 0.989932039165 0.988505610379 1.01866461981 1.05218135477 0.990553071362 1.00284388713 0.989525747119 0.990806665245 1.01547153983 1.02905718511 0.993342420577 0.985870165469 0.989119833759 0.982120903619 0.990338858628 0.966150858293 0.983847712828 1.00108619967 0.981225297336 1.00561030089 1.02920213527 0.975062932763 1.02174314311 1.00209978012 1.01185425154 0.963398028056 0.993343844471 0.984005393817 0.994142303625 1.01694802743 1.01921403918 1.01165496904 1.02712364863 0.962683585035 0.997790441049 0.980174298638 1.0037975422 1.019609519 1.01136904062 1.00884691755 1.00665472312 1.02189479116 1.0103989158 1.01075612235 1.01365186909 0.996819933505 0.996184879801 0.991121942474 1.00441690682 1.00951098916 1.00962265389 1.00890042028 0.993453878266 1.008037695 0.991759758491 0.990295874183 1.00902517084 0.986115110944 1.00732746869 1.00157912839 1.00098124817 1.0011907906 0.989618960081 0.990052909962 1.00948960914 0.960592615998 1.0016882167 1.00808975829 1.00320052959 1.0189100015 1.00442317191 1.01719340874 0.990197230425 0.99991036753 1.04130570052 1.02062279658 0.982868124599 1.00569959559 1.00643715644 1.00830340233 1.01448246868 0.978383406653 1.00117963489 0.99924924592 0.997019850812 0.987520045301 0.98893588147 0.975804869243 1.00948951032 1.00512821981 1.00767327949 0.98829079222 0.992422089259 0.981559931321 0.993536569644 0.996437034824 1.00522337244 0.978691281152 0.97404378756 -TTJets_TuneCUETP8M2T4_13TeV-amcatnloFXFX-pythia8 /store/group/phys_higgs/HiggsExo/dalfonso/80x_MC_v2/v2.3/TTJets_TuneCUETP8M2T4_13TeV-amcatnloFXFX-pythia8 97982558501.6 831.0 SCALES 1.01632485606 0.978914688255 1.11798565695 1.15112764397 0.936509192397 0.941697204783 PDFS 1.02426945138 0.989415074938 0.988130627353 1.017472698 1.04407072129 0.99153849677 1.00364147504 0.99051473361 0.990239153315 1.01226714999 1.02586520372 0.994868005807 0.986080162655 0.986240738009 0.981702051288 0.99231150015 0.962900427134 0.9830482463 1.00369515118 0.983839352484 1.00586071855 1.03075955606 0.979038925324 1.02310077799 1.00297654299 1.0114300174 0.96116123119 0.991880580623 0.983951260561 0.998032554587 1.01731190549 1.01592492035 1.01225316607 1.03040877943 0.962050927199 1.00021671378 0.981136058909 1.00465093359 1.02010747754 1.0133605364 1.01014484672 1.00787959632 1.02435374207 1.01143503057 1.01386337089 1.0188161334 0.995588041588 0.995063595231 0.991663237936 1.00512896322 1.01067538032 1.00871771449 1.01070600572 0.991541607412 1.00787827906 0.989772376451 0.993363014086 1.00898772474 0.9875124708 1.0085524063 1.00362242382 1.00281873063 1.00013247262 0.987991128961 0.988908081091 1.01006208554 0.962217590706 1.00076042878 1.00414202289 1.00277084668 1.0212657745 1.00455351241 1.01047715173 0.989063261327 0.99928846377 1.04031629068 1.02169992398 0.983556204635 1.00641654903 1.00772223575 1.00908139092 1.01301780441 0.980518618429 1.00207619291 0.996717923194 0.99592785089 0.98642910838 0.988314353628 0.97762108787 1.00879651712 1.00383363865 1.00967259963 0.98797633421 0.996305770272 0.979420663837 0.99411074702 0.996781576941 1.00873864749 0.980027685689 0.97398301165 +TTJets_TuneCUETP8M2T4_13TeV-amcatnloFXFX-pythia8 /eos/cms/store/group/phys_higgs/HiggsExo/jaeyserm/80x_MC_v2/v2.3/TTJets_TuneCUETP8M2T4_13TeV-amcatnloFXFX-pythia8 1.91974351157e+11 831 SCALES 1.01634726287 0.978900105962 1.11782442695 1.15099197262 0.936752585345 0.941948859701 PDFS 1.02421272035 0.989497277916 0.988081191 1.0174447613 1.044090331 0.991554103589 1.00365160596 0.990393053602 0.990415901914 1.01226289251 1.02586212928 0.994874859641 0.986018547279 0.986266724817 0.981782077629 0.99238102313 0.962975164007 0.983048763009 1.00356292823 0.983889961681 1.00591896175 1.03092119105 0.979054333732 1.02303202915 1.00307432735 1.01144566185 0.961047817867 0.991939830731 0.983938084895 0.997944325613 1.01728694518 1.0159503123 1.01226868122 1.03031773576 0.96202829154 1.00018870874 0.981212364354 1.00460189626 1.0199715171 1.01331735836 1.01011550424 1.00788424897 1.0242598329 1.01137314412 1.01374378511 1.01877027866 0.995608258097 0.995040809485 0.991696281198 1.0051706999 1.01064493936 1.00877126485 1.0107546862 0.991616885428 1.00792346287 0.989768229844 0.99344846332 1.00893980541 0.987584258047 1.00873721245 1.00353319017 1.00283352223 1.00026680945 0.987952399418 0.988953124394 1.01014718584 0.962123155679 1.000780424 1.00417677919 1.00283817013 1.02114385805 1.00454209668 1.01050075524 0.989104131364 0.999261169538 1.04024621618 1.02161345213 0.983428915378 1.00631815381 1.00768458894 1.00905412248 1.01300686968 0.980369944456 1.00222305495 0.996822345135 0.995949761204 0.986576605656 0.988293466028 0.977704892543 1.00887199246 1.00377444835 1.0096067969 0.987995695529 0.996077569326 0.97954092563 0.994087879126 0.99676572493 1.00873276613 0.980019326231 0.974060526958 + +###TTJets_TuneCUETP8M2T4_13TeV-amcatnloFXFX-pythia8 /store/group/phys_higgs/HiggsExo/dalfonso/80x_MC_v2/v2.3/TTJets_TuneCUETP8M2T4_13TeV-amcatnloFXFX-pythia8 97982558501.6 831.0 SCALES 1.01632485606 0.978914688255 1.11798565695 1.15112764397 0.936509192397 0.941697204783 PDFS 1.02426945138 0.989415074938 0.988130627353 1.017472698 1.04407072129 0.99153849677 1.00364147504 0.99051473361 0.990239153315 1.01226714999 1.02586520372 0.994868005807 0.986080162655 0.986240738009 0.981702051288 0.99231150015 0.962900427134 0.9830482463 1.00369515118 0.983839352484 1.00586071855 1.03075955606 0.979038925324 1.02310077799 1.00297654299 1.0114300174 0.96116123119 0.991880580623 0.983951260561 0.998032554587 1.01731190549 1.01592492035 1.01225316607 1.03040877943 0.962050927199 1.00021671378 0.981136058909 1.00465093359 1.02010747754 1.0133605364 1.01014484672 1.00787959632 1.02435374207 1.01143503057 1.01386337089 1.0188161334 0.995588041588 0.995063595231 0.991663237936 1.00512896322 1.01067538032 1.00871771449 1.01070600572 0.991541607412 1.00787827906 0.989772376451 0.993363014086 1.00898772474 0.9875124708 1.0085524063 1.00362242382 1.00281873063 1.00013247262 0.987991128961 0.988908081091 1.01006208554 0.962217590706 1.00076042878 1.00414202289 1.00277084668 1.0212657745 1.00455351241 1.01047715173 0.989063261327 0.99928846377 1.04031629068 1.02169992398 0.983556204635 1.00641654903 1.00772223575 1.00908139092 1.01301780441 0.980518618429 1.00207619291 0.996717923194 0.99592785089 0.98642910838 0.988314353628 0.97762108787 1.00879651712 1.00383363865 1.00967259963 0.98797633421 0.996305770272 0.979420663837 0.99411074702 0.996781576941 1.00873864749 0.980027685689 0.97398301165 TTTo2L2Nu_ttbbFilter_TuneCUETP8M2_ttHtranche3_13TeV-powheg-pythia8 /store/group/phys_higgs/ceballos/Nero/v2.2/TTTo2L2Nu_ttbbFilter_TuneCUETP8M2_ttHtranche3_13TeV-powheg-pythia8 1136627 87.31483776 TTToSemilepton_ttbbFilter_TuneCUETP8M2_ttHtranche3_13TeV-powheg-pythia8 /store/group/phys_higgs/ceballos/Nero/v2.2/TTToSemilepton_ttbbFilter_TuneCUETP8M2_ttHtranche3_13TeV-powheg-pythia8 19072787 364.35 @@ -190,15 +192,21 @@ ST_tW_top_5f_inclusiveDecays_13TeV-powheg-pythia8_TuneCUETP8M1 /store/group/phys ST_s-channel_4f_leptonDecays_13TeV-amcatnlo-pythia8_TuneCUETP8M1 /store/group/phys_higgs/HiggsExo/dalfonso/80x_MC_v2/v2.3/ST_s-channel_4f_leptonDecays_13TeV-amcatnlo-pythia8_TuneCUETP8M1 3370668.41375 3.45016613382 SCALES 0.98751416638 1.01584425297 1.02276331415 1.00863020643 0.973434884316 0.986809372898 PDFS 1.01566444887 1.00238108896 0.983416472213 0.981903495727 0.994396667634 1.02387977786 0.991118882762 1.00740399696 0.997189915248 0.994285042703 1.01443006362 1.00112773789 0.982230529214 1.00713555555 0.999701103809 1.00722672864 1.01426995592 1.02732852251 1.00651286322 0.995596087709 0.973672127593 0.998127108772 0.965119727889 0.982989291651 0.998802383851 0.988769923699 1.01898352027 1.00516509445 1.01212134597 0.991534161323 0.977226031279 1.00197592726 0.989637008037 0.993966407374 0.988031256075 1.00651399738 1.00916513731 1.0205621571 1.00226345054 0.995948508 0.992714834146 0.999600012703 0.993118463789 1.00278604253 0.988627923312 1.00884434648 1.01702087398 1.00755003417 1.00177975923 0.992923071667 0.999251664901 0.999655278744 0.9909491662 0.984359003288 0.993921513839 1.02128118364 0.99790052623 1.00193286843 0.996114666469 0.991722521448 1.00139643193 1.00231885159 1.0000880688 1.0304012072 0.998664916883 0.994371680132 0.971284689736 1.00102967392 1.00554573132 1.00563620952 0.994448833587 1.01258222226 1.01157894051 0.982094968144 1.00859901671 1.00496068269 0.996668474758 0.989799070388 1.0074946157 0.986783295623 0.992836523876 0.986826363206 1.02046184682 0.995824067849 1.00640733187 1.00527430103 1.00369751928 1.00259379758 1.01221845771 0.991649692836 0.994720885993 0.993420878259 1.00940294992 0.999900930603 1.02838644979 1.00855532742 0.992572265154 0.988340496354 0.993698175316 1.03462557757 ##### RARES with tops +TTTT_TuneCUETP8M2T4_13TeV-amcatnlo-pythia8 /store/group/phys_higgs/HiggsExo/dalfonso/80x_MC_v2/v2.3/TTTT_TuneCUETP8M2T4_13TeV-amcatnlo-pythia8 22331.2631844 0.009103 SCALES 1.07090001383 0.927859459555 1.23641730067 1.33823836638 0.813201022058 0.768476103747 PDFS 0.997364488094 0.957795933998 0.979647460914 1.0216202367 0.999398190281 0.981974398502 1.02881986469 0.978178167116 0.982906852628 0.991521478996 0.984194207751 1.01062577188 0.960422477561 0.920694798351 0.967492992738 1.01190201115 0.858318060213 0.946240222057 1.04675963601 1.02564928838 1.04427611412 1.09667874616 1.06567503956 1.08793973679 1.00534167235 1.03072727949 0.863624865428 0.942529803428 0.95579071916 1.05662556933 1.04510545346 1.00726335256 1.03093216672 1.12516163361 0.927827195817 1.02974500626 0.95559021155 1.04272713702 1.04233304567 1.04245040159 1.07274767615 1.01566674084 1.0789124238 1.02755148094 1.075323207 1.14271515541 0.947199644636 0.963940191112 0.972087460834 1.00606646452 1.01968374042 1.00114043212 1.0694939971 0.954140363234 1.00802599254 0.930676101495 1.02885215601 0.993801076661 1.00539948617 1.04040076121 1.04243988057 1.03924498008 0.989772440663 0.920162342288 0.969714271497 1.02988144964 1.01724314565 0.986578108397 0.946236183797 0.953592379819 1.0936774246 1.01786655394 0.935394086081 0.97224423195 0.986971319828 1.07871237804 1.06370217594 0.982303349563 1.02229432954 1.0222314252 1.0511442274 1.01072339353 0.972494169842 1.01839997279 0.951023040628 0.958506081771 0.946428360241 0.954932022542 0.984141539996 0.99427414807 0.986403636601 1.0532836864 0.963856123871 1.05391820249 0.884391080511 1.00667385726 0.998968696717 1.0981569064 0.970204310726 0.913280030642 + +TTZToQQ_TuneCUETP8M1_13TeV-amcatnlo-pythia8 /store/group/phys_higgs/HiggsExo/dalfonso/80x_MC_v2/v2.3/TTZToQQ_TuneCUETP8M1_13TeV-amcatnlo-pythia8 396340.938017 0.5297 SCALES 1.02316179076 0.973061672725 1.08957987141 1.12361227502 0.926968756815 0.912848998708 PDFS 1.01715816112 0.988322345529 0.985591852538 1.01247351788 1.01686440471 1.00088482386 1.00477185269 0.989188751641 0.986982918804 0.998637041573 1.01861199229 1.00154902932 0.983747371198 0.974421690347 0.982918330656 0.995253807601 0.952476290528 0.982192612989 1.01335381196 0.987160967288 1.00496204467 1.03198604792 0.994254918292 1.01961620968 1.00534738432 1.00977429252 0.950686759787 0.986770456328 0.984026432689 1.00692879677 1.01217471425 1.00388168812 1.01270625602 1.0376864228 0.956120687041 1.01041113609 0.982784772454 1.01038582953 1.01991070758 1.01832295614 1.01896211908 1.01378054819 1.02911876496 1.01379488327 1.01745787399 1.03661698563 0.993908125023 0.990597888438 0.989710483195 1.00711028055 1.01480297056 1.0046802312 1.01729665854 0.984657159265 1.00554297997 0.984976634656 1.00867811988 1.01069677027 0.991605667062 1.01017229826 1.0085956354 1.00753859239 1.00046965304 0.985126269236 0.985894500676 1.01017852532 0.971881131424 0.99768407877 0.989218279481 0.995217161529 1.03144584827 1.00807630542 0.991580856654 0.986008401404 0.999472731189 1.03668617077 1.02323592972 0.986866406567 1.00853766658 1.00520788453 1.01219375187 1.00531986731 0.989505009529 1.00165568592 0.987391567005 0.992157887798 0.983081794692 0.989184962057 0.986313769641 1.00258616768 0.997965794421 1.01179531263 0.986773251655 1.00515034168 0.973638029968 0.99905911904 0.99246636642 1.02341150016 0.986204122099 0.977098617506 + +TTZToLLNuNu_M-10_TuneCUETP8M1_13TeV-amcatnlo-pythia8 /store/group/phys_higgs/HiggsExo/dalfonso/80x_MC_v2/v2.3/TTZToLLNuNu_M-10_TuneCUETP8M1_13TeV-amcatnlo-pythia8 2012332.01745 0.2529 SCALES 1.02239642648 0.973832008353 1.08947209545 1.1227335849 0.927366676059 0.914070986619 PDFS 1.01781691329 0.988780884825 0.985546441076 1.01255991087 1.01823338597 1.00028073668 1.00492828012 0.989203279547 0.987518443077 0.999577426163 1.01850648209 1.00116718355 0.983426938085 0.974902613326 0.983294927222 0.995284850888 0.95312603505 0.983318316785 1.01273629578 0.987106738602 1.00437922478 1.0318374274 0.993577883444 1.01881940919 1.00532467616 1.00962909152 0.951317269623 0.987148555044 0.983611202745 1.00580945777 1.011961537 1.00474153625 1.01286049688 1.0365337294 0.95656131227 1.01041346323 0.982626558425 1.01021359867 1.01935174714 1.01752216641 1.01861458171 1.0130381898 1.02837966637 1.0131289807 1.01720598361 1.03538579777 0.99418841987 0.990848471279 0.989655850177 1.00675836296 1.0139765733 1.0053828487 1.01636265982 0.984720186069 1.00539586494 0.985658847867 1.00827256594 1.00974660536 0.991248262019 1.0097598482 1.00873495557 1.00688739928 1.00066960459 0.9862859356 0.985988742699 1.00997195201 0.972062560351 0.997603410571 0.989841448618 0.995460590883 1.03128734387 1.00819840323 0.993184526707 0.986034787282 0.99988399374 1.03634587134 1.02316058017 0.986619274091 1.007951018 1.00512605836 1.01214555843 1.00588589892 0.989374376814 1.00176569884 0.988305651504 0.992712751699 0.984067479845 0.989262468377 0.986392583264 1.00271463022 0.99852981443 1.01184777681 0.987032110178 1.00369488402 0.974425715667 0.998838629938 0.993052601002 1.0225671798 0.985962970654 0.977430952072 + +TTWJetsToLNu_TuneCUETP8M1_13TeV-amcatnloFXFX-madspin-pythia8 /store/group/phys_higgs/HiggsExo/dalfonso/80x_MC_v2/v2.3/TTWJetsToLNu_TuneCUETP8M1_13TeV-amcatnloFXFX-madspin-pythia8 1786575.571 0.2043 SCALES 1.02180341254 0.973541776469 1.11517947632 1.1452825025 0.911655351229 0.894557807259 PDFS 1.02999282126 1.00695158598 0.986263851859 0.984958853241 0.993004100089 1.02629292849 0.994117110773 1.00681692771 0.985884137424 0.986737358523 1.0130562967 1.00124813591 0.984073991677 0.990038484974 1.00303813899 0.997702128825 0.999194862301 1.01504178077 1.0137782026 0.985582572946 0.97879665335 1.0036703297 0.972971188663 0.976335625291 1.00232220661 0.994606139566 0.995254077606 0.999364544193 1.01063505623 0.999215290314 0.983915255521 0.984651159246 0.997851567076 0.998535104935 0.965107967105 1.0122153664 1.00854208945 1.01129854463 1.00944499868 1.00380744251 1.00421891675 1.01184269165 1.00208496803 1.00881714826 0.999489124608 1.01791800273 1.02093109584 1.00125494211 0.999598784833 1.00525447989 1.01081769 0.997030878802 0.993610759186 0.982336521169 0.992627726637 1.01579028253 1.01368493948 1.0131140225 1.00295277144 0.998694423614 1.00497157282 1.00739406771 0.985342494061 1.03692701101 0.975181091375 0.998607728424 0.978908534328 0.997521532026 0.98403466861 0.998232940422 1.006101299 1.00904749269 0.998792654284 0.979572896056 1.00871591569 1.0021423289 0.99868523135 0.988523348117 1.00321558333 0.991884524653 0.994436077067 0.985897527323 1.02938690132 0.990367824234 1.00336901784 1.00743301287 1.00074809704 1.00622080414 1.00796057543 0.991418503302 0.999151331499 0.989242832157 1.00439264496 0.997980108896 1.03153788487 1.0009806934 0.981236467088 0.998581556648 1.00220821451 1.03688797727 + +TTWJetsToQQ_TuneCUETP8M1_13TeV-amcatnloFXFX-madspin-pythia8 /store/group/phys_higgs/HiggsExo/dalfonso/80x_MC_v2/v2.3/TTWJetsToQQ_TuneCUETP8M1_13TeV-amcatnloFXFX-madspin-pythia8 569424.146326 0.40620 SCALES 1.02259685299 0.97266449944 1.11614384533 1.14693688479 0.910303780885 0.892078321939 PDFS 1.02973643107 1.00681905088 0.985688548939 0.985508700845 0.993126094271 1.02576715293 0.994538637612 1.00639984931 0.986934443785 0.985943026503 1.01249660438 1.00001871634 0.983434388301 0.989693135535 1.00220975946 0.998990814812 0.998174149802 1.01510377161 1.01457482743 0.986272167653 0.978430886411 1.00560020535 0.972852792136 0.977093847771 1.00303766987 0.994711247837 0.994795414282 0.998955507416 1.01001307077 0.99992449471 0.983958605465 0.984357941324 0.998149881463 0.99903543163 0.965206199405 1.01175280527 1.00753409624 1.01048399252 1.01111134987 1.00459586599 1.00498055716 1.01146261353 1.00291205465 1.00986131876 1.00118879764 1.01991722366 1.02086250158 1.0014122083 0.999008108281 1.00461637445 1.01038933939 0.996500654339 0.993463398996 0.98166852246 0.991873560905 1.01544165302 1.01399621329 1.01298364283 1.00258622408 1.00023647345 1.0049408693 1.00711046948 0.985091077836 1.03680599201 0.974450310554 0.998154600839 0.979256899436 0.996776402949 0.983926579651 0.997228582827 1.00600929419 1.00894601359 0.998481493313 0.979296763981 1.01008327033 1.00178181285 0.998716108422 0.988970543809 1.0036872807 0.992513642078 0.994017805389 0.986084903955 1.02849537877 0.992377583557 1.00201152712 1.0079264902 1.00113822412 1.00600559826 1.00767939948 0.990747332267 0.998519103294 0.988938558615 1.00486708539 0.999548018848 1.03056391719 1.00102631977 0.98128958894 0.998797097107 1.00099311713 1.0361144898 + +TTGJets_TuneCUETP8M1_13TeV-amcatnloFXFX-madspin-pythia8 /store/group/phys_higgs/HiggsExo/dalfonso/80x_MC_v2/v2.3/TTGJets_TuneCUETP8M1_13TeV-amcatnloFXFX-madspin-pythia8 101054779.415 3.697 SCALES 1.01868094896 0.977257781945 1.12042175044 1.1555111455 0.922551054601 0.922251605549 PDFS 1.01711292502 0.992298096888 0.984785170407 1.01066661045 1.02190384371 0.996173351432 1.00336032088 0.995047691241 0.991770787309 1.00326395755 1.01757384789 0.997718858576 0.984908947501 0.979194728667 0.985285524938 0.998083682697 0.961882439505 0.988931025037 1.00871561437 0.989642212126 1.00375282978 1.02880438883 0.986489471632 1.01663448454 1.00439890461 1.00790056045 0.961428398128 0.989332724269 0.985003620555 1.00221099058 1.01311901913 1.00743344897 1.01307164016 1.02907128264 0.962332014912 1.00575509526 0.986590394414 1.00780558272 1.01624306492 1.01354761053 1.01080660841 1.0082298378 1.02250209316 1.01115934753 1.01406536355 1.0239467867 0.997610133524 0.993437051199 0.991878388393 1.0032847938 1.00929352953 1.00612154512 1.00913324712 0.989161159039 1.00440312078 0.988818407569 1.00047546235 1.00514445029 0.993145423559 1.00794203738 1.00690158837 1.0065842732 0.998761978748 0.995419794261 0.987115739201 1.00906326612 0.970113028712 0.996218575031 0.996120468739 1.00157018163 1.02219987286 1.00542797058 0.999146571397 0.985865173912 0.999523849262 1.03149590284 1.02051457439 0.988824917401 1.00536105728 1.00684635301 1.00765715252 1.00684913313 0.990139587099 1.00102777435 0.995165935422 0.998018103403 0.986472356123 0.987737239374 0.987967419942 1.00525617428 1.00185198682 1.01109583676 0.990107841096 1.0006189179 0.983054534834 0.996676852041 0.996840265837 1.01156400597 0.985530517831 0.982739702997 + +ttHToNonbb_M125_TuneCUETP8M2_ttHtranche3_13TeV-powheg-pythia8 /store/group/phys_higgs/HiggsExo/dalfonso/80x_MC_v2/v2.3/ttHToNonbb_M125_TuneCUETP8M2_ttHtranche3_13TeV-powheg-pythia8 2241139.08398 0.2150955 SCALES 1.0195670305 0.974249475834 1.07093861552 1.10247957464 0.953735724886 0.943074359462 PDFS 1.01150955371 0.975880228025 0.979294721726 1.00876930715 1.01861175439 0.991452671581 1.00203425052 0.988018773988 0.981136834243 0.999398954041 1.01443868624 0.988197266924 0.969942621023 0.967264058286 0.966575844676 0.994442115812 0.93735577475 0.973563681749 1.01085207674 0.975632401961 1.00431624301 1.03291495937 0.98693426868 1.02271076761 1.00006137918 1.00486117343 0.940479787044 0.968017359775 0.975456238276 1.0030149534 1.01609276585 1.00302568315 1.00889116664 1.03770558356 0.949643601187 1.00209366772 0.979824516707 1.00916247973 1.0176068641 1.01689366214 1.01789725532 1.01050367475 1.02839234722 1.01158671286 1.01691534037 1.03026494522 0.980806342409 0.983252022446 0.988412949003 0.996471213874 1.01067451477 0.996135706941 1.01646826571 0.972207378419 0.999195420037 0.972471039032 0.999594533989 0.998397403324 0.99014010416 1.00853022992 1.00773160079 1.00598801107 0.989379508687 0.970602140054 0.978668804356 1.00224401595 0.965674353127 0.98925402955 0.98299709999 0.98132858504 1.02720093782 1.00344623451 0.989049299126 0.970115579388 0.991094801641 1.03381949008 1.02559007983 0.987468596009 1.00661249087 1.00689847318 1.00677842396 0.999236967635 0.982803732904 1.00113761009 0.977018132181 0.988719091378 0.981610392572 0.977562808346 0.971040145824 0.989955907139 0.984503022204 1.00963159032 0.978533608928 1.00030802804 0.955476379036 0.993449948236 0.995202126741 1.01674526127 0.969019654904 0.962458018587 -TTTT_TuneCUETP8M2T4_13TeV-amcatnlo-pythia8 /store/group/phys_higgs/HiggsExo/dalfonso/80x_MC_v2/v2.3/TTTT_TuneCUETP8M2T4_13TeV-amcatnlo-pythia8 22331.2631844 0.009103 -TTZToQQ_TuneCUETP8M1_13TeV-amcatnlo-pythia8 /store/group/phys_higgs/HiggsExo/dalfonso/80x_MC_v2/v2.3/TTZToQQ_TuneCUETP8M1_13TeV-amcatnlo-pythia8 396340.938017 0.5297 -TTZToLLNuNu_M-10_TuneCUETP8M1_13TeV-amcatnlo-pythia8 /store/group/phys_higgs/HiggsExo/dalfonso/80x_MC_v2/v2.3/TTZToLLNuNu_M-10_TuneCUETP8M1_13TeV-amcatnlo-pythia8 2012332.01745 0.2529 -TTWJetsToLNu_TuneCUETP8M1_13TeV-amcatnloFXFX-madspin-pythia8 /store/group/phys_higgs/HiggsExo/dalfonso/80x_MC_v2/v2.3/TTWJetsToLNu_TuneCUETP8M1_13TeV-amcatnloFXFX-madspin-pythia8 1786575.571 0.40620 -TTWJetsToQQ_TuneCUETP8M1_13TeV-amcatnloFXFX-madspin-pythia8 /store/group/phys_higgs/HiggsExo/dalfonso/80x_MC_v2/v2.3/TTWJetsToQQ_TuneCUETP8M1_13TeV-amcatnloFXFX-madspin-pythia8 569424.146326 0.2043 -TTGJets_TuneCUETP8M1_13TeV-amcatnloFXFX-madspin-pythia8 /store/group/phys_higgs/HiggsExo/dalfonso/80x_MC_v2/v2.3/TTGJets_TuneCUETP8M1_13TeV-amcatnloFXFX-madspin-pythia8 101054779.415 3.697 -ttHToNonbb_M125_TuneCUETP8M2_ttHtranche3_13TeV-powheg-pythia8 /store/group/phys_higgs/HiggsExo/dalfonso/80x_MC_v2/v2.3/ttHToNonbb_M125_TuneCUETP8M2_ttHtranche3_13TeV-powheg-pythia8 2241139.08398 0.2150955 -ttHTobb_M125_TuneCUETP8M2_ttHtranche3_13TeV-powheg-pythia8 /store/group/phys_higgs/HiggsExo/dalfonso/80x_MC_v2/v2.3/ttHTobb_M125_TuneCUETP8M2_ttHtranche3_13TeV-powheg-pythia8 2164705.74748 0.2150955 +ttHTobb_M125_TuneCUETP8M2_ttHtranche3_13TeV-powheg-pythia8 /store/group/phys_higgs/HiggsExo/dalfonso/80x_MC_v2/v2.3/ttHTobb_M125_TuneCUETP8M2_ttHtranche3_13TeV-powheg-pythia8 2164705.74748 0.2934 SCALES 1.01954365153 0.974279188509 1.07086575477 1.10238616813 0.953832044991 0.943209192605 PDFS 1.01362048736 0.979894265762 0.98133646663 1.0109284716 1.02023689205 0.994275233905 1.00387571667 0.987938730709 0.983722206427 1.00152454542 1.01525093415 0.992224779884 0.974307536178 0.970057347203 0.971324271796 0.994550585857 0.941947354635 0.976113623039 1.01062990837 0.954948408927 1.00588015169 1.03303525807 0.989262471003 1.02265247844 1.00297556311 1.00713481081 0.943439573041 0.972667821312 0.977099331231 1.00308706505 1.01612757193 1.00506029952 1.01058256073 1.03738955141 0.952608181701 1.004453681 0.9798111748 1.00912232003 1.01732106892 1.01677873649 1.01756432967 1.0106966269 1.0285072497 1.01163048972 1.01628815701 1.03019093751 0.984906000623 0.986105150575 0.988337208153 0.999659994012 1.01097386354 0.999878270647 1.01642386567 0.977059344537 1.00186051056 0.975478367446 1.001647067 1.0015078541 0.990323567909 1.00864326178 1.00736020094 1.00575245182 0.99356869977 0.974030057582 0.98238628756 1.00478254743 0.967881931453 0.991828886742 0.987088004804 0.98609200371 1.02893001475 1.00654743668 0.990952815334 0.974957195048 0.993418344476 1.03523016346 1.02507348544 0.987330455386 1.00648730235 1.00654860669 1.00918149913 1.00224348353 0.982826293552 1.00093913576 0.981283730891 0.990462748774 0.981987661097 0.981123147635 0.974907600281 0.994635187295 0.98887801027 1.0112855692 0.981997803106 1.00029427203 0.961645189156 0.99510900882 0.994768014858 1.01879741125 0.973474009838 0.966433947165 ## from AN 2017 115 v2 TTZH_TuneCUETP8M2T4_13TeV-madgraph-pythia8 /store/group/phys_higgs/HiggsExo/dalfonso/80x_MC_v2/v2.3/TTZH_TuneCUETP8M2T4_13TeV-madgraph-pythia8 195710.0 0.001535 From 870ee06e88c68e2fb8419fa673daa75dd79fd8b6 Mon Sep 17 00:00:00 2001 From: maria Date: Thu, 23 Aug 2018 21:52:16 +0200 Subject: [PATCH 36/60] split below and above, decorrelate nonClosure-muRFttbar-SDmass --- script/bwsFullHadTB.py | 151 +++++++++++++++++++++++++++++------------ 1 file changed, 106 insertions(+), 45 deletions(-) diff --git a/script/bwsFullHadTB.py b/script/bwsFullHadTB.py index 1b522864..8d74b271 100644 --- a/script/bwsFullHadTB.py +++ b/script/bwsFullHadTB.py @@ -208,7 +208,6 @@ def MergeAbove(tfile,hname): def MergeAbove3B(tfile,hname): ## histos has "below" and "two" - hname_=hname.replace("_below", "_above") hname_1=hname_.replace("_two", "_three") # original @@ -234,10 +233,11 @@ def mergeCategory(tfile,toget): else: hTmp = tfile.Get(toget) else: - if "_below" in toget: - hTmp = MergeAbove(tfile,toget) - else: - hTmp = tfile.Get(toget) +# if "_below" in toget: +# hTmp = MergeAbove(tfile,toget) +# else: +# hTmp = tfile.Get(toget) + hTmp = tfile.Get(toget) if hTmp!=None: hTmp.Rebin(nRebinHT) @@ -259,7 +259,7 @@ def mergeCategory(tfile,toget): ### FINAL conf if doSChannel: basecat = [ "OneBOneFat_one_highj","OneBOneFat_two_highj", "OneBOneFat_one_lowj","OneBOneFat_two_lowj" - ,"OneBOneFat1l_one","OneBOneFat1l_two","OneBOneFat1l_three" + ,"OneBOneFat1l_one","OneBOneFat1l_two" ,"OneBOneMirrorFat_one_highj","OneBOneMirrorFat_two_highj", "OneBOneMirrorFat_one_lowj","OneBOneMirrorFat_two_lowj" ] else: @@ -325,8 +325,9 @@ def mergeCategory(tfile,toget): for y in channel: for x in basecat: -## region = ["_in","_above","_below"] - region = ["_in","_below"] + region = ["_in","_above","_below"] +## region = ["_in","_below"] +## region = ["_in"] #counting # if True: @@ -371,18 +372,18 @@ def mergeCategory(tfile,toget): ## wbb if "_two_lowj" in x and y=="wbb": continue ## t0b and t1b - if "_two_highj" in x and y=="t0b" and "below" in reg: continue - if "_three_lowj" in x and y=="t0b" and "in" in reg: continue - if "_one_highj" in x and (y=="t1b" or y=="t0b") and "in" in reg: continue - if "_one_lowj" in x and (y=="t1b") and "below" in reg: continue - if "_three" in x and y=="t0b" and "below" in reg: continue +# if "_two_highj" in x and y=="t0b" and "below" in reg: continue +# if "_three_lowj" in x and y=="t0b" and "in" in reg: continue +# if "_one_highj" in x and (y=="t1b" or y=="t0b") and "in" in reg: continue +# if "_one_lowj" in x and (y=="t1b") and "below" in reg: continue +# if "_three" in x and y=="t0b" and "below" in reg: continue #2500,3000 if "_three_highj" in x and (y=="t0b") and "in" in reg missing ST if opts.kMass=="3000": -## if "_two_highj" in x and y=="wbb": continue -## if "_three_lowj" in x and (y=="t0b") and "above" in reg: continue - if "_three_lowj" in x and (y=="t1b") and "in" in reg: continue +### if "_two_highj" in x and y=="wbb": continue +### if "_three_lowj" in x and (y=="t0b") and "above" in reg: continue +###### if "_three_lowj" in x and (y=="t1b") and "in" in reg: continue if "_three_highj" in x and (y=="t0b") and "in" in reg: continue if "_three_lowj" in x and (y=="t0b") and "in" in reg: continue @@ -538,7 +539,7 @@ def mergeCategory(tfile,toget): "qcd_tx_one":{"name":"qcd_tx_one", "hist":["QCD_HT"], "num":4 }, "qcd_tx_two":{"name":"qcd_tx_two", "hist":["QCD_HT"], "num":5 }, "qcd_tx_three":{"name":"qcd_tx_three", "hist":["QCD_HT"], "num":6 }, -## "ttbar":{ "name":"ttbar","hist":["ttb_TT_TuneCUETP8M2T4","ttc_TT_TuneCUETP8M2T4","ttlight_TT_TuneCUETP8M2T4"],"num":7}, +# "ttbar":{ "name":"ttbar","hist":["ttb_TT_TuneCUETP8M2T4","ttc_TT_TuneCUETP8M2T4","ttlight_TT_TuneCUETP8M2T4"],"num":7}, "ttbar":{ "name":"ttbar","hist":["TT_TuneCUETP8M2T4_13TeV-powheg-pythia8"],"num":7}, "top":{ "name":"top","hist":["ST","TTX"],"num":8}, "ewk":{ "name":"ewk","hist":["ewk"],"num":9} @@ -565,20 +566,26 @@ def mergeCategory(tfile,toget): "lumi_13TeV":{"type":"lnN", "value":["1.025"] ,"proc":[".*"],"wsname":"lumi_13TeV","name":"XXX"}, ### lepton veto "CMS_eff_l":{"type":"lnN", "value":["0.96"] ,"proc":[".*"],"wsname":"CMS_eff_l","name":"XXX"}, ## name used for shape - "CMS_eff_t":{"type":"lnN", "value":["1.03"] ,"proc":[".*"],"wsname":"CMS_eff_t","name":"XXX"}, ## name used for shape - ### trigger efficiency + "CMS_eff_t":{"type":"lnN", "value":["1.03"] ,"proc":[".*"],"wsname":"CMS_eff_t","name":"XXX"}, ## name used for shape + #### trigger efficiency "CMS_eff_trigger":{"type":"lnN", "value":["1.05"] ,"proc":[".*"],"wsname":"CMS_eff_triggger","name":"XXX"}, ### Theory modeling "CMS_topreweight":{"type":"shape", "wsname":"CMS_topreweight","name":"TOPRW","proc":["ttbar"]}, - "muRF_ttbar":{"type":"shape", "wsname":"muRF_ttbar","name":"Scale","proc":["ttbar"]}, "muRF_Hptb":{"type":"shape", "wsname":"muRF_Hptb","name":"Scale","proc":["Hptb"]}, + "muRF_ttbar_below":{"type":"shape", "wsname":"muRF_ttbar_below","name":"Scale","proc":["ttbar"]}, + "muRF_ttbar_in":{"type":"shape", "wsname":"muRF_ttbar_in","name":"Scale","proc":["ttbar"]}, + "muRF_ttbar_above":{"type":"shape", "wsname":"muRF_ttbar_above","name":"Scale","proc":["ttbar"]}, ### MET-Jets-PU "CMS_pileup":{"type":"shape", "wsname":"CMS_pileup","name":"PU","proc":["qcd_wx_one","qcd_wx_two","qcd_wx_three","qcd_tx_one","qcd_tx_two","qcd_tx_three""ttbar","top","Hptb"]}, "CMS_scale_uncluster":{"type":"shape", "wsname":"CMS_scale_uncluster","name":"UNCLUSTER","proc":["qcd_wx_one","qcd_wx_two","qcd_wx_three","qcd_tx_one","qcd_tx_two","qcd_tx_three","ttbar","top","Hptb"]}, ## SDmass "CMS_scale_SDMass":{"type":"shape", "wsname":"CMS_scale_SDMass","name":"SDMassSCALE","proc":["ttbar","top","Hptb"]}, - "CMS_scale_SDMass_qcd_wx":{"type":"shape", "wsname":"CMS_scale_SDMass_qcd_wx","name":"SDMassSCALE","proc":["qcd_wx_one","qcd_wx_two","qcd_wx_three"]}, - "CMS_scale_SDMass_qcd_tx":{"type":"shape", "wsname":"CMS_scale_SDMass_qcd_tx","name":"SDMassSCALE","proc":["qcd_tx_one","qcd_tx_two","qcd_tx_three"]}, + "CMS_scale_SDMass_qcd_wx_below":{"type":"shape", "wsname":"CMS_scale_SDMass_qcd_wx_below","name":"SDMassSCALE","proc":["qcd_wx_one","qcd_wx_two","qcd_wx_three"]}, + "CMS_scale_SDMass_qcd_tx_below":{"type":"shape", "wsname":"CMS_scale_SDMass_qcd_tx_below","name":"SDMassSCALE","proc":["qcd_tx_one","qcd_tx_two","qcd_tx_three"]}, + "CMS_scale_SDMass_qcd_wx_in":{"type":"shape", "wsname":"CMS_scale_SDMass_qcd_wx_in","name":"SDMassSCALE","proc":["qcd_wx_one","qcd_wx_two","qcd_wx_three"]}, + "CMS_scale_SDMass_qcd_tx_in":{"type":"shape", "wsname":"CMS_scale_SDMass_qcd_tx_in","name":"SDMassSCALE","proc":["qcd_tx_one","qcd_tx_two","qcd_tx_three"]}, + "CMS_scale_SDMass_qcd_wx_above":{"type":"shape", "wsname":"CMS_scale_SDMass_qcd_wx_above","name":"SDMassSCALE","proc":["qcd_wx_one","qcd_wx_two","qcd_wx_three"]}, + "CMS_scale_SDMass_qcd_tx_above":{"type":"shape", "wsname":"CMS_scale_SDMass_qcd_tx_above","name":"SDMassSCALE","proc":["qcd_tx_one","qcd_tx_two","qcd_tx_three"]}, ## Taus "CMS_eff_Tau21":{"type":"lnN", "value":["1.08","1.08","1.08"] ,"proc":["ttbar","top","Hptb"],"wsname":"CMS_eff_Tau21","name":"XXX"}, ## name used for shape "CMS_eff_Tau32":{"type":"lnN", "value":["1.02","1.02","1.02"] ,"proc":["ttbar","top","Hptb"],"wsname":"CMS_eff_Tau32","name":"XXX"}, ## name used for shape @@ -597,8 +604,8 @@ def mergeCategory(tfile,toget): # note decouple the qcd "CMS_btag_HFstat1":{"type":"shape", "wsname":"CMS_btag_HFstat1","name":"CSVRHFSTAT1","proc":["ttbar","top","Hptb","top"]}, "CMS_btag_HFstat2":{"type":"shape", "wsname":"CMS_btag_HFstat2","name":"CSVRHFSTAT2","proc":["ttbar","top","Hptb","top"]}, - "CMS_btag_LFstat1":{"type":"shape", "wsname":"CMS_btag_LFstat1","name":"CSVRLFSTAT1","proc":["ttbar","top","Hptb","top"]}, - "CMS_btag_LFstat2":{"type":"shape", "wsname":"CMS_btag_LFstat2","name":"CSVRLFSTAT2","proc":["ttbar","top","Hptb","top"]}, + "CMS_btag_LFstat1":{"type":"shape", "wsname":"CMS_btag_LFstat1","name":"CSVRLFSTAT1","proc":["ttbar","top","Hptb","top"]}, + "CMS_btag_LFstat2":{"type":"shape", "wsname":"CMS_btag_LFstat2","name":"CSVRLFSTAT2","proc":["ttbar","top","Hptb","top"]}, "CMS_btag_CFerr1":{"type":"shape", "wsname":"CMS_btag_CFerr1","name":"CSVRCERR1","proc":["ttbar","top","Hptb","top"]}, "CMS_btag_CFerr2":{"type":"shape", "wsname":"CMS_btag_CFerr2","name":"CSVRCERR2","proc":["ttbar","top","Hptb","top"]}, "CMS_btag_HFstat1_qcd":{"type":"shape", "wsname":"CMS_btag_HFstat1_qcd","name":"CSVRHFSTAT1","proc":["qcd_wx_one","qcd_wx_two","qcd_wx_three","qcd_tx_one","qcd_tx_two","qcd_tx_three"]}, @@ -619,11 +626,11 @@ def mergeCategory(tfile,toget): print "* ",cat,":",catStore[cat] print "---------------------- --------" -fileTmp="MIAO_AUG10/"+label+VarTest+opts.kMass+"_"+opts.output +fileTmp="MIAO_AUG23/"+label+VarTest+opts.kMass+"_"+opts.output w = ROOT.RooWorkspace("w","w") datNameTmp = opts.datCardName -datName = "MIAO_AUG10/"+label+ VarTest+opts.kMass+"_" + datNameTmp +datName = "MIAO_AUG23/"+label+ VarTest+opts.kMass+"_" + datNameTmp datacard=open(datName,"w") datacard.write("-------------------------------------\n") @@ -771,6 +778,7 @@ def writeNormSystLU(name="lumi",valueL=["1.027","1.026"], regexpL=["TT","ST",""] def writeNormSyst(name="lumi",valueL=["1.027","1.026"], regexpL=["TT","ST",""],regexpCat=[]): + datacard.write(name+"\tlnN") invert=False @@ -804,15 +812,15 @@ def writeNormSyst(name="lumi",valueL=["1.027","1.026"], regexpL=["TT","ST",""],r datacard.write("\t-") datacard.write("\n") -def writeSystShape(syst,regexpL=[],regexpCat=None): +def writeSystShape(syst,regexpL=[],regexpCat=[]): # this function put a bunch of 1 name=syst["wsname"] datacard.write(name+"\tshape") for cat in catStore: matchCat=True - if regexpCat != None: - matchCat=re.search(regexpCat,cat) +# if regexpCat != None: +# matchCat=re.search(regexpCat,cat) for proc in mcStore: if skip(catStore[cat],mcStore[proc]): continue @@ -827,7 +835,18 @@ def writeSystShape(syst,regexpL=[],regexpCat=None): idx=i break - if (idx>=0): + idx2=-1 + invert=False + for i,regexp in enumerate(regexpCat): + match=re.search(regexp,cat) + if regexp != "" and regexp[0] == '!': + invert=True + regexp=regexp[1:] + if (match and not invert) or (not match and invert): + idx2=i + break + + if (idx>=0 and (idx2>=0 or len(regexpCat)==0 )): datacard.write("\t1") else: datacard.write("\t-") @@ -898,8 +917,29 @@ def importStat(): else: writeNormSyst(syst,systStore[syst]["value"],systStore[syst]["proc"]) if systStore[syst]["type"] == "shape": - if "muRF" in systStore[syst]["wsname"]: + if "muRF_Hptb" in systStore[syst]["wsname"]: if not doSChannel: writeSystShape(systStore[syst],systStore[syst]["proc"]) +## + elif "muRF_ttbar_below" in systStore[syst]["wsname"]: + writeSystShape(systStore[syst],systStore[syst]["proc"],["below"]) + elif "muRF_ttbar_in" in systStore[syst]["wsname"]: + writeSystShape(systStore[syst],systStore[syst]["proc"],["in"]) + elif "muRF_ttbar_above" in systStore[syst]["wsname"]: + writeSystShape(systStore[syst],systStore[syst]["proc"],["above"]) +## + elif "CMS_scale_SDMass_qcd_wx_below" in systStore[syst]["wsname"]: + writeSystShape(systStore[syst],systStore[syst]["proc"],["below"]) + elif "CMS_scale_SDMass_qcd_wx_in" in systStore[syst]["wsname"]: + writeSystShape(systStore[syst],systStore[syst]["proc"],["in"]) + elif "CMS_scale_SDMass_qcd_wx_above" in systStore[syst]["wsname"]: + writeSystShape(systStore[syst],systStore[syst]["proc"],["above"]) +## + elif "CMS_scale_SDMass_qcd_tx_below" in systStore[syst]["wsname"]: + writeSystShape(systStore[syst],systStore[syst]["proc"],["below"]) + elif "CMS_scale_SDMass_qcd_tx_in" in systStore[syst]["wsname"]: + writeSystShape(systStore[syst],systStore[syst]["proc"],["in"]) + elif "CMS_scale_SDMass_qcd_tx_above" in systStore[syst]["wsname"]: + writeSystShape(systStore[syst],systStore[syst]["proc"],["above"]) else: writeSystShape(systStore[syst],systStore[syst]["proc"]) @@ -920,12 +960,20 @@ def importStat(): #if doSyst: writeNormSyst("CMS_HPTB_QCDnonclosure_",["1.20","1.20","1.20"],["qcd_wx_one","qcd_wx_two","qcd_wx_three"]) #if doSyst: writeNormSyst("CMS_HPTB_QCDnonclosure_",["1.20","1.20","1.20"],["qcd_tx_one","qcd_tx_two","qcd_tx_three"]) -if doSyst: writeNormSystLU("CMS_HPTB_QCDnonclosure_wx_one",["2."],["qcd_wx_one"]) -if doSyst: writeNormSystLU("CMS_HPTB_QCDnonclosure_wx_two",["2."],["qcd_wx_two"]) -if doSyst: writeNormSystLU("CMS_HPTB_QCDnonclosure_wx_three",["2."],["qcd_wx_three"]) -if doSyst: writeNormSystLU("CMS_HPTB_QCDnonclosure_tx_one",["2."],["qcd_tx_one"]) -if doSyst: writeNormSystLU("CMS_HPTB_QCDnonclosure_tx_two",["2."],["qcd_tx_two"]) -if doSyst: writeNormSystLU("CMS_HPTB_QCDnonclosure_tx_three",["2."],["qcd_tx_three"]) +if doSyst: writeNormSyst("CMS_HPTB_QCDnonclosure_wx_one_1l",["1.50"],["qcd_wx_one"],["OneBOneFat1l"]) +if doSyst: writeNormSyst("CMS_HPTB_QCDnonclosure_wx_two_1l",["1.50"],["qcd_wx_two"],["OneBOneFat1l"]) +if doSyst: writeNormSyst("CMS_HPTB_QCDnonclosure_wx_three_1l",["1.50"],["qcd_wx_three"],["OneBOneFat1l"]) +if doSyst: writeNormSyst("CMS_HPTB_QCDnonclosure_tx_one_1l",["1.50"],["qcd_tx_one"],["OneBOneFat1l"]) +if doSyst: writeNormSyst("CMS_HPTB_QCDnonclosure_tx_two_1l",["1.50"],["qcd_tx_two"],["OneBOneFat1l"]) +if doSyst: writeNormSyst("CMS_HPTB_QCDnonclosure_tx_three_1l",["1.50"],["qcd_tx_three"],["OneBOneFat1l"]) + + +if doSyst: writeNormSyst("CMS_HPTB_QCDnonclosure_wx_one",["1.50"],["qcd_wx_one"],["OneBOneFat_","OneBOneMirrorFat_"]) +if doSyst: writeNormSyst("CMS_HPTB_QCDnonclosure_wx_two",["1.50"],["qcd_wx_two"],["OneBOneFat_","OneBOneMirrorFat_"]) +if doSyst: writeNormSyst("CMS_HPTB_QCDnonclosure_wx_three",["1.50"],["qcd_wx_three"],["OneBOneFat_","OneBOneMirrorFat_"]) +if doSyst: writeNormSyst("CMS_HPTB_QCDnonclosure_tx_one",["1.50"],["qcd_tx_one"],["OneBOneFat_","OneBOneMirrorFat_"]) +if doSyst: writeNormSyst("CMS_HPTB_QCDnonclosure_tx_two",["1.50"],["qcd_tx_two"],["OneBOneFat_","OneBOneMirrorFat_"]) +if doSyst: writeNormSyst("CMS_HPTB_QCDnonclosure_tx_three",["1.50"],["qcd_tx_three"],["OneBOneFat_","OneBOneMirrorFat_"]) ## "ewk" get the envelop of the DY and W+jets if doSyst: writeNormSyst("QCDscale_ewk",["0.996/1.008"],["ewk"]) @@ -937,6 +985,7 @@ def importStat(): #if doSyst: writeNormSyst("CMS_HPTB_QCDscale_ttbb",["1.50"],["ttbb"]) #if doSyst: writeNormSyst("CMS_HPTB_QCDscale_tt2b",["1.50"],["tt2b"]) + #if doSyst: writeNormSyst("QCDscale_ewk",["0.98/1.02"],["ewk"]) #if doSyst: writeNormSyst("pdf_qqbar",["1.04"],["ewk"]) @@ -1186,14 +1235,21 @@ def importPdfFromTH1(cat,mc,myBin,LikelihoodMapping,syst=None): else: hTmp = mergeCategory(tfile,togetNom) - if hTmp!=None: print "<*> Reading Hist '"+toget+"'",hTmp.Integral() + if hTmp!=None: print "<*> 2/3 Reading Hist '"+toget+"'",hTmp.Integral() + +# if hTmp.Integral() <= 0 and ( "ewk" in mc["hist"]) : +# print "<*> Hist '"+toget+"' norm null but keep going" +# hTmp = None if hTmp == None: print "<*> Hist '"+toget+"' doesn't exist" - raise IOError +# raise IOError + ## raise error only if is on the 2Third and for the syst central value + if not ( "ST" in mc["hist"] or "ewk" in mc["hist"] or "TTX" in mc["hist"]) : + raise IOError # not using the 1/3 and 2/3 -# if ( mc["name"]=="ttbar" or mc["name"]=="ttb" or mc["name"]=="ttc" or mc["name"]=="ttlight" or "qcd" in mc["name"] ) and hTmp: +# if ( mc["name"]=="ttb" or mc["name"]=="ttc" or mc["name"]=="ttlight" or "qcd" in mc["name"] ) and hTmp: # hTmp.Scale(1.50) # ## foor QCD we do not apply the tauVeto and trigger @@ -1213,7 +1269,7 @@ def importPdfFromTH1(cat,mc,myBin,LikelihoodMapping,syst=None): # print 'xxxxxxxxx hname=',hname,' base=',base,'cat["dir"]',cat["dir"] #####1L - if applyLikelihoodRebinBin: + if hTmp and applyLikelihoodRebinBin: hTmp = likelihoodBinning.applyMapping(LikelihoodMapping, hTmp) if hTmpSum==None:hTmpSum = hTmp else: @@ -1240,7 +1296,7 @@ def importPdfFromTH1(cat,mc,myBin,LikelihoodMapping,syst=None): #save RooDataHist - h.Scale(opts.lumi) + if h: h.Scale(opts.lumi) print "* Importing ",target @@ -1372,11 +1428,16 @@ def importPdfFromTH1SumBKG(cat,mc,syst=None,do1Third=False): if hTmp!= None: print "<*> 1/3 Reading Hist '"+toget+"'",hTmp.Integral(),' nBin=',hTmp.GetNbinsX() +# if hTmp.Integral() <= 0 and ( "ewk" in mc["hist"]) : +# print "<*> Hist '"+toget+"' norm null but keep going" +# hTmp = None + if hTmp == None: print "<*> Hist '"+toget+"' doesn't exist" ## raise error only if is on the 2Third and for the syst central value if not do1Third: if syst == None: + print 'au revoir' raise IOError @@ -1402,17 +1463,17 @@ def importPdfFromTH1SumBKG(cat,mc,syst=None,do1Third=False): if hRef: if hRef.Integral() <= 0 : - print "ERROR histogram", hRef.GetName(),"has null norm" + print "ERROR hRef histogram", hRef.GetName(),"has null norm" raise ValueError if hSum: if hSum.Integral() <= 0 : - print "ERROR histogram", hSum.GetName(),"has null norm" + print "ERROR hSum histogram", hSum.GetName(),"has null norm" raise ValueError if hSig: if hSig.Integral() <= 0 : - print "ERROR histogram", hSig.GetName(),"has null norm" + print "ERROR hSig histogram", hSig.GetName(),"has null norm" raise ValueError if hSum!=None: From cff586885bfadcf06b2da4c23c488a124e9bc1a9 Mon Sep 17 00:00:00 2001 From: maria Date: Fri, 24 Aug 2018 20:09:56 +0200 Subject: [PATCH 37/60] bwsFullHadTB: fixes --- script/bwsFullHadTB.py | 70 +++++++++++++++++++++++------------------- 1 file changed, 38 insertions(+), 32 deletions(-) diff --git a/script/bwsFullHadTB.py b/script/bwsFullHadTB.py index 8d74b271..89c868e3 100644 --- a/script/bwsFullHadTB.py +++ b/script/bwsFullHadTB.py @@ -86,8 +86,8 @@ #parser.add_option("","--input",type='string',help="Input ROOT file. [%default]", default="/afs/cern.ch/user/h/hum/work/public/CMSSW_8_0_26_patch1/src/ChargedHiggs/ntufile/preapp2systNoSpi.root") #parser.add_option("","--inputBin",type='string',help="Input ROOT file. [%default]", default="/afs/cern.ch/user/h/hum/work/public/CMSSW_8_0_26_patch1/src/ChargedHiggs/ntufile/preapp2systNoSpi.root") -parser.add_option("","--input",type='string',help="Input ROOT file. [%default]", default="/afs/cern.ch/user/h/hum/work/public/CMSSW_8_0_26_patch1/src/ChargedHiggs/ntufile/preapp2systttb70.root") -parser.add_option("","--inputBin",type='string',help="Input ROOT file. [%default]", default="/afs/cern.ch/user/h/hum/work/public/CMSSW_8_0_26_patch1/src/ChargedHiggs/ntufile/preapp2systttb70.root") +parser.add_option("","--input",type='string',help="Input ROOT file. [%default]", default="/afs/cern.ch/user/h/hum/work/public/CMSSW_8_0_26_patch1/src/ChargedHiggs/ntufile/preapp3systsd.root") +parser.add_option("","--inputBin",type='string',help="Input ROOT file. [%default]", default="/afs/cern.ch/user/h/hum/work/public/CMSSW_8_0_26_patch1/src/ChargedHiggs/ntufile/preapp3systsd.root") ## REMEMBER TO: # a) change the rebin 20% to 50% Inf @@ -381,15 +381,13 @@ def mergeCategory(tfile,toget): #2500,3000 if "_three_highj" in x and (y=="t0b") and "in" in reg missing ST if opts.kMass=="3000": -### if "_two_highj" in x and y=="wbb": continue -### if "_three_lowj" in x and (y=="t0b") and "above" in reg: continue -###### if "_three_lowj" in x and (y=="t1b") and "in" in reg: continue - if "_three_highj" in x and (y=="t0b") and "in" in reg: continue + if "_three_lowj" in x and ( y=="t1b" or y=="t0b" ) and "above" in reg: continue + if "_three_highj" in x and ( y=="t0b" ) and "in" in reg: continue if "_three_lowj" in x and (y=="t0b") and "in" in reg: continue if opts.kMass=="2500": - if "_three_lowj" in x and (y=="t0b") and "in" in reg: continue - if "_three_highj" in x and (y=="t0b") and "in" in reg: continue + if "_three_highj" in x and (y=="t0b" or y=="t1b") and "in" in reg: continue + if "_three_highj" in x and (y=="t0b") and "above" in reg: continue ## below are for associated only # if not doSChannel and (opts.kMass=="500" or opts.kMass=="400") and "in" in reg or "below" in reg: @@ -576,7 +574,7 @@ def mergeCategory(tfile,toget): "muRF_ttbar_in":{"type":"shape", "wsname":"muRF_ttbar_in","name":"Scale","proc":["ttbar"]}, "muRF_ttbar_above":{"type":"shape", "wsname":"muRF_ttbar_above","name":"Scale","proc":["ttbar"]}, ### MET-Jets-PU - "CMS_pileup":{"type":"shape", "wsname":"CMS_pileup","name":"PU","proc":["qcd_wx_one","qcd_wx_two","qcd_wx_three","qcd_tx_one","qcd_tx_two","qcd_tx_three""ttbar","top","Hptb"]}, + "CMS_pileup":{"type":"shape", "wsname":"CMS_pileup","name":"PU","proc":["qcd_wx_one","qcd_wx_two","qcd_wx_three","qcd_tx_one","qcd_tx_two","qcd_tx_three","ttbar","top","Hptb"]}, "CMS_scale_uncluster":{"type":"shape", "wsname":"CMS_scale_uncluster","name":"UNCLUSTER","proc":["qcd_wx_one","qcd_wx_two","qcd_wx_three","qcd_tx_one","qcd_tx_two","qcd_tx_three","ttbar","top","Hptb"]}, ## SDmass "CMS_scale_SDMass":{"type":"shape", "wsname":"CMS_scale_SDMass","name":"SDMassSCALE","proc":["ttbar","top","Hptb"]}, @@ -599,15 +597,15 @@ def mergeCategory(tfile,toget): "CMS_btag_HF":{"type":"shape", "wsname":"CMS_btag_HF","name":"CSVRHF","proc":["ttbar","top","Hptb"]}, ##Heavy jets light flavor contamination "CMS_btag_LF":{"type":"shape", "wsname":"CMS_btag_LF","name":"CSVRLF","proc":["ttbar","top","Hptb"]}, - "CMS_btag_LF_qcd":{"type":"shape", "wsname":"CMS_btag_LF","name":"CSVRLF","proc":["qcd_wx_one","qcd_wx_two","qcd_wx_three","qcd_tx_one","qcd_tx_two","qcd_tx_three"]}, + "CMS_btag_LF_qcd":{"type":"shape", "wsname":"CMS_btag_LF_qcd","name":"CSVRLF","proc":["qcd_wx_one","qcd_wx_two","qcd_wx_three","qcd_tx_one","qcd_tx_two","qcd_tx_three"]}, ##Linear and quadratic uncertainties # note decouple the qcd - "CMS_btag_HFstat1":{"type":"shape", "wsname":"CMS_btag_HFstat1","name":"CSVRHFSTAT1","proc":["ttbar","top","Hptb","top"]}, - "CMS_btag_HFstat2":{"type":"shape", "wsname":"CMS_btag_HFstat2","name":"CSVRHFSTAT2","proc":["ttbar","top","Hptb","top"]}, - "CMS_btag_LFstat1":{"type":"shape", "wsname":"CMS_btag_LFstat1","name":"CSVRLFSTAT1","proc":["ttbar","top","Hptb","top"]}, - "CMS_btag_LFstat2":{"type":"shape", "wsname":"CMS_btag_LFstat2","name":"CSVRLFSTAT2","proc":["ttbar","top","Hptb","top"]}, - "CMS_btag_CFerr1":{"type":"shape", "wsname":"CMS_btag_CFerr1","name":"CSVRCERR1","proc":["ttbar","top","Hptb","top"]}, - "CMS_btag_CFerr2":{"type":"shape", "wsname":"CMS_btag_CFerr2","name":"CSVRCERR2","proc":["ttbar","top","Hptb","top"]}, + "CMS_btag_HFstat1":{"type":"shape", "wsname":"CMS_btag_HFstat1","name":"CSVRHFSTAT1","proc":["ttbar","top","Hptb"]}, + "CMS_btag_HFstat2":{"type":"shape", "wsname":"CMS_btag_HFstat2","name":"CSVRHFSTAT2","proc":["ttbar","top","Hptb"]}, + "CMS_btag_LFstat1":{"type":"shape", "wsname":"CMS_btag_LFstat1","name":"CSVRLFSTAT1","proc":["ttbar","top","Hptb"]}, + "CMS_btag_LFstat2":{"type":"shape", "wsname":"CMS_btag_LFstat2","name":"CSVRLFSTAT2","proc":["ttbar","top","Hptb"]}, + "CMS_btag_CFerr1":{"type":"shape", "wsname":"CMS_btag_CFerr1","name":"CSVRCERR1","proc":["ttbar","top","Hptb"]}, + "CMS_btag_CFerr2":{"type":"shape", "wsname":"CMS_btag_CFerr2","name":"CSVRCERR2","proc":["ttbar","top","Hptb"]}, "CMS_btag_HFstat1_qcd":{"type":"shape", "wsname":"CMS_btag_HFstat1_qcd","name":"CSVRHFSTAT1","proc":["qcd_wx_one","qcd_wx_two","qcd_wx_three","qcd_tx_one","qcd_tx_two","qcd_tx_three"]}, "CMS_btag_HFstat2_qcd":{"type":"shape", "wsname":"CMS_btag_HFstat2_qcd","name":"CSVRHFSTAT2","proc":["qcd_wx_one","qcd_wx_two","qcd_wx_three","qcd_tx_one","qcd_tx_two","qcd_tx_three"]}, "CMS_btag_LFstat1_qcd":{"type":"shape", "wsname":"CMS_btag_LFstat1_qcd","name":"CSVRLFSTAT1","proc":["qcd_wx_one","qcd_wx_two","qcd_wx_three","qcd_tx_one","qcd_tx_two","qcd_tx_three"]}, @@ -626,11 +624,11 @@ def mergeCategory(tfile,toget): print "* ",cat,":",catStore[cat] print "---------------------- --------" -fileTmp="MIAO_AUG23/"+label+VarTest+opts.kMass+"_"+opts.output +fileTmp="MIAO_AUG23_bin2/"+label+VarTest+opts.kMass+"_"+opts.output w = ROOT.RooWorkspace("w","w") datNameTmp = opts.datCardName -datName = "MIAO_AUG23/"+label+ VarTest+opts.kMass+"_" + datNameTmp +datName = "MIAO_AUG23_bin2/"+label+ VarTest+opts.kMass+"_" + datNameTmp datacard=open(datName,"w") datacard.write("-------------------------------------\n") @@ -910,6 +908,7 @@ def importStat(): for syst in systStore: if syst == "None": continue if systStore[syst]["type"] == "lnN": + ## remember to decorrelate among the mirror and SR if "CMS_eff_Tau21" in systStore[syst]["wsname"]: writeNormSyst(syst,systStore[syst]["value"],systStore[syst]["proc"],["wbb","wbj"]) elif "CMS_eff_Tau32" in systStore[syst]["wsname"]: @@ -1098,23 +1097,30 @@ def envelop(tfile,togetNom, togetSyst, s) : for iBin in range(1,h.GetNbinsX()+1): c= h.GetBinContent(iBin) - ## take the maximum for the Up - if 'Up' in s and hTmp.GetBinContent(iBin)>c: - h.SetBinContent(iBin,hTmp.GetBinContent(iBin)) + ## take the maximum for the Up + if 'Up' in s and hTmp.GetBinContent(iBin)>c: + h.SetBinContent(iBin,hTmp.GetBinContent(iBin)) - ## take the minimum for the Down - if 'Down' in s and hTmp.GetBinContent(iBin) 2/3 Reading Hist '"+toget+"'",hTmp.Integral() -# if hTmp.Integral() <= 0 and ( "ewk" in mc["hist"]) : +# if hTmp.Integral() <= 0 and ( "ewk" in mc["hist"] or "TTX" in mc["hist"]) : # print "<*> Hist '"+toget+"' norm null but keep going" # hTmp = None @@ -1271,9 +1277,9 @@ def importPdfFromTH1(cat,mc,myBin,LikelihoodMapping,syst=None): if hTmp and applyLikelihoodRebinBin: hTmp = likelihoodBinning.applyMapping(LikelihoodMapping, hTmp) - if hTmpSum==None:hTmpSum = hTmp + if hTmpSum==None and hTmp:hTmpSum = hTmp else: - hTmpSum.Add(hTmp) + if hTmp: hTmpSum.Add(hTmp) h=hTmpSum @@ -1428,7 +1434,7 @@ def importPdfFromTH1SumBKG(cat,mc,syst=None,do1Third=False): if hTmp!= None: print "<*> 1/3 Reading Hist '"+toget+"'",hTmp.Integral(),' nBin=',hTmp.GetNbinsX() -# if hTmp.Integral() <= 0 and ( "ewk" in mc["hist"]) : +# if hTmp.Integral() <= 0 and ( "ewk" in mc["hist"] or "TTX" in mc["hist"]) : # print "<*> Hist '"+toget+"' norm null but keep going" # hTmp = None From 448d2996343e266bdff837b9ee5b7725f05a399d Mon Sep 17 00:00:00 2001 From: maria Date: Sun, 26 Aug 2018 09:20:26 +0200 Subject: [PATCH 38/60] add muRF-ttbar for the 1l; for mirror use the in only --- script/bwsFullHadTB.py | 20 ++++++++------------ 1 file changed, 8 insertions(+), 12 deletions(-) diff --git a/script/bwsFullHadTB.py b/script/bwsFullHadTB.py index 89c868e3..1120c2be 100644 --- a/script/bwsFullHadTB.py +++ b/script/bwsFullHadTB.py @@ -14,8 +14,8 @@ nRebinHT=1 #nRebinHT=5 #LikeBins=10 -LikeBins=1 -#LikeBins=2 +#LikeBins=1 +LikeBins=2 doRebin = False applyLikelihoodRebinBin = True @@ -326,14 +326,9 @@ def mergeCategory(tfile,toget): for x in basecat: region = ["_in","_above","_below"] -## region = ["_in","_below"] -## region = ["_in"] -#counting -# if True: -# region = ["_in"] -# if "OneBOneFat1l" in x: continue -# if "OneBOneMirrorFat" in x:continue + if "OneBOneMirrorFat" in x: + region = ["_in"] if "OneBOneFat1l" in x: region = ["_all"] @@ -624,11 +619,11 @@ def mergeCategory(tfile,toget): print "* ",cat,":",catStore[cat] print "---------------------- --------" -fileTmp="MIAO_AUG23_bin2/"+label+VarTest+opts.kMass+"_"+opts.output +fileTmp="MIAO_AUG25_bin2/"+label+VarTest+opts.kMass+"_"+opts.output w = ROOT.RooWorkspace("w","w") datNameTmp = opts.datCardName -datName = "MIAO_AUG23_bin2/"+label+ VarTest+opts.kMass+"_" + datNameTmp +datName = "MIAO_AUG25_bin2/"+label+ VarTest+opts.kMass+"_" + datNameTmp datacard=open(datName,"w") datacard.write("-------------------------------------\n") @@ -909,6 +904,7 @@ def importStat(): if syst == "None": continue if systStore[syst]["type"] == "lnN": ## remember to decorrelate among the mirror and SR + ## remember to decorrelate eff-l for among veto and 1l if "CMS_eff_Tau21" in systStore[syst]["wsname"]: writeNormSyst(syst,systStore[syst]["value"],systStore[syst]["proc"],["wbb","wbj"]) elif "CMS_eff_Tau32" in systStore[syst]["wsname"]: @@ -922,7 +918,7 @@ def importStat(): elif "muRF_ttbar_below" in systStore[syst]["wsname"]: writeSystShape(systStore[syst],systStore[syst]["proc"],["below"]) elif "muRF_ttbar_in" in systStore[syst]["wsname"]: - writeSystShape(systStore[syst],systStore[syst]["proc"],["in"]) + writeSystShape(systStore[syst],systStore[syst]["proc"],["in","OneBOneFat1l"]) elif "muRF_ttbar_above" in systStore[syst]["wsname"]: writeSystShape(systStore[syst],systStore[syst]["proc"],["above"]) ## From 369ab278c985402b52bf20ee4e78e52e8ae89ee9 Mon Sep 17 00:00:00 2001 From: maria Date: Thu, 30 Aug 2018 21:34:41 +0200 Subject: [PATCH 39/60] finalize syst correlation --- script/bwsFullHadTB.py | 249 +++++++++++++++++++++++++++++++---------- 1 file changed, 189 insertions(+), 60 deletions(-) diff --git a/script/bwsFullHadTB.py b/script/bwsFullHadTB.py index 1120c2be..32b99970 100644 --- a/script/bwsFullHadTB.py +++ b/script/bwsFullHadTB.py @@ -328,7 +328,7 @@ def mergeCategory(tfile,toget): region = ["_in","_above","_below"] if "OneBOneMirrorFat" in x: - region = ["_in"] + region = ["_in"] if "OneBOneFat1l" in x: region = ["_all"] @@ -383,13 +383,34 @@ def mergeCategory(tfile,toget): if opts.kMass=="2500": if "_three_highj" in x and (y=="t0b" or y=="t1b") and "in" in reg: continue if "_three_highj" in x and (y=="t0b") and "above" in reg: continue +# if "_three_lowj" in x and (y=="t0b") and "in" in reg: continue +# if "_three_highj" in x and (y=="t0b" or y=="t1b") and "above" in reg: continue ## below are for associated only # if not doSChannel and (opts.kMass=="500" or opts.kMass=="400") and "in" in reg or "below" in reg: - if not doSChannel and (opts.kMass=="500" or opts.kMass=="400") and ("below" in reg or "in" in reg): - if "_three_lowj" in x and y=="wbb": continue - if "_one_lowj" in x and y=="wbj": continue - +# if not doSChannel and (opts.kMass=="500" or opts.kMass=="400") and ("below" in reg or "in" in reg): +# if "_three_lowj" in x and y=="wbb": continue +# if "_one_lowj" in x and y=="wbj": continue + +# if not doSChannel and (opts.kMass=="1500" or opts.kMass=="2000" or opts.kMass=="2500" or opts.kMass=="3000") and "in" in reg: +# if "_two_lowj" in x and y=="wbj": continue +# if "_three_highj" in x and y=="wbj": continue + +# if not doSChannel and (opts.kMass=="2000" or opts.kMass=="2500" or opts.kMass=="3000") and "in" in reg: +# if "_one_highj" in x and y=="wbj": continue +# if "_two_highj" in x and y=="wbj": continue +# if "_three_lowj" in x and y=="wbb": continue +# if "_three_highj" in x and y=="wbb": continue + +# if not doSChannel and (opts.kMass=="2500" or opts.kMass=="3000") and "in" in reg: +# if "_two_lowj" in x and y=="wbb": continue +# if "_three_lowj" in x and y=="wbb": continue +# if "_three_highj" in x and y=="wbb": continue +# if "_one_lowj" in x and y=="wbj": continue + +###################### +############ s-channel +###################### if doSChannel and (opts.kMass=="800" or opts.kMass=="900" or opts.kMass=="1000" or opts.kMass=="1500" or opts.kMass=="2000" or opts.kMass=="2500" or opts.kMass=="3000") and "in" in reg: if "_two_highj" in x and y=="wbb": continue if "_one_highj" in x and y=="wbj": continue @@ -402,21 +423,9 @@ def mergeCategory(tfile,toget): if y=="wbb": continue if y=="wbj": continue - if not doSChannel and (opts.kMass=="1500" or opts.kMass=="2000" or opts.kMass=="2500" or opts.kMass=="3000") and "in" in reg: - if "_two_lowj" in x and y=="wbj": continue - if "_three_highj" in x and y=="wbj": continue - - if not doSChannel and (opts.kMass=="2000" or opts.kMass=="2500" or opts.kMass=="3000") and "in" in reg: - if "_one_highj" in x and y=="wbj": continue - if "_two_highj" in x and y=="wbj": continue - if "_three_lowj" in x and y=="wbb": continue - if "_three_highj" in x and y=="wbb": continue - - if not doSChannel and (opts.kMass=="2500" or opts.kMass=="3000") and "in" in reg: - if "_two_lowj" in x and y=="wbb": continue - if "_three_lowj" in x and y=="wbb": continue - if "_three_highj" in x and y=="wbb": continue - if "_one_lowj" in x and y=="wbj": continue +###################### +###################### +###################### # if opts.kMass=="2000" or opts.kMass=="2500" or opts.kMass=="3000": @@ -557,17 +566,19 @@ def mergeCategory(tfile,toget): systStore={ "None":None, "lumi_13TeV":{"type":"lnN", "value":["1.025"] ,"proc":[".*"],"wsname":"lumi_13TeV","name":"XXX"}, - ### lepton veto + ### lepton veto 0.96 / for 1l is 1.04 "CMS_eff_l":{"type":"lnN", "value":["0.96"] ,"proc":[".*"],"wsname":"CMS_eff_l","name":"XXX"}, ## name used for shape + ## check the direction of the tau for the combination "CMS_eff_t":{"type":"lnN", "value":["1.03"] ,"proc":[".*"],"wsname":"CMS_eff_t","name":"XXX"}, ## name used for shape #### trigger efficiency "CMS_eff_trigger":{"type":"lnN", "value":["1.05"] ,"proc":[".*"],"wsname":"CMS_eff_triggger","name":"XXX"}, ### Theory modeling "CMS_topreweight":{"type":"shape", "wsname":"CMS_topreweight","name":"TOPRW","proc":["ttbar"]}, "muRF_Hptb":{"type":"shape", "wsname":"muRF_Hptb","name":"Scale","proc":["Hptb"]}, - "muRF_ttbar_below":{"type":"shape", "wsname":"muRF_ttbar_below","name":"Scale","proc":["ttbar"]}, - "muRF_ttbar_in":{"type":"shape", "wsname":"muRF_ttbar_in","name":"Scale","proc":["ttbar"]}, - "muRF_ttbar_above":{"type":"shape", "wsname":"muRF_ttbar_above","name":"Scale","proc":["ttbar"]}, + "muRF_ttbar":{"type":"shape", "wsname":"muRF_ttbar","name":"Scale","proc":["ttbar"]}, +# "muRF_ttbar_below":{"type":"shape", "wsname":"muRF_ttbar_below","name":"Scale","proc":["ttbar"]}, +# "muRF_ttbar_in":{"type":"shape", "wsname":"muRF_ttbar_in","name":"Scale","proc":["ttbar"]}, +# "muRF_ttbar_above":{"type":"shape", "wsname":"muRF_ttbar_above","name":"Scale","proc":["ttbar"]}, ### MET-Jets-PU "CMS_pileup":{"type":"shape", "wsname":"CMS_pileup","name":"PU","proc":["qcd_wx_one","qcd_wx_two","qcd_wx_three","qcd_tx_one","qcd_tx_two","qcd_tx_three","ttbar","top","Hptb"]}, "CMS_scale_uncluster":{"type":"shape", "wsname":"CMS_scale_uncluster","name":"UNCLUSTER","proc":["qcd_wx_one","qcd_wx_two","qcd_wx_three","qcd_tx_one","qcd_tx_two","qcd_tx_three","ttbar","top","Hptb"]}, @@ -606,8 +617,27 @@ def mergeCategory(tfile,toget): "CMS_btag_LFstat1_qcd":{"type":"shape", "wsname":"CMS_btag_LFstat1_qcd","name":"CSVRLFSTAT1","proc":["qcd_wx_one","qcd_wx_two","qcd_wx_three","qcd_tx_one","qcd_tx_two","qcd_tx_three"]}, "CMS_btag_LFstat2_qcd":{"type":"shape", "wsname":"CMS_btag_LFstat2_qcd","name":"CSVRLFSTAT2","proc":["qcd_wx_one","qcd_wx_two","qcd_wx_three","qcd_tx_one","qcd_tx_two","qcd_tx_three"]}, "CMS_btag_CFerr1_qcd":{"type":"shape", "wsname":"CMS_btag_CFerr1_qcd","name":"CSVRCERR1","proc":["qcd_wx_one","qcd_wx_two","qcd_wx_three","qcd_tx_one","qcd_tx_two","qcd_tx_three"]}, - "CMS_btag_CFerr2_qcd":{"type":"shape", "wsname":"CMS_btag_CFerr2_qcd","name":"CSVRCERR2","proc":["qcd_wx_one","qcd_wx_two","qcd_wx_three","qcd_tx_one","qcd_tx_two","qcd_tx_three"]} + "CMS_btag_CFerr2_qcd":{"type":"shape", "wsname":"CMS_btag_CFerr2_qcd","name":"CSVRCERR2","proc":["qcd_wx_one","qcd_wx_two","qcd_wx_three","qcd_tx_one","qcd_tx_two","qcd_tx_three"]}, #### + ## QCD Pol + "CMS_scale_Pol_qcd_tx_one_below":{"type":"shape", "wsname":"CMS_scale_Pol_qcd_tx_one_below","name":"XXX","proc":["qcd_tx_one"]}, + "CMS_scale_Pol_qcd_tx_two_below":{"type":"shape", "wsname":"CMS_scale_Pol_qcd_tx_two_below","name":"XXX","proc":["qcd_tx_two"]}, + "CMS_scale_Pol_qcd_tx_three_below":{"type":"shape", "wsname":"CMS_scale_Pol_qcd_tx_three_below","name":"XXX","proc":["qcd_tx_three"]}, + "CMS_scale_Pol_qcd_wx_one_below":{"type":"shape", "wsname":"CMS_scale_Pol_qcd_wx_one_below","name":"XXX","proc":["qcd_wx_one"]}, + "CMS_scale_Pol_qcd_wx_two_below":{"type":"shape", "wsname":"CMS_scale_Pol_qcd_wx_two_below","name":"XXX","proc":["qcd_wx_two"]}, + "CMS_scale_Pol_qcd_wx_three_below":{"type":"shape", "wsname":"CMS_scale_Pol_qcd_wx_three_below","name":"XXX","proc":["qcd_wx_three"]}, + "CMS_scale_Pol_qcd_tx_one_in":{"type":"shape", "wsname":"CMS_scale_Pol_qcd_tx_one_in","name":"XXX","proc":["qcd_tx_one"]}, + "CMS_scale_Pol_qcd_tx_two_in":{"type":"shape", "wsname":"CMS_scale_Pol_qcd_tx_two_in","name":"XXX","proc":["qcd_tx_two"]}, + "CMS_scale_Pol_qcd_tx_three_in":{"type":"shape", "wsname":"CMS_scale_Pol_qcd_tx_three_in","name":"XXX","proc":["qcd_tx_three"]}, + "CMS_scale_Pol_qcd_wx_one_in":{"type":"shape", "wsname":"CMS_scale_Pol_qcd_wx_one_in","name":"XXX","proc":["qcd_wx_one"]}, + "CMS_scale_Pol_qcd_wx_two_in":{"type":"shape", "wsname":"CMS_scale_Pol_qcd_wx_two_in","name":"XXX","proc":["qcd_wx_two"]}, + "CMS_scale_Pol_qcd_wx_three_in":{"type":"shape", "wsname":"CMS_scale_Pol_qcd_wx_three_in","name":"XXX","proc":["qcd_wx_three"]}, + "CMS_scale_Pol_qcd_tx_one_above":{"type":"shape", "wsname":"CMS_scale_Pol_qcd_tx_one_above","name":"XXX","proc":["qcd_tx_one"]}, + "CMS_scale_Pol_qcd_tx_two_above":{"type":"shape", "wsname":"CMS_scale_Pol_qcd_tx_two_above","name":"XXX","proc":["qcd_tx_two"]}, + "CMS_scale_Pol_qcd_tx_three_above":{"type":"shape", "wsname":"CMS_scale_Pol_qcd_tx_three_above","name":"XXX","proc":["qcd_tx_three"]}, + "CMS_scale_Pol_qcd_wx_one_above":{"type":"shape", "wsname":"CMS_scale_Pol_qcd_wx_one_above","name":"XXX","proc":["qcd_wx_one"]}, + "CMS_scale_Pol_qcd_wx_two_above":{"type":"shape", "wsname":"CMS_scale_Pol_qcd_wx_two_above","name":"XXX","proc":["qcd_wx_two"]}, + "CMS_scale_Pol_qcd_wx_three_above":{"type":"shape", "wsname":"CMS_scale_Pol_qcd_wx_three_above","name":"XXX","proc":["qcd_wx_three"]} } else: systStore={ @@ -619,11 +649,11 @@ def mergeCategory(tfile,toget): print "* ",cat,":",catStore[cat] print "---------------------- --------" -fileTmp="MIAO_AUG25_bin2/"+label+VarTest+opts.kMass+"_"+opts.output +fileTmp="MIAO_AUG30_SRinShape/"+label+VarTest+opts.kMass+"_"+opts.output w = ROOT.RooWorkspace("w","w") datNameTmp = opts.datCardName -datName = "MIAO_AUG25_bin2/"+label+ VarTest+opts.kMass+"_" + datNameTmp +datName = "MIAO_AUG30_SRinShape/"+label+ VarTest+opts.kMass+"_" + datNameTmp datacard=open(datName,"w") datacard.write("-------------------------------------\n") @@ -903,24 +933,29 @@ def importStat(): for syst in systStore: if syst == "None": continue if systStore[syst]["type"] == "lnN": - ## remember to decorrelate among the mirror and SR - ## remember to decorrelate eff-l for among veto and 1l + if "CMS_eff_Tau21" in systStore[syst]["wsname"]: - writeNormSyst(syst,systStore[syst]["value"],systStore[syst]["proc"],["wbb","wbj"]) + writeNormSyst(syst,["1.08","1.08","1.08"],systStore[syst]["proc"],["OneBOneFat_.*_wbb","OneBOneFat_.*_wbj"]) + writeNormSyst(syst,["0.92","0.92","0.92"],systStore[syst]["proc"],["OneBOneMirrorFat_.*_wbb","OneBOneMirrorFat_.*_wbj"]) elif "CMS_eff_Tau32" in systStore[syst]["wsname"]: - writeNormSyst(syst,systStore[syst]["value"],systStore[syst]["proc"],["t0b","t1b"]) + writeNormSyst(syst,["1.02","1.02","1.02"],systStore[syst]["proc"],["OneBOneFat_.*_t0b","OneBOneFat_.*_t1b"]) + writeNormSyst(syst,["0.98","0.98","0.98"],systStore[syst]["proc"],["OneBOneMirrorFat_.*_t0b","OneBOneMirrorFat_.*_t1b"]) + elif "CMS_eff_l" in systStore[syst]["wsname"]: + writeNormSyst(syst,["1.04"],systStore[syst]["proc"],["OneBOneFat1l_"]) + writeNormSyst(syst,["0.96"],systStore[syst]["proc"],["OneBOneFat_","OneBOneMirrorFat_"]) else: writeNormSyst(syst,systStore[syst]["value"],systStore[syst]["proc"]) + if systStore[syst]["type"] == "shape": if "muRF_Hptb" in systStore[syst]["wsname"]: if not doSChannel: writeSystShape(systStore[syst],systStore[syst]["proc"]) ## - elif "muRF_ttbar_below" in systStore[syst]["wsname"]: - writeSystShape(systStore[syst],systStore[syst]["proc"],["below"]) - elif "muRF_ttbar_in" in systStore[syst]["wsname"]: - writeSystShape(systStore[syst],systStore[syst]["proc"],["in","OneBOneFat1l"]) - elif "muRF_ttbar_above" in systStore[syst]["wsname"]: - writeSystShape(systStore[syst],systStore[syst]["proc"],["above"]) +# elif "muRF_ttbar_below" in systStore[syst]["wsname"]: +# writeSystShape(systStore[syst],systStore[syst]["proc"],["below"]) +# elif "muRF_ttbar_in" in systStore[syst]["wsname"]: +# writeSystShape(systStore[syst],systStore[syst]["proc"],["in","OneBOneFat1l"]) +# elif "muRF_ttbar_above" in systStore[syst]["wsname"]: +# writeSystShape(systStore[syst],systStore[syst]["proc"],["above"]) ## elif "CMS_scale_SDMass_qcd_wx_below" in systStore[syst]["wsname"]: writeSystShape(systStore[syst],systStore[syst]["proc"],["below"]) @@ -935,6 +970,46 @@ def importStat(): writeSystShape(systStore[syst],systStore[syst]["proc"],["in"]) elif "CMS_scale_SDMass_qcd_tx_above" in systStore[syst]["wsname"]: writeSystShape(systStore[syst],systStore[syst]["proc"],["above"]) + + elif "CMS_scale_Pol_qcd_tx_one_below" in systStore[syst]["wsname"]: + writeSystShape(systStore[syst],systStore[syst]["proc"],["below"]) + elif "CMS_scale_Pol_qcd_tx_one_in" in systStore[syst]["wsname"]: + writeSystShape(systStore[syst],systStore[syst]["proc"],["in"]) + elif "CMS_scale_Pol_qcd_tx_one_above" in systStore[syst]["wsname"]: + writeSystShape(systStore[syst],systStore[syst]["proc"],["above"]) + elif "CMS_scale_Pol_qcd_tx_two_below" in systStore[syst]["wsname"]: + writeSystShape(systStore[syst],systStore[syst]["proc"],["below"]) + elif "CMS_scale_Pol_qcd_tx_two_in" in systStore[syst]["wsname"]: + writeSystShape(systStore[syst],systStore[syst]["proc"],["in"]) + elif "CMS_scale_Pol_qcd_tx_two_above" in systStore[syst]["wsname"]: + writeSystShape(systStore[syst],systStore[syst]["proc"],["above"]) + elif "CMS_scale_Pol_qcd_tx_three_below" in systStore[syst]["wsname"]: + writeSystShape(systStore[syst],systStore[syst]["proc"],["below"]) + elif "CMS_scale_Pol_qcd_tx_three_in" in systStore[syst]["wsname"]: + writeSystShape(systStore[syst],systStore[syst]["proc"],["in"]) + elif "CMS_scale_Pol_qcd_tx_three_above" in systStore[syst]["wsname"]: + writeSystShape(systStore[syst],systStore[syst]["proc"],["above"]) + + + elif "CMS_scale_Pol_qcd_wx_one_below" in systStore[syst]["wsname"]: + writeSystShape(systStore[syst],systStore[syst]["proc"],["below"]) + elif "CMS_scale_Pol_qcd_wx_one_in" in systStore[syst]["wsname"]: + writeSystShape(systStore[syst],systStore[syst]["proc"],["in"]) + elif "CMS_scale_Pol_qcd_wx_one_above" in systStore[syst]["wsname"]: + writeSystShape(systStore[syst],systStore[syst]["proc"],["above"]) + elif "CMS_scale_Pol_qcd_wx_two_below" in systStore[syst]["wsname"]: + writeSystShape(systStore[syst],systStore[syst]["proc"],["below"]) + elif "CMS_scale_Pol_qcd_wx_two_in" in systStore[syst]["wsname"]: + writeSystShape(systStore[syst],systStore[syst]["proc"],["in"]) + elif "CMS_scale_Pol_qcd_wx_two_above" in systStore[syst]["wsname"]: + writeSystShape(systStore[syst],systStore[syst]["proc"],["above"]) + elif "CMS_scale_Pol_qcd_wx_three_below" in systStore[syst]["wsname"]: + writeSystShape(systStore[syst],systStore[syst]["proc"],["below"]) + elif "CMS_scale_Pol_qcd_wx_three_in" in systStore[syst]["wsname"]: + writeSystShape(systStore[syst],systStore[syst]["proc"],["in"]) + elif "CMS_scale_Pol_qcd_wx_three_above" in systStore[syst]["wsname"]: + writeSystShape(systStore[syst],systStore[syst]["proc"],["above"]) + else: writeSystShape(systStore[syst],systStore[syst]["proc"]) @@ -955,20 +1030,33 @@ def importStat(): #if doSyst: writeNormSyst("CMS_HPTB_QCDnonclosure_",["1.20","1.20","1.20"],["qcd_wx_one","qcd_wx_two","qcd_wx_three"]) #if doSyst: writeNormSyst("CMS_HPTB_QCDnonclosure_",["1.20","1.20","1.20"],["qcd_tx_one","qcd_tx_two","qcd_tx_three"]) -if doSyst: writeNormSyst("CMS_HPTB_QCDnonclosure_wx_one_1l",["1.50"],["qcd_wx_one"],["OneBOneFat1l"]) -if doSyst: writeNormSyst("CMS_HPTB_QCDnonclosure_wx_two_1l",["1.50"],["qcd_wx_two"],["OneBOneFat1l"]) -if doSyst: writeNormSyst("CMS_HPTB_QCDnonclosure_wx_three_1l",["1.50"],["qcd_wx_three"],["OneBOneFat1l"]) -if doSyst: writeNormSyst("CMS_HPTB_QCDnonclosure_tx_one_1l",["1.50"],["qcd_tx_one"],["OneBOneFat1l"]) -if doSyst: writeNormSyst("CMS_HPTB_QCDnonclosure_tx_two_1l",["1.50"],["qcd_tx_two"],["OneBOneFat1l"]) -if doSyst: writeNormSyst("CMS_HPTB_QCDnonclosure_tx_three_1l",["1.50"],["qcd_tx_three"],["OneBOneFat1l"]) - - -if doSyst: writeNormSyst("CMS_HPTB_QCDnonclosure_wx_one",["1.50"],["qcd_wx_one"],["OneBOneFat_","OneBOneMirrorFat_"]) -if doSyst: writeNormSyst("CMS_HPTB_QCDnonclosure_wx_two",["1.50"],["qcd_wx_two"],["OneBOneFat_","OneBOneMirrorFat_"]) -if doSyst: writeNormSyst("CMS_HPTB_QCDnonclosure_wx_three",["1.50"],["qcd_wx_three"],["OneBOneFat_","OneBOneMirrorFat_"]) -if doSyst: writeNormSyst("CMS_HPTB_QCDnonclosure_tx_one",["1.50"],["qcd_tx_one"],["OneBOneFat_","OneBOneMirrorFat_"]) -if doSyst: writeNormSyst("CMS_HPTB_QCDnonclosure_tx_two",["1.50"],["qcd_tx_two"],["OneBOneFat_","OneBOneMirrorFat_"]) -if doSyst: writeNormSyst("CMS_HPTB_QCDnonclosure_tx_three",["1.50"],["qcd_tx_three"],["OneBOneFat_","OneBOneMirrorFat_"]) +if doSyst: writeNormSyst("CMS_HPTB_QCDnonclosure_wx_one_1l",["1.50"],["qcd_wx_one"],["OneBOneFat1l_"]) +if doSyst: writeNormSyst("CMS_HPTB_QCDnonclosure_wx_two_1l",["1.50"],["qcd_wx_two"],["OneBOneFat1l_"]) +if doSyst: writeNormSyst("CMS_HPTB_QCDnonclosure_wx_three_1l",["1.50"],["qcd_wx_three"],["OneBOneFat1l_"]) +if doSyst: writeNormSyst("CMS_HPTB_QCDnonclosure_tx_one_1l",["1.50"],["qcd_tx_one"],["OneBOneFat1l_"]) +if doSyst: writeNormSyst("CMS_HPTB_QCDnonclosure_tx_two_1l",["1.50"],["qcd_tx_two"],["OneBOneFat1l_"]) +if doSyst: writeNormSyst("CMS_HPTB_QCDnonclosure_tx_three_1l",["1.50"],["qcd_tx_three"],["OneBOneFat1l_"]) + +if doSyst: writeNormSyst("CMS_HPTB_QCDnonclosure_wx_one_below",["1.50"],["qcd_wx_one"],["OneBOneFat_.*_below","OneBOneMirrorFat_.*_below"]) +if doSyst: writeNormSyst("CMS_HPTB_QCDnonclosure_wx_two_below",["1.50"],["qcd_wx_two"],["OneBOneFat_.*_below","OneBOneMirrorFat_.*_below"]) +if doSyst: writeNormSyst("CMS_HPTB_QCDnonclosure_wx_three_below",["1.50"],["qcd_wx_three"],["OneBOneFat_.*_below","OneBOneMirrorFat_.*_below"]) +if doSyst: writeNormSyst("CMS_HPTB_QCDnonclosure_tx_one_below",["1.50"],["qcd_tx_one"],["OneBOneFat_.*_below","OneBOneMirrorFat_.*_below"]) +if doSyst: writeNormSyst("CMS_HPTB_QCDnonclosure_tx_two_below",["1.50"],["qcd_tx_two"],["OneBOneFat_.*_below","OneBOneMirrorFat_.*_below"]) +if doSyst: writeNormSyst("CMS_HPTB_QCDnonclosure_tx_three_below",["1.50"],["qcd_tx_three"],["OneBOneFat_.*_below","OneBOneMirrorFat_.*_below"]) + +if doSyst: writeNormSyst("CMS_HPTB_QCDnonclosure_wx_one_in",["1.50"],["qcd_wx_one"],["OneBOneFat_.*_in","OneBOneMirrorFat_.*_in"]) +if doSyst: writeNormSyst("CMS_HPTB_QCDnonclosure_wx_two_in",["1.50"],["qcd_wx_two"],["OneBOneFat_.*_in","OneBOneMirrorFat_.*_in"]) +if doSyst: writeNormSyst("CMS_HPTB_QCDnonclosure_wx_three_in",["1.50"],["qcd_wx_three"],["OneBOneFat_.*_in","OneBOneMirrorFat_.*_in"]) +if doSyst: writeNormSyst("CMS_HPTB_QCDnonclosure_tx_one_in",["1.50"],["qcd_tx_one"],["OneBOneFat_.*_in","OneBOneMirrorFat_.*_in"]) +if doSyst: writeNormSyst("CMS_HPTB_QCDnonclosure_tx_two_in",["1.50"],["qcd_tx_two"],["OneBOneFat_.*_in","OneBOneMirrorFat_.*_in"]) +if doSyst: writeNormSyst("CMS_HPTB_QCDnonclosure_tx_three_in",["1.50"],["qcd_tx_three"],["OneBOneFat_.*_in","OneBOneMirrorFat_.*_in"]) + +if doSyst: writeNormSyst("CMS_HPTB_QCDnonclosure_wx_one_above",["1.50"],["qcd_wx_one"],["OneBOneFat_.*_above","OneBOneMirrorFat_.*_above"]) +if doSyst: writeNormSyst("CMS_HPTB_QCDnonclosure_wx_two_above",["1.50"],["qcd_wx_two"],["OneBOneFat_.*_above","OneBOneMirrorFat_.*_above"]) +if doSyst: writeNormSyst("CMS_HPTB_QCDnonclosure_wx_three_above",["1.50"],["qcd_wx_three"],["OneBOneFat_.*_above","OneBOneMirrorFat_.*_above"]) +if doSyst: writeNormSyst("CMS_HPTB_QCDnonclosure_tx_one_above",["1.50"],["qcd_tx_one"],["OneBOneFat_.*_above","OneBOneMirrorFat_.*_above"]) +if doSyst: writeNormSyst("CMS_HPTB_QCDnonclosure_tx_two_above",["1.50"],["qcd_tx_two"],["OneBOneFat_.*_above","OneBOneMirrorFat_.*_above"]) +if doSyst: writeNormSyst("CMS_HPTB_QCDnonclosure_tx_three_above",["1.50"],["qcd_tx_three"],["OneBOneFat_.*_above","OneBOneMirrorFat_.*_above"]) ## "ewk" get the envelop of the DY and W+jets if doSyst: writeNormSyst("QCDscale_ewk",["0.996/1.008"],["ewk"]) @@ -1052,8 +1140,11 @@ def SmoothAndMergeSyst(tfile,togetNom,togetSyst,s): if LikeBins==1 or LikeBins==2: - hUp = hTmpUp - hDown = hTmpDown + if ('JESANDCSV' in togetSyst): + hUp, hDown = SS.SystematicSmoother(hTmpNom, hTmpUp, hTmpDown,"~/www/forMIAO/JUNE14/SYST").smooth() + else: + hUp = hTmpUp + hDown = hTmpDown else: @@ -1118,6 +1209,40 @@ def envelop(tfile,togetNom, togetSyst, s) : hUp, hDown = SS.SystematicSmoother(hTmpNom, hTmpDown.Clone("test1"), hTmpDown,"~/www/ChargedHiggsTB/JULY30/SYST/").smooth() return hDown + +### write qcd POL shape uncertainties +def creatPolShape(tfile,togetNom, s) : + + hTmpNom=mergeCategory(tfile,togetNom) + + if hTmpNom==None: return + + h=hTmpNom.Clone("Pol") + + normold = h.Integral() + + + for iBin in range(1,h.GetNbinsX()+1): + c = h.GetBinContent(iBin) + flo = c * (h.GetBinCenter(iBin)) * 0.1/1000 #linear, 10%/1TeV, range from 5%-500 GeV to 50%-5000GeV + #flo = c * math.log10(h.GetBinCenter(iBin)) * 0.1 #log10, 10%*log(HT/1GeV), range from 27%-500eV to 37%-5000GeV + + if 'Up' in s: + h.SetBinContent(iBin,c+flo) + + if 'Down' in s: + h.SetBinContent(iBin,c-flo) + + + normnew = h.Integral() + h.Scale(normold/normnew) + + return h + + + + + ## import Everything in ws TODO def importPdfFromTH1(cat,mc,myBin,LikelihoodMapping,syst=None): @@ -1222,7 +1347,7 @@ def importPdfFromTH1(cat,mc,myBin,LikelihoodMapping,syst=None): togetNom = toget togetSyst = '' - if syst != None: + if syst != None and not "Pol" in syst["wsname"]: togetSyst = toget + "_" + syst["name"] toget += "_" + syst["name"] + s @@ -1230,6 +1355,10 @@ def importPdfFromTH1(cat,mc,myBin,LikelihoodMapping,syst=None): if mc["name"]=="Hptb" or mc["name"]=="ttb" or mc["name"]=="ttc" or mc["name"]=="ttlight" or mc["name"]=="ttbar": hTmp = envelop(tfile,togetNom,togetSyst,s) + elif syst != None and "Pol" in syst["wsname"]: + if "qcd" in mc["name"]: + hTmp = creatPolShape(tfile,togetNom,s) + elif syst != None: hTmp = SmoothAndMergeSyst(tfile,togetNom,togetSyst,s) @@ -1239,9 +1368,9 @@ def importPdfFromTH1(cat,mc,myBin,LikelihoodMapping,syst=None): if hTmp!=None: print "<*> 2/3 Reading Hist '"+toget+"'",hTmp.Integral() -# if hTmp.Integral() <= 0 and ( "ewk" in mc["hist"] or "TTX" in mc["hist"]) : -# print "<*> Hist '"+toget+"' norm null but keep going" -# hTmp = None + if hTmp!=None and hTmp.Integral() <= 0 and ( "ewk" in mc["hist"] or "TTX" in mc["hist"] or "ST" in mc["hist"]) : + print "<*> Hist '"+toget+"' norm null but keep going" + hTmp.Scale(0) if hTmp == None: print "<*> Hist '"+toget+"' doesn't exist" @@ -1430,9 +1559,9 @@ def importPdfFromTH1SumBKG(cat,mc,syst=None,do1Third=False): if hTmp!= None: print "<*> 1/3 Reading Hist '"+toget+"'",hTmp.Integral(),' nBin=',hTmp.GetNbinsX() -# if hTmp.Integral() <= 0 and ( "ewk" in mc["hist"] or "TTX" in mc["hist"]) : -# print "<*> Hist '"+toget+"' norm null but keep going" -# hTmp = None + if hTmp!= None and hTmp.Integral() <= 0 and ( "ewk" in mc["hist"] or "ST" in mc["hist"] or "TTX" in mc["hist"]) : + print "<*> Hist '"+toget+"' norm null but keep going" + hTmp.Scale(0) if hTmp == None: print "<*> Hist '"+toget+"' doesn't exist" From 9e88cc3a542e526a49295b68574f959b041c58e1 Mon Sep 17 00:00:00 2001 From: maria Date: Mon, 3 Sep 2018 18:47:16 +0200 Subject: [PATCH 40/60] leptonic card: as in the AUG22 results documented in ANs/PAPER --- script/bwsTB.py | 27 +++++++++++++++------------ 1 file changed, 15 insertions(+), 12 deletions(-) diff --git a/script/bwsTB.py b/script/bwsTB.py index aa9862e5..9da19bc1 100644 --- a/script/bwsTB.py +++ b/script/bwsTB.py @@ -48,6 +48,9 @@ parser.add_option("","--input1LBin",type='string',help="Input ROOT file. [%default]", default="/afs/cern.ch/work/d/dalfonso/CMSSW_9_1_0_pre2_ReTestNERO/src/ChargedHiggs/AUG6_1l_1Third.root") parser.add_option("","--input2LBin",type='string',help="Input ROOT file. [%default]", default="/afs/cern.ch/work/d/dalfonso/CMSSW_9_1_0_pre2_ReTestNERO/src/ChargedHiggs/AUG6_2l_1Third.root") +#parser.add_option("","--input1LBin",type='string',help="Input ROOT file. [%default]", default="/afs/cern.ch/work/d/dalfonso/CMSSW_9_1_0_pre2_ReTestNERO/src/ChargedHiggs/AUG6_FINAL_2ThirdSYST_bTag_bin200_wDATA_1l.root") +#parser.add_option("","--input2LBin",type='string',help="Input ROOT file. [%default]", default="/afs/cern.ch/work/d/dalfonso/CMSSW_9_1_0_pre2_ReTestNERO/src/ChargedHiggs/AUG6_FINAL_2ThirdSYST_bTag_bin200_wDATA_2l.root") + ###### ###### @@ -151,12 +154,16 @@ def RebinN(h,nBin): #1l if opts.kTest==0 or opts.kTest==1 or opts.kTest==2 or opts.kTest==3 or opts.kTest==4 or opts.kTest==5 or opts.kTest==6 or opts.kTest==7 or opts.kTest==8 or opts.kTest==9 or opts.kTest==10 or opts.kTest==11 or opts.kTest==12 or opts.kTest==13 or opts.kTest==14 or opts.kTest==15 or opts.kTest==16 or opts.kTest==100 or opts.kTest==101 or opts.kTest==102: - channel = ["1Mu","1Ele"] -# channel = ["1L"] +# channel = ["1Mu","1Ele"] + channel = ["1L"] basecat = ["Baseline","topCRR4","topCRR5","extraRadCRR10","extraRadCRR7","charmCR"] #2l if opts.kTest==30 or opts.kTest==31 or opts.kTest==32 or opts.kTest==33 or opts.kTest==34 or opts.kTest==35 or opts.kTest==36 or opts.kTest==37 or opts.kTest==38 or opts.kTest==39 or opts.kTest==40 or opts.kTest==41 or opts.kTest==42 or opts.kTest==43 or opts.kTest==44 or opts.kTest==45 or opts.kTest==46 or opts.kTest==200 or opts.kTest==201 or opts.kTest==202: +# channel = ["2Mu"] +# channel = ["2Ele"] +# channel = ["1Mu1Ele"] +# channel = ["1Mu1Ele","2Mu","2Ele"] # channel = ["1Mu1Ele","2Mu","2Ele"] channel = ["2L"] basecat = ["Baseline","topCRR4","topCRR5","extraRadCRR10","extraRadCRR7"] @@ -523,11 +530,7 @@ def RebinN(h,nBin): "CMS_btag_LFstat1":{"type":"shape", "wsname":"CMS_btag_LFstat1","name":"CSVRLFSTAT1","proc":[".*"]}, ## name used for shape "CMS_btag_LFstat2":{"type":"shape", "wsname":"CMS_btag_LFstat2","name":"CSVRLFSTAT2","proc":[".*"]}, ## name used for shape "CMS_btag_CFerr1":{"type":"shape", "wsname":"CMS_btag_CFerr1","name":"CSVRCERR1","proc":[".*"]}, ## name used for shape - "CMS_btag_CFerr2":{"type":"shape", "wsname":"CMS_btag_CFerr2","name":"CSVRCERR2","proc":[".*"]}, ## name used for shape - "CMS_scale_jHighPt":{"type":"shape", "wsname":"CMS_scale_j_HighPt","name":"JESANDCSVHighPt","proc":["Hptb","ttlf","ttb","ttcc"]}, ## name used for shape - "CMS_btag_HFHighPt":{"type":"shape", "wsname":"CMS_btag_HFHighPt","name":"CSVRHFHighPt","proc":["Hptb","ttlf","ttb","ttcc"]}, ## name used for shape - "CMS_btag_LFHighPt":{"type":"shape", "wsname":"CMS_btag_LFHighPt","name":"CSVRLFHighPt","proc":["Hptb","ttlf","ttb","ttcc"]}, ## name used for shape - "CMS_btag_CFerr1HighPt":{"type":"shape", "wsname":"CMS_btag_CFerr1HighPt","name":"CSVRCERR1HighPt","proc":["Hptb","ttlf","ttb","ttcc"]} ## name used for shape + "CMS_btag_CFerr2":{"type":"shape", "wsname":"CMS_btag_CFerr2","name":"CSVRCERR2","proc":[".*"]} ## name used for shape #### } else: @@ -542,12 +545,12 @@ def RebinN(h,nBin): #print "---------------------- --------" #fileTmp="AUG6_HT/"+label+VarTest+opts.output -fileTmp="AUG12_HT200_bTag/"+ label + VarTest + str(opts.kMass) + opts.output +fileTmp="AUG22_HT200/"+ label + VarTest + str(opts.kMass) + opts.output w = ROOT.RooWorkspace("w","w") datNameTmp = opts.datCardName #datName = "AUG6_HT/"+ label + VarTest + datNameTmp -datName = "AUG12_HT200_bTag/"+ label + VarTest + str(opts.kMass) + datNameTmp +datName = "AUG22_HT200/"+ label + VarTest + str(opts.kMass) + datNameTmp datacard=open(datName,"w") datacard.write("-------------------------------------\n") @@ -988,7 +991,7 @@ def importStat(): ###if doSyst: writeNormSyst("CMS_HPTB_QCDscale_ttlf",["1.50"],["ttlf"]) if doSyst: writeNormSyst("bgnorm_ttcc",["1.50"],["ttcc"]) -if doSyst: writeNormSyst("bgnorm_ttb",["1.30"],["ttb$"]) +if doSyst: writeNormSyst("bgnorm_ttb",["1.50"],["ttb$"]) #if doSyst: writeNormSyst("bgnorm_ttbb",["1.50"],["ttbb$"]) ##if doSyst: writeNormSyst("bgnorm_tt2b",["1.50"],["tt2b"]) @@ -1282,8 +1285,8 @@ def importPdfFromTH1(cat,mc,myBin,LikelihoodMapping,syst=None): if hTmp!= None: print "<*> Reading Hist '"+toget+"' integral=",hTmp.Integral(),' nBin=',hTmp.GetNbinsX(), 'underflow=',hTmp.GetBinContent(0), 'overflow=',hTmp.GetBinContent(hTmp.GetNbinsX()+1),' entries=',hTmp.GetEntries() - if mc["name"]=="ttb": - hTmp.Scale(1.83) +# if mc["name"]=="ttb": +# hTmp.Scale(1.83) ### SCALE for the 2/3 if mc["name"]!="qcd" and not "EWK" in hname: From 219e9488a248897e019c4a01b8f52a49834c6df6 Mon Sep 17 00:00:00 2001 From: maria Date: Thu, 6 Sep 2018 17:12:29 +0200 Subject: [PATCH 41/60] full Hadronic cards: 1l-CR updates --- script/bwsFullHadTB.py | 22 +++++++++++++++++++--- 1 file changed, 19 insertions(+), 3 deletions(-) diff --git a/script/bwsFullHadTB.py b/script/bwsFullHadTB.py index 32b99970..43a1110c 100644 --- a/script/bwsFullHadTB.py +++ b/script/bwsFullHadTB.py @@ -325,7 +325,9 @@ def mergeCategory(tfile,toget): for y in channel: for x in basecat: - region = ["_in","_above","_below"] +# region = ["_in","_above","_below"] +# region = ["_above","_below"] + region = ["_in"] if "OneBOneMirrorFat" in x: region = ["_in"] @@ -935,10 +937,10 @@ def importStat(): if systStore[syst]["type"] == "lnN": if "CMS_eff_Tau21" in systStore[syst]["wsname"]: - writeNormSyst(syst,["1.08","1.08","1.08"],systStore[syst]["proc"],["OneBOneFat_.*_wbb","OneBOneFat_.*_wbj"]) + writeNormSyst(syst,["1.08","1.08","1.08"],systStore[syst]["proc"],["OneBOneFat_.*_wbb","OneBOneFat_.*_wbj","OneBOneFat1l_.*_wbb","OneBOneFat1l_.*_wbb"]) writeNormSyst(syst,["0.92","0.92","0.92"],systStore[syst]["proc"],["OneBOneMirrorFat_.*_wbb","OneBOneMirrorFat_.*_wbj"]) elif "CMS_eff_Tau32" in systStore[syst]["wsname"]: - writeNormSyst(syst,["1.02","1.02","1.02"],systStore[syst]["proc"],["OneBOneFat_.*_t0b","OneBOneFat_.*_t1b"]) + writeNormSyst(syst,["1.02","1.02","1.02"],systStore[syst]["proc"],["OneBOneFat_.*_t0b","OneBOneFat_.*_t1b","OneBOneFat1l_.*_t0b","OneBOneFat1l_.*_t1b"]) writeNormSyst(syst,["0.98","0.98","0.98"],systStore[syst]["proc"],["OneBOneMirrorFat_.*_t0b","OneBOneMirrorFat_.*_t1b"]) elif "CMS_eff_l" in systStore[syst]["wsname"]: writeNormSyst(syst,["1.04"],systStore[syst]["proc"],["OneBOneFat1l_"]) @@ -957,6 +959,7 @@ def importStat(): # elif "muRF_ttbar_above" in systStore[syst]["wsname"]: # writeSystShape(systStore[syst],systStore[syst]["proc"],["above"]) ## + elif "CMS_scale_SDMass_qcd_wx_below" in systStore[syst]["wsname"]: writeSystShape(systStore[syst],systStore[syst]["proc"],["below"]) elif "CMS_scale_SDMass_qcd_wx_in" in systStore[syst]["wsname"]: @@ -1010,6 +1013,19 @@ def importStat(): elif "CMS_scale_Pol_qcd_wx_three_above" in systStore[syst]["wsname"]: writeSystShape(systStore[syst],systStore[syst]["proc"],["above"]) + elif "CMS_scale_Pol_qcd_wx_one_1l" in systStore[syst]["wsname"]: + writeSystShape(systStore[syst],systStore[syst]["proc"],["1l"]) + elif "CMS_scale_Pol_qcd_wx_two_1l" in systStore[syst]["wsname"]: + writeSystShape(systStore[syst],systStore[syst]["proc"],["1l"]) + elif "CMS_scale_Pol_qcd_wx_three_1l" in systStore[syst]["wsname"]: + writeSystShape(systStore[syst],systStore[syst]["proc"],["1l"]) + elif "CMS_scale_Pol_qcd_tx_one_1l" in systStore[syst]["wsname"]: + writeSystShape(systStore[syst],systStore[syst]["proc"],["1l"]) + elif "CMS_scale_Pol_qcd_tx_two_1l" in systStore[syst]["wsname"]: + writeSystShape(systStore[syst],systStore[syst]["proc"],["1l"]) + elif "CMS_scale_Pol_qcd_tx_three_1l" in systStore[syst]["wsname"]: + writeSystShape(systStore[syst],systStore[syst]["proc"],["1l"]) + else: writeSystShape(systStore[syst],systStore[syst]["proc"]) From 62fa54b5acbcda0b153c07396e8651035e53bb66 Mon Sep 17 00:00:00 2001 From: maria Date: Thu, 6 Sep 2018 20:00:30 +0200 Subject: [PATCH 42/60] full Hadronic cards: recover regions --- script/bwsFullHadTB.py | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/script/bwsFullHadTB.py b/script/bwsFullHadTB.py index 43a1110c..f900dbc1 100644 --- a/script/bwsFullHadTB.py +++ b/script/bwsFullHadTB.py @@ -375,7 +375,16 @@ def mergeCategory(tfile,toget): # if "_one_lowj" in x and (y=="t1b") and "below" in reg: continue # if "_three" in x and y=="t0b" and "below" in reg: continue -#2500,3000 if "_three_highj" in x and (y=="t0b") and "in" in reg missing ST + + if opts.kMass=="500": + if "OneBOneMirrorFat_one_lowj" in x and y=="wbb" and "in" in reg: continue + if "OneBOneFat_one_lowj" in x and y=="wbb" and "below" in reg: continue + if "_one" in x and y=="wbb" and "all" in reg: continue + if "OneBOneFat_three_lowj" in x and y=="wbb" and "below" in reg: continue + + if opts.kMass=="1500": + if "OneBOneMirrorFat_three_highj" in x and y=="wbb" and "in" in reg: continue + if "OneBOneMirrorFat_three_lowj" in x and y=="wbb" and "in" in reg: continue if opts.kMass=="3000": if "_three_lowj" in x and ( y=="t1b" or y=="t0b" ) and "above" in reg: continue From c65b1eb506fc2458640c86711fbbe5904bbfb4d4 Mon Sep 17 00:00:00 2001 From: maria Date: Sun, 9 Sep 2018 22:47:05 +0200 Subject: [PATCH 43/60] fullHad: new files + fix the s-channel regions --- script/bwsFullHadTB.py | 142 ++++++++++++++++++++++++++++++----------- 1 file changed, 105 insertions(+), 37 deletions(-) diff --git a/script/bwsFullHadTB.py b/script/bwsFullHadTB.py index f900dbc1..bca9f50d 100644 --- a/script/bwsFullHadTB.py +++ b/script/bwsFullHadTB.py @@ -13,9 +13,9 @@ # original binning is 10GeV nRebinHT=1 #nRebinHT=5 -#LikeBins=10 +LikeBins=10 #LikeBins=1 -LikeBins=2 +#LikeBins=2 doRebin = False applyLikelihoodRebinBin = True @@ -86,8 +86,18 @@ #parser.add_option("","--input",type='string',help="Input ROOT file. [%default]", default="/afs/cern.ch/user/h/hum/work/public/CMSSW_8_0_26_patch1/src/ChargedHiggs/ntufile/preapp2systNoSpi.root") #parser.add_option("","--inputBin",type='string',help="Input ROOT file. [%default]", default="/afs/cern.ch/user/h/hum/work/public/CMSSW_8_0_26_patch1/src/ChargedHiggs/ntufile/preapp2systNoSpi.root") -parser.add_option("","--input",type='string',help="Input ROOT file. [%default]", default="/afs/cern.ch/user/h/hum/work/public/CMSSW_8_0_26_patch1/src/ChargedHiggs/ntufile/preapp3systsd.root") -parser.add_option("","--inputBin",type='string',help="Input ROOT file. [%default]", default="/afs/cern.ch/user/h/hum/work/public/CMSSW_8_0_26_patch1/src/ChargedHiggs/ntufile/preapp3systsd.root") +## SEPT6 results +#parser.add_option("","--input",type='string',help="Input ROOT file. [%default]", default="/afs/cern.ch/user/h/hum/work/public/CMSSW_8_0_26_patch1/src/ChargedHiggs/ntufile/preapp3systsd.root") +#parser.add_option("","--inputBin",type='string',help="Input ROOT file. [%default]", default="/afs/cern.ch/user/h/hum/work/public/CMSSW_8_0_26_patch1/src/ChargedHiggs/ntufile/preapp3systsd.root") + +## SEPT6+Schannel results +#parser.add_option("","--input",type='string',help="Input ROOT file. [%default]", default="/afs/cern.ch/user/h/hum/work/public/CMSSW_8_0_26_patch1/src/ChargedHiggs/ntufile/preapp3systtt.root") +#parser.add_option("","--inputBin",type='string',help="Input ROOT file. [%default]", default="/afs/cern.ch/user/h/hum/work/public/CMSSW_8_0_26_patch1/src/ChargedHiggs/ntufile/preapp3systtt.root") + +## SEPT9 + Schannel/Associated results +parser.add_option("","--input",type='string',help="Input ROOT file. [%default]", default="/afs/cern.ch/user/h/hum/work/public/CMSSW_8_0_26_patch1/src/ChargedHiggs/ntufile/preapp3systmore.root") +parser.add_option("","--inputBin",type='string',help="Input ROOT file. [%default]", default="/afs/cern.ch/user/h/hum/work/public/CMSSW_8_0_26_patch1/src/ChargedHiggs/ntufile/preapp3systmore.root") + ## REMEMBER TO: # a) change the rebin 20% to 50% Inf @@ -223,12 +233,14 @@ def mergeCategory(tfile,toget): if doSChannel: - if "_two" in toget and not "_below" in toget: + if "_two" in toget: hTmp = Merge3B(tfile,toget) - elif "_below" in toget and not "_two" in toget: - hTmp = MergeAbove(tfile,toget) - elif "_below" and "_two" in toget: - hTmp = MergeAbove3B(tfile,toget) +# if "_two" in toget and not "_below" in toget: +# hTmp = Merge3B(tfile,toget) +# elif "_below" in toget and not "_two" in toget: +# hTmp = MergeAbove(tfile,toget) +# elif "_below" and "_two" in toget: +# hTmp = MergeAbove3B(tfile,toget) else: hTmp = tfile.Get(toget) @@ -367,7 +379,13 @@ def mergeCategory(tfile,toget): if "_three_highj" in x and y=="wbj": continue if "_two_lowj" in x and y=="wbj": continue ## wbb + if "_one_highj" in x and y=="wbb": continue + if "_one_lowj" in x and y=="wbb": continue + if "_two_highj" in x and y=="wbb": continue if "_two_lowj" in x and y=="wbb": continue + if "_three_highj" in x and y=="wbb": continue + if "_three_lowj" in x and y=="wbb": continue + if "OneBOneFat1l" in x and y=="wbb": continue ## t0b and t1b # if "_two_highj" in x and y=="t0b" and "below" in reg: continue # if "_three_lowj" in x and y=="t0b" and "in" in reg: continue @@ -375,31 +393,66 @@ def mergeCategory(tfile,toget): # if "_one_lowj" in x and (y=="t1b") and "below" in reg: continue # if "_three" in x and y=="t0b" and "below" in reg: continue - if opts.kMass=="500": - if "OneBOneMirrorFat_one_lowj" in x and y=="wbb" and "in" in reg: continue - if "OneBOneFat_one_lowj" in x and y=="wbb" and "below" in reg: continue - if "_one" in x and y=="wbb" and "all" in reg: continue - if "OneBOneFat_three_lowj" in x and y=="wbb" and "below" in reg: continue + if "OneBOneMirrorFat_one_lowj" in x and y=="wbb" and "in" in reg: continue + if "OneBOneFat_one_lowj" in x and y=="wbb" and "below" in reg: continue + if "_one" in x and y=="wbb" and "all" in reg: continue + if "OneBOneFat_three_lowj" in x and y=="wbb" and "below" in reg: continue - if opts.kMass=="1500": + if opts.kMass=="1500" and not doSChannel: if "OneBOneMirrorFat_three_highj" in x and y=="wbb" and "in" in reg: continue if "OneBOneMirrorFat_three_lowj" in x and y=="wbb" and "in" in reg: continue - if opts.kMass=="3000": + if opts.kMass=="3000" and not doSChannel: if "_three_lowj" in x and ( y=="t1b" or y=="t0b" ) and "above" in reg: continue if "_three_highj" in x and ( y=="t0b" ) and "in" in reg: continue if "_three_lowj" in x and (y=="t0b") and "in" in reg: continue - if opts.kMass=="2500": - if "_three_highj" in x and (y=="t0b" or y=="t1b") and "in" in reg: continue - if "_three_highj" in x and (y=="t0b") and "above" in reg: continue -# if "_three_lowj" in x and (y=="t0b") and "in" in reg: continue -# if "_three_highj" in x and (y=="t0b" or y=="t1b") and "above" in reg: continue + if opts.kMass=="2500" and not doSChannel: + if "OneBOneFat_three_highj" in x and (y=="t0b" or y=="t1b") and "in" in reg: continue + if "OneBOneFat_three_highj" in x and y=="t0b" and "above" in reg: continue + # this one below has overflow + if "OneBOneFat_three_highj" in x and y=="t1b" and "above" in reg: continue +# if "_three_highj" in x and (y=="t0b" or y=="t1b") and "in" in reg: continue +# if "_three_highj" in x and (y=="t0b") and "above" in reg: continue +### if "_three_lowj" in x and (y=="t0b") and "in" in reg: continue +### if "_three_highj" in x and (y=="t0b" or y=="t1b") and "above" in reg: continue + + + if (opts.kMass=="1000" or opts.kMass=="900" or opts.kMass=="800") and doSChannel: + if "OneBOneFat1l_two" in x and y=="t0b": continue + if opts.kMass=="800" and "OneBOneFat1l_two" in x and y=="t1b": continue + + if "OneBOneFat1l" in x and y=="wbb": continue + + if opts.kMass=="800" and doSChannel: + if "OneBOneMirrorFat_two_highj" in x and y=="wbb" and "in" in reg : continue + + if opts.kMass=="1500" and doSChannel: + if "OneBOneMirrorFat_one_highj" in x and y=="wbb" and "in" in reg : continue + + if opts.kMass=="2000" and doSChannel: + if "OneBOneFat_two_highj" in x and "above" in reg and y=="wbb": continue + if "OneBOneFat_two_highj" in x and "in" in reg and y=="wbb": continue + if "OneBOneMirrorFat_two_highj" in x and "in" in reg and y=="wbb": continue + if "OneBOneFat_one_highj" in x and "above" in reg and y=="wbb": continue + + if opts.kMass=="3000" and doSChannel: + if "OneBOneFat_two_highj" in x and "above" in reg and y=="wbb": continue + if "OneBOneFat_two_highj" in x and "in" in reg and y=="wbb": continue + if "OneBOneMirrorFat_two_highj" in x and "in" in reg and y=="wbb": continue + if "OneBOneMirrorFat_two_lowj" in x and "in" in reg and y=="wbb": continue + if "OneBOneFat_one_highj" in x and "above" in reg and y=="wbb": continue + if "OneBOneMirrorFat_one_highj" in x and "in" in reg and y=="wbb": continue + if "OneBOneMirrorFat_one_lowj" in x and "in" in reg and y=="wbb": continue + if "OneBOneFat_two_lowj" in x and "above" in reg and y=="wbb": continue + if "OneBOneFat_two_lowj" in x and "in" in reg and y=="wbb": continue + if "OneBOneFat_one_highj" in x and "in" in reg and y=="wbb": continue + ## below are for associated only -# if not doSChannel and (opts.kMass=="500" or opts.kMass=="400") and "in" in reg or "below" in reg: -# if not doSChannel and (opts.kMass=="500" or opts.kMass=="400") and ("below" in reg or "in" in reg): +# if not doSChannel and (opts.kMass=="400") and "in" in reg or "below" in reg: +# if not doSChannel and (opts.kMass=="400") and ("below" in reg or "in" in reg): # if "_three_lowj" in x and y=="wbb": continue # if "_one_lowj" in x and y=="wbj": continue @@ -422,17 +475,17 @@ def mergeCategory(tfile,toget): ###################### ############ s-channel ###################### - if doSChannel and (opts.kMass=="800" or opts.kMass=="900" or opts.kMass=="1000" or opts.kMass=="1500" or opts.kMass=="2000" or opts.kMass=="2500" or opts.kMass=="3000") and "in" in reg: - if "_two_highj" in x and y=="wbb": continue - if "_one_highj" in x and y=="wbj": continue +# if doSChannel and (opts.kMass=="800" or opts.kMass=="900" or opts.kMass=="1000" or opts.kMass=="1500" or opts.kMass=="2000" or opts.kMass=="2500" or opts.kMass=="3000") and "in" in reg: +# if "_two_highj" in x and y=="wbb": continue +# if "_one_highj" in x and y=="wbj": continue - if doSChannel and (opts.kMass=="900" or opts.kMass=="1000" or opts.kMass=="1500" or opts.kMass=="2000" or opts.kMass=="2500" or opts.kMass=="3000") and "in" in reg: - if "_two_lowj" in x and y=="wbj": continue - if "_two_highj" in x and y=="wbj": continue +# if doSChannel and (opts.kMass=="900" or opts.kMass=="1000" or opts.kMass=="1500" or opts.kMass=="2000" or opts.kMass=="2500" or opts.kMass=="3000") and "in" in reg: +# if "_two_lowj" in x and y=="wbj": continue +# if "_two_highj" in x and y=="wbj": continue - if doSChannel and (opts.kMass=="1000" or opts.kMass=="1500" or opts.kMass=="2000" or opts.kMass=="2500" or opts.kMass=="3000") and "in" in reg: - if y=="wbb": continue - if y=="wbj": continue +# if doSChannel and (opts.kMass=="1000" or opts.kMass=="1500" or opts.kMass=="2000" or opts.kMass=="2500" or opts.kMass=="3000") and "in" in reg: +# if y=="wbb": continue +# if y=="wbj": continue ###################### ###################### @@ -553,7 +606,8 @@ def mergeCategory(tfile,toget): "qcd_tx_two":{"name":"qcd_tx_two", "hist":["QCD_HT"], "num":5 }, "qcd_tx_three":{"name":"qcd_tx_three", "hist":["QCD_HT"], "num":6 }, # "ttbar":{ "name":"ttbar","hist":["ttb_TT_TuneCUETP8M2T4","ttc_TT_TuneCUETP8M2T4","ttlight_TT_TuneCUETP8M2T4"],"num":7}, - "ttbar":{ "name":"ttbar","hist":["TT_TuneCUETP8M2T4_13TeV-powheg-pythia8"],"num":7}, + "ttbar":{ "name":"ttbar","hist":["TT_TuneCUETP8M2T4"],"num":7}, +# "ttbar":{ "name":"ttbar","hist":["TT_TuneCUETP8M2T4_13TeV-powheg-pythia8"],"num":7}, "top":{ "name":"top","hist":["ST","TTX"],"num":8}, "ewk":{ "name":"ewk","hist":["ewk"],"num":9} } @@ -568,7 +622,8 @@ def mergeCategory(tfile,toget): "qcd_tx_two":{"name":"qcd_tx_two", "hist":["QCD_HT"], "num":5 }, "qcd_tx_three":{"name":"qcd_tx_three", "hist":["QCD_HT"], "num":6 }, # "ttbar":{ "name":"ttbar","hist":["ttb_TT_TuneCUETP8M2T4","ttc_TT_TuneCUETP8M2T4","ttlight_TT_TuneCUETP8M2T4"],"num":7}, - "ttbar":{ "name":"ttbar","hist":["TT_TuneCUETP8M2T4_13TeV-powheg-pythia8"],"num":7}, + "ttbar":{ "name":"ttbar","hist":["TT_TuneCUETP8M2T4"],"num":7}, +# "ttbar":{ "name":"ttbar","hist":["TT_TuneCUETP8M2T4_13TeV-powheg-pythia8"],"num":7}, "top":{ "name":"top","hist":["ST","TTX"],"num":8}, "ewk":{ "name":"ewk","hist":["ewk"],"num":9} } @@ -660,11 +715,11 @@ def mergeCategory(tfile,toget): print "* ",cat,":",catStore[cat] print "---------------------- --------" -fileTmp="MIAO_AUG30_SRinShape/"+label+VarTest+opts.kMass+"_"+opts.output +fileTmp="MIAO_SEPT9_Shape/"+label+VarTest+opts.kMass+"_"+opts.output w = ROOT.RooWorkspace("w","w") datNameTmp = opts.datCardName -datName = "MIAO_AUG30_SRinShape/"+label+ VarTest+opts.kMass+"_" + datNameTmp +datName = "MIAO_SEPT9_Shape/"+label+ VarTest+opts.kMass+"_" + datNameTmp datacard=open(datName,"w") datacard.write("-------------------------------------\n") @@ -968,7 +1023,6 @@ def importStat(): # elif "muRF_ttbar_above" in systStore[syst]["wsname"]: # writeSystShape(systStore[syst],systStore[syst]["proc"],["above"]) ## - elif "CMS_scale_SDMass_qcd_wx_below" in systStore[syst]["wsname"]: writeSystShape(systStore[syst],systStore[syst]["proc"],["below"]) elif "CMS_scale_SDMass_qcd_wx_in" in systStore[syst]["wsname"]: @@ -1022,6 +1076,7 @@ def importStat(): elif "CMS_scale_Pol_qcd_wx_three_above" in systStore[syst]["wsname"]: writeSystShape(systStore[syst],systStore[syst]["proc"],["above"]) + elif "CMS_scale_Pol_qcd_wx_one_1l" in systStore[syst]["wsname"]: writeSystShape(systStore[syst],systStore[syst]["proc"],["1l"]) elif "CMS_scale_Pol_qcd_wx_two_1l" in systStore[syst]["wsname"]: @@ -1393,6 +1448,9 @@ def importPdfFromTH1(cat,mc,myBin,LikelihoodMapping,syst=None): if hTmp!=None: print "<*> 2/3 Reading Hist '"+toget+"'",hTmp.Integral() + if mc["name"]=="ttbar" and hTmp: + hTmp.Scale(0.2) + if hTmp!=None and hTmp.Integral() <= 0 and ( "ewk" in mc["hist"] or "TTX" in mc["hist"] or "ST" in mc["hist"]) : print "<*> Hist '"+toget+"' norm null but keep going" hTmp.Scale(0) @@ -1433,8 +1491,15 @@ def importPdfFromTH1(cat,mc,myBin,LikelihoodMapping,syst=None): h=hTmpSum + + if h!= None: print "<*> Read Hist '"+toget+"'",h.Integral(),' nBin=',h.GetNbinsX(), 'underflow=',h.GetBinContent(0), 'overflow=',h.GetBinContent(h.GetNbinsX()+1),' entries=',h.GetEntries() + if h!=None and h.GetBinContent(h.GetNbinsX()+1)!=0: print " ------------------- OVERFLOW ------------------- " + if h!=None and h.GetBinContent(h.GetNbinsX()+1)!=0: print "OVERFLOW", h.GetBinContent(h.GetNbinsX()+1), " in ", toget + if h!=None and h.GetBinContent(h.GetNbinsX()+1)!=0: raise IOError + if h!=None and h.GetBinContent(h.GetNbinsX()+1)!=0: raise ValueError + #clean h if h: h.SetBinContent(0,0) ##underflow @@ -1588,6 +1653,9 @@ def importPdfFromTH1SumBKG(cat,mc,syst=None,do1Third=False): print "<*> Hist '"+toget+"' norm null but keep going" hTmp.Scale(0) + if mc["name"]=="ttbar" and hTmp: + hTmp.Scale(0.2) + if hTmp == None: print "<*> Hist '"+toget+"' doesn't exist" ## raise error only if is on the 2Third and for the syst central value From 65d2ef0c9b0aea64bf286ff5dd88e81632657ea9 Mon Sep 17 00:00:00 2001 From: maria Date: Tue, 11 Sep 2018 11:47:21 +0200 Subject: [PATCH 44/60] script cards had: fix the Pol-1l --- script/bwsFullHadTB.py | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/script/bwsFullHadTB.py b/script/bwsFullHadTB.py index bca9f50d..0cba6c1a 100644 --- a/script/bwsFullHadTB.py +++ b/script/bwsFullHadTB.py @@ -398,6 +398,7 @@ def mergeCategory(tfile,toget): if "OneBOneFat_one_lowj" in x and y=="wbb" and "below" in reg: continue if "_one" in x and y=="wbb" and "all" in reg: continue if "OneBOneFat_three_lowj" in x and y=="wbb" and "below" in reg: continue + if "OneBOneFat1l_three" in x and y=="t0b" and "all" in reg: continue if opts.kMass=="1500" and not doSChannel: if "OneBOneMirrorFat_three_highj" in x and y=="wbb" and "in" in reg: continue @@ -686,6 +687,13 @@ def mergeCategory(tfile,toget): "CMS_btag_CFerr2_qcd":{"type":"shape", "wsname":"CMS_btag_CFerr2_qcd","name":"CSVRCERR2","proc":["qcd_wx_one","qcd_wx_two","qcd_wx_three","qcd_tx_one","qcd_tx_two","qcd_tx_three"]}, #### ## QCD Pol + "CMS_scale_Pol_qcd_tx_one_1l":{"type":"shape", "wsname":"CMS_scale_Pol_qcd_tx_one_1l","name":"XXX","proc":["qcd_tx_one"]}, + "CMS_scale_Pol_qcd_tx_two_1l":{"type":"shape", "wsname":"CMS_scale_Pol_qcd_tx_two_1l","name":"XXX","proc":["qcd_tx_two"]}, + "CMS_scale_Pol_qcd_tx_three_1l":{"type":"shape", "wsname":"CMS_scale_Pol_qcd_tx_three_1l","name":"XXX","proc":["qcd_tx_three"]}, + "CMS_scale_Pol_qcd_wx_one_1l":{"type":"shape", "wsname":"CMS_scale_Pol_qcd_wx_one_1l","name":"XXX","proc":["qcd_wx_one"]}, + "CMS_scale_Pol_qcd_wx_two_1l":{"type":"shape", "wsname":"CMS_scale_Pol_qcd_wx_two_1l","name":"XXX","proc":["qcd_wx_two"]}, + "CMS_scale_Pol_qcd_wx_three_1l":{"type":"shape", "wsname":"CMS_scale_Pol_qcd_wx_three_1l","name":"XXX","proc":["qcd_wx_three"]}, + ## "CMS_scale_Pol_qcd_tx_one_below":{"type":"shape", "wsname":"CMS_scale_Pol_qcd_tx_one_below","name":"XXX","proc":["qcd_tx_one"]}, "CMS_scale_Pol_qcd_tx_two_below":{"type":"shape", "wsname":"CMS_scale_Pol_qcd_tx_two_below","name":"XXX","proc":["qcd_tx_two"]}, "CMS_scale_Pol_qcd_tx_three_below":{"type":"shape", "wsname":"CMS_scale_Pol_qcd_tx_three_below","name":"XXX","proc":["qcd_tx_three"]}, @@ -715,11 +723,11 @@ def mergeCategory(tfile,toget): print "* ",cat,":",catStore[cat] print "---------------------- --------" -fileTmp="MIAO_SEPT9_Shape/"+label+VarTest+opts.kMass+"_"+opts.output +fileTmp="MIAO_SEPT10_Shape/"+label+VarTest+opts.kMass+"_"+opts.output w = ROOT.RooWorkspace("w","w") datNameTmp = opts.datCardName -datName = "MIAO_SEPT9_Shape/"+label+ VarTest+opts.kMass+"_" + datNameTmp +datName = "MIAO_SEPT10_Shape/"+label+ VarTest+opts.kMass+"_" + datNameTmp datacard=open(datName,"w") datacard.write("-------------------------------------\n") From a890483d5037afbff21e70f1377ff558a87f3d26 Mon Sep 17 00:00:00 2001 From: maria Date: Tue, 11 Sep 2018 20:29:46 +0200 Subject: [PATCH 45/60] script cards had: refine minor uncertainties --- script/bwsFullHadTB.py | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/script/bwsFullHadTB.py b/script/bwsFullHadTB.py index 0cba6c1a..f1725b32 100644 --- a/script/bwsFullHadTB.py +++ b/script/bwsFullHadTB.py @@ -634,9 +634,9 @@ def mergeCategory(tfile,toget): "None":None, "lumi_13TeV":{"type":"lnN", "value":["1.025"] ,"proc":[".*"],"wsname":"lumi_13TeV","name":"XXX"}, ### lepton veto 0.96 / for 1l is 1.04 - "CMS_eff_l":{"type":"lnN", "value":["0.96"] ,"proc":[".*"],"wsname":"CMS_eff_l","name":"XXX"}, ## name used for shape + "CMS_eff_l":{"type":"lnN", "value":["0.96"] ,"proc":["ttbar","top","Hptb","ewk"],"wsname":"CMS_eff_l","name":"XXX"}, ## name used for shape ## check the direction of the tau for the combination - "CMS_eff_t":{"type":"lnN", "value":["1.03"] ,"proc":[".*"],"wsname":"CMS_eff_t","name":"XXX"}, ## name used for shape + "CMS_eff_t":{"type":"lnN", "value":["1.03"] ,"proc":["ttbar","top","Hptb","ewk"],"wsname":"CMS_eff_t","name":"XXX"}, ## name used for shape #### trigger efficiency "CMS_eff_trigger":{"type":"lnN", "value":["1.05"] ,"proc":[".*"],"wsname":"CMS_eff_triggger","name":"XXX"}, ### Theory modeling @@ -647,8 +647,8 @@ def mergeCategory(tfile,toget): # "muRF_ttbar_in":{"type":"shape", "wsname":"muRF_ttbar_in","name":"Scale","proc":["ttbar"]}, # "muRF_ttbar_above":{"type":"shape", "wsname":"muRF_ttbar_above","name":"Scale","proc":["ttbar"]}, ### MET-Jets-PU - "CMS_pileup":{"type":"shape", "wsname":"CMS_pileup","name":"PU","proc":["qcd_wx_one","qcd_wx_two","qcd_wx_three","qcd_tx_one","qcd_tx_two","qcd_tx_three","ttbar","top","Hptb"]}, - "CMS_scale_uncluster":{"type":"shape", "wsname":"CMS_scale_uncluster","name":"UNCLUSTER","proc":["qcd_wx_one","qcd_wx_two","qcd_wx_three","qcd_tx_one","qcd_tx_two","qcd_tx_three","ttbar","top","Hptb"]}, + "CMS_pileup":{"type":"shape", "wsname":"CMS_pileup","name":"PU","proc":["qcd_wx_one","qcd_wx_two","qcd_wx_three","qcd_tx_one","qcd_tx_two","qcd_tx_three","ttbar","top","Hptb","ewk"]}, + "CMS_scale_uncluster":{"type":"shape", "wsname":"CMS_scale_uncluster","name":"UNCLUSTER","proc":["qcd_wx_one","qcd_wx_two","qcd_wx_three","qcd_tx_one","qcd_tx_two","qcd_tx_three","ttbar","top","Hptb","ewk"]}, ## SDmass "CMS_scale_SDMass":{"type":"shape", "wsname":"CMS_scale_SDMass","name":"SDMassSCALE","proc":["ttbar","top","Hptb"]}, "CMS_scale_SDMass_qcd_wx_below":{"type":"shape", "wsname":"CMS_scale_SDMass_qcd_wx_below","name":"SDMassSCALE","proc":["qcd_wx_one","qcd_wx_two","qcd_wx_three"]}, @@ -662,7 +662,7 @@ def mergeCategory(tfile,toget): "CMS_eff_Tau32":{"type":"lnN", "value":["1.02","1.02","1.02"] ,"proc":["ttbar","top","Hptb"],"wsname":"CMS_eff_Tau32","name":"XXX"}, ## name used for shape ## JER/S "CMS_res_j":{"type":"shape", "wsname":"CMS_res_j","name":"JER","proc":[".*"]}, - "CMS_scale_j":{"type":"shape", "wsname":"CMS_scale_j","name":"JESANDCSV","proc":["Hptb","ttbar","top"]}, + "CMS_scale_j":{"type":"shape", "wsname":"CMS_scale_j","name":"JESANDCSV","proc":["Hptb","ttbar","top","ewk"]}, "CMS_scale_j_qcd_wx":{"type":"shape", "wsname":"CMS_scale_j_qcd_wx","name":"JESANDCSV","proc":["qcd_wx_one","qcd_wx_two","qcd_wx_three"]}, "CMS_scale_j_qcd_tx":{"type":"shape", "wsname":"CMS_scale_j_qcd_tx","name":"JESANDCSV","proc":["qcd_tx_one","qcd_tx_two","qcd_tx_three"]}, ##Light jets Heavy flavor contamination From c32021fc874663495a668fa2851944fcd84670b0 Mon Sep 17 00:00:00 2001 From: maria Date: Wed, 19 Sep 2018 17:58:05 +0200 Subject: [PATCH 46/60] update isr/fsr add ue --- aux/mcdb.2017.v23.txt | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) diff --git a/aux/mcdb.2017.v23.txt b/aux/mcdb.2017.v23.txt index ff9422a4..2763e602 100644 --- a/aux/mcdb.2017.v23.txt +++ b/aux/mcdb.2017.v23.txt @@ -163,13 +163,18 @@ TTTo2L2Nu_TuneCUETP8M2_ttHtranche3_13TeV-powheg-pythia8 /store/group/phys_higgs/ TTToSemilepton_TuneCUETP8M2_ttHtranche3_13TeV-powheg-pythia8 /store/group/phys_higgs/HiggsExo/jaeyserm/80x_MC_v2/v2.3/TTToSemilepton_TuneCUETP8M2_ttHtranche3_13TeV-powheg-pythia8 152720952.0 831.0 SCALES 1.01975966099 0.975134106733 1.11533260523 1.1433752908 0.897540077767 0.880418561708 PDFS 1.02840067398 0.989882049986 0.988486859932 1.01864133455 1.05216146138 0.990524171892 1.00285042371 0.989521606658 0.990775461161 1.01544799696 1.02906400971 0.993314678503 0.985830962994 0.989082730308 0.982068998832 0.990349913026 0.966076227597 0.983806782084 1.00111804485 0.981248715634 1.00562111845 1.02922881598 0.975057795648 1.02176283294 1.00208124952 1.01183892284 0.963374639955 0.993279194025 0.983999649257 0.994159964797 1.01695727023 1.01918538206 1.01164273273 1.0271350351 0.962653616093 0.997769183043 0.980172459842 1.0038165685 1.01962216942 1.01138888581 1.00887873692 1.00665797357 1.02189787343 1.01041425285 1.0107713348 1.01368297842 0.996763269087 0.996160229142 0.99112504727 1.00439952953 1.009517605 1.00957012002 1.00892379148 0.993390983612 1.00801904994 0.991711609856 0.990292734135 1.00901813997 0.986140359726 1.00733767825 1.00160888264 1.00099484879 1.00115103057 0.989567079643 0.990003559163 1.00948133226 0.9605923593 1.00166982095 1.00802988044 1.00314055216 1.01892344658 1.00440240885 1.01714352831 0.990132659319 0.999905991342 1.04133659273 1.02063684444 0.98289289554 1.00571035469 1.00643129791 1.00829542621 1.01444545657 0.978395394004 1.00121653218 0.999183934541 0.997007483447 0.987505269039 0.988898774569 0.975761457589 1.00942332702 1.00507479433 1.00767198433 0.988272736414 0.992457113843 0.98148548154 0.993538222736 0.99640415238 1.00522603063 0.978646452638 0.973977600396 -TT_TuneCUETP8M2T4_13TeV-powheg-fsrdown-pythia8 /store/group/phys_higgs/HiggsExo/dalfonso/80x_MC_v2/v2.3/TT_TuneCUETP8M2T4_13TeV-powheg-fsrdown-pythia8 59306906.0 831.0 SCALES 1.01974311981 0.975155089452 1.11532014773 1.14334674556 0.897541758514 0.880449785276 PDFS 1.02842234844 0.989910538177 0.988502136665 1.01864436201 1.0521241684 0.990549961525 1.0028310828 0.98952092941 0.990751105902 1.01545443828 1.02906756557 0.993349649947 0.985883976867 0.989102364184 0.982116700714 0.990343475571 0.966113650483 0.983792818098 1.00111584098 0.981236599281 1.00563585704 1.02921498516 0.975080006196 1.0217598527 1.00209148939 1.0118602965 0.963391212575 0.993323177565 0.984019109923 0.994164103335 1.01695555672 1.01916624715 1.01163314981 1.02713362738 0.962670176601 0.997782105767 0.980180934243 1.00382267496 1.01960249195 1.01138812931 1.00885126892 1.00665765828 1.02189393621 1.01041708428 1.01071301247 1.01367127804 0.99680470067 0.996179176187 0.991116349054 1.00442183289 1.00952047054 1.00959927486 1.00892362026 0.993436614287 1.00803892193 0.991720126985 0.990278222962 1.0090586195 0.986140415432 1.00733416593 1.00159003774 1.00100100942 1.00117755468 0.98960341878 0.990034146583 1.009507676 0.960606380624 1.00169051079 1.00804454181 1.00317922821 1.01892678521 1.00441998369 1.01712416936 0.990183189911 0.999893779805 1.04134281437 1.02063819263 0.982891668128 1.0057147245 1.00640702457 1.00831265968 1.01443113969 0.978401076599 1.00115518467 0.999203743339 0.997005979444 0.98746181857 0.98892424023 0.975796577069 1.00947064515 1.00511278522 1.00768547714 0.988285886294 0.992471043159 0.981516250836 0.993537129414 0.996372615527 1.00523351954 0.978692657325 0.9739772825 +TT_TuneCUETP8M2T4_13TeV-powheg-fsrdown-pythia8 /eos/cms/store/group/phys_higgs/HiggsExo/jaeyserm/80x_MC_v2/v2.3/TT_TuneCUETP8M2T4_13TeV-powheg-fsrdown-pythia8 88490686.0 831 SCALES 1.01974337167 0.975153154585 1.11531376819 1.14334053237 0.89754277618 0.880445785646 PDFS 1.02841876538 0.989916242777 0.988503986371 1.01864099502 1.05211203709 0.990550833073 1.00282985831 0.989521168954 0.990761211323 1.01545244354 1.02907159833 0.993349884904 0.985885322229 0.989105087407 0.982116701188 0.990347702692 0.966121904109 0.983785556653 1.00111425135 0.98123759739 1.00563331666 1.02921871423 0.975075627792 1.02175795247 1.0020966499 1.01185687809 0.963392864791 0.993326189474 0.984020993534 0.994162167218 1.01695373925 1.01916140813 1.0116320145 1.0271336704 0.962669326659 0.997775905812 0.980182948771 1.00382052891 1.01959872224 1.01139119856 1.00885038527 1.00665922372 1.02189389425 1.01042044344 1.01070852032 1.01367157383 0.996807608424 0.996180181258 0.991115529079 1.00442228716 1.00952076447 1.00959953888 1.00892019028 0.993438625819 1.00803861014 0.991712312954 0.990282843028 1.00906090078 0.986143624706 1.00733886439 1.00157592676 1.00100105699 1.00118465309 0.989608202508 0.990036145098 1.00950458875 0.96059950794 1.00168965684 1.00805014602 1.00318371981 1.018918292 1.00441911442 1.0171184414 0.990184437554 0.999897384851 1.04134011864 1.0206348801 0.982897380375 1.00571462835 1.00640316299 1.00830886958 1.01442623431 0.978400849019 1.00116832304 0.999201911036 0.997010848029 0.987465221174 0.988928984531 0.97579823209 1.00947143814 1.00510925771 1.00768134706 0.988289132102 0.992470098965 0.981527901841 0.993536605295 0.996364101059 1.00523119868 0.978693680266 0.973984785669 -TT_TuneCUETP8M2T4_13TeV-powheg-fsrup-pythia8 /store/group/phys_higgs/HiggsExo/dalfonso/80x_MC_v2/v2.3/TT_TuneCUETP8M2T4_13TeV-powheg-fsrup-pythia8 59230899.0 831.0 SCALES 1.01972998276 0.975160045443 1.11531209576 1.1433268829 0.89754307985 0.880450573838 PDFS 1.0284042716 0.989915233893 0.988481466903 1.01866562112 1.05218644678 0.990543561727 1.00285880351 0.989516855445 0.990808240343 1.01544852876 1.02902068912 0.993324520011 0.985832999139 0.989101509862 0.982092520228 0.990354350165 0.966104451815 0.983840558829 1.00109729806 0.981250820294 1.00561662259 1.02923327762 0.975070866116 1.02174876165 1.00210164439 1.01185115624 0.963343615146 0.993322026016 0.983993568067 0.99415276144 1.01695283836 1.01921018902 1.01165615892 1.02713070028 0.962665126465 0.997785423181 0.98016644037 1.00381149303 1.01962431767 1.01137757411 1.00887170733 1.00664038509 1.02190115791 1.01038664783 1.01076506541 1.01368246273 0.996789504907 0.996171271112 0.991119273053 1.00439675796 1.00948676274 1.0095959951 1.00891621644 0.99342500374 1.00802767607 0.991744428554 0.990309891526 1.00898018869 0.986123276568 1.00734684792 1.00160351129 1.00097889618 1.00117706443 0.989576819857 0.990024294776 1.00948343889 0.960586164858 1.00168367549 1.00805835562 1.00316600783 1.01891392263 1.00442186091 1.0171706988 0.990174613149 0.999920518587 1.04127449272 1.02062925647 0.982872686635 1.00569838248 1.00644055999 1.00830288293 1.01448071055 0.978369754598 1.00121491559 0.999229481022 0.997006053444 0.987525604378 0.988908479994 0.975795412403 1.00946438833 1.0051106857 1.00767502489 0.98828779633 0.992424171777 0.981526030543 0.993545865625 0.996420857102 1.00523340286 0.97867183139 0.974015763192 +TT_TuneCUETP8M2T4_13TeV-powheg-fsrup-pythia8 /eos/cms/store/group/phys_higgs/HiggsExo/jaeyserm/80x_MC_v2/v2.3/TT_TuneCUETP8M2T4_13TeV-powheg-fsrup-pythia8 59178569.0 831 SCALES 1.0197297599 0.975160248147 1.11531227935 1.14332688207 0.897542647532 0.880450408009 PDFS 1.0284041967 0.989915261944 0.988481368626 1.01866562244 1.05218632428 0.990543598812 1.00285874059 0.989516694403 0.990808079235 1.01544860431 1.02902062669 0.993324424119 0.985832923388 0.989101501359 0.982092523549 0.99035427072 0.96610446974 0.98384053865 1.00109718657 0.981250745295 1.00561667195 1.02923315292 0.975070948946 1.02174876485 1.00210158342 1.01185128199 0.963343533182 0.993322027268 0.983993512959 0.994152787038 1.0169529136 1.01921012145 1.01165620114 1.02713058654 0.962665207258 0.997785413817 0.980166416371 1.00381143877 1.01962414298 1.01137749653 1.00887146146 1.00664040996 1.02190126788 1.01038671551 1.01076484979 1.01368238976 0.996789666272 0.996171226563 0.991119207443 1.00439675778 1.00948669617 1.00959602309 1.00891637057 0.993424973822 1.00802768843 0.991744383288 0.990309751419 1.00898008284 0.986123178279 1.00734674906 1.00160344941 1.00097872089 1.00117703293 0.989576816425 0.990024222963 1.00948356385 0.960586150536 1.00168370901 1.00805829973 1.00316607266 1.01891391257 1.00442195279 1.01717052138 0.990174755828 0.999920135136 1.04127443931 1.02062929996 0.982872517499 1.00569834455 1.00644047521 1.00830284428 1.01448061575 0.978369598414 1.00121461951 0.999229481903 0.997005977407 0.987525501184 0.988908397396 0.975795430797 1.00946453255 1.00511075214 1.0076750617 0.988287795089 0.992424020678 0.981525921485 0.993545904496 0.996420691392 1.00523337819 0.978671801359 0.974015656978 -TT_TuneCUETP8M2T4_13TeV-powheg-isrdown-pythia8 /store/group/phys_higgs/HiggsExo/dalfonso/80x_MC_v2/v2.3/TT_TuneCUETP8M2T4_13TeV-powheg-isrdown-pythia8 58999580.0 831.0 SCALES 1.01974764117 0.97514119511 1.11528679734 1.14332435546 0.897553664457 0.88044737153 PDFS 1.02839597405 0.989898237003 0.988485330644 1.01865934805 1.05216842303 0.990542088603 1.00284792983 0.989527442165 0.990784512382 1.01544385119 1.0290107566 0.993338008933 0.985824914216 0.989090797218 0.982087380767 0.990340546178 0.966100470042 0.983814157896 1.00108415833 0.981194309454 1.00562064399 1.02921150113 0.975067650541 1.02175084595 1.00208557819 1.01184817125 0.963326518661 0.993306575413 0.983992627856 0.99415492101 1.01695404749 1.01920022883 1.01163987417 1.02713508327 0.962653191183 0.997784781644 0.980176544666 1.00380838058 1.0196119394 1.0113717395 1.00886315435 1.00664717124 1.02189681064 1.01037452431 1.01075450829 1.01366301082 0.996773562574 0.996164501004 0.991132898346 1.00439553036 1.00950229286 1.00959431389 1.00891355497 0.993419188127 1.00802900359 0.991727087835 0.990287632362 1.00896727982 0.986134967814 1.00733224284 1.00160388292 1.00099380185 1.00116980485 0.989554946825 0.990029067589 1.00947962978 0.9605752963 1.00167833105 1.00803728948 1.00316122241 1.01890398577 1.00441773587 1.01715941185 0.990161645743 0.999912310361 1.04128209593 1.02062496455 0.982855796774 1.0056851162 1.00643646758 1.00830149298 1.01446366215 0.978379458831 1.00119558681 0.999214637713 0.99700777947 0.987512893093 0.988902447703 0.975782528005 1.0094542111 1.0050997519 1.00767135496 0.988276078412 0.992417794246 0.981506852912 0.993534897956 0.996428170761 1.00522725203 0.978667680752 0.974001963972 +TT_TuneCUETP8M2T4_13TeV-powheg-isrdown-pythia8 /eos/cms/store/group/phys_higgs/HiggsExo/jaeyserm/80x_MC_v2/v2.3/TT_TuneCUETP8M2T4_13TeV-powheg-isrdown-pythia8 149666158.0 831 SCALES 1.01976461449 0.975128282134 1.11530048303 1.14335051408 0.89754849219 0.880425967452 PDFS 1.0284072562 0.989910962188 0.988488804509 1.01865769185 1.0521628269 0.990542791314 1.00284235136 0.989521903032 0.990770935637 1.01545902141 1.02901570739 0.993334460262 0.985836377905 0.989106198253 0.982089957192 0.990339565541 0.966112445335 0.98382519168 1.00108416005 0.981204485274 1.00561609534 1.02920577359 0.975065873531 1.02174998683 1.00208909431 1.01184564742 0.96334814923 0.993322376035 0.983996978241 0.994148611508 1.0169512567 1.01919000739 1.01164143875 1.02711749037 0.962664884836 0.997782765564 0.98017291738 1.00380929111 1.01960505832 1.01137398821 1.00885167489 1.0066384421 1.02189204772 1.01038439413 1.01074245253 1.01365825044 0.996788710068 0.996173063768 0.991127197819 1.0044006768 1.00949327711 1.00960211516 1.00891004529 0.993424888124 1.00803126762 0.991736784591 0.990280917908 1.00898739288 0.986123608413 1.00732443444 1.00159628708 1.00098590335 1.00116709593 0.989584341864 0.990033475893 1.00948267403 0.960582518249 1.00168401491 1.00804577709 1.00317022489 1.0189094348 1.00441862214 1.01716093094 0.990170262438 0.99990908607 1.04128016991 1.02062383115 0.982860531864 1.00568945481 1.00642258648 1.00830391392 1.01445833005 0.978377348876 1.0011758142 0.999221346006 0.997009373871 0.987507363631 0.988913245227 0.975791191751 1.00946581983 1.00511034924 1.00767285528 0.988282305246 0.992424527087 0.981522971218 0.993535533125 0.996413132803 1.00522328642 0.978676259063 0.974004875084 + +TT_TuneCUETP8M2T4_13TeV-powheg-isrup-pythia8 /eos/cms/store/group/phys_higgs/HiggsExo/jaeyserm/80x_MC_v2/v2.3/TT_TuneCUETP8M2T4_13TeV-powheg-isrup-pythia8 156377655.0 831 SCALES 1.01978056813 0.97511726031 1.11530477041 1.14336727933 0.897553697689 0.880418261332 PDFS 1.02841279157 0.98992061419 0.98849773978 1.01866228945 1.05217421955 0.990546285632 1.00284226563 0.989524001982 0.99079555839 1.01546125415 1.02904569732 0.993334922742 0.985859224527 0.989111314946 0.982111912047 0.990344016217 0.966136959126 0.983842910527 1.00109569671 0.981237265354 1.00561075316 1.02920818778 0.97506277705 1.02174552478 1.0020958444 1.01184940239 0.963390176507 0.99333418363 0.98400450901 0.994147229592 1.01694840793 1.01919725788 1.01164791582 1.02711593358 0.962676287379 0.997785532497 0.980178407485 1.0038039974 1.01961096463 1.01137252163 1.00885118922 1.00665003699 1.02189457352 1.01039900345 1.01074791767 1.01365590442 0.996806894292 0.996180925655 0.991125074235 1.00441036099 1.00950136351 1.00961306875 1.00890469161 0.99343711317 1.00803002229 0.991751686654 0.990288585964 1.00901359788 0.986124922179 1.0073306671 1.00158633813 1.00098684668 1.00117829137 0.989607076438 0.990042844845 1.00948696927 0.960590169735 1.00168257387 1.00807025824 1.00318475568 1.01890769938 1.00441770586 1.01717604754 0.990181859606 0.999915624977 1.04130277951 1.0206243198 0.982875206846 1.00569781344 1.00643012302 1.00829677311 1.01446680626 0.978386134209 1.00118280344 0.999239441295 0.99701523124 0.987521409423 0.98892064347 0.97580064414 1.00947409933 1.00511759437 1.0076698213 0.988286664082 0.992425115141 0.981548802586 0.993539385479 0.996421915224 1.00521935352 0.978681788846 0.974027079729 + +TT_TuneCUETP8M2T4down_13TeV-powheg-pythia8 /store/group/phys_higgs/HiggsExo/jaeyserm/80x_MC_v2/v2.3/TT_TuneCUETP8M2T4down_13TeV-powheg-pythia8 58338240.0 831 SCALES 1.01973435247 0.975158981271 1.11534031261 1.14335902913 0.897518524687 0.880429229531 PDFS 1.02839066683 0.98987441356 0.988472585109 1.01863437886 1.05214322894 0.990522132384 1.00282622046 0.989517557713 0.99076572902 1.01544255069 1.02901757546 0.993303677534 0.985781887369 0.989065220119 0.982045170037 0.990349501891 0.966051432347 0.983798879497 1.00108868719 0.981247034826 1.00559937953 1.02921942909 0.975047150237 1.02175545576 1.00207168525 1.01183086879 0.963320487935 0.993259583113 0.983990368102 0.994164787704 1.01695154832 1.01917346278 1.01162864435 1.0271392109 0.962639371542 0.997763250501 0.980160741323 1.00381030845 1.01960973891 1.01137271015 1.0088581162 1.00664072899 1.02189556853 1.01039819289 1.01075302543 1.01367892652 0.99675149597 0.996145967358 0.991114281745 1.00437376558 1.00949070098 1.00956172523 1.00891318933 0.993377460639 1.0080012598 0.991699023907 0.990274488481 1.00896457097 0.98612389576 1.00733563541 1.00159944861 1.00097937957 1.00113589106 0.989554589274 0.990005117944 1.00946449937 0.96057644961 1.00165733904 1.00801481184 1.00311812144 1.01889248979 1.00440148811 1.01713635034 0.99012040415 0.999876034854 1.04128744737 1.02062130277 0.982861835839 1.00569048576 1.00642923772 1.00828233611 1.01442303842 0.978385609544 1.00118338748 0.999169889955 0.997003096692 0.987503400277 0.988883297858 0.975756873779 1.00940985033 1.00505447472 1.00765955633 0.988260230803 0.992429239244 0.981455383259 0.993527877351 0.99642027127 1.00521118091 0.978626399126 0.973974233858 + +TT_TuneCUETP8M2T4up_13TeV-powheg-pythia8 /store/group/phys_higgs/HiggsExo/jaeyserm/80x_MC_v2/v2.3/TT_TuneCUETP8M2T4down_13TeV-powheg-pythia8 58338240.0 831 SCALES 1.01973435247 0.975158981271 1.11534031261 1.14335902913 0.897518524687 0.880429229531 PDFS 1.02839066683 0.98987441356 0.988472585109 1.01863437886 1.05214322894 0.990522132384 1.00282622046 0.989517557713 0.99076572902 1.01544255069 1.02901757546 0.993303677534 0.985781887369 0.989065220119 0.982045170037 0.990349501891 0.966051432347 0.983798879497 1.00108868719 0.981247034826 1.00559937953 1.02921942909 0.975047150237 1.02175545576 1.00207168525 1.01183086879 0.963320487935 0.993259583113 0.983990368102 0.994164787704 1.01695154832 1.01917346278 1.01162864435 1.0271392109 0.962639371542 0.997763250501 0.980160741323 1.00381030845 1.01960973891 1.01137271015 1.0088581162 1.00664072899 1.02189556853 1.01039819289 1.01075302543 1.01367892652 0.99675149597 0.996145967358 0.991114281745 1.00437376558 1.00949070098 1.00956172523 1.00891318933 0.993377460639 1.0080012598 0.991699023907 0.990274488481 1.00896457097 0.98612389576 1.00733563541 1.00159944861 1.00097937957 1.00113589106 0.989554589274 0.990005117944 1.00946449937 0.96057644961 1.00165733904 1.00801481184 1.00311812144 1.01889248979 1.00440148811 1.01713635034 0.99012040415 0.999876034854 1.04128744737 1.02062130277 0.982861835839 1.00569048576 1.00642923772 1.00828233611 1.01442303842 0.978385609544 1.00118338748 0.999169889955 0.997003096692 0.987503400277 0.988883297858 0.975756873779 1.00940985033 1.00505447472 1.00765955633 0.988260230803 0.992429239244 0.981455383259 0.993527877351 0.99642027127 1.00521118091 0.978626399126 0.973974233858 -TT_TuneCUETP8M2T4_13TeV-powheg-isrup-pythia8 /store/group/phys_higgs/HiggsExo/dalfonso/80x_MC_v2/v2.3/TT_TuneCUETP8M2T4_13TeV-powheg-isrup-pythia8 59033604.0 831.0 SCALES 1.019769132 0.975128486522 1.11529529646 1.14334624169 0.897558033916 0.880435246352 PDFS 1.02841573878 0.989932039165 0.988505610379 1.01866461981 1.05218135477 0.990553071362 1.00284388713 0.989525747119 0.990806665245 1.01547153983 1.02905718511 0.993342420577 0.985870165469 0.989119833759 0.982120903619 0.990338858628 0.966150858293 0.983847712828 1.00108619967 0.981225297336 1.00561030089 1.02920213527 0.975062932763 1.02174314311 1.00209978012 1.01185425154 0.963398028056 0.993343844471 0.984005393817 0.994142303625 1.01694802743 1.01921403918 1.01165496904 1.02712364863 0.962683585035 0.997790441049 0.980174298638 1.0037975422 1.019609519 1.01136904062 1.00884691755 1.00665472312 1.02189479116 1.0103989158 1.01075612235 1.01365186909 0.996819933505 0.996184879801 0.991121942474 1.00441690682 1.00951098916 1.00962265389 1.00890042028 0.993453878266 1.008037695 0.991759758491 0.990295874183 1.00902517084 0.986115110944 1.00732746869 1.00157912839 1.00098124817 1.0011907906 0.989618960081 0.990052909962 1.00948960914 0.960592615998 1.0016882167 1.00808975829 1.00320052959 1.0189100015 1.00442317191 1.01719340874 0.990197230425 0.99991036753 1.04130570052 1.02062279658 0.982868124599 1.00569959559 1.00643715644 1.00830340233 1.01448246868 0.978383406653 1.00117963489 0.99924924592 0.997019850812 0.987520045301 0.98893588147 0.975804869243 1.00948951032 1.00512821981 1.00767327949 0.98829079222 0.992422089259 0.981559931321 0.993536569644 0.996437034824 1.00522337244 0.978691281152 0.97404378756 TTJets_TuneCUETP8M2T4_13TeV-amcatnloFXFX-pythia8 /eos/cms/store/group/phys_higgs/HiggsExo/jaeyserm/80x_MC_v2/v2.3/TTJets_TuneCUETP8M2T4_13TeV-amcatnloFXFX-pythia8 1.91974351157e+11 831 SCALES 1.01634726287 0.978900105962 1.11782442695 1.15099197262 0.936752585345 0.941948859701 PDFS 1.02421272035 0.989497277916 0.988081191 1.0174447613 1.044090331 0.991554103589 1.00365160596 0.990393053602 0.990415901914 1.01226289251 1.02586212928 0.994874859641 0.986018547279 0.986266724817 0.981782077629 0.99238102313 0.962975164007 0.983048763009 1.00356292823 0.983889961681 1.00591896175 1.03092119105 0.979054333732 1.02303202915 1.00307432735 1.01144566185 0.961047817867 0.991939830731 0.983938084895 0.997944325613 1.01728694518 1.0159503123 1.01226868122 1.03031773576 0.96202829154 1.00018870874 0.981212364354 1.00460189626 1.0199715171 1.01331735836 1.01011550424 1.00788424897 1.0242598329 1.01137314412 1.01374378511 1.01877027866 0.995608258097 0.995040809485 0.991696281198 1.0051706999 1.01064493936 1.00877126485 1.0107546862 0.991616885428 1.00792346287 0.989768229844 0.99344846332 1.00893980541 0.987584258047 1.00873721245 1.00353319017 1.00283352223 1.00026680945 0.987952399418 0.988953124394 1.01014718584 0.962123155679 1.000780424 1.00417677919 1.00283817013 1.02114385805 1.00454209668 1.01050075524 0.989104131364 0.999261169538 1.04024621618 1.02161345213 0.983428915378 1.00631815381 1.00768458894 1.00905412248 1.01300686968 0.980369944456 1.00222305495 0.996822345135 0.995949761204 0.986576605656 0.988293466028 0.977704892543 1.00887199246 1.00377444835 1.0096067969 0.987995695529 0.996077569326 0.97954092563 0.994087879126 0.99676572493 1.00873276613 0.980019326231 0.974060526958 From aeab466d30376647fdbee57dc7ea8ac0ae0a54c8 Mon Sep 17 00:00:00 2001 From: maria Date: Sun, 23 Sep 2018 16:03:30 +0200 Subject: [PATCH 47/60] script leptonic: update ISR/FSR histogram --- script/bwsTB.py | 17 ++++++++--------- 1 file changed, 8 insertions(+), 9 deletions(-) diff --git a/script/bwsTB.py b/script/bwsTB.py index 9da19bc1..db3eebe9 100644 --- a/script/bwsTB.py +++ b/script/bwsTB.py @@ -113,7 +113,8 @@ def WorkspaceSubstitution(string): def PartonShowerSyst(type, cat, direction, njet, nbjet, proc): - filename="/afs/cern.ch/user/j/jaeyserm/public/forJacopo/PS.root" + filename="/afs/cern.ch/user/j/jaeyserm/public/ChargedHiggs/PSNew.root" + if cat == "1L": cat = "1l" njet = njet +1 @@ -195,9 +196,10 @@ def RebinN(h,nBin): for x in basecat: label="2l_" if y == "1L": label="1L_" - if y == "1Ele" or y == "1Mu": label="1l_" -## if y == "1Ele" or y == "1Mu": label="1Mu_" -## if y == "1Ele" or y == "1Mu": label="1Ele_" +# if y == "1Ele" or y == "1Mu": label="1l_" + if y == "1Mu": label="1Mu_" + if y == "1Ele": label="1Ele_" + #dilep if y == "2Ele": label="2Ele_" if y == "2Mu": label="2Mu_" if y == "1Mu1Ele": label="1Mu1Ele_" @@ -545,12 +547,12 @@ def RebinN(h,nBin): #print "---------------------- --------" #fileTmp="AUG6_HT/"+label+VarTest+opts.output -fileTmp="AUG22_HT200/"+ label + VarTest + str(opts.kMass) + opts.output +fileTmp="SEPT12_HT200/"+ label + VarTest + str(opts.kMass) + opts.output w = ROOT.RooWorkspace("w","w") datNameTmp = opts.datCardName #datName = "AUG6_HT/"+ label + VarTest + datNameTmp -datName = "AUG22_HT200/"+ label + VarTest + str(opts.kMass) + datNameTmp +datName = "SEPT12_HT200/"+ label + VarTest + str(opts.kMass) + datNameTmp datacard=open(datName,"w") datacard.write("-------------------------------------\n") @@ -715,9 +717,6 @@ def writeSystISRFSR(name="test",valueL=["1.027","1.026"], regexpL=["TT","ST",""] if "HDAMP" in name: mySyst="hdamp" - if "ttb" == proc: proc = "tt1b" - elif "ttbb" == proc: proc = "tt2b" - elif "tt2b" == proc: proc = "tt2bmerged" ## regexpL=["ttlf","ttb","ttbb","tt2b","ttcc"] # if "1L" in cat: From d5c937350b122256589879028f91b28d8111b6bc Mon Sep 17 00:00:00 2001 From: maria Date: Thu, 25 Oct 2018 18:55:09 +0200 Subject: [PATCH 48/60] tb leptonic: redefine label for UE; add option for doDY; fix the mm channel --- interface/AnalysisChargedHiggsTopBottom.hpp | 3 ++- src/AnalysisChargedHiggsTopBottom.cpp | 11 +++++++++-- 2 files changed, 11 insertions(+), 3 deletions(-) diff --git a/interface/AnalysisChargedHiggsTopBottom.hpp b/interface/AnalysisChargedHiggsTopBottom.hpp index 3d1593eb..5de3bfb0 100644 --- a/interface/AnalysisChargedHiggsTopBottom.hpp +++ b/interface/AnalysisChargedHiggsTopBottom.hpp @@ -22,10 +22,11 @@ class ChargedHiggsTopBottom: virtual public AnalysisBase ChargedHiggsTopBottom() : AnalysisBase () {} virtual ~ChargedHiggsTopBottom () {} - bool doJECSources = true; + bool doJECSources = false; bool doSynch = false; bool doQCD = false; + bool doDY = false; bool doBDTSyst = true; bool doFinal = true; // true for final ; no need to compute fancy stuff bool writeTree = false; // false for final diff --git a/src/AnalysisChargedHiggsTopBottom.cpp b/src/AnalysisChargedHiggsTopBottom.cpp index a2aee0dd..15b093f3 100644 --- a/src/AnalysisChargedHiggsTopBottom.cpp +++ b/src/AnalysisChargedHiggsTopBottom.cpp @@ -3310,6 +3310,10 @@ int ChargedHiggsTopBottom::analyze(Event*e,string systname) if ( label == "WZZ") label = "EWK"; if ( label == "ZZZ") label = "EWK"; + // redefine plots + if ( label == "TT_TuneCUETP8M2T4up_13TeV-powheg-pythia8" ) label = "TT_TuneCUETP8M2T4_13TeV-powheg-pythia8"; + if ( label == "TT_TuneCUETP8M2T4down_13TeV-powheg-pythia8" ) label = "TT_TuneCUETP8M2T4_13TeV-powheg-pythia8"; + /* std::cout << e->GetName() << std::endl; if(e->GetName().find("SingleMuon")!=string::npos) std::cout << "this should be SingleMuon" << std::endl; @@ -3386,9 +3390,10 @@ int ChargedHiggsTopBottom::analyze(Event*e,string systname) if(doQCD and do2lAnalysis) pairSign = (it->Charge()*leadLep->Charge()>0); if( pairSign and (it->GetP4() + leadLep->GetP4()).M() > 12 ) { - if(pairSign || (it->IsElectron() && leadLep->IsElectron()) ) { + if(((it->IsMuon() && leadLep->IsMuon()) || (it->IsElectron() && leadLep->IsElectron()))) { // same flavour - if( (std::abs((it->GetP4() + leadLep->GetP4()).M()-91) > 15) && (it->GetP4() + leadLep->GetP4()).M()>50 ) { trailLep=it; nOSLepPair++; } + if( not doDY && (std::abs((it->GetP4() + leadLep->GetP4()).M()-91) > 15) && (it->GetP4() + leadLep->GetP4()).M()>50 ) { trailLep=it; nOSLepPair++; } + if( doDY && (std::abs((it->GetP4() + leadLep->GetP4()).M()-91) < 15)) { trailLep=it; nOSLepPair++; } } else { trailLep=it; nOSLepPair++; } } // and OS } @@ -3661,6 +3666,7 @@ int ChargedHiggsTopBottom::analyze(Event*e,string systname) ////$$$$$$$ Apply SF ////$$$$$$$ + /* // do not apply topPT in the central value if (not e->IsRealData() and ((label.find("TTTo2L2Nu_TuneCUETP8M2")!=string::npos) || (label.find("TTToSemilepton_TuneCUETP8M2")!=string::npos) || (label.find("TTTo2L2Nu_ttbbFilter")!=string::npos) || (label.find("TTToSemilepton_ttbbFilter")!=string::npos) @@ -3671,6 +3677,7 @@ int ChargedHiggsTopBottom::analyze(Event*e,string systname) || (label.find("TT_TuneCUETP8M2T4_13TeV-powheg-isrup")!=string::npos) || (label.find("TTJets")!=string::npos) )) { e->ApplyTopReweight(); } + */ ////$$$$$$$ ////$$$$$$$ Fill Cut Flow From d8a6f6f73f7008506bab781eae32dd02526a44a6 Mon Sep 17 00:00:00 2001 From: maria Date: Thu, 1 Nov 2018 11:23:21 +0100 Subject: [PATCH 49/60] add classifyZHF, comment unused histos, fix 1Ele-eta --- interface/AnalysisChargedHiggsTopBottom.hpp | 1 + src/AnalysisChargedHiggsTopBottom.cpp | 321 ++++++++++++++++---- 2 files changed, 262 insertions(+), 60 deletions(-) diff --git a/interface/AnalysisChargedHiggsTopBottom.hpp b/interface/AnalysisChargedHiggsTopBottom.hpp index 5de3bfb0..24ae8edc 100644 --- a/interface/AnalysisChargedHiggsTopBottom.hpp +++ b/interface/AnalysisChargedHiggsTopBottom.hpp @@ -70,6 +70,7 @@ class ChargedHiggsTopBottom: virtual public AnalysisBase void leptonPlot(Event*e, string label, string category, string systname, string phasespace); void eventShapePlot(Event*e, string label, string category, string systname, string phasespace); void classifyHF(Event*e, string label, string category, string systname, string jetname, string SR); + void classifyZHF(Event*e, string label, string category, string systname, string jetname, string SR); void leptonicHiggs(Event*e, string label, string systname, TLorentzVector b1, TLorentzVector b2, TLorentzVector p4W, string combination); void fillMoneyPlot(Event*e, string category, string systname,string SRlabel, string label); diff --git a/src/AnalysisChargedHiggsTopBottom.cpp b/src/AnalysisChargedHiggsTopBottom.cpp index 15b093f3..18e2a06c 100644 --- a/src/AnalysisChargedHiggsTopBottom.cpp +++ b/src/AnalysisChargedHiggsTopBottom.cpp @@ -233,6 +233,7 @@ void ChargedHiggsTopBottom::setTree(Event*e, string label, string category ) if(label.find("TT_TuneCUETP8M2T4_13TeV-powheg-fsrup") !=string::npos) mc =105 ; if(label.find("TT_TuneCUETP8M2T4_13TeV-powheg-isrdown") !=string::npos) mc =106 ; if(label.find("TT_TuneCUETP8M2T4_13TeV-powheg-isrup") !=string::npos) mc =107 ; + // to add HDAMP if(label.find("TTJets") !=string::npos) mc =108 ; @@ -1260,15 +1261,15 @@ void ChargedHiggsTopBottom::BookHisto(string l, string category, string phasespa if(phasespace.find("Baseline")!=string::npos) { - AddFinalHisto("ChargedHiggsTopBottom/"+phasespace+category+"/ST_SR13_"+l); - AddFinalHisto("ChargedHiggsTopBottom/"+phasespace+category+"/ST_SR24_"+l); - if(doSplit) AddFinalHisto("ChargedHiggsTopBottom/"+phasespace+category+"/ST_SR1_"+l); - if(doSplit) AddFinalHisto("ChargedHiggsTopBottom/"+phasespace+category+"/ST_SR2_"+l); - if(doSplit) AddFinalHisto("ChargedHiggsTopBottom/"+phasespace+category+"/ST_SR3_"+l); - if(doSplit) AddFinalHisto("ChargedHiggsTopBottom/"+phasespace+category+"/ST_SR4_"+l); + // AddFinalHisto("ChargedHiggsTopBottom/"+phasespace+category+"/ST_SR13_"+l); + // AddFinalHisto("ChargedHiggsTopBottom/"+phasespace+category+"/ST_SR24_"+l); + // if(doSplit) AddFinalHisto("ChargedHiggsTopBottom/"+phasespace+category+"/ST_SR1_"+l); + // if(doSplit) AddFinalHisto("ChargedHiggsTopBottom/"+phasespace+category+"/ST_SR2_"+l); + // if(doSplit) AddFinalHisto("ChargedHiggsTopBottom/"+phasespace+category+"/ST_SR3_"+l); + // if(doSplit) AddFinalHisto("ChargedHiggsTopBottom/"+phasespace+category+"/ST_SR4_"+l); - AddFinalHisto("ChargedHiggsTopBottom/"+phasespace+category+"/HT_SR13_"+l); - AddFinalHisto("ChargedHiggsTopBottom/"+phasespace+category+"/HT_SR24_"+l); + // AddFinalHisto("ChargedHiggsTopBottom/"+phasespace+category+"/HT_SR13_"+l); + // AddFinalHisto("ChargedHiggsTopBottom/"+phasespace+category+"/HT_SR24_"+l); if(doSplit) AddFinalHisto("ChargedHiggsTopBottom/"+phasespace+category+"/HT_SR1_"+l); if(doSplit) AddFinalHisto("ChargedHiggsTopBottom/"+phasespace+category+"/HT_SR2_"+l); if(doSplit) AddFinalHisto("ChargedHiggsTopBottom/"+phasespace+category+"/HT_SR3_"+l); @@ -1290,8 +1291,8 @@ void ChargedHiggsTopBottom::BookHisto(string l, string category, string phasespa if(doBDTSyst and (do1lAnalysis or do2lAnalysis)) AddFinalHisto("ChargedHiggsTopBottom/"+phasespace+category+"/bdt"+BDT+"_"+"SR3_"+l); if(doBDTSyst and (do1lAnalysis or do2lAnalysis)) AddFinalHisto("ChargedHiggsTopBottom/"+phasespace+category+"/bdt"+BDT+"_"+"SR4_"+l); } - if(doBDTSyst and (do1lAnalysis or do2lAnalysis)) AddFinalHisto("ChargedHiggsTopBottom/"+phasespace+category+"/bdt"+BDT+"_"+"SR13_"+l); - if(doBDTSyst and (do1lAnalysis or do2lAnalysis)) AddFinalHisto("ChargedHiggsTopBottom/"+phasespace+category+"/bdt"+BDT+"_"+"SR24_"+l); + // if(doBDTSyst and (do1lAnalysis or do2lAnalysis)) AddFinalHisto("ChargedHiggsTopBottom/"+phasespace+category+"/bdt"+BDT+"_"+"SR13_"+l); + // if(doBDTSyst and (do1lAnalysis or do2lAnalysis)) AddFinalHisto("ChargedHiggsTopBottom/"+phasespace+category+"/bdt"+BDT+"_"+"SR24_"+l); } if(doSplit) { @@ -1313,13 +1314,13 @@ void ChargedHiggsTopBottom::BookHisto(string l, string category, string phasespa } - if(doBDTSyst and doTMVA and do1lAnalysis) AddFinalHisto("ChargedHiggsTopBottom/"+phasespace+category+"/bdt1lh_"+"SR13_"+l); - if(doBDTSyst and doTMVA and do1lAnalysis) AddFinalHisto("ChargedHiggsTopBottom/"+phasespace+category+"/bdt1lm_"+"SR13_"+l); - if(doBDTSyst and doTMVA and do1lAnalysis) AddFinalHisto("ChargedHiggsTopBottom/"+phasespace+category+"/bdt1ll_"+"SR13_"+l); + // if(doBDTSyst and doTMVA and do1lAnalysis) AddFinalHisto("ChargedHiggsTopBottom/"+phasespace+category+"/bdt1lh_"+"SR13_"+l); + // if(doBDTSyst and doTMVA and do1lAnalysis) AddFinalHisto("ChargedHiggsTopBottom/"+phasespace+category+"/bdt1lm_"+"SR13_"+l); + // if(doBDTSyst and doTMVA and do1lAnalysis) AddFinalHisto("ChargedHiggsTopBottom/"+phasespace+category+"/bdt1ll_"+"SR13_"+l); - if(doBDTSyst and doTMVA and do1lAnalysis) AddFinalHisto("ChargedHiggsTopBottom/"+phasespace+category+"/bdt1lh_"+"SR24_"+l); - if(doBDTSyst and doTMVA and do1lAnalysis) AddFinalHisto("ChargedHiggsTopBottom/"+phasespace+category+"/bdt1lm_"+"SR24_"+l); - if(doBDTSyst and doTMVA and do1lAnalysis) AddFinalHisto("ChargedHiggsTopBottom/"+phasespace+category+"/bdt1ll_"+"SR24_"+l); + // if(doBDTSyst and doTMVA and do1lAnalysis) AddFinalHisto("ChargedHiggsTopBottom/"+phasespace+category+"/bdt1lh_"+"SR24_"+l); + // if(doBDTSyst and doTMVA and do1lAnalysis) AddFinalHisto("ChargedHiggsTopBottom/"+phasespace+category+"/bdt1lm_"+"SR24_"+l); + // if(doBDTSyst and doTMVA and do1lAnalysis) AddFinalHisto("ChargedHiggsTopBottom/"+phasespace+category+"/bdt1ll_"+"SR24_"+l); if(doSplit) { @@ -1341,13 +1342,13 @@ void ChargedHiggsTopBottom::BookHisto(string l, string category, string phasespa } - if(doBDTSyst and doTMVA and do2lAnalysis) AddFinalHisto("ChargedHiggsTopBottom/"+phasespace+category+"/bdt2lh_"+"SR13_"+l); - if(doBDTSyst and doTMVA and do2lAnalysis) AddFinalHisto("ChargedHiggsTopBottom/"+phasespace+category+"/bdt2lm_"+"SR13_"+l); - if(doBDTSyst and doTMVA and do2lAnalysis) AddFinalHisto("ChargedHiggsTopBottom/"+phasespace+category+"/bdt2ll_"+"SR13_"+l); + // if(doBDTSyst and doTMVA and do2lAnalysis) AddFinalHisto("ChargedHiggsTopBottom/"+phasespace+category+"/bdt2lh_"+"SR13_"+l); + // if(doBDTSyst and doTMVA and do2lAnalysis) AddFinalHisto("ChargedHiggsTopBottom/"+phasespace+category+"/bdt2lm_"+"SR13_"+l); + // if(doBDTSyst and doTMVA and do2lAnalysis) AddFinalHisto("ChargedHiggsTopBottom/"+phasespace+category+"/bdt2ll_"+"SR13_"+l); - if(doBDTSyst and doTMVA and do2lAnalysis) AddFinalHisto("ChargedHiggsTopBottom/"+phasespace+category+"/bdt2lh_"+"SR24_"+l); - if(doBDTSyst and doTMVA and do2lAnalysis) AddFinalHisto("ChargedHiggsTopBottom/"+phasespace+category+"/bdt2lm_"+"SR24_"+l); - if(doBDTSyst and doTMVA and do2lAnalysis) AddFinalHisto("ChargedHiggsTopBottom/"+phasespace+category+"/bdt2ll_"+"SR24_"+l); + // if(doBDTSyst and doTMVA and do2lAnalysis) AddFinalHisto("ChargedHiggsTopBottom/"+phasespace+category+"/bdt2lh_"+"SR24_"+l); + // if(doBDTSyst and doTMVA and do2lAnalysis) AddFinalHisto("ChargedHiggsTopBottom/"+phasespace+category+"/bdt2lm_"+"SR24_"+l); + // if(doBDTSyst and doTMVA and do2lAnalysis) AddFinalHisto("ChargedHiggsTopBottom/"+phasespace+category+"/bdt2ll_"+"SR24_"+l); /* @@ -1467,17 +1468,17 @@ void ChargedHiggsTopBottom::BookHisto(string l, string category, string phasespa if(phasespace.find("Baseline")!=string::npos) { - Book("ChargedHiggsTopBottom/"+phasespace+category+"/ST_SR1_"+l,"ST "+l+"; ST ( HT+MET+lepsPt )",800,0,8000); - Book("ChargedHiggsTopBottom/"+phasespace+category+"/ST_SR13_"+l,"ST "+l+"; ST ( HT+MET+lepsPt )",800,0,8000); - Book("ChargedHiggsTopBottom/"+phasespace+category+"/ST_SR2_"+l,"ST "+l+"; ST ( HT+MET+lepsPt )",800,0,8000); - Book("ChargedHiggsTopBottom/"+phasespace+category+"/ST_SR24_"+l,"ST "+l+"; ST ( HT+MET+lepsPt )",800,0,8000); - Book("ChargedHiggsTopBottom/"+phasespace+category+"/ST_SR3_"+l,"ST "+l+"; ST ( HT+MET+lepsPt )",800,0,8000); - Book("ChargedHiggsTopBottom/"+phasespace+category+"/ST_SR4_"+l,"ST "+l+"; ST ( HT+MET+lepsPt )",800,0,8000); + // Book("ChargedHiggsTopBottom/"+phasespace+category+"/ST_SR1_"+l,"ST "+l+"; ST ( HT+MET+lepsPt )",800,0,8000); + // Book("ChargedHiggsTopBottom/"+phasespace+category+"/ST_SR13_"+l,"ST "+l+"; ST ( HT+MET+lepsPt )",800,0,8000); + // Book("ChargedHiggsTopBottom/"+phasespace+category+"/ST_SR2_"+l,"ST "+l+"; ST ( HT+MET+lepsPt )",800,0,8000); + // Book("ChargedHiggsTopBottom/"+phasespace+category+"/ST_SR24_"+l,"ST "+l+"; ST ( HT+MET+lepsPt )",800,0,8000); + // Book("ChargedHiggsTopBottom/"+phasespace+category+"/ST_SR3_"+l,"ST "+l+"; ST ( HT+MET+lepsPt )",800,0,8000); + // Book("ChargedHiggsTopBottom/"+phasespace+category+"/ST_SR4_"+l,"ST "+l+"; ST ( HT+MET+lepsPt )",800,0,8000); Book("ChargedHiggsTopBottom/"+phasespace+category+"/HT_SR1_"+l,"HT "+l+"; HT (P_{T}^{jet}>40 [GeV])",800,0,8000); - Book("ChargedHiggsTopBottom/"+phasespace+category+"/HT_SR13_"+l,"HT "+l+"; HT (P_{T}^{jet}>40 [GeV])",800,0,8000); + // Book("ChargedHiggsTopBottom/"+phasespace+category+"/HT_SR13_"+l,"HT "+l+"; HT (P_{T}^{jet}>40 [GeV])",800,0,8000); Book("ChargedHiggsTopBottom/"+phasespace+category+"/HT_SR2_"+l,"HT "+l+"; HT (P_{T}^{jet}>40 [GeV])",800,0,8000); - Book("ChargedHiggsTopBottom/"+phasespace+category+"/HT_SR24_"+l,"HT "+l+"; HT (P_{T}^{jet}>40 [GeV])",800,0,8000); + // Book("ChargedHiggsTopBottom/"+phasespace+category+"/HT_SR24_"+l,"HT "+l+"; HT (P_{T}^{jet}>40 [GeV])",800,0,8000); Book("ChargedHiggsTopBottom/"+phasespace+category+"/HT_SR3_"+l,"HT "+l+"; HT (P_{T}^{jet}>40 [GeV])",800,0,8000); Book("ChargedHiggsTopBottom/"+phasespace+category+"/HT_SR4_"+l,"HT "+l+"; HT (P_{T}^{jet}>40 [GeV])",800,0,8000); @@ -1630,26 +1631,26 @@ void ChargedHiggsTopBottom::BookHisto(string l, string category, string phasespa if(do2lAnalysis) Book("ChargedHiggsTopBottom/"+phasespace+category+"/bdt2D_2lh_SR4_"+l,"bdt2D_2lh_ "+l+";bdt (2D high) 2l", 6,-0.5,5.5); */ - if(do1lAnalysis and doTMVA) Book("ChargedHiggsTopBottom/"+phasespace+category+"/bdt1lh_SR13_"+l,"bdt1lh "+l+";bdt (1l high)",nbinsBDT,binMIN,binMAX); - if(do1lAnalysis and doTMVA) Book("ChargedHiggsTopBottom/"+phasespace+category+"/bdt1lm_SR13_"+l,"bdt1lm "+l+";bdt (1l medium)",nbinsBDT,binMIN,binMAX); - if(do1lAnalysis and doTMVA) Book("ChargedHiggsTopBottom/"+phasespace+category+"/bdt1ll_SR13_"+l,"bdt1ll "+l+";bdt (1l low)",nbinsBDT,binMIN,binMAX); + // if(do1lAnalysis and doTMVA) Book("ChargedHiggsTopBottom/"+phasespace+category+"/bdt1lh_SR13_"+l,"bdt1lh "+l+";bdt (1l high)",nbinsBDT,binMIN,binMAX); + // if(do1lAnalysis and doTMVA) Book("ChargedHiggsTopBottom/"+phasespace+category+"/bdt1lm_SR13_"+l,"bdt1lm "+l+";bdt (1l medium)",nbinsBDT,binMIN,binMAX); + // if(do1lAnalysis and doTMVA) Book("ChargedHiggsTopBottom/"+phasespace+category+"/bdt1ll_SR13_"+l,"bdt1ll "+l+";bdt (1l low)",nbinsBDT,binMIN,binMAX); - if(do1lAnalysis and doTMVA) Book("ChargedHiggsTopBottom/"+phasespace+category+"/bdt1lh_SR24_"+l,"bdt1lh "+l+";bdt (1l high)",nbinsBDT,binMIN,binMAX); - if(do1lAnalysis and doTMVA) Book("ChargedHiggsTopBottom/"+phasespace+category+"/bdt1lm_SR24_"+l,"bdt1lm "+l+";bdt (1l medium)",nbinsBDT,binMIN,binMAX); - if(do1lAnalysis and doTMVA) Book("ChargedHiggsTopBottom/"+phasespace+category+"/bdt1ll_SR24_"+l,"bdt1ll "+l+";bdt (1l low)",nbinsBDT,binMIN,binMAX); + // if(do1lAnalysis and doTMVA) Book("ChargedHiggsTopBottom/"+phasespace+category+"/bdt1lh_SR24_"+l,"bdt1lh "+l+";bdt (1l high)",nbinsBDT,binMIN,binMAX); + // if(do1lAnalysis and doTMVA) Book("ChargedHiggsTopBottom/"+phasespace+category+"/bdt1lm_SR24_"+l,"bdt1lm "+l+";bdt (1l medium)",nbinsBDT,binMIN,binMAX); + // if(do1lAnalysis and doTMVA) Book("ChargedHiggsTopBottom/"+phasespace+category+"/bdt1ll_SR24_"+l,"bdt1ll "+l+";bdt (1l low)",nbinsBDT,binMIN,binMAX); //// - if(do2lAnalysis and doTMVA) Book("ChargedHiggsTopBottom/"+phasespace+category+"/bdt2lh_SR13_"+l,"bdt2lh "+l+";bdt (2l high)",nbinsBDT,binMIN,binMAX); - if(do2lAnalysis and doTMVA) Book("ChargedHiggsTopBottom/"+phasespace+category+"/bdt2lm_SR13_"+l,"bdt2lm "+l+";bdt (2l medium)",nbinsBDT,binMIN,binMAX); - if(do2lAnalysis and doTMVA) Book("ChargedHiggsTopBottom/"+phasespace+category+"/bdt2ll_SR13_"+l,"bdt2ll "+l+";bdt (2l low)",nbinsBDT,binMIN,binMAX); + // if(do2lAnalysis and doTMVA) Book("ChargedHiggsTopBottom/"+phasespace+category+"/bdt2lh_SR13_"+l,"bdt2lh "+l+";bdt (2l high)",nbinsBDT,binMIN,binMAX); + // if(do2lAnalysis and doTMVA) Book("ChargedHiggsTopBottom/"+phasespace+category+"/bdt2lm_SR13_"+l,"bdt2lm "+l+";bdt (2l medium)",nbinsBDT,binMIN,binMAX); + // if(do2lAnalysis and doTMVA) Book("ChargedHiggsTopBottom/"+phasespace+category+"/bdt2ll_SR13_"+l,"bdt2ll "+l+";bdt (2l low)",nbinsBDT,binMIN,binMAX); - if(do2lAnalysis and doTMVA) Book("ChargedHiggsTopBottom/"+phasespace+category+"/bdt2lh_SR24_"+l,"bdt2lh "+l+";bdt (2l high)",nbinsBDT,binMIN,binMAX); - if(do2lAnalysis and doTMVA) Book("ChargedHiggsTopBottom/"+phasespace+category+"/bdt2lm_SR24_"+l,"bdt2lm "+l+";bdt (2l medium)",nbinsBDT,binMIN,binMAX); - if(do2lAnalysis and doTMVA) Book("ChargedHiggsTopBottom/"+phasespace+category+"/bdt2ll_SR24_"+l,"bdt2ll "+l+";bdt (2l low)",nbinsBDT,binMIN,binMAX); + // if(do2lAnalysis and doTMVA) Book("ChargedHiggsTopBottom/"+phasespace+category+"/bdt2lh_SR24_"+l,"bdt2lh "+l+";bdt (2l high)",nbinsBDT,binMIN,binMAX); + // if(do2lAnalysis and doTMVA) Book("ChargedHiggsTopBottom/"+phasespace+category+"/bdt2lm_SR24_"+l,"bdt2lm "+l+";bdt (2l medium)",nbinsBDT,binMIN,binMAX); + // if(do2lAnalysis and doTMVA) Book("ChargedHiggsTopBottom/"+phasespace+category+"/bdt2ll_SR24_"+l,"bdt2ll "+l+";bdt (2l low)",nbinsBDT,binMIN,binMAX); //// - + /* if(do1lAnalysis or do2lAnalysis) Book("ChargedHiggsTopBottom/"+phasespace+category+"/bdt1_SR13_"+l,"bdt1lh180 "+l+";bdt (1l m180)",nbinsBDT,binMIN,binMAX); if(do1lAnalysis or do2lAnalysis) Book("ChargedHiggsTopBottom/"+phasespace+category+"/bdt2_SR13_"+l,"bdt1lh200 "+l+";bdt (1l m200)",nbinsBDT,binMIN,binMAX); if(do1lAnalysis or do2lAnalysis) Book("ChargedHiggsTopBottom/"+phasespace+category+"/bdt3_SR13_"+l,"bdt1lh220 "+l+";bdt (1l m220)",nbinsBDT,binMIN,binMAX); @@ -1685,6 +1686,7 @@ void ChargedHiggsTopBottom::BookHisto(string l, string category, string phasespa if(do1lAnalysis or do2lAnalysis) Book("ChargedHiggsTopBottom/"+phasespace+category+"/bdt14_SR24_"+l,"bdt1lh3 "+l+";bdt (1l m3000)",nbinsBDT,binMIN,binMAX); if(do1lAnalysis or do2lAnalysis) Book("ChargedHiggsTopBottom/"+phasespace+category+"/bdt15_SR24_"+l,"bdt1lh3 "+l+";bdt (1l m3000)",nbinsBDT,binMIN,binMAX); if(do1lAnalysis or do2lAnalysis) Book("ChargedHiggsTopBottom/"+phasespace+category+"/bdt16_SR24_"+l,"bdt1lh3 "+l+";bdt (1l m3000)",nbinsBDT,binMIN,binMAX); + */ // if(do2lAnalysis) Book("ChargedHiggsTopBottom/"+phasespace+category+"/bdt37_SR24_"+l,"bdt2ll "+l+";bdt (2l DNN)",200,-1.,1.); @@ -1711,13 +1713,64 @@ void ChargedHiggsTopBottom::BookHisto(string l, string category, string phasespa **********************************************/ + if((l.find("DYJetsToLL_M-5to50_HT") !=string::npos) or (l.find("DYJetsToLL_M-50_HT") !=string::npos) or (l.find("WJetsToLNu_HT") !=string::npos) ) + { + + BookFlavor(l, category, phasespace, "other_", ""); + BookFlavor(l, category, phasespace, "light_", ""); + BookFlavor(l, category, phasespace, "b_", ""); + BookFlavor(l, category, phasespace, "bb_", ""); + + if(phasespace.find("Baseline")!=string::npos) { + + + // BookFlavor(l, category, phasespace, "other_", "SR13_"); + // BookFlavor(l, category, phasespace, "other_", "SR24_"); + if(doSplit) BookFlavor(l, category, phasespace, "other_", "SR1_"); + if(doSplit) BookFlavor(l, category, phasespace, "other_", "SR2_"); + if(doSplit) BookFlavor(l, category, phasespace, "other_", "SR3_"); + if(doSplit) BookFlavor(l, category, phasespace, "other_", "SR4_"); + + // BookFlavor(l, category, phasespace, "light_", "SR13_"); + // BookFlavor(l, category, phasespace, "light_", "SR24_"); + if(doSplit) BookFlavor(l, category, phasespace, "light_", "SR1_"); + if(doSplit) BookFlavor(l, category, phasespace, "light_", "SR2_"); + if(doSplit) BookFlavor(l, category, phasespace, "light_", "SR3_"); + if(doSplit) BookFlavor(l, category, phasespace, "light_", "SR4_"); + + // BookFlavor(l, category, phasespace, "b_", "SR13_"); + // BookFlavor(l, category, phasespace, "b_", "SR24_"); + if(doSplit) BookFlavor(l, category, phasespace, "b_", "SR1_"); + if(doSplit) BookFlavor(l, category, phasespace, "b_", "SR2_"); + if(doSplit) BookFlavor(l, category, phasespace, "b_", "SR3_"); + if(doSplit) BookFlavor(l, category, phasespace, "b_", "SR4_"); + + // BookFlavor(l, category, phasespace, "bb_", "SR13_"); + // BookFlavor(l, category, phasespace, "bb_", "SR24_"); + if(doSplit) BookFlavor(l, category, phasespace, "bb_", "SR1_"); + if(doSplit) BookFlavor(l, category, phasespace, "bb_", "SR2_"); + if(doSplit) BookFlavor(l, category, phasespace, "bb_", "SR3_"); + if(doSplit) BookFlavor(l, category, phasespace, "bb_", "SR4_"); + + } + + } + + /********************************************** + * special HeavyFlavour * + **********************************************/ + if((l.find("TTTo2L2Nu_TuneCUETP8M2")!=string::npos) || (l.find("TTToSemilepton_TuneCUETP8M2")!=string::npos) || (l.find("TTTo2L2Nu_ttbbFilter")!=string::npos) || (l.find("TTToSemilepton_ttbbFilter")!=string::npos) || (l.find("TT_TuneCUETP8M2T4_13TeV-powheg-pythia8")!=string::npos) + // || (l.find("TT_TuneCUETP8M2T4_13TeV-powheg-fsrdown")!=string::npos) || (l.find("TT_TuneCUETP8M2T4_13TeV-powheg-fsrup")!=string::npos) || (l.find("TT_TuneCUETP8M2T4_13TeV-powheg-isrdown")!=string::npos) || (l.find("TT_TuneCUETP8M2T4_13TeV-powheg-isrup")!=string::npos) + // + || (l.find("TT_hdampUP_TuneCUETP8M2T4_13TeV-powheg-pythia8")!=string::npos) + || (l.find("TT_hdampDOWN_TuneCUETP8M2T4_13TeV-powheg-pythia8")!=string::npos) || (l.find("TTJets")!=string::npos) ) { @@ -1728,42 +1781,45 @@ void ChargedHiggsTopBottom::BookHisto(string l, string category, string phasespa BookFlavor(l, category, phasespace, "ttc_", ""); BookFlavor(l, category, phasespace, "ttlight_", ""); + if(phasespace.find("Baseline")!=string::npos) { + + // BookFlavor(l, category, phasespace, "other_", "SR1_"); // BookFlavor(l, category, phasespace, "other_", "SR2_"); // BookFlavor(l, category, phasespace, "other_", "SR3_"); // BookFlavor(l, category, phasespace, "other_", "SR4_"); - BookFlavor(l, category, phasespace, "tt2bMerged_", "SR13_"); - BookFlavor(l, category, phasespace, "tt2bMerged_", "SR24_"); + // BookFlavor(l, category, phasespace, "tt2bMerged_", "SR13_"); + // BookFlavor(l, category, phasespace, "tt2bMerged_", "SR24_"); if(doSplit) BookFlavor(l, category, phasespace, "tt2bMerged_", "SR1_"); if(doSplit) BookFlavor(l, category, phasespace, "tt2bMerged_", "SR2_"); if(doSplit) BookFlavor(l, category, phasespace, "tt2bMerged_", "SR3_"); if(doSplit) BookFlavor(l, category, phasespace, "tt2bMerged_", "SR4_"); - BookFlavor(l, category, phasespace, "tt2b_", "SR13_"); - BookFlavor(l, category, phasespace, "tt2b_", "SR24_"); + // BookFlavor(l, category, phasespace, "tt2b_", "SR13_"); + // BookFlavor(l, category, phasespace, "tt2b_", "SR24_"); if(doSplit) BookFlavor(l, category, phasespace, "tt2b_", "SR1_"); if(doSplit) BookFlavor(l, category, phasespace, "tt2b_", "SR2_"); if(doSplit) BookFlavor(l, category, phasespace, "tt2b_", "SR3_"); if(doSplit) BookFlavor(l, category, phasespace, "tt2b_", "SR4_"); - BookFlavor(l, category, phasespace, "tt1b_", "SR13_"); - BookFlavor(l, category, phasespace, "tt1b_", "SR24_"); + // BookFlavor(l, category, phasespace, "tt1b_", "SR13_"); + // BookFlavor(l, category, phasespace, "tt1b_", "SR24_"); if(doSplit) BookFlavor(l, category, phasespace, "tt1b_", "SR1_"); if(doSplit) BookFlavor(l, category, phasespace, "tt1b_", "SR2_"); if(doSplit) BookFlavor(l, category, phasespace, "tt1b_", "SR3_"); if(doSplit) BookFlavor(l, category, phasespace, "tt1b_", "SR4_"); - BookFlavor(l, category, phasespace, "ttc_", "SR13_"); - BookFlavor(l, category, phasespace, "ttc_", "SR24_"); + // BookFlavor(l, category, phasespace, "ttc_", "SR13_"); + // BookFlavor(l, category, phasespace, "ttc_", "SR24_"); if(doSplit) BookFlavor(l, category, phasespace, "ttc_", "SR1_"); if(doSplit) BookFlavor(l, category, phasespace, "ttc_", "SR2_"); if(doSplit) BookFlavor(l, category, phasespace, "ttc_", "SR3_"); if(doSplit) BookFlavor(l, category, phasespace, "ttc_", "SR4_"); - BookFlavor(l, category, phasespace, "ttlight_", "SR13_"); - BookFlavor(l, category, phasespace, "ttlight_", "SR24_"); + // BookFlavor(l, category, phasespace, "ttlight_", "SR13_"); + // BookFlavor(l, category, phasespace, "ttlight_", "SR24_"); if(doSplit) BookFlavor(l, category, phasespace, "ttlight_", "SR1_"); if(doSplit) BookFlavor(l, category, phasespace, "ttlight_", "SR2_"); if(doSplit) BookFlavor(l, category, phasespace, "ttlight_", "SR3_"); @@ -2895,6 +2951,138 @@ void ChargedHiggsTopBottom::jetPlot(Event*e, string label, string category, stri } +void ChargedHiggsTopBottom::classifyZHF(Event*e, string label, string category, string systname, string phasespace, string Sregion) { + + if((label.find("DYJetsToLL_M-5to50_HT") !=string::npos) or (label.find("DYJetsToLL_M-50_HT") !=string::npos) or (label.find("WJetsToLNu_HT") !=string::npos) ) { + + //https://github.com/cms-sw/cmssw/blob/CMSSW_8_0_X/TopQuarkAnalysis/TopTools/plugins/GenTtbarCategorizer.cc#L35 + string LabelHF="other_"; + if(e->GetnBHadrons()==1) LabelHF="b_"; + else if (e->GetnBHadrons()==2) LabelHF="bb_"; + else if (e->GetnBHadrons()==0) LabelHF="light_"; + else LabelHF="other_"; + + // Fill("ChargedHiggsTopBottom/"+phasespace+category+"/ST_"+Sregion+LabelHF+label,systname, evt_ST ,e->weight()); + Fill("ChargedHiggsTopBottom/"+phasespace+category+"/HT_"+Sregion+LabelHF+label,systname, evt_HT ,e->weight()); + + // Fill("ChargedHiggsTopBottom/"+phasespace+category+"/ST_zoom_"+Sregion+LabelHF+label,systname, evt_ST ,e->weight()); + // Fill("ChargedHiggsTopBottom/"+phasespace+category+"/HT_zoom_"+Sregion+LabelHF+label,systname, evt_HT ,e->weight()); + + ///// + ///// + ///// + + if (doScikit) { + + for ( unsigned int iMass=1; iMass < 17; iMass++ ) { + + if(iMass==16 and ( do1lAnalysis or do2lAnalysis)) Fill("ChargedHiggsTopBottom/"+phasespace+category+"/bdt16"+"_"+Sregion+LabelHF+label,systname,scikit[iMass],e->weight()); + if(iMass==15 and ( do1lAnalysis or do2lAnalysis)) Fill("ChargedHiggsTopBottom/"+phasespace+category+"/bdt15"+"_"+Sregion+LabelHF+label,systname,scikit[iMass],e->weight()); + + if(iMass==14 and ( do1lAnalysis or do2lAnalysis)) Fill("ChargedHiggsTopBottom/"+phasespace+category+"/bdt14"+"_"+Sregion+LabelHF+label,systname,scikit[iMass],e->weight()); + if(iMass==13 and ( do1lAnalysis or do2lAnalysis)) Fill("ChargedHiggsTopBottom/"+phasespace+category+"/bdt13"+"_"+Sregion+LabelHF+label,systname,scikit[iMass],e->weight()); + if(iMass==12 and ( do1lAnalysis or do2lAnalysis)) Fill("ChargedHiggsTopBottom/"+phasespace+category+"/bdt12"+"_"+Sregion+LabelHF+label,systname,scikit[iMass],e->weight()); + if(iMass==11 and ( do1lAnalysis or do2lAnalysis)) Fill("ChargedHiggsTopBottom/"+phasespace+category+"/bdt11"+"_"+Sregion+LabelHF+label,systname,scikit[iMass],e->weight()); + + if(iMass==10 and ( do1lAnalysis or do2lAnalysis)) Fill("ChargedHiggsTopBottom/"+phasespace+category+"/bdt10"+"_"+Sregion+LabelHF+label,systname,scikit[iMass],e->weight()); + if(iMass==9 and ( do1lAnalysis or do2lAnalysis)) Fill("ChargedHiggsTopBottom/"+phasespace+category+"/bdt9"+"_"+Sregion+LabelHF+label,systname,scikit[iMass],e->weight()); + if(iMass==8 and ( do1lAnalysis or do2lAnalysis)) Fill("ChargedHiggsTopBottom/"+phasespace+category+"/bdt8"+"_"+Sregion+LabelHF+label,systname,scikit[iMass],e->weight()); + if(iMass==7 and ( do1lAnalysis or do2lAnalysis)) Fill("ChargedHiggsTopBottom/"+phasespace+category+"/bdt7"+"_"+Sregion+LabelHF+label,systname,scikit[iMass],e->weight()); + + if(iMass==6 and ( do1lAnalysis or do2lAnalysis)) Fill("ChargedHiggsTopBottom/"+phasespace+category+"/bdt6"+"_"+Sregion+LabelHF+label,systname,scikit[iMass],e->weight()); + if(iMass==5 and ( do1lAnalysis or do2lAnalysis)) Fill("ChargedHiggsTopBottom/"+phasespace+category+"/bdt5"+"_"+Sregion+LabelHF+label,systname,scikit[iMass],e->weight()); + if(iMass==4 and ( do1lAnalysis or do2lAnalysis)) Fill("ChargedHiggsTopBottom/"+phasespace+category+"/bdt4"+"_"+Sregion+LabelHF+label,systname,scikit[iMass],e->weight()); + if(iMass==3 and ( do1lAnalysis or do2lAnalysis)) Fill("ChargedHiggsTopBottom/"+phasespace+category+"/bdt3"+"_"+Sregion+LabelHF+label,systname,scikit[iMass],e->weight()); + if(iMass==2 and ( do1lAnalysis or do2lAnalysis)) Fill("ChargedHiggsTopBottom/"+phasespace+category+"/bdt2"+"_"+Sregion+LabelHF+label,systname,scikit[iMass],e->weight()); + if(iMass==1 and ( do1lAnalysis or do2lAnalysis)) Fill("ChargedHiggsTopBottom/"+phasespace+category+"/bdt1"+"_"+Sregion+LabelHF+label,systname,scikit[iMass],e->weight()); + } + } + + if ( doTMVA ) { + + for ( unsigned int iXML=1; iXML< 31; iXML++ ) { + //TEMPORARY + // doBDTSyst=false; + + if(doBDTSyst and iXML==1 and do1lAnalysis) Fill("ChargedHiggsTopBottom/"+phasespace+category+"/bdt1lh_"+Sregion+LabelHF+label,systname,bdt[iXML-1],e->weight()); + if(doBDTSyst and iXML==2 and do1lAnalysis) Fill("ChargedHiggsTopBottom/"+phasespace+category+"/bdt1lm_"+Sregion+LabelHF+label,systname,bdt[iXML-1],e->weight()); + if(doBDTSyst and iXML==3 and do1lAnalysis) Fill("ChargedHiggsTopBottom/"+phasespace+category+"/bdt1ll_"+Sregion+LabelHF+label,systname,bdt[iXML-1],e->weight()); + + // if(doBDTSyst and iXML==?? and do1lAnalysis) Fill("ChargedHiggsTopBottom/"+phasespace+category+"/bdt16"+"_"+Sregion+LabelHF+label,systname,bdt[iXML-1],e->weight()); + // if(doBDTSyst and iXML==?? and do1lAnalysis) Fill("ChargedHiggsTopBottom/"+phasespace+category+"/bdt15"+"_"+Sregion+LabelHF+label,systname,bdt[iXML-1],e->weight()); + if(doBDTSyst and iXML==4 and do1lAnalysis) Fill("ChargedHiggsTopBottom/"+phasespace+category+"/bdt14"+"_"+Sregion+LabelHF+label,systname,bdt[iXML-1],e->weight()); + if(doBDTSyst and iXML==5 and do1lAnalysis) Fill("ChargedHiggsTopBottom/"+phasespace+category+"/bdt13"+"_"+Sregion+LabelHF+label,systname,bdt[iXML-1],e->weight()); + if(doBDTSyst and iXML==6 and do1lAnalysis) Fill("ChargedHiggsTopBottom/"+phasespace+category+"/bdt12"+"_"+Sregion+LabelHF+label,systname,bdt[iXML-1],e->weight()); + if(doBDTSyst and iXML==7 and do1lAnalysis) Fill("ChargedHiggsTopBottom/"+phasespace+category+"/bdt11"+"_"+Sregion+LabelHF+label,systname,bdt[iXML-1],e->weight()); + + if(doBDTSyst and iXML==8 and do1lAnalysis) Fill("ChargedHiggsTopBottom/"+phasespace+category+"/bdt9"+"_"+Sregion+LabelHF+label,systname,bdt[iXML-1],e->weight()); + if(doBDTSyst and iXML==9 and do1lAnalysis) Fill("ChargedHiggsTopBottom/"+phasespace+category+"/bdt7"+"_"+Sregion+LabelHF+label,systname,bdt[iXML-1],e->weight()); + + if(doBDTSyst and iXML==10 and do1lAnalysis) Fill("ChargedHiggsTopBottom/"+phasespace+category+"/bdt6"+"_"+Sregion+LabelHF+label,systname,bdt[iXML-1],e->weight()); + if(doBDTSyst and iXML==11 and do1lAnalysis) Fill("ChargedHiggsTopBottom/"+phasespace+category+"/bdt5"+"_"+Sregion+LabelHF+label,systname,bdt[iXML-1],e->weight()); + if(doBDTSyst and iXML==12 and do1lAnalysis) Fill("ChargedHiggsTopBottom/"+phasespace+category+"/bdt4"+"_"+Sregion+LabelHF+label,systname,bdt[iXML-1],e->weight()); + if(doBDTSyst and iXML==13 and do1lAnalysis) Fill("ChargedHiggsTopBottom/"+phasespace+category+"/bdt3"+"_"+Sregion+LabelHF+label,systname,bdt[iXML-1],e->weight()); + if(doBDTSyst and iXML==14 and do1lAnalysis) Fill("ChargedHiggsTopBottom/"+phasespace+category+"/bdt2"+"_"+Sregion+LabelHF+label,systname,bdt[iXML-1],e->weight()); + if(doBDTSyst and iXML==15 and do1lAnalysis) Fill("ChargedHiggsTopBottom/"+phasespace+category+"/bdt1"+"_"+Sregion+LabelHF+label,systname,bdt[iXML-1],e->weight()); + + //// + + if(doBDTSyst and iXML==16 and do2lAnalysis) Fill("ChargedHiggsTopBottom/"+phasespace+category+"/bdt2lh_"+Sregion+LabelHF+label,systname,bdt[iXML-1],e->weight()); + if(doBDTSyst and iXML==17 and do2lAnalysis) Fill("ChargedHiggsTopBottom/"+phasespace+category+"/bdt2lm_"+Sregion+LabelHF+label,systname,bdt[iXML-1],e->weight()); + if(doBDTSyst and iXML==18 and do2lAnalysis) Fill("ChargedHiggsTopBottom/"+phasespace+category+"/bdt2ll_"+Sregion+LabelHF+label,systname,bdt[iXML-1],e->weight()); + + // if(doBDTSyst and iXML==?? and do2lAnalysis) Fill("ChargedHiggsTopBottom/"+phasespace+category+"/bdt16"+"_"+Sregion+LabelHF+label,systname,bdt[iXML-1],e->weight()); + // if(doBDTSyst and iXML==?? and do2lAnalysis) Fill("ChargedHiggsTopBottom/"+phasespace+category+"/bdt15"+"_"+Sregion+LabelHF+label,systname,bdt[iXML-1],e->weight()); + if(doBDTSyst and iXML==19 and do2lAnalysis) Fill("ChargedHiggsTopBottom/"+phasespace+category+"/bdt14"+"_"+Sregion+LabelHF+label,systname,bdt[iXML-1],e->weight()); + if(doBDTSyst and iXML==20 and do2lAnalysis) Fill("ChargedHiggsTopBottom/"+phasespace+category+"/bdt13"+"_"+Sregion+LabelHF+label,systname,bdt[iXML-1],e->weight()); + if(doBDTSyst and iXML==21 and do2lAnalysis) Fill("ChargedHiggsTopBottom/"+phasespace+category+"/bdt12"+"_"+Sregion+LabelHF+label,systname,bdt[iXML-1],e->weight()); + if(doBDTSyst and iXML==22 and do2lAnalysis) Fill("ChargedHiggsTopBottom/"+phasespace+category+"/bdt11"+"_"+Sregion+LabelHF+label,systname,bdt[iXML-1],e->weight()); + + if(doBDTSyst and iXML==23 and do2lAnalysis) Fill("ChargedHiggsTopBottom/"+phasespace+category+"/bdt9"+"_"+Sregion+LabelHF+label,systname,bdt[iXML-1],e->weight()); + if(doBDTSyst and iXML==24 and do2lAnalysis) Fill("ChargedHiggsTopBottom/"+phasespace+category+"/bdt7"+"_"+Sregion+LabelHF+label,systname,bdt[iXML-1],e->weight()); + + if(doBDTSyst and iXML==25 and do2lAnalysis) Fill("ChargedHiggsTopBottom/"+phasespace+category+"/bdt6"+"_"+Sregion+LabelHF+label,systname,bdt[iXML-1],e->weight()); + if(doBDTSyst and iXML==26 and do2lAnalysis) Fill("ChargedHiggsTopBottom/"+phasespace+category+"/bdt5"+"_"+Sregion+LabelHF+label,systname,bdt[iXML-1],e->weight()); + if(doBDTSyst and iXML==27 and do2lAnalysis) Fill("ChargedHiggsTopBottom/"+phasespace+category+"/bdt4"+"_"+Sregion+LabelHF+label,systname,bdt[iXML-1],e->weight()); + if(doBDTSyst and iXML==28 and do2lAnalysis) Fill("ChargedHiggsTopBottom/"+phasespace+category+"/bdt3"+"_"+Sregion+LabelHF+label,systname,bdt[iXML-1],e->weight()); + if(doBDTSyst and iXML==29 and do2lAnalysis) Fill("ChargedHiggsTopBottom/"+phasespace+category+"/bdt2"+"_"+Sregion+LabelHF+label,systname,bdt[iXML-1],e->weight()); + if(doBDTSyst and iXML==30 and do2lAnalysis) Fill("ChargedHiggsTopBottom/"+phasespace+category+"/bdt1"+"_"+Sregion+LabelHF+label,systname,bdt[iXML-1],e->weight()); + + } + } + + // if(do2lAnalysis) Fill("ChargedHiggsTopBottom/"+phasespace+category+"/bdt37_"+Sregion+LabelHF+label,systname,bdt[36],e->weight()); + // if(do2lAnalysis) Fill("ChargedHiggsTopBottom/"+phasespace+category+"/bdt37_"+Sregion+LabelHF+label,systname,-1,e->weight()); + /* + if(do1lAnalysis) Fill("ChargedHiggsTopBottom/"+phasespace+category+"/bdt2D_1lh_"+Sregion+LabelHF+label,systname,binHigh_->GetCluster(bdt[12],bdt[13]),e->weight()); + if(do1lAnalysis) Fill("ChargedHiggsTopBottom/"+phasespace+category+"/bdt2D_1lm_"+Sregion+LabelHF+label,systname,binMedium_->GetCluster(bdt[14],bdt[15]),e->weight()); + if(do1lAnalysis) Fill("ChargedHiggsTopBottom/"+phasespace+category+"/bdt2D_1ll_"+Sregion+LabelHF+label,systname,binLow_->GetCluster(bdt[16],bdt[17]),e->weight()); + if(do2lAnalysis) Fill("ChargedHiggsTopBottom/"+phasespace+category+"/bdt2D_2lh_"+Sregion+LabelHF+label,systname,binHigh_->GetCluster(bdt[18],bdt[19]),e->weight()); + if(do2lAnalysis) Fill("ChargedHiggsTopBottom/"+phasespace+category+"/bdt2D_2lm_"+Sregion+LabelHF+label,systname,binMedium_->GetCluster(bdt[20],bdt[21]),e->weight()); + if(do2lAnalysis) Fill("ChargedHiggsTopBottom/"+phasespace+category+"/bdt2D_2ll_"+Sregion+LabelHF+label,systname,binLow_->GetCluster(bdt[22],bdt[23]),e->weight()); + */ + + if(doFinal) return; + + ///// + ///// + ///// + + /* + if(!(Sregion.find("SR")!=string::npos)) { + Fill("ChargedHiggsTopBottom/"+phasespace+category+"/NBjets_"+Sregion+LabelHF+label,systname, e->Bjets() ,e->weight()); + if(e->NcentralJets()>=3 && valid.size() != 0) Fill("ChargedHiggsTopBottom/"+phasespace+category+"/thirdBDiscr_"+Sregion+LabelHF+label,systname, valid[2].first ,e->weight()); + + if(e->Bjets()>1) Fill("ChargedHiggsTopBottom/"+phasespace+category+"/minDRbb_"+Sregion+LabelHF+label, systname, evt_minDRbb ,e->weight()); + if(e->Bjets()>1) Fill("ChargedHiggsTopBottom/"+phasespace+category+"/minDRbb_mass_"+Sregion+LabelHF+label, systname, evt_minDRbb_invMass ,e->weight()); + if(e->Bjets()>1) Fill("ChargedHiggsTopBottom/"+phasespace+category+"/DEtaMaxBB_"+Sregion+LabelHF+label,systname, evt_DEtaMaxBB ,e->weight()); + // if(e->NcentralJets()>1) Fill("ChargedHiggsTopBottom/"+phasespace+category+"/AvCSVPt_"+Sregion+LabelHF+label, systname, evt_AvCSVPt ,e->weight()); + } + */ + } + +} + void ChargedHiggsTopBottom::classifyHF(Event*e, string label, string category, string systname, string phasespace, string Sregion) { @@ -2906,6 +3094,8 @@ void ChargedHiggsTopBottom::classifyHF(Event*e, string label, string category, s || (label.find("TT_TuneCUETP8M2T4_13TeV-powheg-fsrup")!=string::npos) || (label.find("TT_TuneCUETP8M2T4_13TeV-powheg-isrdown")!=string::npos) || (label.find("TT_TuneCUETP8M2T4_13TeV-powheg-isrup")!=string::npos) + || (label.find("TT_hdampUP_TuneCUETP8M2T4_13TeV-powheg-pythia8")!=string::npos) + || (label.find("TT_hdampDOWN_TuneCUETP8M2T4_13TeV-powheg-pythia8")!=string::npos) || (label.find("TTJets")!=string::npos) ) { @@ -3066,7 +3256,7 @@ void ChargedHiggsTopBottom::classifyHF(Event*e, string label, string category, s void ChargedHiggsTopBottom::fillMoneyPlot(Event*e, string category, string systname,string SRlabel, string label) { Fill("ChargedHiggsTopBottom/Baseline"+category+"/HT_"+SRlabel+label,systname, evt_HT ,e->weight()); - Fill("ChargedHiggsTopBottom/Baseline"+category+"/ST_"+SRlabel+label,systname, evt_ST ,e->weight()); + // Fill("ChargedHiggsTopBottom/Baseline"+category+"/ST_"+SRlabel+label,systname, evt_ST ,e->weight()); if (doScikit) { @@ -3163,6 +3353,7 @@ void ChargedHiggsTopBottom::fillMoneyPlot(Event*e, string category, string systn } */ classifyHF(e, label, category, systname,"Baseline",SRlabel); + classifyZHF(e, label, category, systname,"Baseline",SRlabel); } @@ -3369,6 +3560,8 @@ int ChargedHiggsTopBottom::analyze(Event*e,string systname) bool muon=(it->IsMuon() and it->Pt()>LeadingLeptonPt_ and it->IsMedium() and it->MiniIsolation() < 0.1 and leadLep==NULL ); bool ele=(it->IsElectron() and fabs(it->Eta())<2.1 and it->Pt()>LeadingLeptonElePt_ and it->IsEleMvaTight() and it->MiniIsolation() < 0.1 and leadLep==NULL ); + if(do1lAnalysis) ele=(ele and fabs(it->Eta())<1.479); + if(doQCD and do1lAnalysis) { muon=(it->IsMuon() and it->Pt()>LeadingLeptonPt_ and it->IsMedium() and it->MiniIsolation() > 0.1 and it->MiniIsolation() < 0.6 and leadLep==NULL ); @@ -3943,13 +4136,13 @@ int ChargedHiggsTopBottom::analyze(Event*e,string systname) computeVar(e); - + // TEMPORARY NOW if (not e->IsRealData() and ((label.find("DYJetsToLL_M-50_HT") !=string::npos) or (label.find("WJetsToLNu_HT") !=string::npos) or (label.find("DYJetsToLL_M-5to50_HT") !=string::npos) ) ) { e->SetPtEtaSF("htRECO",evt_HT,0); e->ApplySF("htRECO"); - } + } if(doTMVA) ReadTmva(e); if(doScikit) ReadScikit(e); @@ -4030,16 +4223,19 @@ int ChargedHiggsTopBottom::analyze(Event*e,string systname) if(topCR) leptonPlot(e,label, category, systname,"topCR"); if(topCR) eventShapePlot(e, label, category, systname,"topCR"); if(topCR) classifyHF(e, label, category, systname,"topCR",""); + if(topCR) classifyZHF(e, label, category, systname,"topCR",""); if(topCRR4) jetPlot(e, label, category, systname,"topCRR4"); if(topCRR4) leptonPlot(e,label, category, systname,"topCRR4"); if(topCRR4) eventShapePlot(e, label, category, systname,"topCRR4"); if(topCRR4) classifyHF(e, label, category, systname,"topCRR4",""); + if(topCRR4) classifyZHF(e, label, category, systname,"topCRR4",""); if(topCRR5) jetPlot(e, label, category, systname,"topCRR5"); if(topCRR5) leptonPlot(e,label, category, systname,"topCRR5"); if(topCRR5) eventShapePlot(e, label, category, systname,"topCRR5"); if(topCRR5) classifyHF(e, label, category, systname,"topCRR5",""); + if(topCRR5) classifyZHF(e, label, category, systname,"topCRR5",""); ///// @@ -4047,16 +4243,19 @@ int ChargedHiggsTopBottom::analyze(Event*e,string systname) if(extraRadCR) leptonPlot(e, label, category, systname,"extraRadCR"); if(extraRadCR) eventShapePlot(e, label, category, systname,"extraRadCR"); if(extraRadCR) classifyHF(e, label, category, systname,"extraRadCR",""); + if(extraRadCR) classifyZHF(e, label, category, systname,"extraRadCR",""); if(extraRadCRR10 and doSplit) jetPlot(e, label, category, systname,"extraRadCRR10"); if(extraRadCRR10 and doSplit) leptonPlot(e, label, category, systname,"extraRadCRR10"); if(extraRadCRR10 and doSplit) eventShapePlot(e, label, category, systname,"extraRadCRR10"); if(extraRadCRR10 and doSplit) classifyHF(e, label, category, systname,"extraRadCRR10",""); + if(extraRadCRR10 and doSplit) classifyZHF(e, label, category, systname,"extraRadCRR10",""); if(extraRadCRR7 and doSplit) jetPlot(e, label, category, systname,"extraRadCRR7"); if(extraRadCRR7 and doSplit) leptonPlot(e, label, category, systname,"extraRadCRR7"); if(extraRadCRR7 and doSplit) eventShapePlot(e, label, category, systname,"extraRadCRR7"); if(extraRadCRR7 and doSplit) classifyHF(e, label, category, systname,"extraRadCRR7",""); + if(extraRadCRR7 and doSplit) classifyZHF(e, label, category, systname,"extraRadCRR7",""); ///// @@ -4064,6 +4263,7 @@ int ChargedHiggsTopBottom::analyze(Event*e,string systname) if(do1lAnalysis && charmCR) leptonPlot(e, label, category, systname,"charmCR"); if(do1lAnalysis && charmCR) eventShapePlot(e, label, category, systname,"charmCR"); if(do1lAnalysis && charmCR) classifyHF(e, label, category, systname,"charmCR",""); + if(do1lAnalysis && charmCR) classifyZHF(e, label, category, systname,"charmCR",""); //////// //// @@ -4076,20 +4276,21 @@ int ChargedHiggsTopBottom::analyze(Event*e,string systname) leptonPlot(e, label, category, systname,"Baseline"); eventShapePlot(e, label, category, systname,"Baseline"); classifyHF(e, label, category, systname,"Baseline",""); + classifyZHF(e, label, category, systname,"Baseline",""); - if( do1lAnalysis and e->Bjets()==2 and e->NcentralJets()>=5) fillMoneyPlot(e,category,systname,"SR13_",label); + // if( do1lAnalysis and e->Bjets()==2 and e->NcentralJets()>=5) fillMoneyPlot(e,category,systname,"SR13_",label); if( doSplit && do1lAnalysis and e->Bjets()==2 and e->NcentralJets()==5) fillMoneyPlot(e,category,systname,"SR1_",label); if( doSplit && do1lAnalysis and e->Bjets()==2 and e->NcentralJets()>5) fillMoneyPlot(e,category,systname,"SR3_",label); - if( do1lAnalysis and e->Bjets()>2 and e->NcentralJets()>=5) fillMoneyPlot(e,category,systname,"SR24_",label); + // if( do1lAnalysis and e->Bjets()>2 and e->NcentralJets()>=5) fillMoneyPlot(e,category,systname,"SR24_",label); if( doSplit && do1lAnalysis and e->Bjets()>2 and e->NcentralJets()==5) fillMoneyPlot(e,category,systname,"SR2_",label); if( doSplit && do1lAnalysis and e->Bjets()>2 and e->NcentralJets()>5) fillMoneyPlot(e,category,systname,"SR4_",label); - if( do2lAnalysis and e->Bjets()==2 and e->NcentralJets()>=3) fillMoneyPlot(e,category,systname,"SR13_",label); + // if( do2lAnalysis and e->Bjets()==2 and e->NcentralJets()>=3) fillMoneyPlot(e,category,systname,"SR13_",label); if( doSplit && do2lAnalysis and e->Bjets()==2 and e->NcentralJets()==3) fillMoneyPlot(e,category,systname,"SR1_",label); if( doSplit && do2lAnalysis and e->Bjets()==2 and e->NcentralJets()>3) fillMoneyPlot(e,category,systname,"SR3_",label); - if( do2lAnalysis and e->Bjets()>2 and e->NcentralJets()>=3) fillMoneyPlot(e,category,systname,"SR24_",label); + // if( do2lAnalysis and e->Bjets()>2 and e->NcentralJets()>=3) fillMoneyPlot(e,category,systname,"SR24_",label); if( doSplit && do2lAnalysis and e->Bjets()>2 and e->NcentralJets()==3) fillMoneyPlot(e,category,systname,"SR2_",label); if( doSplit && do2lAnalysis and e->Bjets()>2 and e->NcentralJets()>3) fillMoneyPlot(e,category,systname,"SR4_",label); From dc7e1f53144392b9c7f97972fff8939cef96fcf2 Mon Sep 17 00:00:00 2001 From: maria Date: Thu, 1 Nov 2018 12:18:51 +0100 Subject: [PATCH 50/60] updated configuration files --- aux/mcdb.2017.v23.txt | 32 +++++++---- dat/catalog/2017.v23/rares.dat | 7 --- dat/catalog/2017.v23/topbottom.dat | 29 +++++----- dat/catalog/2017.v23/ttISRFSR.dat | 18 ++++-- dat/catalog/2017.v23/vv.dat | 6 ++ dat/configTopBot_1l_v23.dat | 89 ++++++++++++++++++++++-------- dat/configTopBot_2l_v23.dat | 81 +++++++++++++++++++++------ dat/topBot.OnlyRares.dat | 22 ++------ dat/topBot.OnlyTTbar.dat | 9 ++- 9 files changed, 195 insertions(+), 98 deletions(-) diff --git a/aux/mcdb.2017.v23.txt b/aux/mcdb.2017.v23.txt index 2763e602..edaf8610 100644 --- a/aux/mcdb.2017.v23.txt +++ b/aux/mcdb.2017.v23.txt @@ -153,6 +153,15 @@ WWZ_TuneCUETP8M1_13TeV-amcatnlo-pythia8 /store/group/phys_higgs/HiggsExo/dalfons WZZ_TuneCUETP8M1_13TeV-amcatnlo-pythia8 /store/group/phys_higgs/HiggsExo/dalfonso/80x_MC_v2/v2.3/WZZ_TuneCUETP8M1_13TeV-amcatnlo-pythia8 13736.4203469 0.05565 ZZZ_TuneCUETP8M1_13TeV-amcatnlo-pythia8 /store/group/phys_higgs/HiggsExo/dalfonso/80x_MC_v2/v2.3/ZZZ_TuneCUETP8M1_13TeV-amcatnlo-pythia8 3499.44687032 0.01398 +## from AN 2015 168 +VHToNonbb_M125_13TeV_amcatnloFXFX_madspin_pythia8 /store/group/phys_higgs/HiggsExo/dalfonso/80x_MC_v2/v2.3/VHToNonbb_M125_13TeV_amcatnloFXFX_madspin_pythia8 5296350.95847 0.952 +WH_HToBB_WToLNu_M125_13TeV_amcatnloFXFX_madspin_pythia8 /store/group/phys_higgs/HiggsExo/dalfonso/80x_MC_v2/v2.3/WH_HToBB_WToLNu_M125_13TeV_amcatnloFXFX_madspin_pythia8 3149195.28072 0.0868 +ZH_HToBB_ZToLL_M125_13TeV_powheg_pythia8 /store/group/phys_higgs/HiggsExo/dalfonso/80x_MC_v2/v2.3/ZH_HToBB_ZToLL_M125_13TeV_powheg_pythia8 149117.202298 0.048 + +##tZq_ll_4f_13TeV-amcatnlo-pythia8 /store/user/ceballos/Nero/v2.2/tZq_ll_4f_13TeV-amcatnlo-pythia8 1101395.78678 0.0758 +##tZq_nunu_4f /store/user/jaeyserm/Nero/80X/tZq_nunu_4f_13TeV-amcatnlo-pythia8_TuneCUETP8M1/tZq_nunu_4f/170102_091325/0000 138419.494451 0.201032728607 + + ##### TTbar TTJets_TuneCUETP8M2T4_13TeV-amcatnloFXFX-pythia8 /store/group/phys_higgs/ceballos/Nero/v2.2/TTJets_TuneCUETP8M2T4_13TeV-amcatnloFXFX-pythia8 96178140602 831 @@ -171,6 +180,9 @@ TT_TuneCUETP8M2T4_13TeV-powheg-isrdown-pythia8 /eos/cms/store/group/phys_higgs/H TT_TuneCUETP8M2T4_13TeV-powheg-isrup-pythia8 /eos/cms/store/group/phys_higgs/HiggsExo/jaeyserm/80x_MC_v2/v2.3/TT_TuneCUETP8M2T4_13TeV-powheg-isrup-pythia8 156377655.0 831 SCALES 1.01978056813 0.97511726031 1.11530477041 1.14336727933 0.897553697689 0.880418261332 PDFS 1.02841279157 0.98992061419 0.98849773978 1.01866228945 1.05217421955 0.990546285632 1.00284226563 0.989524001982 0.99079555839 1.01546125415 1.02904569732 0.993334922742 0.985859224527 0.989111314946 0.982111912047 0.990344016217 0.966136959126 0.983842910527 1.00109569671 0.981237265354 1.00561075316 1.02920818778 0.97506277705 1.02174552478 1.0020958444 1.01184940239 0.963390176507 0.99333418363 0.98400450901 0.994147229592 1.01694840793 1.01919725788 1.01164791582 1.02711593358 0.962676287379 0.997785532497 0.980178407485 1.0038039974 1.01961096463 1.01137252163 1.00885118922 1.00665003699 1.02189457352 1.01039900345 1.01074791767 1.01365590442 0.996806894292 0.996180925655 0.991125074235 1.00441036099 1.00950136351 1.00961306875 1.00890469161 0.99343711317 1.00803002229 0.991751686654 0.990288585964 1.00901359788 0.986124922179 1.0073306671 1.00158633813 1.00098684668 1.00117829137 0.989607076438 0.990042844845 1.00948696927 0.960590169735 1.00168257387 1.00807025824 1.00318475568 1.01890769938 1.00441770586 1.01717604754 0.990181859606 0.999915624977 1.04130277951 1.0206243198 0.982875206846 1.00569781344 1.00643012302 1.00829677311 1.01446680626 0.978386134209 1.00118280344 0.999239441295 0.99701523124 0.987521409423 0.98892064347 0.97580064414 1.00947409933 1.00511759437 1.0076698213 0.988286664082 0.992425115141 0.981548802586 0.993539385479 0.996421915224 1.00521935352 0.978681788846 0.974027079729 +TT_hdampUP_TuneCUETP8M2T4_13TeV-powheg-pythia8 /eos/cms/store/group/phys_higgs/HiggsExo/jaeyserm/80x_MC_v2/v2.3/TT_hdampUP_TuneCUETP8M2T4_13TeV-powheg-pythia8 58582610 831 +TT_hdampDOWN_TuneCUETP8M2T4_13TeV-powheg-pythia8 /eos/cms/store/group/phys_higgs/HiggsExo/jaeyserm/80x_MC_v2/v2.3/TT_hdampDOWN_TuneCUETP8M2T4_13TeV-powheg-pythia8 58163976 831 + TT_TuneCUETP8M2T4down_13TeV-powheg-pythia8 /store/group/phys_higgs/HiggsExo/jaeyserm/80x_MC_v2/v2.3/TT_TuneCUETP8M2T4down_13TeV-powheg-pythia8 58338240.0 831 SCALES 1.01973435247 0.975158981271 1.11534031261 1.14335902913 0.897518524687 0.880429229531 PDFS 1.02839066683 0.98987441356 0.988472585109 1.01863437886 1.05214322894 0.990522132384 1.00282622046 0.989517557713 0.99076572902 1.01544255069 1.02901757546 0.993303677534 0.985781887369 0.989065220119 0.982045170037 0.990349501891 0.966051432347 0.983798879497 1.00108868719 0.981247034826 1.00559937953 1.02921942909 0.975047150237 1.02175545576 1.00207168525 1.01183086879 0.963320487935 0.993259583113 0.983990368102 0.994164787704 1.01695154832 1.01917346278 1.01162864435 1.0271392109 0.962639371542 0.997763250501 0.980160741323 1.00381030845 1.01960973891 1.01137271015 1.0088581162 1.00664072899 1.02189556853 1.01039819289 1.01075302543 1.01367892652 0.99675149597 0.996145967358 0.991114281745 1.00437376558 1.00949070098 1.00956172523 1.00891318933 0.993377460639 1.0080012598 0.991699023907 0.990274488481 1.00896457097 0.98612389576 1.00733563541 1.00159944861 1.00097937957 1.00113589106 0.989554589274 0.990005117944 1.00946449937 0.96057644961 1.00165733904 1.00801481184 1.00311812144 1.01889248979 1.00440148811 1.01713635034 0.99012040415 0.999876034854 1.04128744737 1.02062130277 0.982861835839 1.00569048576 1.00642923772 1.00828233611 1.01442303842 0.978385609544 1.00118338748 0.999169889955 0.997003096692 0.987503400277 0.988883297858 0.975756873779 1.00940985033 1.00505447472 1.00765955633 0.988260230803 0.992429239244 0.981455383259 0.993527877351 0.99642027127 1.00521118091 0.978626399126 0.973974233858 TT_TuneCUETP8M2T4up_13TeV-powheg-pythia8 /store/group/phys_higgs/HiggsExo/jaeyserm/80x_MC_v2/v2.3/TT_TuneCUETP8M2T4down_13TeV-powheg-pythia8 58338240.0 831 SCALES 1.01973435247 0.975158981271 1.11534031261 1.14335902913 0.897518524687 0.880429229531 PDFS 1.02839066683 0.98987441356 0.988472585109 1.01863437886 1.05214322894 0.990522132384 1.00282622046 0.989517557713 0.99076572902 1.01544255069 1.02901757546 0.993303677534 0.985781887369 0.989065220119 0.982045170037 0.990349501891 0.966051432347 0.983798879497 1.00108868719 0.981247034826 1.00559937953 1.02921942909 0.975047150237 1.02175545576 1.00207168525 1.01183086879 0.963320487935 0.993259583113 0.983990368102 0.994164787704 1.01695154832 1.01917346278 1.01162864435 1.0271392109 0.962639371542 0.997763250501 0.980160741323 1.00381030845 1.01960973891 1.01137271015 1.0088581162 1.00664072899 1.02189556853 1.01039819289 1.01075302543 1.01367892652 0.99675149597 0.996145967358 0.991114281745 1.00437376558 1.00949070098 1.00956172523 1.00891318933 0.993377460639 1.0080012598 0.991699023907 0.990274488481 1.00896457097 0.98612389576 1.00733563541 1.00159944861 1.00097937957 1.00113589106 0.989554589274 0.990005117944 1.00946449937 0.96057644961 1.00165733904 1.00801481184 1.00311812144 1.01889248979 1.00440148811 1.01713635034 0.99012040415 0.999876034854 1.04128744737 1.02062130277 0.982861835839 1.00569048576 1.00642923772 1.00828233611 1.01442303842 0.978385609544 1.00118338748 0.999169889955 0.997003096692 0.987503400277 0.988883297858 0.975756873779 1.00940985033 1.00505447472 1.00765955633 0.988260230803 0.992429239244 0.981455383259 0.993527877351 0.99642027127 1.00521118091 0.978626399126 0.973974233858 @@ -214,19 +226,17 @@ ttHToNonbb_M125_TuneCUETP8M2_ttHtranche3_13TeV-powheg-pythia8 /store/group/phys_ ttHTobb_M125_TuneCUETP8M2_ttHtranche3_13TeV-powheg-pythia8 /store/group/phys_higgs/HiggsExo/dalfonso/80x_MC_v2/v2.3/ttHTobb_M125_TuneCUETP8M2_ttHtranche3_13TeV-powheg-pythia8 2164705.74748 0.2934 SCALES 1.01954365153 0.974279188509 1.07086575477 1.10238616813 0.953832044991 0.943209192605 PDFS 1.01362048736 0.979894265762 0.98133646663 1.0109284716 1.02023689205 0.994275233905 1.00387571667 0.987938730709 0.983722206427 1.00152454542 1.01525093415 0.992224779884 0.974307536178 0.970057347203 0.971324271796 0.994550585857 0.941947354635 0.976113623039 1.01062990837 0.954948408927 1.00588015169 1.03303525807 0.989262471003 1.02265247844 1.00297556311 1.00713481081 0.943439573041 0.972667821312 0.977099331231 1.00308706505 1.01612757193 1.00506029952 1.01058256073 1.03738955141 0.952608181701 1.004453681 0.9798111748 1.00912232003 1.01732106892 1.01677873649 1.01756432967 1.0106966269 1.0285072497 1.01163048972 1.01628815701 1.03019093751 0.984906000623 0.986105150575 0.988337208153 0.999659994012 1.01097386354 0.999878270647 1.01642386567 0.977059344537 1.00186051056 0.975478367446 1.001647067 1.0015078541 0.990323567909 1.00864326178 1.00736020094 1.00575245182 0.99356869977 0.974030057582 0.98238628756 1.00478254743 0.967881931453 0.991828886742 0.987088004804 0.98609200371 1.02893001475 1.00654743668 0.990952815334 0.974957195048 0.993418344476 1.03523016346 1.02507348544 0.987330455386 1.00648730235 1.00654860669 1.00918149913 1.00224348353 0.982826293552 1.00093913576 0.981283730891 0.990462748774 0.981987661097 0.981123147635 0.974907600281 0.994635187295 0.98887801027 1.0112855692 0.981997803106 1.00029427203 0.961645189156 0.99510900882 0.994768014858 1.01879741125 0.973474009838 0.966433947165 ## from AN 2017 115 v2 -TTZH_TuneCUETP8M2T4_13TeV-madgraph-pythia8 /store/group/phys_higgs/HiggsExo/dalfonso/80x_MC_v2/v2.3/TTZH_TuneCUETP8M2T4_13TeV-madgraph-pythia8 195710.0 0.001535 -TTWW_TuneCUETP8M2T4_13TeV-madgraph-pythia8 /store/group/phys_higgs/HiggsExo/dalfonso/80x_MC_v2/v2.3/TTWW_TuneCUETP8M2T4_13TeV-madgraph-pythia8 197384.0 0.01150 -TTWH_TuneCUETP8M2T4_13TeV-madgraph-pythia8 /store/group/phys_higgs/HiggsExo/dalfonso/80x_MC_v2/v2.3/TTWH_TuneCUETP8M2T4_13TeV-madgraph-pythia8 200000.0 0.001582 -TTWZ_TuneCUETP8M2T4_13TeV-madgraph-pythia8 /store/group/phys_higgs/HiggsExo/dalfonso/80x_MC_v2/v2.3/TTWZ_TuneCUETP8M2T4_13TeV-madgraph-pythia8 198284.0 0.003884 -TTZZ_TuneCUETP8M2T4_13TeV-madgraph-pythia8 /store/group/phys_higgs/HiggsExo/dalfonso/80x_MC_v2/v2.3/TTZZ_TuneCUETP8M2T4_13TeV-madgraph-pythia8 197426.0 0.001982 +TTZH_TuneCUETP8M2T4_13TeV-madgraph-pythia8 /store/group/phys_higgs/HiggsExo/dalfonso/80x_MC_v2/v2.3/TTZH_TuneCUETP8M2T4_13TeV-madgraph-pythia8 195710.0 0.001535 SCALES 371665.980082 312932.871358 405358.915735 440089.784305 284510.104014 260060.580393 PDFS 342287.462647 356450.003196 374306.35465 344140.025788 336731.532163 358936.199112 365107.097437 317099.081449 353155.603744 341738.893544 382751.775699 367632.884994 368233.730335 357622.306803 298966.955354 346406.82327 367682.149004 330538.813985 298663.121484 350973.050094 344924.16482 338153.696317 352172.115773 359290.27232 356739.36309 298881.230517 321186.13038 333058.521233 318047.125632 354712.312505 346012.561183 351194.327793 324929.178434 340558.890101 361650.290556 360929.014509 359110.272122 367594.893447 356462.53175 342503.653663 343186.543472 357290.243247 345487.12024 343593.955636 354077.108465 335335.131511 308293.834517 352948.123599 334147.703671 361798.24519 293680.679858 342201.117827 354911.136201 343146.884844 267779.108118 349659.501585 274748.390452 362950.379174 329141.756325 345745.270552 353545.538782 346329.022654 345680.151384 333550.528609 348904.866164 351163.776769 341897.329999 291662.296568 337385.130648 349467.887319 354448.592645 347678.886435 331846.117756 329461.303765 349804.565221 345411.490572 348338.936307 345877.831906 362095.027193 347339.635245 348926.551956 351067.106587 340430.543729 350086.75842 345958.502927 340932.912965 346271.90021 317656.084646 312823.337561 348464.980482 335640.728366 357362.694546 357943.446948 366344.704924 328398.428356 359709.087114 343581.355663 357823.099736 329527.090959 346339.107722 + +TTWW_TuneCUETP8M2T4_13TeV-madgraph-pythia8 /store/group/phys_higgs/HiggsExo/dalfonso/80x_MC_v2/v2.3/TTWW_TuneCUETP8M2T4_13TeV-madgraph-pythia8 197384.0 0.01150 SCALES 60148.0744314 50650.3437106 65937.3225167 71600.6704177 45760.705841 41845.1581121 PDFS 55393.0849262 57496.8139642 60564.6263879 55979.1595152 54732.0748709 58096.1173872 58840.9681785 51383.5509845 56714.2529869 55052.7228729 61733.9871685 59663.689051 59097.1808589 57672.9076568 48399.7685691 56129.1116268 59535.5134812 53648.3999409 48527.50628 57187.8814712 55545.7200482 54458.8702217 56841.3216117 58089.5146978 57279.1065865 48546.6672736 51802.5084558 53821.4369077 51396.167931 57399.2967032 56017.437468 56767.7682238 52785.9897928 55085.0153717 58421.5225244 58081.2210142 58178.4409464 59539.3514037 57568.8980167 55844.6294648 55456.7070656 57721.3119099 55964.3105035 55474.0419754 57035.6092063 54400.3174623 50036.9598322 57200.6445611 54700.3735373 58343.146184 47813.0724936 55480.6916495 57242.0815701 55586.0408653 43629.717505 56536.2578284 44540.0132284 58224.4895703 53292.1396379 56091.8371803 57210.4455131 55773.1397867 55727.3048475 53876.2361145 56233.0131912 56893.3668802 55369.6045673 47588.0825391 54542.4062295 56197.3233645 57640.204793 56029.0190904 53718.4347534 53514.3751656 56896.3102541 56009.6183127 56983.9172751 56470.7511856 58493.9828112 56276.4152182 56252.4567099 56599.6694286 55349.0365506 56189.2196526 56052.6573358 55346.9058866 56327.7832246 51393.0676151 50885.5429811 56305.4442595 54263.0135755 57829.2951874 57713.8421238 59222.0172502 53086.7491954 57920.7947944 55475.8270176 57866.0123114 53300.2287819 56126.9072465 + +TTWH_TuneCUETP8M2T4_13TeV-madgraph-pythia8 /store/group/phys_higgs/HiggsExo/dalfonso/80x_MC_v2/v2.3/TTWH_TuneCUETP8M2T4_13TeV-madgraph-pythia8 200000.0 0.001582 SCALES 455929.473392 414122.250298 513051.196161 537993.727758 363044.285036 345793.892693 PDFS 434823.638371 423741.097854 437385.753883 453921.814799 437057.271664 438183.478976 450500.889144 422770.787992 407958.819801 452872.721583 437692.374493 474207.744251 434267.509668 460955.202157 408949.677679 433086.121968 435815.554384 432947.73106 414176.527438 494417.863918 415621.687855 446095.460792 423608.296331 461632.01583 415487.995867 414422.359181 428508.850004 433935.438488 415740.761345 454624.909811 432858.622951 443509.831462 428788.553484 434326.993302 430978.86208 426336.917644 420826.22858 446314.918663 419660.645726 437707.736314 441166.800985 432551.820795 434215.322786 451057.265202 435019.181669 446024.236164 419456.786412 403065.591995 435452.122267 412228.031158 389668.742851 432862.673865 403418.543357 453334.799792 382822.386242 433133.163488 392773.641315 436343.382768 407523.62049 456721.162966 439834.562394 456637.213837 430134.037261 451892.740034 444636.843496 446393.959754 438863.707693 430940.916206 423923.137588 448624.716076 430670.257655 454712.201334 465123.550771 427124.38702 418634.557616 459030.739403 515397.335883 440089.118715 418965.297614 437013.414192 440770.066423 443150.918365 435137.279505 435969.149982 435428.763894 438744.643625 452239.046761 441516.482686 453604.028513 432455.25572 405334.824586 419214.361097 426394.753601 445572.102187 440513.134988 435578.981731 442466.103117 435054.638069 435309.769186 455980.736711 + +TTWZ_TuneCUETP8M2T4_13TeV-madgraph-pythia8 /store/group/phys_higgs/HiggsExo/dalfonso/80x_MC_v2/v2.3/TTWZ_TuneCUETP8M2T4_13TeV-madgraph-pythia8 198284.0 0.003884 SCALES 153330.052742 137089.109184 172607.756802 182373.699288 120024.618257 113386.895494 PDFS 145133.794008 140693.718095 146059.059282 151852.867724 146386.675119 145927.727585 151091.107733 141455.636076 135419.858134 151514.389721 146153.626786 158769.224476 144806.43834 154080.241302 136722.782447 144037.835826 145140.752276 143459.709914 139249.423966 166717.397168 137664.360919 149579.792092 140768.821027 154319.346564 138214.045875 138705.126627 143271.77533 144138.512996 138652.490169 151399.871631 144732.814951 148377.083279 143113.475568 144974.555368 142692.348101 142380.432445 140038.65025 149495.600426 139870.653037 145914.182026 147929.535573 144470.13212 144727.863379 151602.168734 144916.361609 149112.941484 140673.989327 132977.46259 145414.735884 136986.968737 130231.441925 144298.702232 133060.844685 151436.890292 128214.994043 145098.56635 131284.461997 145284.397514 136080.537474 153016.161129 146615.950541 153821.995923 143886.067101 151565.079221 148946.487465 149176.874572 146150.70386 144740.957081 141949.628574 150267.330057 144195.829501 151954.068505 155502.684061 142210.161968 139530.124257 153822.835917 173116.936708 146847.291468 138931.421851 144948.981004 147139.295984 148154.171632 145190.046143 145447.183655 144932.506125 146212.866397 151886.481983 147646.681191 149927.702237 143743.35306 134279.278552 139475.63603 141628.565304 148793.502899 147052.626438 145374.109911 147741.415887 145532.42157 145208.126131 152857.181823 + +TTZZ_TuneCUETP8M2T4_13TeV-madgraph-pythia8 /store/group/phys_higgs/HiggsExo/dalfonso/80x_MC_v2/v2.3/TTZZ_TuneCUETP8M2T4_13TeV-madgraph-pythia8 197426.0 0.001982 SCALES 295685.280343 253415.011074 326604.314898 351757.549252 226986.302248 209520.998299 PDFS 274551.139749 280540.127115 293557.277636 278891.10256 271065.979216 282532.64255 291932.599869 258370.320582 275547.185353 280424.878811 297200.870861 295262.379106 290342.915659 289051.596261 246176.800755 275431.16271 288005.731097 266147.98511 245550.981864 289645.547289 269619.682569 276013.98792 277896.956043 289804.367956 280709.800678 246234.299727 262513.248052 268561.024673 258681.958442 285767.238286 275309.89053 281618.93096 263575.987796 274254.258721 282768.997815 283869.512331 280085.791144 291207.378343 279260.265839 274154.147479 276846.986034 282133.13551 276468.344052 279898.875569 281936.720362 272224.929361 252550.114506 271898.871687 266439.308211 279751.604963 237394.385633 273006.87542 274170.362924 278325.092877 222186.093572 278386.81937 227652.290669 287994.806608 262290.211888 281216.264037 281592.801069 283185.585861 275864.784206 274152.006815 280501.529225 281969.956636 274581.07341 242382.818122 269835.989238 282989.266723 279891.120184 282073.169493 274974.266933 264862.836216 273819.42428 281192.423818 289376.40508 275683.503339 281159.531634 276391.381057 279645.43743 281783.520888 273353.307081 279757.211167 276594.35131 273909.338866 279392.587229 261508.32136 260304.220922 278811.815222 262802.801026 279151.895561 282426.553322 290538.542504 267703.360941 286020.926275 277253.348112 282680.052708 266556.295429 280134.885911 -## from AN 2015 168 -VHToNonbb_M125_13TeV_amcatnloFXFX_madspin_pythia8 /store/group/phys_higgs/HiggsExo/dalfonso/80x_MC_v2/v2.3/VHToNonbb_M125_13TeV_amcatnloFXFX_madspin_pythia8 5296350.95847 0.952 -WH_HToBB_WToLNu_M125_13TeV_amcatnloFXFX_madspin_pythia8 /store/group/phys_higgs/HiggsExo/dalfonso/80x_MC_v2/v2.3/WH_HToBB_WToLNu_M125_13TeV_amcatnloFXFX_madspin_pythia8 3149195.28072 0.0868 -ZH_HToBB_ZToLL_M125_13TeV_powheg_pythia8 /store/group/phys_higgs/HiggsExo/dalfonso/80x_MC_v2/v2.3/ZH_HToBB_ZToLL_M125_13TeV_powheg_pythia8 149117.202298 0.048 -##tZq_ll_4f_13TeV-amcatnlo-pythia8 /store/user/ceballos/Nero/v2.2/tZq_ll_4f_13TeV-amcatnlo-pythia8 1101395.78678 0.0758 -##tZq_nunu_4f /store/user/jaeyserm/Nero/80X/tZq_nunu_4f_13TeV-amcatnlo-pythia8_TuneCUETP8M1/tZq_nunu_4f/170102_091325/0000 138419.494451 0.201032728607 ##### QCD diff --git a/dat/catalog/2017.v23/rares.dat b/dat/catalog/2017.v23/rares.dat index fcb67717..698914e8 100644 --- a/dat/catalog/2017.v23/rares.dat +++ b/dat/catalog/2017.v23/rares.dat @@ -2,13 +2,6 @@ sub=dalfonsoHiggs|/store/group/phys_higgs/HiggsExo/dalfonso/80x_MC_v2/v2.3/ #### ---> tZq_nunu_4f, TTHH, TTTW, TTTJ -##addfiles=%(ceballosUser)s/tZq_ll_4f_13TeV-amcatnlo-pythia8 -##addfiles=%(ceballosHig)s/tZq_nunu_4f_13TeV-amcatnlo-pythia8_TuneCUETP8M1 - -addfiles=%(dalfonsoHiggs)s/VHToNonbb_M125_13TeV_amcatnloFXFX_madspin_pythia8 -addfiles=%(dalfonsoHiggs)s/WH_HToBB_WToLNu_M125_13TeV_amcatnloFXFX_madspin_pythia8 -addfiles=%(dalfonsoHiggs)s/ZH_HToBB_ZToLL_M125_13TeV_powheg_pythia8 - addfiles=%(dalfonsoHiggs)s/TTTT_TuneCUETP8M2T4_13TeV-amcatnlo-pythia8 addfiles=%(dalfonsoHiggs)s/TTZToQQ_TuneCUETP8M1_13TeV-amcatnlo-pythia8 diff --git a/dat/catalog/2017.v23/topbottom.dat b/dat/catalog/2017.v23/topbottom.dat index a9592568..2722d29e 100644 --- a/dat/catalog/2017.v23/topbottom.dat +++ b/dat/catalog/2017.v23/topbottom.dat @@ -1,19 +1,20 @@ sub=janHiggs|/store/group/phys_higgs/HiggsExo/jaeyserm/80x_MC_v2/v2.3/ -###addfiles=%(janHiggs)s/ChargedHiggs_HplusTB_HplusToTB_M-180_13TeV_amcatnlo_pythia8 -###addfiles=%(janHiggs)s/ChargedHiggs_HplusTB_HplusToTB_M-200_13TeV_amcatnlo_pythia8 -###addfiles=%(janHiggs)s/ChargedHiggs_HplusTB_HplusToTB_M-220_13TeV_amcatnlo_pythia8 -###addfiles=%(janHiggs)s/ChargedHiggs_HplusTB_HplusToTB_M-250_13TeV_amcatnlo_pythia8 -###addfiles=%(janHiggs)s/ChargedHiggs_HplusTB_HplusToTB_M-300_13TeV_amcatnlo_pythia8 -###addfiles=%(janHiggs)s/ChargedHiggs_HplusTB_HplusToTB_M-350_13TeV_amcatnlo_pythia8 -###addfiles=%(janHiggs)s/ChargedHiggs_HplusTB_HplusToTB_M-400_13TeV_amcatnlo_pythia8 -###addfiles=%(janHiggs)s/ChargedHiggs_HplusTB_HplusToTB_M-500_13TeV_amcatnlo_pythia8 -###addfiles=%(janHiggs)s/ChargedHiggs_HplusTB_HplusToTB_M-800_13TeV_amcatnlo_pythia8 -###addfiles=%(janHiggs)s/ChargedHiggs_HplusTB_HplusToTB_M-1000_13TeV_amcatnlo_pythia8 -###addfiles=%(janHiggs)s/ChargedHiggs_HplusTB_HplusToTB_M-1500_13TeV_amcatnlo_pythia8 -###addfiles=%(janHiggs)s/ChargedHiggs_HplusTB_HplusToTB_M-2000_13TeV_amcatnlo_pythia8 -###addfiles=%(janHiggs)s/ChargedHiggs_HplusTB_HplusToTB_M-2500_13TeV_amcatnlo_pythia8 -###addfiles=%(janHiggs)s/ChargedHiggs_HplusTB_HplusToTB_M-3000_13TeV_amcatnlo_pythia8 +addfiles=%(janHiggs)s/ChargedHiggs_HplusTB_HplusToTB_M-180_13TeV_amcatnlo_pythia8 +addfiles=%(janHiggs)s/ChargedHiggs_HplusTB_HplusToTB_M-200_13TeV_amcatnlo_pythia8 +addfiles=%(janHiggs)s/ChargedHiggs_HplusTB_HplusToTB_M-220_13TeV_amcatnlo_pythia8 +addfiles=%(janHiggs)s/ChargedHiggs_HplusTB_HplusToTB_M-250_13TeV_amcatnlo_pythia8 +addfiles=%(janHiggs)s/ChargedHiggs_HplusTB_HplusToTB_M-300_13TeV_amcatnlo_pythia8 +addfiles=%(janHiggs)s/ChargedHiggs_HplusTB_HplusToTB_M-350_13TeV_amcatnlo_pythia8 +addfiles=%(janHiggs)s/ChargedHiggs_HplusTB_HplusToTB_M-400_13TeV_amcatnlo_pythia8 +addfiles=%(janHiggs)s/ChargedHiggs_HplusTB_HplusToTB_M-500_13TeV_amcatnlo_pythia8 +addfiles=%(janHiggs)s/ChargedHiggs_HplusTB_HplusToTB_M-650_13TeV_amcatnlo_pythia8 +addfiles=%(janHiggs)s/ChargedHiggs_HplusTB_HplusToTB_M-800_13TeV_amcatnlo_pythia8 +addfiles=%(janHiggs)s/ChargedHiggs_HplusTB_HplusToTB_M-1000_13TeV_amcatnlo_pythia8 +addfiles=%(janHiggs)s/ChargedHiggs_HplusTB_HplusToTB_M-1500_13TeV_amcatnlo_pythia8 +addfiles=%(janHiggs)s/ChargedHiggs_HplusTB_HplusToTB_M-2000_13TeV_amcatnlo_pythia8 +addfiles=%(janHiggs)s/ChargedHiggs_HplusTB_HplusToTB_M-2500_13TeV_amcatnlo_pythia8 +addfiles=%(janHiggs)s/ChargedHiggs_HplusTB_HplusToTB_M-3000_13TeV_amcatnlo_pythia8 ##addfiles=%(janHiggs)s/ChargedHiggs_HplusTB_HplusToTB_M-5000_13TeV_amcatnlo_pythia8 ##addfiles=%(janHiggs)s/ChargedHiggs_HplusTB_HplusToTB_M-7000_13TeV_amcatnlo_pythia8 diff --git a/dat/catalog/2017.v23/ttISRFSR.dat b/dat/catalog/2017.v23/ttISRFSR.dat index 5f52983a..842c042c 100644 --- a/dat/catalog/2017.v23/ttISRFSR.dat +++ b/dat/catalog/2017.v23/ttISRFSR.dat @@ -1,11 +1,17 @@ -sub=dalfonsoHiggs|/store/group/phys_higgs/HiggsExo/dalfonso/80x_MC_v2/v2.3/ +sub=janHiggs|/store/group/phys_higgs/HiggsExo/jaeyserm/80x_MC_v2/v2.3/ -addfiles=%(dalfonsoHiggs)s/TT_TuneCUETP8M2T4_13TeV-powheg-fsrdown-pythia8 -addfiles=%(dalfonsoHiggs)s/TT_TuneCUETP8M2T4_13TeV-powheg-isrdown-pythia8 -addfiles=%(dalfonsoHiggs)s/TT_TuneCUETP8M2T4_13TeV-powheg-fsrup-pythia8 -addfiles=%(dalfonsoHiggs)s/TT_TuneCUETP8M2T4_13TeV-powheg-isrup-pythia8 +addfiles=%(janHiggs)s/TT_TuneCUETP8M2T4up_13TeV-powheg-pythia8 +addfiles=%(janHiggs)s/TT_TuneCUETP8M2T4down_13TeV-powheg-pythia8 -addfiles=%(dalfonsoHiggs)s/TTJets_TuneCUETP8M2T4_13TeV-amcatnloFXFX-pythia8 +#addfiles=%(janHiggs)s/TT_TuneCUETP8M2T4_13TeV-powheg-fsrdown-pythia8 +#addfiles=%(janHiggs)s/TT_TuneCUETP8M2T4_13TeV-powheg-isrdown-pythia8 +#addfiles=%(janHiggs)s/TT_TuneCUETP8M2T4_13TeV-powheg-fsrup-pythia8 +#addfiles=%(janHiggs)s/TT_TuneCUETP8M2T4_13TeV-powheg-isrup-pythia8 + +#addfiles=%(janHiggs)s/TT_hdampUP_TuneCUETP8M2T4_13TeV-powheg-pythia8 +#addfiles=%(janHiggs)s/TT_hdampDOWN_TuneCUETP8M2T4_13TeV-powheg-pythia8 + +#addfiles=%(janHiggs)s/TTJets_TuneCUETP8M2T4_13TeV-amcatnloFXFX-pythia8 ##addfiles=%(dalfonsoHig)s/TTTo2L2Nu_ttbbFilter_TuneCUETP8M2_ttHtranche3_13TeV-powheg-pythia8 ##addfiles=%(dalfonsoHig)s/TTToSemilepton_ttbbFilter_TuneCUETP8M2_ttHtranche3_13TeV-powheg-pythia8 diff --git a/dat/catalog/2017.v23/vv.dat b/dat/catalog/2017.v23/vv.dat index 8070158d..54b471c9 100644 --- a/dat/catalog/2017.v23/vv.dat +++ b/dat/catalog/2017.v23/vv.dat @@ -18,3 +18,9 @@ addfiles=%(dalfonsoHiggs)s/WWZ_TuneCUETP8M1_13TeV-amcatnlo-pythia8 addfiles=%(dalfonsoHiggs)s/WZZ_TuneCUETP8M1_13TeV-amcatnlo-pythia8 addfiles=%(dalfonsoHiggs)s/ZZZ_TuneCUETP8M1_13TeV-amcatnlo-pythia8 +##addfiles=%(ceballosUser)s/tZq_ll_4f_13TeV-amcatnlo-pythia8 +##addfiles=%(ceballosHig)s/tZq_nunu_4f_13TeV-amcatnlo-pythia8_TuneCUETP8M1 + +addfiles=%(dalfonsoHiggs)s/VHToNonbb_M125_13TeV_amcatnloFXFX_madspin_pythia8 +addfiles=%(dalfonsoHiggs)s/WH_HToBB_WToLNu_M125_13TeV_amcatnloFXFX_madspin_pythia8 +addfiles=%(dalfonsoHiggs)s/ZH_HToBB_ZToLL_M125_13TeV_powheg_pythia8 diff --git a/dat/configTopBot_1l_v23.dat b/dat/configTopBot_1l_v23.dat index 5304fb14..8a5ce29f 100644 --- a/dat/configTopBot_1l_v23.dat +++ b/dat/configTopBot_1l_v23.dat @@ -11,15 +11,16 @@ MCDB=aux/mcdb.2017.v23.txt Files= include=dat/catalog/2017.v23/tt.dat -#include=dat/catalog/2017.v23/ttlep.dat +include=dat/catalog/2017.v23/ttlep.dat include=dat/catalog/2017.v23/st.dat include=dat/catalog/2017.v23/dy_ht.dat +include=dat/catalog/2017.v23/dy_lowMass_ht.py include=dat/catalog/2017.v23/wjets_ht.dat include=dat/catalog/2017.v23/vv.dat include=dat/catalog/2017.v23/rares.dat -#include=dat/catalog/2017.v23/ttISRFSR.dat +include=dat/catalog/2017.v23/ttISRFSR.dat # signal -#include=dat/catalog/2017.v23/topbottom.dat +include=dat/catalog/2017.v23/topbottom.dat include=dat/catalog/2017.v23/topbottom_ext.dat # data include=dat/catalog/2017.moriond/singleElecton.dat @@ -33,42 +34,81 @@ pileup=aux/pileup.2017.BCDEFGH.root #____________________ SPECIAL SETTINGS _____________________________ Files= + +#__________________________________________________________________ +#____________________ TTBAR (nominal + UE) _________________ +# + #include=dat/catalog/2017.v23/ttISRFSR.dat -#include=dat/catalog/2017.v23/ttlep.dat +#include=dat/topBot.OnlyTTbar.dat +#Smear=NONE,@SmearUncluster(),@SmearPu,JER,*[1!10]SmearJesAndCSV(%%d),@SmearScales("ScaleR"!1!0),@SmearScales("ScaleF"!0!1),@SmearScales("ScaleRF"!1!1) +#Smear=NONE -include=dat/catalog/2017.v23/tt.dat -include=dat/topBot.OnlyTTbar.dat -##Smear=NONE,@SmearUncluster(),@SmearPu,JER,*[1!10]SmearJesAndCSV(%%d),@SmearSF("TOPRW"!"topreweight") -##Smear=@SmearScales("ScaleR"!1!0),@SmearScales("ScaleF"!0!1),@SmearScales("ScaleRF"!1!1) -##Smear=*[0!50]SmearPdfs(%%d) +#include=dat/catalog/2017.v23/tt.dat +#include=dat/topBot.OnlyTTbar.dat +#Smear=NONE,@SmearUncluster(),@SmearPu,JER,*[1!10]SmearJesAndCSV(%%d),@SmearScales("ScaleR"!1!0),@SmearScales("ScaleF"!0!1),@SmearScales("ScaleRF"!1!1) +#Smear=NONE + +#__________________________________________________________________ +#____________________ SIGNAL _____________________________ +# +## All #include=dat/catalog/2017.v23/topbottom.dat -#include=dat/catalog/2017.v23/topbottom_ext.dat #include=dat/topBot.OnlyChTB.dat -#Smear=NONE,@SmearUncluster(),@SmearPu,JER,*[1!10]SmearJesAndCSV(%%d) -#Smear=@SmearScales("ScaleR"!1!0),@SmearScales("ScaleF"!0!1),@SmearScales("ScaleRF"!1!1) +#Smear=NONE +#Smear=NONE,@SmearUncluster(),@SmearPu,JER,*[1!10]SmearJesAndCSV(%%d),@SmearScales("ScaleR"!1!0),@SmearScales("ScaleF"!0!1),@SmearScales("ScaleRF"!1!1) + +#__________________________________________________________________ +#____________________ ST _____________________________ +# #include=dat/catalog/2017.v23/st.dat #include=dat/topBot.OnlyTopMinor.dat -##Smear=NONE,@SmearUncluster(),@SmearPu,JER,*[1!10]SmearJesAndCSV(%%d) +#Smear=NONE +#Smear=NONE,@SmearUncluster(),@SmearPu,JER,*[1!10]SmearJesAndCSV(%%d) + +#__________________________________________________________________ +#____________________ TTX _____________________________ +# -#include=dat/catalog/2017.v23/st.dat #include=dat/catalog/2017.v23/rares.dat -#include=dat/catalog/2017.v23/vv.dat -#include=dat/topBot.OnlyRares.dat -#include=dat/topBot.OnlyTopMinor.dat +#include=dat/topBot.OnlyTTX.dat +#Smear=NONE +#Smear=NONE,@SmearUncluster(),@SmearPu,JER,*[1!10]SmearJesAndCSV(%%d),@SmearScales("ScaleR"!1!0),@SmearScales("ScaleF"!0!1),@SmearScales("ScaleRF"!1!1) + +#__________________________________________________________________ +#____________________ EWK(di-tri boson) _____________________________ +# + +##include=dat/catalog/2017.v23/vv.dat +##include=dat/topBot.OnlyRares.dat +#Smear=NONE #Smear=NONE,@SmearUncluster(),@SmearPu,JER,*[1!10]SmearJesAndCSV(%%d) + +#__________________________________________________________________ +#____________________ V+jets _____________________________ +# + #include=dat/catalog/2017.v23/wjets_ht.dat #include=dat/catalog/2017.v23/dy_ht.dat #include=dat/catalog/2017.v23/dy_lowMass_ht.py #include=dat/topBot.OnlyEWK.dat -#Smear=NONE,@SmearUncluster(),@SmearPu,JER,*[1!10]SmearJesAndCSV(%%d),@SmearSF("htRECO"!"htRECO") -#Smear=@SmearScales("ScaleR"!1!0),@SmearScales("ScaleF"!0!1),@SmearScales("ScaleRF"!1!1) +#Smear=NONE +#Smear=NONE,@SmearUncluster(),@SmearPu,JER,*[1!10]SmearJesAndCSV(%%d),@SmearSF("htRECO"!"htRECO"),@SmearScales("ScaleR"!1!0),@SmearScales("ScaleF"!0!1),@SmearScales("ScaleRF"!1!1) + +#__________________________________________________________________ +#____________________ QCD _____________________________ +# #include=dat/catalog/2017.v23/qcd.dat #include=dat/topBot.OnlyQCD.dat -#Smear=NONE,@SmearUncluster(),@SmearPu,JER,*[1!10]SmearJesAndCSV(%%d) +#Smear=NONE + +#__________________________________________________________________ +#____________________ DATA _____________________________ +# #include=dat/topBot.DATAOnly.dat #include=dat/catalog/2017.moriond/singleElecton.dat @@ -81,19 +121,20 @@ include=dat/topBot.OnlyTTbar.dat # Smearer -Smear=NONE +##Smear=NONE ##Smear=*[0!50]SmearPdfs(%%d) -##Smear=@SmearScales("ScaleR"!1!0),@SmearScales("ScaleF"!0!1),@SmearScales("ScaleRF"!1!1) +##Smear=NONE,@SmearJesSource("AbsoluteStat"),@SmearJesSource("AbsoluteScale"),@SmearJesSource("AbsoluteMPFBias"),@SmearJesSource("Fragmentation"),@SmearJesSource("SinglePionECAL"),@SmearJesSource("SinglePionHCAL"),@SmearJesSource("FlavorQCD"),@SmearJesSource("TimePtEta"),@SmearJesSource("RelativeJEREC1"),@SmearJesSource("RelativePtBB"),@SmearJesSource("RelativePtEC1"),@SmearJesSource("RelativeBal"),@SmearJesSource("RelativeFSR"),@SmearJesSource("RelativeStatFSR"),@SmearJesSource("RelativeStatEC"),@SmearJesSource("PileUpDataMC"),@SmearJesSource("PileUpPtRef"),@SmearJesSource("PileUpPtBB"),@SmearJesSource("PileUpPtEC1") +##@SmearJesSource("RelativeJEREC2"),@SmearJesSource("RelativePtEC2"),@SmearJesSource("PileUpPtEC2"),@SmearJesSource("RelativeJERHF"),@SmearJesSource("RelativePtHF"),@SmearJesSource("PileUpPtHF"),@SmearJesSource("RelativeStatHF"),@SmearJesSource("SubTotalRelative"),@SmearJesSource("SubTotalPileUp"),@SmearJesSource("SubTotalAbsolute") -##Smear=NONE,@SmearUncluster(),@SmearPu,@SmearSF("TOPRW"!"topreweight"),JES,JER,@SmearSF("muTRG"!"muTRG"),*[1!10]SmearJesAndCSV(%%d),@SmearScales("ScaleR"!1!0),@SmearScales("ScaleF"!0!1),@SmearScales("ScaleRF"!1!1) +##Smear=NONE,@SmearUncluster(),@SmearPu,JER,*[1!10]SmearJesAndCSV(%%d),@SmearSF("TOPRW"!"topreweight"),@SmearScales("ScaleR"!1!0),@SmearScales("ScaleF"!0!1),@SmearScales("ScaleRF"!1!1),@SmearSF("muTRG"!"muTRG"),@SmearSF("eleTightTRG"!"eleTightTRG") #old way to do btaggind syst, muon and electron #Smear=@SmearBjets(1!0!"btag"),@SmearBjets(0!1!"btag"),@SmearSF("muID"!"muIDtight"),@SmearSF("muTRG"!"muTRG"),@SmearSF("muISO"!"muISO"),@SmearSF("muRECO"!"muRECO"),@SmearSF("eleTight"!"eletight") ################################# ANALYSIS CONFIGURATION ############################ -Correct=NONE +#Correct=NONE #Correct=MetPhiCorrector #Final=no Final=yes diff --git a/dat/configTopBot_2l_v23.dat b/dat/configTopBot_2l_v23.dat index ba52cbab..fbb72a39 100644 --- a/dat/configTopBot_2l_v23.dat +++ b/dat/configTopBot_2l_v23.dat @@ -11,15 +11,16 @@ MCDB=aux/mcdb.2017.v23.txt Files= include=dat/catalog/2017.v23/tt.dat -#include=dat/catalog/2017.v23/ttlep.dat +include=dat/catalog/2017.v23/ttlep.dat include=dat/catalog/2017.v23/st.dat include=dat/catalog/2017.v23/dy_ht.dat +include=dat/catalog/2017.v23/dy_lowMass_ht.py include=dat/catalog/2017.v23/wjets_ht.dat include=dat/catalog/2017.v23/vv.dat include=dat/catalog/2017.v23/rares.dat -#include=dat/catalog/2017.v23/ttISRFSR.dat +include=dat/catalog/2017.v23/ttISRFSR.dat # signal -##include=dat/catalog/2017.v23/topbottom.dat +include=dat/catalog/2017.v23/topbottom.dat include=dat/catalog/2017.v23/topbottom_ext.dat # data include=dat/catalog/2017.moriond/singleElecton.dat @@ -33,41 +34,79 @@ pileup=aux/pileup.2017.BCDEFGH.root #____________________ SPECIAL SETTINGS _____________________________ Files= + +#__________________________________________________________________ +#____________________ TTBAR (nominal + UE) ________________________ +# + #include=dat/catalog/2017.v23/ttISRFSR.dat -#include=dat/catalog/2017.v23/ttlep.dat +#include=dat/topBot.OnlyTTbar.dat +#Smear=NONE +#Smear=NONE,@SmearUncluster(),@SmearPu,JER,*[1!10]SmearJesAndCSV(%%d),@SmearScales("ScaleR"!1!0),@SmearScales("ScaleF"!0!1),@SmearScales("ScaleRF"!1!1) -include=dat/catalog/2017.v23/tt.dat -include=dat/topBot.OnlyTTbar.dat -##Smear=NONE,@SmearUncluster(),@SmearPu,JER,*[1!10]SmearJesAndCSV(%%d),@SmearSF("TOPRW"!"topreweight") -##Smear=@SmearScales("ScaleR"!1!0),@SmearScales("ScaleF"!0!1),@SmearScales("ScaleRF"!1!1) -##Smear=*[0!50]SmearPdfs(%%d) +#include=dat/catalog/2017.v23/tt.dat +#include=dat/topBot.OnlyTTbar.dat +#Smear=NONE +#Smear=NONE,@SmearUncluster(),@SmearPu,JER,*[1!10]SmearJesAndCSV(%%d),@SmearScales("ScaleR"!1!0),@SmearScales("ScaleF"!0!1),@SmearScales("ScaleRF"!1!1) + +#__________________________________________________________________ +#____________________ SIGNAL _____________________________ +# +## All #include=dat/catalog/2017.v23/topbottom.dat -#include=dat/catalog/2017.v23/topbottom_ext.dat #include=dat/topBot.OnlyChTB.dat -#Smear=NONE,@SmearUncluster(),@SmearPu,JER,*[1!10]SmearJesAndCSV(%%d) -#Smear=@SmearScales("ScaleR"!1!0),@SmearScales("ScaleF"!0!1),@SmearScales("ScaleRF"!1!1) +#Smear=NONE +#Smear=NONE,@SmearUncluster(),@SmearPu,JER,*[1!10]SmearJesAndCSV(%%d),@SmearScales("ScaleR"!1!0),@SmearScales("ScaleF"!0!1),@SmearScales("ScaleRF"!1!1) + +#__________________________________________________________________ +#____________________ ST _____________________________ +# #include=dat/catalog/2017.v23/st.dat #include=dat/topBot.OnlyTopMinor.dat -##Smear=NONE,@SmearUncluster(),@SmearPu,JER,*[1!10]SmearJesAndCSV(%%d) +#Smear=NONE +#Smear=NONE,@SmearUncluster(),@SmearPu,JER,*[1!10]SmearJesAndCSV(%%d) + +#__________________________________________________________________ +#____________________ TTX _____________________________ +# #include=dat/catalog/2017.v23/rares.dat +#include=dat/topBot.OnlyTTX.dat +#Smear=NONE,@SmearUncluster(),@SmearPu,JER,*[1!10]SmearJesAndCSV(%%d),@SmearScales("ScaleR"!1!0),@SmearScales("ScaleF"!0!1),@SmearScales("ScaleRF"!1!1) +#Smear=NONE + +#__________________________________________________________________ +#____________________ EWK (vv+vh+vvv) _____________________________ +# #include=dat/catalog/2017.v23/vv.dat #include=dat/topBot.OnlyRares.dat +#Smear=NONE #Smear=NONE,@SmearUncluster(),@SmearPu,JER,*[1!10]SmearJesAndCSV(%%d) +#__________________________________________________________________ +#____________________ W & DY _____________________________ +# + #include=dat/catalog/2017.v23/dy_ht.dat #include=dat/catalog/2017.v23/wjets_ht.dat #include=dat/catalog/2017.v23/dy_lowMass_ht.py #include=dat/topBot.OnlyEWK.dat -#Smear=NONE,@SmearUncluster(),@SmearPu,JER,*[1!10]SmearJesAndCSV(%%d),@SmearSF("htRECO"!"htRECO") -#Smear=@SmearScales("ScaleR"!1!0),@SmearScales("ScaleF"!0!1),@SmearScales("ScaleRF"!1!1) +#Smear=NONE #Smear=NONE,@SmearUncluster(),@SmearPu,JER,*[1!10]SmearJesAndCSV(%%d),@SmearSF("htRECO"!"htRECO"),@SmearScales("ScaleR"!1!0),@SmearScales("ScaleF"!0!1),@SmearScales("ScaleRF"!1!1) +#__________________________________________________________________ +#____________________ QCD _____________________________ +# + #include=dat/catalog/2017.v23/qcd.dat #include=dat/topBot.OnlyQCD.dat -#Smear=NONE,@SmearUncluster(),@SmearPu,JER,*[1!10]SmearJesAndCSV(%%d) +#Smear=NONE + +#__________________________________________________________________ +#____________________ DATA _____________________________ +# #include=dat/topBot.DATAOnly.dat #include=dat/catalog/2017.moriond/singleElecton.dat @@ -80,7 +119,7 @@ include=dat/topBot.OnlyTTbar.dat ### Smearer -Smear=NONE +##Smear=NONE ##Smear=*[0!50]SmearPdfs(%%d) ##Smear=@SmearScales("ScaleR"!1!0),@SmearScales("ScaleF"!0!1),@SmearScales("ScaleRF"!1!1) @@ -90,11 +129,17 @@ Smear=NONE ##old way to do btaggind syst, muon and electron ##Smear=@SmearBjets(1!0!"btag"),@SmearBjets(0!1!"btag"),@SmearSF("muID"!"muIDtight"),@SmearSF("muTRG"!"muTRG"),@SmearSF("muISO"!"muISO"),@SmearSF("muRECO"!"muRECO"),@SmearSF("eleTight"!"eletight"),@SmearSF("muIDloose"!"muIDloose"),@SmearSF("muISOloose"!"muISOloose"),@SmearSF("eleVeto"!"eleveto") +##Smear=@SmearSF("muTRG"!"muTRG"),@SmearSF("muID"!"muID"),@SmearSF("muISO"!"muISO"),@SmearSF("muRECO"!"muRECO"),@SmearSF("muIDloose"!"muIDloose"),@SmearSF("muISOloose"!"muISOloose"),@SmearSF("muLooseTRG"!"muLooseTRG"),@SmearSF("eleTightTRG"!"eleTightTRG"),@SmearSF("eleLooseTRG"!"eleLooseTRG"),@SmearSF("eleRECO"!"eleRECO"),@SmearSF("eleTight"!"eleTight"),@SmearSF("eleLoose"!"eleLoose"),#SmearSF("eleTight"!"eleTightIso"),@SmearSF("eleLoose"!"eleLooseIso") + +##Smear=NONE,@SmearUncluster(),@SmearPu,JER,*[1!10]SmearJesAndCSV(%%d),@SmearSF("htRECO"!"htRECO") +##Smear=@SmearScales("ScaleR"!1!0),@SmearScales("ScaleF"!0!1),@SmearScales("ScaleRF"!1!1) +#Smear=NONE,@SmearUncluster(),@SmearPu,JER,*[1!10]SmearJesAndCSV(%%d),@SmearSF("htRECO"!"htRECO"),@SmearJesSource("AbsoluteStat"),@SmearJesSource("AbsoluteScale"),@SmearJesSource("AbsoluteMPFBias"),@SmearJesSource("Fragmentation"),@SmearJesSource("SinglePionECAL"),@SmearJesSource("SinglePionHCAL"),@SmearJesSource("FlavorQCD"),@SmearJesSource("TimePtEta"),@SmearJesSource("RelativeJEREC1"),@SmearJesSource("RelativePtBB"),@SmearJesSource("RelativePtEC1"),@SmearJesSource("RelativeBal"),@SmearJesSource("RelativeFSR"),@SmearJesSource("RelativeStatFSR"),@SmearJesSource("RelativeStatEC"),@SmearJesSource("PileUpDataMC"),@SmearJesSource("PileUpPtRef"),@SmearJesSource("PileUpPtBB"),@SmearJesSource("PileUpPtEC1") + #Smear=NONE,JER # this is problematic ################################# ANALYSIS CONFIGURATION ############################ -Correct=NONE +#Correct=NONE #Correct=MetPhiCorrector #Final=no Final=yes diff --git a/dat/topBot.OnlyRares.dat b/dat/topBot.OnlyRares.dat index 13221b30..b0345b97 100644 --- a/dat/topBot.OnlyRares.dat +++ b/dat/topBot.OnlyRares.dat @@ -1,23 +1,8 @@ ############# -### TTX with X=G,W,Z,TT + diboson + triboson +### diboson + triboson ############# -##TTTT -config=ChargedHiggsTopBottom|AddLabel('TTTT') -##TTZToQQ, TTZToLLNuNu -addConfig=ChargedHiggsTopBottom|AddLabel('TTZ') -##TTWJetsToQQ,TTWJetsToLNu -addConfig=ChargedHiggsTopBottom|AddLabel('TTW') -##ttHJetTobb,ttHJetToNonbb -addConfig=ChargedHiggsTopBottom|AddLabel('ttH') -##TTGJets -addConfig=ChargedHiggsTopBottom|AddLabel('TTG') - -addConfig=ChargedHiggsTopBottom|AddLabel('TTX') - -addConfig=ChargedHiggsTopBottom|AddLabel('EWK') - -addConfig=ChargedHiggsTopBottom|AddLabel('WWTo') +config=ChargedHiggsTopBottom|AddLabel('WWTo') ###WZTo1L1Nu2Q,WZTo1L3Nu,WZTo2L2Q,WZTo3LNu addConfig=ChargedHiggsTopBottom|AddLabel('WZTo') ###ZZTo2L2Nu,ZZTo2L2Q,ZZTo4L @@ -31,6 +16,9 @@ addConfig=ChargedHiggsTopBottom|AddLabel('WWZ') addConfig=ChargedHiggsTopBottom|AddLabel('WZZ') addConfig=ChargedHiggsTopBottom|AddLabel('ZZZ') +addConfig=ChargedHiggsTopBottom|AddLabel('EWK') + + ## 1l - 16 ########### addConfig=ChargedHiggsTopBottom|weights.push_back("aux/JAN12_BDT_1l/BDT_1/TMVAClassification_BDTG.weights.xml") diff --git a/dat/topBot.OnlyTTbar.dat b/dat/topBot.OnlyTTbar.dat index 287c5eb9..a2bc64e5 100644 --- a/dat/topBot.OnlyTTbar.dat +++ b/dat/topBot.OnlyTTbar.dat @@ -2,19 +2,26 @@ ### TopBottom ### ############# +#config=ChargedHiggsTopBottom|AddLabel('TTJets_TuneCUETP8M2T4_13TeV-amcatnloFXFX-pythia8') + config=ChargedHiggsTopBottom|AddLabel('TT_TuneCUETP8M2T4_13TeV-powheg-pythia8') +addConfig=ChargedHiggsTopBottom|AddLabel('TT_TuneCUETP8M2T4up_13TeV-powheg-pythia8') +addConfig=ChargedHiggsTopBottom|AddLabel('TT_TuneCUETP8M2T4down_13TeV-powheg-pythia8') + #addConfig=ChargedHiggsTopBottom|AddLabel('TTTo2L2Nu_TuneCUETP8M2') #addConfig=ChargedHiggsTopBottom|AddLabel('TTToSemilepton_TuneCUETP8M2') #standard #addConfig=ChargedHiggsTopBottom|AddLabel('TT_TuneCUETP8M2T4_13TeV-powheg-pythia8') #MC@NLO #addConfig=ChargedHiggsTopBottom|AddLabel('TTJets') -#ISR-FSR +#ISR-FSR-HDAMP #addConfig=ChargedHiggsTopBottom|AddLabel('TT_TuneCUETP8M2T4_13TeV-powheg-fsrdown') #addConfig=ChargedHiggsTopBottom|AddLabel('TT_TuneCUETP8M2T4_13TeV-powheg-fsrup') #addConfig=ChargedHiggsTopBottom|AddLabel('TT_TuneCUETP8M2T4_13TeV-powheg-isrdown') #addConfig=ChargedHiggsTopBottom|AddLabel('TT_TuneCUETP8M2T4_13TeV-powheg-isrup') +#addConfig=ChargedHiggsTopBottom|AddLabel('TT_hdampUP_TuneCUETP8M2T4_13TeV-powheg-pythia8') +#addConfig=ChargedHiggsTopBottom|AddLabel('TT_hdampDOWN_TuneCUETP8M2T4_13TeV-powheg-pythia8') ## 1l - 16 From 7cdf58b6fdac3d0e6d8b7559a5bdd37eaa3d0d5b Mon Sep 17 00:00:00 2001 From: maria Date: Thu, 1 Nov 2018 12:22:03 +0100 Subject: [PATCH 51/60] add set and get bHadrons counter for DY --- dat/branches.txt | 1 + interface/Event.hpp | 6 ++++++ src/Loader.cpp | 6 ++++++ 3 files changed, 13 insertions(+) diff --git a/dat/branches.txt b/dat/branches.txt index b88de0da..a6c55883 100644 --- a/dat/branches.txt +++ b/dat/branches.txt @@ -86,6 +86,7 @@ genParent genFlags genTtbarId genjetP4 +nBHadrons ## JET jethadFlavour jetFlavour diff --git a/interface/Event.hpp b/interface/Event.hpp index 0168aaf8..d6dd9444 100644 --- a/interface/Event.hpp +++ b/interface/Event.hpp @@ -57,6 +57,7 @@ class Event{ int npv_; int genTtbarId_; + int nBHadrons_; vector triggerNames_; @@ -100,6 +101,11 @@ class Event{ ///@brief set gen id tag for ttbar inline void SetGenTtbarId (const int x){ genTtbarId_=x; } + ///@brief get nBhad id tag for DY + inline int GetnBHadrons() const { return nBHadrons_; } + ///@brief set nBhad id tag for DY + inline void SetnBHadrons (const int x){ nBHadrons_=x; } + // --- // This functions should check if the objects are valid diff --git a/src/Loader.cpp b/src/Loader.cpp index 78ca7bdf..7eccaf75 100644 --- a/src/Loader.cpp +++ b/src/Loader.cpp @@ -667,6 +667,12 @@ void LoadNero::FillMC(){ event_ -> GetWeight() -> SetMcWeight( mc->mcWeight ); + if (tree_->GetBranchStatus("nBHadrons") ) { + event_ -> SetnBHadrons( mc->nBHadrons ); + } else { + event_ -> SetnBHadrons( -999 ); + } + if(tree_->GetBranchStatus("genTtbarId")) { event_ -> SetGenTtbarId( mc->genTtbarId ); } else { From 087bfade96c4deb0d42d832c22031535a205877a Mon Sep 17 00:00:00 2001 From: maria Date: Sun, 4 Nov 2018 22:57:49 +0100 Subject: [PATCH 52/60] script fullHad: rebin4, more ttbar stat, add the muRFttbar sch, re-enable a couple of regions (NOV4) --- script/bwsFullHadTB.py | 44 +++++++++++++++++++++++------------------- 1 file changed, 24 insertions(+), 20 deletions(-) diff --git a/script/bwsFullHadTB.py b/script/bwsFullHadTB.py index f1725b32..eb9c99ab 100644 --- a/script/bwsFullHadTB.py +++ b/script/bwsFullHadTB.py @@ -11,7 +11,7 @@ maxStat=0.15 # original binning is 10GeV -nRebinHT=1 +nRebinHT=4 #nRebinHT=5 LikeBins=10 #LikeBins=1 @@ -95,10 +95,14 @@ #parser.add_option("","--inputBin",type='string',help="Input ROOT file. [%default]", default="/afs/cern.ch/user/h/hum/work/public/CMSSW_8_0_26_patch1/src/ChargedHiggs/ntufile/preapp3systtt.root") ## SEPT9 + Schannel/Associated results -parser.add_option("","--input",type='string',help="Input ROOT file. [%default]", default="/afs/cern.ch/user/h/hum/work/public/CMSSW_8_0_26_patch1/src/ChargedHiggs/ntufile/preapp3systmore.root") -parser.add_option("","--inputBin",type='string',help="Input ROOT file. [%default]", default="/afs/cern.ch/user/h/hum/work/public/CMSSW_8_0_26_patch1/src/ChargedHiggs/ntufile/preapp3systmore.root") +#parser.add_option("","--input",type='string',help="Input ROOT file. [%default]", default="/afs/cern.ch/user/h/hum/work/public/CMSSW_8_0_26_patch1/src/ChargedHiggs/ntufile/preapp3systmore.root") +#parser.add_option("","--inputBin",type='string',help="Input ROOT file. [%default]", default="/afs/cern.ch/user/h/hum/work/public/CMSSW_8_0_26_patch1/src/ChargedHiggs/ntufile/preapp3systmore.root") +## OCT8 + Schannel/Associated results (7 ttbar samples) +parser.add_option("","--input",type='string',help="Input ROOT file. [%default]", default="/afs/cern.ch/user/h/hum/work/public/CMSSW_8_0_26_patch1/src/ChargedHiggs/ntufile/preapp3syst7tt.root") +parser.add_option("","--inputBin",type='string',help="Input ROOT file. [%default]", default="/afs/cern.ch/user/h/hum/work/public/CMSSW_8_0_26_patch1/src/ChargedHiggs/ntufile/preapp3syst7tt.root") + ## REMEMBER TO: # a) change the rebin 20% to 50% Inf # b) gaussian kernel @@ -396,9 +400,8 @@ def mergeCategory(tfile,toget): if opts.kMass=="500": if "OneBOneMirrorFat_one_lowj" in x and y=="wbb" and "in" in reg: continue if "OneBOneFat_one_lowj" in x and y=="wbb" and "below" in reg: continue - if "_one" in x and y=="wbb" and "all" in reg: continue if "OneBOneFat_three_lowj" in x and y=="wbb" and "below" in reg: continue - if "OneBOneFat1l_three" in x and y=="t0b" and "all" in reg: continue + if opts.kMass=="1500" and not doSChannel: if "OneBOneMirrorFat_three_highj" in x and y=="wbb" and "in" in reg: continue @@ -424,7 +427,7 @@ def mergeCategory(tfile,toget): if "OneBOneFat1l_two" in x and y=="t0b": continue if opts.kMass=="800" and "OneBOneFat1l_two" in x and y=="t1b": continue - if "OneBOneFat1l" in x and y=="wbb": continue + if "OneBOneFat1l" in x and y=="wbb" and doSChannel: continue if opts.kMass=="800" and doSChannel: if "OneBOneMirrorFat_two_highj" in x and y=="wbb" and "in" in reg : continue @@ -434,7 +437,6 @@ def mergeCategory(tfile,toget): if opts.kMass=="2000" and doSChannel: if "OneBOneFat_two_highj" in x and "above" in reg and y=="wbb": continue - if "OneBOneFat_two_highj" in x and "in" in reg and y=="wbb": continue if "OneBOneMirrorFat_two_highj" in x and "in" in reg and y=="wbb": continue if "OneBOneFat_one_highj" in x and "above" in reg and y=="wbb": continue @@ -633,10 +635,9 @@ def mergeCategory(tfile,toget): systStore={ "None":None, "lumi_13TeV":{"type":"lnN", "value":["1.025"] ,"proc":[".*"],"wsname":"lumi_13TeV","name":"XXX"}, - ### lepton veto 0.96 / for 1l is 1.04 - "CMS_eff_l":{"type":"lnN", "value":["0.96"] ,"proc":["ttbar","top","Hptb","ewk"],"wsname":"CMS_eff_l","name":"XXX"}, ## name used for shape - ## check the direction of the tau for the combination - "CMS_eff_t":{"type":"lnN", "value":["1.03"] ,"proc":["ttbar","top","Hptb","ewk"],"wsname":"CMS_eff_t","name":"XXX"}, ## name used for shape + ### lepton veto + "CMS_eff_l":{"type":"lnN", "value":["0.96","0.96","0.96","0.96"] ,"proc":["ttbar","top","Hptb","ewk"],"wsname":"CMS_eff_l","name":"XXX"}, ## name used for shape + "CMS_eff_t":{"type":"lnN", "value":["1.03","1.03","1.03","1.03"] ,"proc":["ttbar","top","Hptb","ewk"],"wsname":"CMS_eff_t","name":"XXX"}, ## name used for shape #### trigger efficiency "CMS_eff_trigger":{"type":"lnN", "value":["1.05"] ,"proc":[".*"],"wsname":"CMS_eff_triggger","name":"XXX"}, ### Theory modeling @@ -723,11 +724,11 @@ def mergeCategory(tfile,toget): print "* ",cat,":",catStore[cat] print "---------------------- --------" -fileTmp="MIAO_SEPT10_Shape/"+label+VarTest+opts.kMass+"_"+opts.output +fileTmp="MIAO_NOV4_Shape/"+label+VarTest+opts.kMass+"_"+opts.output w = ROOT.RooWorkspace("w","w") datNameTmp = opts.datCardName -datName = "MIAO_SEPT10_Shape/"+label+ VarTest+opts.kMass+"_" + datNameTmp +datName = "MIAO_NOV4_Shape/"+label+ VarTest+opts.kMass+"_" + datNameTmp datacard=open(datName,"w") datacard.write("-------------------------------------\n") @@ -1015,8 +1016,8 @@ def importStat(): writeNormSyst(syst,["1.02","1.02","1.02"],systStore[syst]["proc"],["OneBOneFat_.*_t0b","OneBOneFat_.*_t1b","OneBOneFat1l_.*_t0b","OneBOneFat1l_.*_t1b"]) writeNormSyst(syst,["0.98","0.98","0.98"],systStore[syst]["proc"],["OneBOneMirrorFat_.*_t0b","OneBOneMirrorFat_.*_t1b"]) elif "CMS_eff_l" in systStore[syst]["wsname"]: - writeNormSyst(syst,["1.04"],systStore[syst]["proc"],["OneBOneFat1l_"]) - writeNormSyst(syst,["0.96"],systStore[syst]["proc"],["OneBOneFat_","OneBOneMirrorFat_"]) + writeNormSyst(syst,["1.04","1.04","1.04","1.04"],systStore[syst]["proc"],["OneBOneFat1l_"]) + writeNormSyst(syst,["0.96","0.96","0.96","0.96"],systStore[syst]["proc"],["OneBOneFat_","OneBOneMirrorFat_"]) else: writeNormSyst(syst,systStore[syst]["value"],systStore[syst]["proc"]) @@ -1312,7 +1313,8 @@ def creatPolShape(tfile,togetNom, s) : for iBin in range(1,h.GetNbinsX()+1): c = h.GetBinContent(iBin) - flo = c * (h.GetBinCenter(iBin)) * 0.1/1000 #linear, 10%/1TeV, range from 5%-500 GeV to 50%-5000GeV + flo = c * (h.GetBinCenter(iBin)) * 0.25/1000 +# flo = c * (h.GetBinCenter(iBin)) * 0.1/1000 #linear, 10%/1TeV, range from 5%-500 GeV to 50%-5000GeV #flo = c * math.log10(h.GetBinCenter(iBin)) * 0.1 #log10, 10%*log(HT/1GeV), range from 27%-500eV to 37%-5000GeV if 'Up' in s: @@ -1440,7 +1442,9 @@ def importPdfFromTH1(cat,mc,myBin,LikelihoodMapping,syst=None): toget += "_" + syst["name"] + s if syst != None and "muRF" in syst["wsname"] and not doSChannel: - if mc["name"]=="Hptb" or mc["name"]=="ttb" or mc["name"]=="ttc" or mc["name"]=="ttlight" or mc["name"]=="ttbar": + if mc["name"]=="ttb" or mc["name"]=="ttc" or mc["name"]=="ttlight" or mc["name"]=="ttbar": + hTmp = envelop(tfile,togetNom,togetSyst,s) + if mc["name"]=="Hptb" and not doSChannel: hTmp = envelop(tfile,togetNom,togetSyst,s) elif syst != None and "Pol" in syst["wsname"]: @@ -1457,7 +1461,7 @@ def importPdfFromTH1(cat,mc,myBin,LikelihoodMapping,syst=None): if hTmp!=None: print "<*> 2/3 Reading Hist '"+toget+"'",hTmp.Integral() if mc["name"]=="ttbar" and hTmp: - hTmp.Scale(0.2) + hTmp.Scale(1.0/7) if hTmp!=None and hTmp.Integral() <= 0 and ( "ewk" in mc["hist"] or "TTX" in mc["hist"] or "ST" in mc["hist"]) : print "<*> Hist '"+toget+"' norm null but keep going" @@ -1662,7 +1666,7 @@ def importPdfFromTH1SumBKG(cat,mc,syst=None,do1Third=False): hTmp.Scale(0) if mc["name"]=="ttbar" and hTmp: - hTmp.Scale(0.2) + hTmp.Scale(1.0/7) if hTmp == None: print "<*> Hist '"+toget+"' doesn't exist" @@ -1788,7 +1792,7 @@ def importPdfFromTH1SumBKG(cat,mc,syst=None,do1Third=False): h=mergeCategory(tfile,toget) if h == None: - print "<*> Hist do not exists ",toget + print "<*> Hist OBS do not exists ",toget raise IOError if h != None: From b3baf32524d972ad56e85640ced86e6d9b202ce5 Mon Sep 17 00:00:00 2001 From: maria Date: Tue, 6 Nov 2018 22:27:31 +0100 Subject: [PATCH 53/60] script fullHad: adjust the QCD correlation nuissances --- script/bwsFullHadTB.py | 95 +++++++++++------------------------------- 1 file changed, 24 insertions(+), 71 deletions(-) diff --git a/script/bwsFullHadTB.py b/script/bwsFullHadTB.py index eb9c99ab..db0d3e20 100644 --- a/script/bwsFullHadTB.py +++ b/script/bwsFullHadTB.py @@ -432,18 +432,16 @@ def mergeCategory(tfile,toget): if opts.kMass=="800" and doSChannel: if "OneBOneMirrorFat_two_highj" in x and y=="wbb" and "in" in reg : continue - if opts.kMass=="1500" and doSChannel: + if (opts.kMass=="1500" or opts.kMass=="2000" or opts.kMass=="3000") and doSChannel: if "OneBOneMirrorFat_one_highj" in x and y=="wbb" and "in" in reg : continue if opts.kMass=="2000" and doSChannel: if "OneBOneFat_two_highj" in x and "above" in reg and y=="wbb": continue - if "OneBOneMirrorFat_two_highj" in x and "in" in reg and y=="wbb": continue if "OneBOneFat_one_highj" in x and "above" in reg and y=="wbb": continue if opts.kMass=="3000" and doSChannel: if "OneBOneFat_two_highj" in x and "above" in reg and y=="wbb": continue if "OneBOneFat_two_highj" in x and "in" in reg and y=="wbb": continue - if "OneBOneMirrorFat_two_highj" in x and "in" in reg and y=="wbb": continue if "OneBOneMirrorFat_two_lowj" in x and "in" in reg and y=="wbb": continue if "OneBOneFat_one_highj" in x and "above" in reg and y=="wbb": continue if "OneBOneMirrorFat_one_highj" in x and "in" in reg and y=="wbb": continue @@ -695,24 +693,12 @@ def mergeCategory(tfile,toget): "CMS_scale_Pol_qcd_wx_two_1l":{"type":"shape", "wsname":"CMS_scale_Pol_qcd_wx_two_1l","name":"XXX","proc":["qcd_wx_two"]}, "CMS_scale_Pol_qcd_wx_three_1l":{"type":"shape", "wsname":"CMS_scale_Pol_qcd_wx_three_1l","name":"XXX","proc":["qcd_wx_three"]}, ## - "CMS_scale_Pol_qcd_tx_one_below":{"type":"shape", "wsname":"CMS_scale_Pol_qcd_tx_one_below","name":"XXX","proc":["qcd_tx_one"]}, - "CMS_scale_Pol_qcd_tx_two_below":{"type":"shape", "wsname":"CMS_scale_Pol_qcd_tx_two_below","name":"XXX","proc":["qcd_tx_two"]}, - "CMS_scale_Pol_qcd_tx_three_below":{"type":"shape", "wsname":"CMS_scale_Pol_qcd_tx_three_below","name":"XXX","proc":["qcd_tx_three"]}, - "CMS_scale_Pol_qcd_wx_one_below":{"type":"shape", "wsname":"CMS_scale_Pol_qcd_wx_one_below","name":"XXX","proc":["qcd_wx_one"]}, - "CMS_scale_Pol_qcd_wx_two_below":{"type":"shape", "wsname":"CMS_scale_Pol_qcd_wx_two_below","name":"XXX","proc":["qcd_wx_two"]}, - "CMS_scale_Pol_qcd_wx_three_below":{"type":"shape", "wsname":"CMS_scale_Pol_qcd_wx_three_below","name":"XXX","proc":["qcd_wx_three"]}, "CMS_scale_Pol_qcd_tx_one_in":{"type":"shape", "wsname":"CMS_scale_Pol_qcd_tx_one_in","name":"XXX","proc":["qcd_tx_one"]}, "CMS_scale_Pol_qcd_tx_two_in":{"type":"shape", "wsname":"CMS_scale_Pol_qcd_tx_two_in","name":"XXX","proc":["qcd_tx_two"]}, "CMS_scale_Pol_qcd_tx_three_in":{"type":"shape", "wsname":"CMS_scale_Pol_qcd_tx_three_in","name":"XXX","proc":["qcd_tx_three"]}, "CMS_scale_Pol_qcd_wx_one_in":{"type":"shape", "wsname":"CMS_scale_Pol_qcd_wx_one_in","name":"XXX","proc":["qcd_wx_one"]}, "CMS_scale_Pol_qcd_wx_two_in":{"type":"shape", "wsname":"CMS_scale_Pol_qcd_wx_two_in","name":"XXX","proc":["qcd_wx_two"]}, - "CMS_scale_Pol_qcd_wx_three_in":{"type":"shape", "wsname":"CMS_scale_Pol_qcd_wx_three_in","name":"XXX","proc":["qcd_wx_three"]}, - "CMS_scale_Pol_qcd_tx_one_above":{"type":"shape", "wsname":"CMS_scale_Pol_qcd_tx_one_above","name":"XXX","proc":["qcd_tx_one"]}, - "CMS_scale_Pol_qcd_tx_two_above":{"type":"shape", "wsname":"CMS_scale_Pol_qcd_tx_two_above","name":"XXX","proc":["qcd_tx_two"]}, - "CMS_scale_Pol_qcd_tx_three_above":{"type":"shape", "wsname":"CMS_scale_Pol_qcd_tx_three_above","name":"XXX","proc":["qcd_tx_three"]}, - "CMS_scale_Pol_qcd_wx_one_above":{"type":"shape", "wsname":"CMS_scale_Pol_qcd_wx_one_above","name":"XXX","proc":["qcd_wx_one"]}, - "CMS_scale_Pol_qcd_wx_two_above":{"type":"shape", "wsname":"CMS_scale_Pol_qcd_wx_two_above","name":"XXX","proc":["qcd_wx_two"]}, - "CMS_scale_Pol_qcd_wx_three_above":{"type":"shape", "wsname":"CMS_scale_Pol_qcd_wx_three_above","name":"XXX","proc":["qcd_wx_three"]} + "CMS_scale_Pol_qcd_wx_three_in":{"type":"shape", "wsname":"CMS_scale_Pol_qcd_wx_three_in","name":"XXX","proc":["qcd_wx_three"]} } else: systStore={ @@ -724,11 +710,11 @@ def mergeCategory(tfile,toget): print "* ",cat,":",catStore[cat] print "---------------------- --------" -fileTmp="MIAO_NOV4_Shape/"+label+VarTest+opts.kMass+"_"+opts.output +fileTmp="MIAO_NOV6_Shape/"+label+VarTest+opts.kMass+"_"+opts.output w = ROOT.RooWorkspace("w","w") datNameTmp = opts.datCardName -datName = "MIAO_NOV4_Shape/"+label+ VarTest+opts.kMass+"_" + datNameTmp +datName = "MIAO_NOV6_Shape/"+label+ VarTest+opts.kMass+"_" + datNameTmp datacard=open(datName,"w") datacard.write("-------------------------------------\n") @@ -1046,45 +1032,19 @@ def importStat(): elif "CMS_scale_SDMass_qcd_tx_above" in systStore[syst]["wsname"]: writeSystShape(systStore[syst],systStore[syst]["proc"],["above"]) - elif "CMS_scale_Pol_qcd_tx_one_below" in systStore[syst]["wsname"]: - writeSystShape(systStore[syst],systStore[syst]["proc"],["below"]) elif "CMS_scale_Pol_qcd_tx_one_in" in systStore[syst]["wsname"]: - writeSystShape(systStore[syst],systStore[syst]["proc"],["in"]) - elif "CMS_scale_Pol_qcd_tx_one_above" in systStore[syst]["wsname"]: - writeSystShape(systStore[syst],systStore[syst]["proc"],["above"]) - elif "CMS_scale_Pol_qcd_tx_two_below" in systStore[syst]["wsname"]: - writeSystShape(systStore[syst],systStore[syst]["proc"],["below"]) + writeSystShape(systStore[syst],systStore[syst]["proc"],["in","below","above"]) elif "CMS_scale_Pol_qcd_tx_two_in" in systStore[syst]["wsname"]: - writeSystShape(systStore[syst],systStore[syst]["proc"],["in"]) - elif "CMS_scale_Pol_qcd_tx_two_above" in systStore[syst]["wsname"]: - writeSystShape(systStore[syst],systStore[syst]["proc"],["above"]) - elif "CMS_scale_Pol_qcd_tx_three_below" in systStore[syst]["wsname"]: - writeSystShape(systStore[syst],systStore[syst]["proc"],["below"]) + writeSystShape(systStore[syst],systStore[syst]["proc"],["in","below","above"]) elif "CMS_scale_Pol_qcd_tx_three_in" in systStore[syst]["wsname"]: - writeSystShape(systStore[syst],systStore[syst]["proc"],["in"]) - elif "CMS_scale_Pol_qcd_tx_three_above" in systStore[syst]["wsname"]: - writeSystShape(systStore[syst],systStore[syst]["proc"],["above"]) + writeSystShape(systStore[syst],systStore[syst]["proc"],["in","below","above"]) - - elif "CMS_scale_Pol_qcd_wx_one_below" in systStore[syst]["wsname"]: - writeSystShape(systStore[syst],systStore[syst]["proc"],["below"]) elif "CMS_scale_Pol_qcd_wx_one_in" in systStore[syst]["wsname"]: - writeSystShape(systStore[syst],systStore[syst]["proc"],["in"]) - elif "CMS_scale_Pol_qcd_wx_one_above" in systStore[syst]["wsname"]: - writeSystShape(systStore[syst],systStore[syst]["proc"],["above"]) - elif "CMS_scale_Pol_qcd_wx_two_below" in systStore[syst]["wsname"]: - writeSystShape(systStore[syst],systStore[syst]["proc"],["below"]) + writeSystShape(systStore[syst],systStore[syst]["proc"],["in","below","above"]) elif "CMS_scale_Pol_qcd_wx_two_in" in systStore[syst]["wsname"]: - writeSystShape(systStore[syst],systStore[syst]["proc"],["in"]) - elif "CMS_scale_Pol_qcd_wx_two_above" in systStore[syst]["wsname"]: - writeSystShape(systStore[syst],systStore[syst]["proc"],["above"]) - elif "CMS_scale_Pol_qcd_wx_three_below" in systStore[syst]["wsname"]: - writeSystShape(systStore[syst],systStore[syst]["proc"],["below"]) + writeSystShape(systStore[syst],systStore[syst]["proc"],["in","below","above"]) elif "CMS_scale_Pol_qcd_wx_three_in" in systStore[syst]["wsname"]: - writeSystShape(systStore[syst],systStore[syst]["proc"],["in"]) - elif "CMS_scale_Pol_qcd_wx_three_above" in systStore[syst]["wsname"]: - writeSystShape(systStore[syst],systStore[syst]["proc"],["above"]) - + writeSystShape(systStore[syst],systStore[syst]["proc"],["in","below","above"]) elif "CMS_scale_Pol_qcd_wx_one_1l" in systStore[syst]["wsname"]: writeSystShape(systStore[syst],systStore[syst]["proc"],["1l"]) @@ -1126,26 +1086,19 @@ def importStat(): if doSyst: writeNormSyst("CMS_HPTB_QCDnonclosure_tx_two_1l",["1.50"],["qcd_tx_two"],["OneBOneFat1l_"]) if doSyst: writeNormSyst("CMS_HPTB_QCDnonclosure_tx_three_1l",["1.50"],["qcd_tx_three"],["OneBOneFat1l_"]) -if doSyst: writeNormSyst("CMS_HPTB_QCDnonclosure_wx_one_below",["1.50"],["qcd_wx_one"],["OneBOneFat_.*_below","OneBOneMirrorFat_.*_below"]) -if doSyst: writeNormSyst("CMS_HPTB_QCDnonclosure_wx_two_below",["1.50"],["qcd_wx_two"],["OneBOneFat_.*_below","OneBOneMirrorFat_.*_below"]) -if doSyst: writeNormSyst("CMS_HPTB_QCDnonclosure_wx_three_below",["1.50"],["qcd_wx_three"],["OneBOneFat_.*_below","OneBOneMirrorFat_.*_below"]) -if doSyst: writeNormSyst("CMS_HPTB_QCDnonclosure_tx_one_below",["1.50"],["qcd_tx_one"],["OneBOneFat_.*_below","OneBOneMirrorFat_.*_below"]) -if doSyst: writeNormSyst("CMS_HPTB_QCDnonclosure_tx_two_below",["1.50"],["qcd_tx_two"],["OneBOneFat_.*_below","OneBOneMirrorFat_.*_below"]) -if doSyst: writeNormSyst("CMS_HPTB_QCDnonclosure_tx_three_below",["1.50"],["qcd_tx_three"],["OneBOneFat_.*_below","OneBOneMirrorFat_.*_below"]) - -if doSyst: writeNormSyst("CMS_HPTB_QCDnonclosure_wx_one_in",["1.50"],["qcd_wx_one"],["OneBOneFat_.*_in","OneBOneMirrorFat_.*_in"]) -if doSyst: writeNormSyst("CMS_HPTB_QCDnonclosure_wx_two_in",["1.50"],["qcd_wx_two"],["OneBOneFat_.*_in","OneBOneMirrorFat_.*_in"]) -if doSyst: writeNormSyst("CMS_HPTB_QCDnonclosure_wx_three_in",["1.50"],["qcd_wx_three"],["OneBOneFat_.*_in","OneBOneMirrorFat_.*_in"]) -if doSyst: writeNormSyst("CMS_HPTB_QCDnonclosure_tx_one_in",["1.50"],["qcd_tx_one"],["OneBOneFat_.*_in","OneBOneMirrorFat_.*_in"]) -if doSyst: writeNormSyst("CMS_HPTB_QCDnonclosure_tx_two_in",["1.50"],["qcd_tx_two"],["OneBOneFat_.*_in","OneBOneMirrorFat_.*_in"]) -if doSyst: writeNormSyst("CMS_HPTB_QCDnonclosure_tx_three_in",["1.50"],["qcd_tx_three"],["OneBOneFat_.*_in","OneBOneMirrorFat_.*_in"]) - -if doSyst: writeNormSyst("CMS_HPTB_QCDnonclosure_wx_one_above",["1.50"],["qcd_wx_one"],["OneBOneFat_.*_above","OneBOneMirrorFat_.*_above"]) -if doSyst: writeNormSyst("CMS_HPTB_QCDnonclosure_wx_two_above",["1.50"],["qcd_wx_two"],["OneBOneFat_.*_above","OneBOneMirrorFat_.*_above"]) -if doSyst: writeNormSyst("CMS_HPTB_QCDnonclosure_wx_three_above",["1.50"],["qcd_wx_three"],["OneBOneFat_.*_above","OneBOneMirrorFat_.*_above"]) -if doSyst: writeNormSyst("CMS_HPTB_QCDnonclosure_tx_one_above",["1.50"],["qcd_tx_one"],["OneBOneFat_.*_above","OneBOneMirrorFat_.*_above"]) -if doSyst: writeNormSyst("CMS_HPTB_QCDnonclosure_tx_two_above",["1.50"],["qcd_tx_two"],["OneBOneFat_.*_above","OneBOneMirrorFat_.*_above"]) -if doSyst: writeNormSyst("CMS_HPTB_QCDnonclosure_tx_three_above",["1.50"],["qcd_tx_three"],["OneBOneFat_.*_above","OneBOneMirrorFat_.*_above"]) +if doSyst: writeNormSyst("CMS_HPTB_QCDnonclosure_wx_one_sr",["1.50"],["qcd_wx_one"],["OneBOneFat_.*"]) +if doSyst: writeNormSyst("CMS_HPTB_QCDnonclosure_wx_two_sr",["1.50"],["qcd_wx_two"],["OneBOneFat_.*"]) +if doSyst: writeNormSyst("CMS_HPTB_QCDnonclosure_wx_three_sr",["1.50"],["qcd_wx_three"],["OneBOneFat_.*"]) +if doSyst: writeNormSyst("CMS_HPTB_QCDnonclosure_tx_one_sr",["1.50"],["qcd_tx_one"],["OneBOneFat_.*"]) +if doSyst: writeNormSyst("CMS_HPTB_QCDnonclosure_tx_two_sr",["1.50"],["qcd_tx_two"],["OneBOneFat_.*"]) +if doSyst: writeNormSyst("CMS_HPTB_QCDnonclosure_tx_three_sr",["1.50"],["qcd_tx_three"],["OneBOneFat_.*"]) + +if doSyst: writeNormSyst("CMS_HPTB_QCDnonclosure_wx_one_mr",["1.50"],["qcd_wx_one"],["OneBOneMirrorFat_.*"]) +if doSyst: writeNormSyst("CMS_HPTB_QCDnonclosure_wx_two_mr",["1.50"],["qcd_wx_two"],["OneBOneMirrorFat_.*"]) +if doSyst: writeNormSyst("CMS_HPTB_QCDnonclosure_wx_three_mr",["1.50"],["qcd_wx_three"],["OneBOneMirrorFat_.*"]) +if doSyst: writeNormSyst("CMS_HPTB_QCDnonclosure_tx_one_mr",["1.50"],["qcd_tx_one"],["OneBOneMirrorFat_.*"]) +if doSyst: writeNormSyst("CMS_HPTB_QCDnonclosure_tx_two_mr",["1.50"],["qcd_tx_two"],["OneBOneMirrorFat_.*"]) +if doSyst: writeNormSyst("CMS_HPTB_QCDnonclosure_tx_three_mr",["1.50"],["qcd_tx_three"],["OneBOneMirrorFat_.*"]) ## "ewk" get the envelop of the DY and W+jets if doSyst: writeNormSyst("QCDscale_ewk",["0.996/1.008"],["ewk"]) @@ -1792,7 +1745,7 @@ def importPdfFromTH1SumBKG(cat,mc,syst=None,do1Third=False): h=mergeCategory(tfile,toget) if h == None: - print "<*> Hist OBS do not exists ",toget + print "<*> Hist do not exists ",toget raise IOError if h != None: From cb1c9ad3186623c871a6eed12e4bf0c19b5bf981 Mon Sep 17 00:00:00 2001 From: maria Date: Sun, 11 Nov 2018 16:01:31 +0100 Subject: [PATCH 54/60] fix muRF ttbar, recover some region --- script/bwsFullHadTB.py | 11 ++++------- 1 file changed, 4 insertions(+), 7 deletions(-) diff --git a/script/bwsFullHadTB.py b/script/bwsFullHadTB.py index db0d3e20..55abd8c6 100644 --- a/script/bwsFullHadTB.py +++ b/script/bwsFullHadTB.py @@ -399,8 +399,8 @@ def mergeCategory(tfile,toget): if opts.kMass=="500": if "OneBOneMirrorFat_one_lowj" in x and y=="wbb" and "in" in reg: continue - if "OneBOneFat_one_lowj" in x and y=="wbb" and "below" in reg: continue - if "OneBOneFat_three_lowj" in x and y=="wbb" and "below" in reg: continue +# if "OneBOneFat_one_lowj" in x and y=="wbb" and "below" in reg: continue +# if "OneBOneFat_three_lowj" in x and y=="wbb" and "below" in reg: continue if opts.kMass=="1500" and not doSChannel: @@ -1394,11 +1394,8 @@ def importPdfFromTH1(cat,mc,myBin,LikelihoodMapping,syst=None): togetSyst = toget + "_" + syst["name"] toget += "_" + syst["name"] + s - if syst != None and "muRF" in syst["wsname"] and not doSChannel: - if mc["name"]=="ttb" or mc["name"]=="ttc" or mc["name"]=="ttlight" or mc["name"]=="ttbar": - hTmp = envelop(tfile,togetNom,togetSyst,s) - if mc["name"]=="Hptb" and not doSChannel: - hTmp = envelop(tfile,togetNom,togetSyst,s) + if syst != None and ("muRF_ttbar" in syst["wsname"] or ("muRF_Hptb" in syst["wsname"] and not doSChannel)): + hTmp = envelop(tfile,togetNom,togetSyst,s) elif syst != None and "Pol" in syst["wsname"]: if "qcd" in mc["name"]: From 1aa40ab0d1d6e378a73094d993b3583d3dc5154e Mon Sep 17 00:00:00 2001 From: maria Date: Tue, 20 Nov 2018 13:41:09 +0100 Subject: [PATCH 55/60] leptonic cards fixes NOV17 --- script/bwsTB.py | 140 +++++++++++++++++++++++++++++++++--------------- 1 file changed, 97 insertions(+), 43 deletions(-) diff --git a/script/bwsTB.py b/script/bwsTB.py index db3eebe9..3868c9f6 100644 --- a/script/bwsTB.py +++ b/script/bwsTB.py @@ -42,15 +42,13 @@ #parser.add_option("","--input1L",type='string',help="Input ROOT file. [%default]", default="/afs/cern.ch/work/d/dalfonso/CMSSW_9_1_0_pre2_ReTestNERO/src/ChargedHiggs/AUG6_FINAL_2ThirdSYST_bin200_wDATA_1l.root") ##parser.add_option("","--input2L",type='string',help="Input ROOT file. [%default]", default="/afs/cern.ch/work/d/dalfonso/CMSSW_9_1_0_pre2_ReTestNERO/src/ChargedHiggs/AUG6_FINAL_2ThirdSYST_bin200_wDATA_2l.root") -parser.add_option("","--input1L",type='string',help="Input ROOT file. [%default]", default="/afs/cern.ch/work/d/dalfonso/CMSSW_9_1_0_pre2_ReTestNERO/src/ChargedHiggs/AUG6_FINAL_2ThirdSYST_bTag_bin200_wDATA_1l.root") -parser.add_option("","--input2L",type='string',help="Input ROOT file. [%default]", default="/afs/cern.ch/work/d/dalfonso/CMSSW_9_1_0_pre2_ReTestNERO/src/ChargedHiggs/AUG6_FINAL_2ThirdSYST_bTag_bin200_wDATA_2l.root") -parser.add_option("","--input1LBin",type='string',help="Input ROOT file. [%default]", default="/afs/cern.ch/work/d/dalfonso/CMSSW_9_1_0_pre2_ReTestNERO/src/ChargedHiggs/AUG6_1l_1Third.root") -parser.add_option("","--input2LBin",type='string',help="Input ROOT file. [%default]", default="/afs/cern.ch/work/d/dalfonso/CMSSW_9_1_0_pre2_ReTestNERO/src/ChargedHiggs/AUG6_2l_1Third.root") - -#parser.add_option("","--input1LBin",type='string',help="Input ROOT file. [%default]", default="/afs/cern.ch/work/d/dalfonso/CMSSW_9_1_0_pre2_ReTestNERO/src/ChargedHiggs/AUG6_FINAL_2ThirdSYST_bTag_bin200_wDATA_1l.root") -#parser.add_option("","--input2LBin",type='string',help="Input ROOT file. [%default]", default="/afs/cern.ch/work/d/dalfonso/CMSSW_9_1_0_pre2_ReTestNERO/src/ChargedHiggs/AUG6_FINAL_2ThirdSYST_bTag_bin200_wDATA_2l.root") +###---- these are the good files +parser.add_option("","--input2L",type='string',help="Input ROOT file. [%default]", default="/afs/cern.ch/work/d/dalfonso/CMSSW_9_1_0_pre2_ReTestNERO/src/ChargedHiggs/NOV1_FINAL_2ThirdSYST_wDATA_2l.root") +parser.add_option("","--input2LBin",type='string',help="Input ROOT file. [%default]", default="/afs/cern.ch/work/d/dalfonso/CMSSW_9_1_0_pre2_ReTestNERO/src/ChargedHiggs/NOV1_2l_1Third.root") +parser.add_option("","--input1L",type='string',help="Input ROOT file. [%default]", default="/afs/cern.ch/work/d/dalfonso/CMSSW_9_1_0_pre2_ReTestNERO/src/ChargedHiggs//NOV1_FINAL_2ThirdSYST_wDATA_1l.root") +parser.add_option("","--input1LBin",type='string',help="Input ROOT file. [%default]", default="/afs/cern.ch/work/d/dalfonso/CMSSW_9_1_0_pre2_ReTestNERO/src/ChargedHiggs/NOV1_1l_1Third.root") ###### ###### @@ -155,6 +153,8 @@ def RebinN(h,nBin): #1l if opts.kTest==0 or opts.kTest==1 or opts.kTest==2 or opts.kTest==3 or opts.kTest==4 or opts.kTest==5 or opts.kTest==6 or opts.kTest==7 or opts.kTest==8 or opts.kTest==9 or opts.kTest==10 or opts.kTest==11 or opts.kTest==12 or opts.kTest==13 or opts.kTest==14 or opts.kTest==15 or opts.kTest==16 or opts.kTest==100 or opts.kTest==101 or opts.kTest==102: +# channel = ["1Ele"] +# channel = ["1Mu"] # channel = ["1Mu","1Ele"] channel = ["1L"] basecat = ["Baseline","topCRR4","topCRR5","extraRadCRR10","extraRadCRR7","charmCR"] @@ -164,7 +164,6 @@ def RebinN(h,nBin): # channel = ["2Mu"] # channel = ["2Ele"] # channel = ["1Mu1Ele"] -# channel = ["1Mu1Ele","2Mu","2Ele"] # channel = ["1Mu1Ele","2Mu","2Ele"] channel = ["2L"] basecat = ["Baseline","topCRR4","topCRR5","extraRadCRR10","extraRadCRR7"] @@ -396,13 +395,17 @@ def RebinN(h,nBin): ## set the MC sample if x=="charmCR": - catStore[name]["hasMC"]=["ttlf","ttb","ttcc","top","ewk","Hptb"] + catStore[name]["hasMC"]=["ttlf","ttb","ttcc","top","ewk","Hptb","ttx"] +# catStore[name]["hasMC"]=["ttlf","ttb","ttcc","top","ewk","dy_hf","Hptb","ttx"] if "extraRadCR" in x: - catStore[name]["hasMC"]=["ttlf","ttb","ttcc","top","ewk","Hptb"] + catStore[name]["hasMC"]=["ttlf","ttb","ttcc","top","ewk","Hptb","ttx"] +# catStore[name]["hasMC"]=["ttlf","ttb","ttcc","top","ewk","dy_hf","Hptb","ttx"] if "topCR" in x: - catStore[name]["hasMC"]=["ttlf","ttb","ttcc","top","ewk","Hptb"] + catStore[name]["hasMC"]=["ttlf","ttb","ttcc","top","ewk","Hptb","ttx"] +# catStore[name]["hasMC"]=["ttlf","ttb","ttcc","top","ewk","dy_hf","Hptb","ttx"] if x=="Baseline": - catStore[name]["hasMC"]=["ttlf","ttb","ttcc","top","ewk","Hptb"] + catStore[name]["hasMC"]=["ttlf","ttb","ttcc","top","ewk","Hptb","ttx"] +# catStore[name]["hasMC"]=["ttlf","ttb","ttcc","top","ewk","dy_hf","Hptb","ttx"] if y == "1Ele" or y == "1Mu" or y == "1L": mcStore={ @@ -416,13 +419,14 @@ def RebinN(h,nBin): ### "ttbb":{ "name":"ttbb","hist":["tt2b_TT_TuneCUETP8M2T4_13TeV-powheg-pythia8"],"num":3}, ### "tt2b":{ "name":"tt2b","hist":["tt2bMerged_TT_TuneCUETP8M2T4_13TeV-powheg-pythia8"],"num":4}, ### "ttbb":{ "name":"ttbb","hist":["tt2b_TT_TuneCUETP8M2T4_13TeV-powheg-pythia8","tt2bMerged_TT_TuneCUETP8M2T4_13TeV-powheg-pythia8"],"num":3}, +### NOMINAL "ttb":{ "name":"ttb","hist":["tt2b_TT_TuneCUETP8M2T4_13TeV-powheg-pythia8","tt2bMerged_TT_TuneCUETP8M2T4_13TeV-powheg-pythia8","tt1b_TT_TuneCUETP8M2T4_13TeV-powheg-pythia8"],"num":2}, "ttcc":{ "name":"ttcc","hist":["ttc_TT_TuneCUETP8M2T4_13TeV-powheg-pythia8"],"num":3}, "ttlf":{ "name":"ttlf","hist":["ttlight_TT_TuneCUETP8M2T4_13TeV-powheg-pythia8"],"num":1}, -# "ewk":{ "name":"ewk","hist":["WJetsToLNu_HT","DYJetsToLL_M-50_HT","DYJetsToLL_M-5to50_HT","ZZTo","WWTo","WZTo","ZZZ","WZZ","WWZ","WWW","VHToNonbb_M125","WH_HToBB_WToLNu_M125","ZH_HToBB_ZToLL"],"num":6}, -# "ewk":{ "name":"ewk","hist":["WJetsToLNu_HT","DYJetsToLL_M-50_HT","DYJetsToLL_M-5to50_HT","ZZTo","WZTo","ZZZ","WZZ","WWZ","WWW","WH_HToBB_WToLNu_M125","ZH_HToBB_ZToLL"],"num":5}, +## "ewk":{ "name":"ewk","hist":["WJetsToLNu_HT","DYJetsToLL_M-50_HT","DYJetsToLL_M-5to50_HT","EWK"],"num":4}, - "top":{ "name":"top","hist":["TTX","ST"],"num":5} + "top":{ "name":"top","hist":["ST"],"num":5}, + "ttx":{ "name":"ttx","hist":["TTX"],"num":7} # "qcd":{ "name":"top","hist":["QCD_HT"],"num":8} } else: @@ -437,11 +441,15 @@ def RebinN(h,nBin): ### "ttbb":{ "name":"ttbb","hist":["tt2b_TT_TuneCUETP8M2T4_13TeV-powheg-pythia8"],"num":3}, ### "tt2b":{ "name":"tt2b","hist":["tt2bMerged_TT_TuneCUETP8M2T4_13TeV-powheg-pythia8"],"num":4}, ### "ttbb":{ "name":"ttbb","hist":["tt2b_TT_TuneCUETP8M2T4_13TeV-powheg-pythia8","tt2bMerged_TT_TuneCUETP8M2T4_13TeV-powheg-pythia8"],"num":3}, +#### NOMINAL "ttb":{ "name":"ttb","hist":["tt2b_TT_TuneCUETP8M2T4_13TeV-powheg-pythia8","tt2bMerged_TT_TuneCUETP8M2T4_13TeV-powheg-pythia8","tt1b_TT_TuneCUETP8M2T4_13TeV-powheg-pythia8"],"num":2}, "ttcc":{ "name":"ttcc","hist":["ttc_TT_TuneCUETP8M2T4_13TeV-powheg-pythia8"],"num":3}, "ttlf":{ "name":"ttlf","hist":["ttlight_TT_TuneCUETP8M2T4_13TeV-powheg-pythia8"],"num":1}, - "ewk":{ "name":"ewk","hist":["WJetsToLNu_HT","DYJetsToLL_M-50_HT","EWK"],"num":4}, - "top":{ "name":"top","hist":["TTX","ST"],"num":5} +## "ewk":{ "name":"ewk","hist":["WJetsToLNu_HT","DYJetsToLL_M-50_HT","EWK"],"num":4}, + "ewk":{ "name":"ewk","hist":["WJetsToLNu_HT","light_DYJetsToLL_M-50_HT","EWK"],"num":4}, + "dy_hf":{ "name":"dy_hf","hist":["bb_DYJetsToLL_M-50_HT"],"num":6}, + "top":{ "name":"top","hist":["ST"],"num":5}, + "ttx":{ "name":"ttx","hist":["TTX"],"num":7} # "qcd":{ "name":"top","hist":["QCD_HT"],"num":8} } @@ -463,27 +471,35 @@ def RebinN(h,nBin): #### #### Theo #### - "CMS_topreweight":{"type":"shape", "wsname":"CMS_topreweight","name":"TOPRW","proc":["ttlf","ttb","ttcc"]}, ## name used for shape - "CMS_HPTB_mcreweight_ewk":{"type":"shape", "wsname":"CMS_HPTB_mcreweight_ewk","name":"htRECO","proc":["ewk"]}, ## name used for shape +# "CMS_topreweight":{"type":"shape", "wsname":"CMS_topreweight","name":"TOPRW","proc":["ttlf","ttb","ttcc"]}, ## name used for shape + "CMS_HPTB_mcreweight_ewk":{"type":"shape", "wsname":"CMS_HPTB_mcreweight_ewk","name":"htRECO","proc":["ewk","dy_hf"]}, ## name used for shape ## "QCDscale":{"type":"shape", "wsname":"QCDscale","name":"ScaleRF","proc":["Hptb","ttlf","ttb","ttbb","tt2b","ttcc"]} ## name used for shape - "muRFenv_ttbar":{"type":"shape", "wsname":"muRFenv_ttbar","name":"Scale","proc":["ttlf","ttb","ttcc"]}, ## name used for shape -# "muRF_ttbar":{"type":"shape", "wsname":"muRF_ttbar","name":"Scale","proc":["ttlf","ttb","ttcc"]}, ## name used for shape -# "muR_ttbar":{"type":"shape", "wsname":"muR_ttbar","name":"Scale","proc":["ttlf","ttb","ttcc"]}, ## name used for shape -# "muF_ttbar":{"type":"shape", "wsname":"muF_ttbar","name":"Scale","proc":["ttlf","ttb","ttcc"]}, ## name used for shape - - "muRFenv_ewk":{"type":"shape", "wsname":"muRFenv_ewk","name":"Scale","proc":["ewk"]}, ## name used for shape -# "muRF_ewk":{"type":"shape", "wsname":"muRF_ewk","name":"Scale","proc":["ewk"]}, ## name used for shape -# "muR_ewk":{"type":"shape", "wsname":"muR_ewk","name":"Scale","proc":["ewk"]}, ## name used for shape -# "muF_ewk":{"type":"shape", "wsname":"muF_ewk","name":"Scale","proc":["ewk"]}, ## name used for shape - - "muRFenv_Hptb":{"type":"shape", "wsname":"muRFenv_Hptb","name":"Scale","proc":["Hptb"]}, ## name used for shape -# "muRF_Hptb":{"type":"shape", "wsname":"muRF_Hptb","name":"Scale","proc":["Hptb"]}, ## name used for shape -# "muR_Hptb":{"type":"shape", "wsname":"muR_Hptb","name":"Scale","proc":["Hptb"]}, ## name used for shape -# "muF_Hptb":{"type":"shape", "wsname":"muF_Hptb","name":"Scale","proc":["Hptb"]}, ## name used for shape +# "muRFenv_ttbar":{"type":"shape", "wsname":"muRFenv_ttbar","name":"Scale","proc":["ttlf","ttb","ttcc"]}, ## name used for shape + "muRF_ttbar":{"type":"shape", "wsname":"muRF_ttbar","name":"ScaleRF","proc":["ttlf","ttb","ttcc"]}, ## name used for shape + "muR_ttbar":{"type":"shape", "wsname":"muR_ttbar","name":"ScaleR","proc":["ttlf","ttb","ttcc"]}, ## name used for shape + "muF_ttbar":{"type":"shape", "wsname":"muF_ttbar","name":"ScaleF","proc":["ttlf","ttb","ttcc"]}, ## name used for shape + +# "muRFenv_ewk":{"type":"shape", "wsname":"muRFenv_ewk","name":"Scale","proc":["ewk"]}, ## name used for shape +# "muRFenv_ewk":{"type":"shape", "wsname":"muRFenv_ewk","name":"Scale","proc":["ewk","dy_hf"]}, ## name used for shape + "muRF_ewk":{"type":"shape", "wsname":"muRF_ewk","name":"ScaleRF","proc":["ewk","dy_hf"]}, ## name used for shape + "muR_ewk":{"type":"shape", "wsname":"muR_ewk","name":"ScaleR","proc":["ewk","dy_hf"]}, ## name used for shape + "muF_ewk":{"type":"shape", "wsname":"muF_ewk","name":"ScaleF","proc":["ewk","dy_hf"]}, ## name used for shape + +# "muRFenv_Hptb":{"type":"shape", "wsname":"muRFenv_Hptb","name":"Scale","proc":["Hptb"]}, ## name used for shape + "muRF_Hptb":{"type":"shape", "wsname":"muRF_Hptb","name":"ScaleRF","proc":["Hptb"]}, ## name used for shape + "muR_Hptb":{"type":"shape", "wsname":"muR_Hptb","name":"ScaleR","proc":["Hptb"]}, ## name used for shape + "muF_Hptb":{"type":"shape", "wsname":"muF_Hptb","name":"ScaleF","proc":["Hptb"]}, ## name used for shape + # "muRFenv_top":{"type":"shape", "wsname":"muRFenv_top","name":"Scale","proc":["top"]}, ## name used for shape # "muRF_top":{"type":"shape", "wsname":"muRF_top","name":"Scale","proc":["top"]}, ## name used for shape # "muR_top":{"type":"shape", "wsname":"muR_top","name":"Scale","proc":["top"]}, ## name used for shape # "muF_top":{"type":"shape", "wsname":"muF_top","name":"Scale","proc":["top"]}, ## name used for shape + +# "muRFenv_ttx":{"type":"shape", "wsname":"muRFenv_ttx","name":"Scale","proc":["ttx"]}, ## name used for shape + "muRF_ttx":{"type":"shape", "wsname":"muRF_ttx","name":"ScaleRF","proc":["ttx"]}, ## name used for shape + "muR_ttx":{"type":"shape", "wsname":"muR_ttx","name":"ScaleR","proc":["ttx"]}, ## name used for shape + "muF_ttx":{"type":"shape", "wsname":"muF_ttx","name":"ScaleF","proc":["ttx"]}, ## name used for shape + "CMS_res_j":{"type":"shape", "wsname":"CMS_res_j","name":"JER","proc":[".*"]}, ## name used for shape #### #### JEC sources @@ -547,12 +563,12 @@ def RebinN(h,nBin): #print "---------------------- --------" #fileTmp="AUG6_HT/"+label+VarTest+opts.output -fileTmp="SEPT12_HT200/"+ label + VarTest + str(opts.kMass) + opts.output +fileTmp="NOV17_HT200_UE_1Mu_muRF/"+ label + VarTest + str(opts.kMass) + opts.output w = ROOT.RooWorkspace("w","w") datNameTmp = opts.datCardName #datName = "AUG6_HT/"+ label + VarTest + datNameTmp -datName = "SEPT12_HT200/"+ label + VarTest + str(opts.kMass) + datNameTmp +datName = "NOV17_HT200_UE_1Mu_muRF/"+ label + VarTest + str(opts.kMass) + datNameTmp datacard=open(datName,"w") datacard.write("-------------------------------------\n") @@ -963,7 +979,7 @@ def importStat(): writeNormSyst(syst,systStore[syst]["value"],systStore[syst]["proc"],["2L"]) writeNormSyst(syst,systStore[syst]["value"],systStore[syst]["proc"],["1L"]) elif "CMS_eff_t_veto" in systStore[syst]["wsname"]: - writeNormSyst(syst,systStore[syst]["value"],systStore[syst]["proc"],["1Mu","1Ele"]) + writeNormSyst(syst,systStore[syst]["value"],systStore[syst]["proc"],["1Mu$","1Ele$"]) else: writeNormSyst(syst,systStore[syst]["value"],systStore[syst]["proc"]) if systStore[syst]["type"] == "shape": @@ -994,14 +1010,24 @@ def importStat(): #if doSyst: writeNormSyst("bgnorm_ttbb",["1.50"],["ttbb$"]) ##if doSyst: writeNormSyst("bgnorm_tt2b",["1.50"],["tt2b"]) +## V+jets HF +#if doSyst: writeNormSyst("bgnorm_dy_hf",["1.50"],["dy_hf"]) + ## "top" get the value od the single top if doSyst: writeNormSyst("QCDscale_top",["0.977/1.028"],["top"]) -if doSyst: writeNormSyst("pdf_top",["1.026"],["top"]) +if doSyst: writeNormSyst("pdf_qg",["1.026"],["top"]) if doSyst: writeNormSyst("CMS_mass_top",["1.022"],["top"]) -## "ewk" get the envelop of the DY and W+jets +## "ewk" get the envelop of the DY and W+jets from the AN2017_063_v11 if doSyst: writeNormSyst("QCDscale_ewk",["0.996/1.008"],["ewk"]) if doSyst: writeNormSyst("pdf_qqbar",["1.04"],["ewk"]) +#if doSyst: writeNormSyst("QCDscale_ewk",["0.996/1.008","0.996/1.008"],["ewk","dy_hf"]) +#if doSyst: writeNormSyst("pdf_qqbar",["1.04","1.04"],["ewk","dy_hf"]) + +### "ttx" take the ttW from the AN2017_063_v11 +if doSyst: writeNormSyst("QCDscale_ttx",["0.88/1.13"],["ttx"]) +if doSyst: writeNormSyst("pdf_qqbar",["1.02"],["ttx"]) +if doSyst: writeNormSyst("CMS_mass_top",["1.022"],["ttx"]) if doSyst: writeSystISRFSR(name="CMS_HPTB_ISR",valueL=["-999","999"], regexpL=["ttlf","ttb","ttcc"]) if doSyst: writeSystISRFSR(name="CMS_HPTB_FSR",valueL=["-999","999"], regexpL=["ttlf","ttb","ttcc"]) @@ -1090,7 +1116,14 @@ def MergeCategory(tfile,hname): if hTmp!=None and hTmp2!=None: hTmp.Add(hTmp2) if hTmp!=None and hTmp3!=None: hTmp.Add(hTmp3) else: + hTmp=tfile.Get(hname) +## temporaty need to fix for the merged categories +# print 'MergeCategory ',hname +# if "bb_DYJetsTo" in hname: +# hTmp = MergeDYHF(tfile,hname) +# else: hTmp=tfile.Get(hname) + #nominal if hTmp!= None and "bdt" in hname: @@ -1174,6 +1207,20 @@ def envelop(tfile,togetNom, togetSyst, s) : return hDown +def MergeDYHF(tfile,hname): + + hname_1=hname.replace("bb_DYJetsTo", "b_DYJetsTo") + hname_2=hname.replace("bb_DYJetsTo", "other_DYJetsTo") + hTmp=tfile.Get(hname) + hTmp1=tfile.Get(hname_1) + hTmp2=tfile.Get(hname_2) + if hTmp!=None and hTmp1!=None: hTmp.Add(hTmp1) + if hTmp!=None and hTmp2!=None: hTmp.Add(hTmp2) + + return hTmp + + + ## import Everything in ws TODO def importPdfFromTH1(cat,mc,myBin,LikelihoodMapping,syst=None): @@ -1260,7 +1307,7 @@ def importPdfFromTH1(cat,mc,myBin,LikelihoodMapping,syst=None): ### ## if syst != None and "QCDscale" in target: if syst != None and "muRFenv" in target: - if mc["name"]=="Hptb" or "WJetsToLNu_HT" in togetSyst or "DYJetsToLL_M-50_HT" in togetSyst or "DYJetsToLL_M-5to50_HT" in togetSyst or "ttlf" in mc["name"] or "ttb" in mc["name"] or "ttbb" in mc["name"] or "tt2b" in mc["name"] or "ttcc" in mc["name"] or "ST" in togetSyst: + if mc["name"]=="Hptb" or "WJetsToLNu_HT" in togetSyst or "DYJetsToLL_M-50_HT" in togetSyst or "DYJetsToLL_M-5to50_HT" in togetSyst or "ttlf" in mc["name"] or "ttb" in mc["name"] or "ttbb" in mc["name"] or "tt2b" in mc["name"] or "ttcc" in mc["name"] or "ST" in togetSyst or "TTX" in togetSyst: hTmp = envelop(tfile,togetNom,togetSyst,s) @@ -1284,11 +1331,14 @@ def importPdfFromTH1(cat,mc,myBin,LikelihoodMapping,syst=None): if hTmp!= None: print "<*> Reading Hist '"+toget+"' integral=",hTmp.Integral(),' nBin=',hTmp.GetNbinsX(), 'underflow=',hTmp.GetBinContent(0), 'overflow=',hTmp.GetBinContent(hTmp.GetNbinsX()+1),' entries=',hTmp.GetEntries() -# if mc["name"]=="ttb": -# hTmp.Scale(1.83) + # added the UE events + if hTmp and ( mc["name"]=="ttb" or mc["name"]=="ttbb" or mc["name"]=="ttcc" or mc["name"]=="ttlf" ) : + hTmp.Scale(1./4) ### SCALE for the 2/3 - if mc["name"]!="qcd" and not "EWK" in hname: +# if mc["name"]!="qcd" and not "EWK" in hname and not "TT_TuneCUETP8M2T4_13TeV" in hname: +# only the SIGNAL/TTBAR and V+jets are skimmed + if hTmp and mc["name"]!="qcd" and not "EWK" in hname and not "TTX" in hname and not "ST" in hname: hTmp.Scale(1.5) ### -- MC -- @@ -1461,6 +1511,10 @@ def importPdfFromTH1SumBKG(cat,mc,syst=None,do1Third=False): hTmp = MergeCategory(tfile,toget) + # added the UE events + if hTmp and ( mc["name"]=="ttb" or mc["name"]=="ttbb" or mc["name"]=="ttcc" or mc["name"]=="ttlf") : + hTmp.Scale(1./4) + if hTmp!= None: print "<*> Reading Hist '"+toget+"'",hTmp.Integral(),' nBin=',hTmp.GetNbinsX(),'underflow=',hTmp.GetBinContent(0), 'overflow=',hTmp.GetBinContent(hTmp.GetNbinsX()+1), ' entries=',hTmp.GetEntries() if hTmp == None: @@ -1635,7 +1689,7 @@ def importPdfFromTH1SumBKG(cat,mc,syst=None,do1Third=False): toget_2=toget.replace("_SingleMuon", "_SingleElectron") hTmp2=tfile.Get(toget_2) if h!= None and hTmp2: h.Add(hTmp2) - if "1L" in cat["dir"]: + elif "1L" in cat["dir"]: toget_1=toget.replace("_1L", "_1Mu") toget_1+="_SingleMuon" toget_2=toget.replace("_1L", "_1Ele") From eaf05a0a071d5adccedbc57d9a0fe9ce867895df Mon Sep 17 00:00:00 2001 From: maria Date: Tue, 20 Nov 2018 16:09:58 +0100 Subject: [PATCH 56/60] hadronic script: fix at the SEPT19 HEXO --- script/bwsFullHadTB.py | 297 +++++++++++++---------------------------- 1 file changed, 93 insertions(+), 204 deletions(-) diff --git a/script/bwsFullHadTB.py b/script/bwsFullHadTB.py index 55abd8c6..428264cb 100644 --- a/script/bwsFullHadTB.py +++ b/script/bwsFullHadTB.py @@ -98,10 +98,13 @@ #parser.add_option("","--input",type='string',help="Input ROOT file. [%default]", default="/afs/cern.ch/user/h/hum/work/public/CMSSW_8_0_26_patch1/src/ChargedHiggs/ntufile/preapp3systmore.root") #parser.add_option("","--inputBin",type='string',help="Input ROOT file. [%default]", default="/afs/cern.ch/user/h/hum/work/public/CMSSW_8_0_26_patch1/src/ChargedHiggs/ntufile/preapp3systmore.root") - ## OCT8 + Schannel/Associated results (7 ttbar samples) -parser.add_option("","--input",type='string',help="Input ROOT file. [%default]", default="/afs/cern.ch/user/h/hum/work/public/CMSSW_8_0_26_patch1/src/ChargedHiggs/ntufile/preapp3syst7tt.root") -parser.add_option("","--inputBin",type='string',help="Input ROOT file. [%default]", default="/afs/cern.ch/user/h/hum/work/public/CMSSW_8_0_26_patch1/src/ChargedHiggs/ntufile/preapp3syst7tt.root") +#parser.add_option("","--input",type='string',help="Input ROOT file. [%default]", default="/afs/cern.ch/user/h/hum/work/public/CMSSW_8_0_26_patch1/src/ChargedHiggs/ntufile/preapp3syst7tt.root") +#parser.add_option("","--inputBin",type='string',help="Input ROOT file. [%default]", default="/afs/cern.ch/user/h/hum/work/public/CMSSW_8_0_26_patch1/src/ChargedHiggs/ntufile/preapp3syst7tt.root") + +## as above but w/o TOPt (7 ttbar samples) +parser.add_option("","--input",type='string',help="Input ROOT file. [%default]", default="/afs/cern.ch/user/h/hum/work/public/CMSSW_8_0_26_patch1/src/ChargedHiggs/PreApp3jerALL/PreApp3notopre.root") +parser.add_option("","--inputBin",type='string',help="Input ROOT file. [%default]", default="/afs/cern.ch/user/h/hum/work/public/CMSSW_8_0_26_patch1/src/ChargedHiggs/PreApp3jerALL/PreApp3notopre.root") ## REMEMBER TO: # a) change the rebin 20% to 50% Inf @@ -274,7 +277,7 @@ def mergeCategory(tfile,toget): ### FINAL conf if doSChannel: - basecat = [ "OneBOneFat_one_highj","OneBOneFat_two_highj", "OneBOneFat_one_lowj","OneBOneFat_two_lowj" + basecat = [ "OneBOneFat_one_lowj","OneBOneFat_two_lowj","OneBOneFat_one_highj","OneBOneFat_two_highj" ,"OneBOneFat1l_one","OneBOneFat1l_two" ,"OneBOneMirrorFat_one_highj","OneBOneMirrorFat_two_highj", "OneBOneMirrorFat_one_lowj","OneBOneMirrorFat_two_lowj" ] @@ -341,9 +344,9 @@ def mergeCategory(tfile,toget): for y in channel: for x in basecat: -# region = ["_in","_above","_below"] + region = ["_in","_above","_below"] # region = ["_above","_below"] - region = ["_in"] +# region = ["_in"] if "OneBOneMirrorFat" in x: region = ["_in"] @@ -363,6 +366,7 @@ def mergeCategory(tfile,toget): # catStore [ name ] = { "name": name,"dir": x+ "_" + y,"file": None, "hasMC":["all"],"var":"invariantExt"} +#---------------------------------------------------------------------------------------------------------- # UNDEFINED # if "OneBOneFat_one" in x and y=="wbb": continue @@ -399,29 +403,28 @@ def mergeCategory(tfile,toget): if opts.kMass=="500": if "OneBOneMirrorFat_one_lowj" in x and y=="wbb" and "in" in reg: continue -# if "OneBOneFat_one_lowj" in x and y=="wbb" and "below" in reg: continue -# if "OneBOneFat_three_lowj" in x and y=="wbb" and "below" in reg: continue + if "OneBOneMirrorFat_one_lowj" in x and y=="wbj" and "in" in reg: continue + if "OneBOneMirrorFat_two_lowj" in x and y=="wbj" and "in" in reg: continue + if opts.kMass=="650": + if "OneBOneMirrorFat_two_lowj" in x and y=="wbj" and "in" in reg: continue if opts.kMass=="1500" and not doSChannel: if "OneBOneMirrorFat_three_highj" in x and y=="wbb" and "in" in reg: continue - if "OneBOneMirrorFat_three_lowj" in x and y=="wbb" and "in" in reg: continue - - if opts.kMass=="3000" and not doSChannel: - if "_three_lowj" in x and ( y=="t1b" or y=="t0b" ) and "above" in reg: continue - if "_three_highj" in x and ( y=="t0b" ) and "in" in reg: continue - if "_three_lowj" in x and (y=="t0b") and "in" in reg: continue if opts.kMass=="2500" and not doSChannel: if "OneBOneFat_three_highj" in x and (y=="t0b" or y=="t1b") and "in" in reg: continue if "OneBOneFat_three_highj" in x and y=="t0b" and "above" in reg: continue - # this one below has overflow - if "OneBOneFat_three_highj" in x and y=="t1b" and "above" in reg: continue -# if "_three_highj" in x and (y=="t0b" or y=="t1b") and "in" in reg: continue -# if "_three_highj" in x and (y=="t0b") and "above" in reg: continue -### if "_three_lowj" in x and (y=="t0b") and "in" in reg: continue -### if "_three_highj" in x and (y=="t0b" or y=="t1b") and "above" in reg: continue +# # this one below has overflow +# if "OneBOneFat_three_highj" in x and y=="t1b" and "above" in reg: continue + if opts.kMass=="3000" and not doSChannel: +# # this one below has overflow + if "OneBOneFat_three_highj" in x and (y=="t1b") and "above" in reg: continue + if "OneBOneFat_three_highj" in x and (y=="t0b") and "in" in reg: continue + if "OneBOneMirrorFat_three_lowj" in x and (y=="t0b") and "in" in reg: continue + +#---------------------------------------------------------------------------------------------------------- if (opts.kMass=="1000" or opts.kMass=="900" or opts.kMass=="800") and doSChannel: if "OneBOneFat1l_two" in x and y=="t0b": continue @@ -432,150 +435,25 @@ def mergeCategory(tfile,toget): if opts.kMass=="800" and doSChannel: if "OneBOneMirrorFat_two_highj" in x and y=="wbb" and "in" in reg : continue - if (opts.kMass=="1500" or opts.kMass=="2000" or opts.kMass=="3000") and doSChannel: + if (opts.kMass=="1500") and doSChannel: if "OneBOneMirrorFat_one_highj" in x and y=="wbb" and "in" in reg : continue if opts.kMass=="2000" and doSChannel: if "OneBOneFat_two_highj" in x and "above" in reg and y=="wbb": continue if "OneBOneFat_one_highj" in x and "above" in reg and y=="wbb": continue - + if "OneBOneMirrorFat_two_highj" in x and "in" in reg and y=="wbb": continue +# if opts.kMass=="3000" and doSChannel: if "OneBOneFat_two_highj" in x and "above" in reg and y=="wbb": continue - if "OneBOneFat_two_highj" in x and "in" in reg and y=="wbb": continue - if "OneBOneMirrorFat_two_lowj" in x and "in" in reg and y=="wbb": continue if "OneBOneFat_one_highj" in x and "above" in reg and y=="wbb": continue + + if "OneBOneFat_two_highj" in x and "in" in reg and y=="wbb": continue if "OneBOneMirrorFat_one_highj" in x and "in" in reg and y=="wbb": continue - if "OneBOneMirrorFat_one_lowj" in x and "in" in reg and y=="wbb": continue - if "OneBOneFat_two_lowj" in x and "above" in reg and y=="wbb": continue - if "OneBOneFat_two_lowj" in x and "in" in reg and y=="wbb": continue - if "OneBOneFat_one_highj" in x and "in" in reg and y=="wbb": continue - - - ## below are for associated only -# if not doSChannel and (opts.kMass=="400") and "in" in reg or "below" in reg: -# if not doSChannel and (opts.kMass=="400") and ("below" in reg or "in" in reg): -# if "_three_lowj" in x and y=="wbb": continue -# if "_one_lowj" in x and y=="wbj": continue - -# if not doSChannel and (opts.kMass=="1500" or opts.kMass=="2000" or opts.kMass=="2500" or opts.kMass=="3000") and "in" in reg: -# if "_two_lowj" in x and y=="wbj": continue -# if "_three_highj" in x and y=="wbj": continue - -# if not doSChannel and (opts.kMass=="2000" or opts.kMass=="2500" or opts.kMass=="3000") and "in" in reg: -# if "_one_highj" in x and y=="wbj": continue -# if "_two_highj" in x and y=="wbj": continue -# if "_three_lowj" in x and y=="wbb": continue -# if "_three_highj" in x and y=="wbb": continue - -# if not doSChannel and (opts.kMass=="2500" or opts.kMass=="3000") and "in" in reg: -# if "_two_lowj" in x and y=="wbb": continue -# if "_three_lowj" in x and y=="wbb": continue -# if "_three_highj" in x and y=="wbb": continue -# if "_one_lowj" in x and y=="wbj": continue - -###################### -############ s-channel -###################### -# if doSChannel and (opts.kMass=="800" or opts.kMass=="900" or opts.kMass=="1000" or opts.kMass=="1500" or opts.kMass=="2000" or opts.kMass=="2500" or opts.kMass=="3000") and "in" in reg: -# if "_two_highj" in x and y=="wbb": continue -# if "_one_highj" in x and y=="wbj": continue - -# if doSChannel and (opts.kMass=="900" or opts.kMass=="1000" or opts.kMass=="1500" or opts.kMass=="2000" or opts.kMass=="2500" or opts.kMass=="3000") and "in" in reg: -# if "_two_lowj" in x and y=="wbj": continue -# if "_two_highj" in x and y=="wbj": continue - -# if doSChannel and (opts.kMass=="1000" or opts.kMass=="1500" or opts.kMass=="2000" or opts.kMass=="2500" or opts.kMass=="3000") and "in" in reg: -# if y=="wbb": continue -# if y=="wbj": continue - -###################### -###################### -###################### - - -# if opts.kMass=="2000" or opts.kMass=="2500" or opts.kMass=="3000": -## if opts.kMass=="1500" or opts.kMass=="2000" or opts.kMass=="2500" or opts.kMass=="3000": -# if y=="wbj": continue -# if "_three" in x and y=="wbb": continue -# if "_two" in x and y=="wbj": continue -# if "_two" in x and y=="wbb" and opts.kMass=="3000": continue -# if "_three" in x and y=="t0b": continue - - -# if opts.kMass=="2500" or opts.kMass=="3000": - # # for the 2000,2500,3000: (They are all in the below bin) -# if "OneBOneMirrorFat" in x and y=="wbb" and ("above" in reg or "in" in reg): continue -# if "OneBOneMirrorFat" in x and y=="wbj" and ("above" in reg or "in" in reg): continue -# if "OneBOneFat" in x and y=="wbb" and ("above" in reg or "in" in reg): continue -# if "OneBOneFat" in x and y=="wbj" and ("above" in reg or "in" in reg): continue - - -## if "OneBOneMirrorFat_three_lowj" in x and y=="t0b": continue -# if "_three" in x and ("above" in reg) and (y=="t0b"): continue -# if "_three" in x and ("above" in reg) and (y=="t1b"): continue -# if "_two" in x and ("above" in reg) and (y=="t0b"): continue -# if "_two" in x and ("above" in reg) and (y=="t1b"): continue -# if "_three" in x and (y=="wbb"): continue -# if "_three" in x and (y=="wbj"): continue - -# if doSChannel and opts.kMass=="3000": -# if ("in" in reg or "above" in reg): continue - -# if doSChannel and opts.kMass=="3000": -# if "OneBOneFat_two_lowj" in x and y=="t1b" and "in" in reg: continue -# if "OneBOneMirrorFat_two_highj" in x and y=="t1b" and ("above" in reg) : continue -# if "OneBOneFat_two_highj" in x and y=="t1b" and ("in" in reg) : continue -# if "OneBOneMirrorFat_two_highj" in x and y=="t1b" and ("in" in reg) : continue - -# if "OneBOneFat_one_lowj" in x and y=="wbb": continue -# if "OneBOneMirrorFat_one_highj" in x and y=="wbb": continue - -# if opts.kMass=="2000" or opts.kMass=="2500" or opts.kMass=="3000": -# # # for the 2000,2500,3000: (They are all in the below bin) -# if "OneBOneMirrorFat" in x and y=="wbb" and ("above" in reg): continue -# if "OneBOneMirrorFat" in x and y=="wbj" and ("above" in reg): continue -# if "OneBOneFat" in x and y=="wbb" and ("above" in reg): continue -# if "OneBOneFat" in x and y=="wbj" and ("above" in reg): continue - - # THIS IS planB -# if "_lowj" in x and y=="wbb": continue -# if "_lowj" in x and y=="wbj": continue + if "OneBOneMirrorFat_two_highj" in x and "in" in reg and y=="wbb": continue - # UNDEFINED - # they should not exist but some are filled -# if "OneBOneFat_one" in x and y=="t1b": continue -# if "OneBOneMirrorFat_one" in x and y=="t1b": continue -# if "OneBOneFat1l_one" in x and y=="t1b": continue - -# if "OneBOneFat_three" in x and y=="wbj": continue -# if "OneBOneMirrorFat_three" in x and y=="wbj": continue -# if "OneBOneFat1l_three" in x and y=="wbj": continue - -# if opts.kMass=="2000" or opts.kMass=="2500" or opts.kMass=="3000": -# # # for the 2000,2500,3000: (They are all in the below bin) -# if "OneBOneMirrorFat" in x and y=="wbb" and ("above" in reg or "in" in reg): continue -# if "OneBOneMirrorFat" in x and y=="wbj" and ("above" in reg or "in" in reg): continue -# # ## recovered the wbb - in -# if "OneBOneFat" in x and y=="wbb" and ("above" in reg ): continue -# if "OneBOneFat" in x and y=="wbj" and ("above" in reg or "in" in reg): continue - -# # t0b/t1b & 3b NO STAT very rare situation -# if "OneBOneMirrorFat_three_lowj" in x and y=="t1b": continue -# if "OneBOneMirrorFat_three_highj" in x and y=="t1b": continue - -# if doSChannel or (opts.kMass=="2000" or opts.kMass=="2500" or opts.kMass=="3000"): -# if "OneBOneFat_three" in x and y=="t0b": continue -# if "OneBOneMirrorFat_three" in x and y=="t0b": continue - -# ## NO STAT -# if "OneBOneFat1l_one" in x and (y=="t0b" or y=="wbj"): continue - ## -## if "OneBOneFat1l_two" in x and ( y=="wbb" or y=="wbj" or y=="t0b" or y=="t1b"): continue -# if "OneBOneFat1l_two" in x and ( y=="wbb" or y=="wbj" or y=="t0b" or y=="t1b"): continue - ## -## if "OneBOneFat1l_three" in x and ( y=="wbb" or y=="t1b" or y=="t0b"): continue -# if "OneBOneFat1l_three" in x and ( y=="wbb" or y=="t1b" or y=="t0b"): continue +#---------------------------------------------------------------------------------------------------------- + if "OneBOneFat1l" in x: catStore [ name ] = { "name": name,"dir": x+ "_" + y,"file": None, "hasMC":["all"],"var":"HT"+reg} @@ -639,9 +517,12 @@ def mergeCategory(tfile,toget): #### trigger efficiency "CMS_eff_trigger":{"type":"lnN", "value":["1.05"] ,"proc":[".*"],"wsname":"CMS_eff_triggger","name":"XXX"}, ### Theory modeling - "CMS_topreweight":{"type":"shape", "wsname":"CMS_topreweight","name":"TOPRW","proc":["ttbar"]}, +## "CMS_topreweight":{"type":"shape", "wsname":"CMS_topreweight","name":"TOPRW","proc":["ttbar"]}, "muRF_Hptb":{"type":"shape", "wsname":"muRF_Hptb","name":"Scale","proc":["Hptb"]}, "muRF_ttbar":{"type":"shape", "wsname":"muRF_ttbar","name":"Scale","proc":["ttbar"]}, +# "muRF_ttbar":{"type":"shape", "wsname":"muRF_ttbar","name":"ScaleRF","proc":["ttbar"]}, +# "muF_ttbar":{"type":"shape", "wsname":"muF_ttbar","name":"ScaleF","proc":["ttbar"]}, +# "muR_ttbar":{"type":"shape", "wsname":"muR_ttbar","name":"ScaleR","proc":["ttbar"]}, # "muRF_ttbar_below":{"type":"shape", "wsname":"muRF_ttbar_below","name":"Scale","proc":["ttbar"]}, # "muRF_ttbar_in":{"type":"shape", "wsname":"muRF_ttbar_in","name":"Scale","proc":["ttbar"]}, # "muRF_ttbar_above":{"type":"shape", "wsname":"muRF_ttbar_above","name":"Scale","proc":["ttbar"]}, @@ -661,30 +542,31 @@ def mergeCategory(tfile,toget): "CMS_eff_Tau32":{"type":"lnN", "value":["1.02","1.02","1.02"] ,"proc":["ttbar","top","Hptb"],"wsname":"CMS_eff_Tau32","name":"XXX"}, ## name used for shape ## JER/S "CMS_res_j":{"type":"shape", "wsname":"CMS_res_j","name":"JER","proc":[".*"]}, - "CMS_scale_j":{"type":"shape", "wsname":"CMS_scale_j","name":"JESANDCSV","proc":["Hptb","ttbar","top","ewk"]}, - "CMS_scale_j_qcd_wx":{"type":"shape", "wsname":"CMS_scale_j_qcd_wx","name":"JESANDCSV","proc":["qcd_wx_one","qcd_wx_two","qcd_wx_three"]}, - "CMS_scale_j_qcd_tx":{"type":"shape", "wsname":"CMS_scale_j_qcd_tx","name":"JESANDCSV","proc":["qcd_tx_one","qcd_tx_two","qcd_tx_three"]}, + "CMS_scale_j":{"type":"shape", "wsname":"CMS_scale_j","name":"JESANDCSV","proc":["Hptb","ttbar","top","ewk"]}, + "CMS_scale_j_qcd_wx":{"type":"shape", "wsname":"CMS_scale_j_qcd_wx","name":"JESANDCSV","proc":["qcd_wx_one","qcd_wx_two","qcd_wx_three"]}, + "CMS_scale_j_qcd_tx":{"type":"shape", "wsname":"CMS_scale_j_qcd_tx","name":"JESANDCSV","proc":["qcd_tx_one","qcd_tx_two","qcd_tx_three"]}, + ## b-tagging ##Light jets Heavy flavor contamination - "CMS_btag_HF_qcd":{"type":"shape", "wsname":"CMS_btag_HF_qcd","name":"CSVRHF","proc":["qcd_wx_one","qcd_wx_two","qcd_wx_three","qcd_tx_one","qcd_tx_two","qcd_tx_three"]}, "CMS_btag_HF":{"type":"shape", "wsname":"CMS_btag_HF","name":"CSVRHF","proc":["ttbar","top","Hptb"]}, + "CMS_btag_HF_qcd":{"type":"shape", "wsname":"CMS_btag_HF_qcd","name":"CSVRHF","proc":["qcd_wx_one","qcd_wx_two","qcd_wx_three","qcd_tx_one","qcd_tx_two","qcd_tx_three"]}, ##Heavy jets light flavor contamination - "CMS_btag_LF":{"type":"shape", "wsname":"CMS_btag_LF","name":"CSVRLF","proc":["ttbar","top","Hptb"]}, - "CMS_btag_LF_qcd":{"type":"shape", "wsname":"CMS_btag_LF_qcd","name":"CSVRLF","proc":["qcd_wx_one","qcd_wx_two","qcd_wx_three","qcd_tx_one","qcd_tx_two","qcd_tx_three"]}, + "CMS_btag_LF":{"type":"shape", "wsname":"CMS_btag_LF","name":"CSVRLF","proc":["ttbar","top","Hptb"]}, + "CMS_btag_LF_qcd":{"type":"shape", "wsname":"CMS_btag_LF_qcd","name":"CSVRLF","proc":["qcd_wx_one","qcd_wx_two","qcd_wx_three","qcd_tx_one","qcd_tx_two","qcd_tx_three"]}, ##Linear and quadratic uncertainties # note decouple the qcd "CMS_btag_HFstat1":{"type":"shape", "wsname":"CMS_btag_HFstat1","name":"CSVRHFSTAT1","proc":["ttbar","top","Hptb"]}, "CMS_btag_HFstat2":{"type":"shape", "wsname":"CMS_btag_HFstat2","name":"CSVRHFSTAT2","proc":["ttbar","top","Hptb"]}, "CMS_btag_LFstat1":{"type":"shape", "wsname":"CMS_btag_LFstat1","name":"CSVRLFSTAT1","proc":["ttbar","top","Hptb"]}, "CMS_btag_LFstat2":{"type":"shape", "wsname":"CMS_btag_LFstat2","name":"CSVRLFSTAT2","proc":["ttbar","top","Hptb"]}, - "CMS_btag_CFerr1":{"type":"shape", "wsname":"CMS_btag_CFerr1","name":"CSVRCERR1","proc":["ttbar","top","Hptb"]}, - "CMS_btag_CFerr2":{"type":"shape", "wsname":"CMS_btag_CFerr2","name":"CSVRCERR2","proc":["ttbar","top","Hptb"]}, + "CMS_btag_CFerr1":{"type":"shape", "wsname":"CMS_btag_CFerr1","name":"CSVRCERR1","proc":["ttbar","top","Hptb"]}, + "CMS_btag_CFerr2":{"type":"shape", "wsname":"CMS_btag_CFerr2","name":"CSVRCERR2","proc":["ttbar","top","Hptb"]}, + ## "CMS_btag_HFstat1_qcd":{"type":"shape", "wsname":"CMS_btag_HFstat1_qcd","name":"CSVRHFSTAT1","proc":["qcd_wx_one","qcd_wx_two","qcd_wx_three","qcd_tx_one","qcd_tx_two","qcd_tx_three"]}, "CMS_btag_HFstat2_qcd":{"type":"shape", "wsname":"CMS_btag_HFstat2_qcd","name":"CSVRHFSTAT2","proc":["qcd_wx_one","qcd_wx_two","qcd_wx_three","qcd_tx_one","qcd_tx_two","qcd_tx_three"]}, - "CMS_btag_LFstat1_qcd":{"type":"shape", "wsname":"CMS_btag_LFstat1_qcd","name":"CSVRLFSTAT1","proc":["qcd_wx_one","qcd_wx_two","qcd_wx_three","qcd_tx_one","qcd_tx_two","qcd_tx_three"]}, - "CMS_btag_LFstat2_qcd":{"type":"shape", "wsname":"CMS_btag_LFstat2_qcd","name":"CSVRLFSTAT2","proc":["qcd_wx_one","qcd_wx_two","qcd_wx_three","qcd_tx_one","qcd_tx_two","qcd_tx_three"]}, - "CMS_btag_CFerr1_qcd":{"type":"shape", "wsname":"CMS_btag_CFerr1_qcd","name":"CSVRCERR1","proc":["qcd_wx_one","qcd_wx_two","qcd_wx_three","qcd_tx_one","qcd_tx_two","qcd_tx_three"]}, - "CMS_btag_CFerr2_qcd":{"type":"shape", "wsname":"CMS_btag_CFerr2_qcd","name":"CSVRCERR2","proc":["qcd_wx_one","qcd_wx_two","qcd_wx_three","qcd_tx_one","qcd_tx_two","qcd_tx_three"]}, - #### + "CMS_btag_LFstat1_qcd":{"type":"shape", "wsname":"CMS_btag_LFstat1_qcd","name":"CSVRLFSTAT1","proc":["qcd_wx_one","qcd_wx_two","qcd_wx_three","qcd_tx_one","qcd_tx_two","qcd_tx_three"]}, + "CMS_btag_LFstat2_qcd":{"type":"shape", "wsname":"CMS_btag_LFstat2_qcd","name":"CSVRLFSTAT2","proc":["qcd_wx_one","qcd_wx_two","qcd_wx_three","qcd_tx_one","qcd_tx_two","qcd_tx_three"]}, + "CMS_btag_CFerr1_qcd":{"type":"shape", "wsname":"CMS_btag_CFerr1_qcd","name":"CSVRCERR1","proc":["qcd_wx_one","qcd_wx_two","qcd_wx_three","qcd_tx_one","qcd_tx_two","qcd_tx_three"]}, + "CMS_btag_CFerr2_qcd":{"type":"shape", "wsname":"CMS_btag_CFerr2_qcd","name":"CSVRCERR2","proc":["qcd_wx_one","qcd_wx_two","qcd_wx_three","qcd_tx_one","qcd_tx_two","qcd_tx_three"]}, ## QCD Pol "CMS_scale_Pol_qcd_tx_one_1l":{"type":"shape", "wsname":"CMS_scale_Pol_qcd_tx_one_1l","name":"XXX","proc":["qcd_tx_one"]}, "CMS_scale_Pol_qcd_tx_two_1l":{"type":"shape", "wsname":"CMS_scale_Pol_qcd_tx_two_1l","name":"XXX","proc":["qcd_tx_two"]}, @@ -693,7 +575,7 @@ def mergeCategory(tfile,toget): "CMS_scale_Pol_qcd_wx_two_1l":{"type":"shape", "wsname":"CMS_scale_Pol_qcd_wx_two_1l","name":"XXX","proc":["qcd_wx_two"]}, "CMS_scale_Pol_qcd_wx_three_1l":{"type":"shape", "wsname":"CMS_scale_Pol_qcd_wx_three_1l","name":"XXX","proc":["qcd_wx_three"]}, ## - "CMS_scale_Pol_qcd_tx_one_in":{"type":"shape", "wsname":"CMS_scale_Pol_qcd_tx_one_in","name":"XXX","proc":["qcd_tx_one"]}, + "CMS_scale_Pol_qcd_tx_one_in":{"type":"shape", "wsname":"CMS_scale_Pol_qcd_tx_one_in","name":"XXX","proc":["qcd_tx_one"]}, "CMS_scale_Pol_qcd_tx_two_in":{"type":"shape", "wsname":"CMS_scale_Pol_qcd_tx_two_in","name":"XXX","proc":["qcd_tx_two"]}, "CMS_scale_Pol_qcd_tx_three_in":{"type":"shape", "wsname":"CMS_scale_Pol_qcd_tx_three_in","name":"XXX","proc":["qcd_tx_three"]}, "CMS_scale_Pol_qcd_wx_one_in":{"type":"shape", "wsname":"CMS_scale_Pol_qcd_wx_one_in","name":"XXX","proc":["qcd_wx_one"]}, @@ -710,11 +592,11 @@ def mergeCategory(tfile,toget): print "* ",cat,":",catStore[cat] print "---------------------- --------" -fileTmp="MIAO_NOV6_Shape/"+label+VarTest+opts.kMass+"_"+opts.output +fileTmp="MIAO_NOV20_Shape/"+label+VarTest+opts.kMass+"_"+opts.output w = ROOT.RooWorkspace("w","w") datNameTmp = opts.datCardName -datName = "MIAO_NOV6_Shape/"+label+ VarTest+opts.kMass+"_" + datNameTmp +datName = "MIAO_NOV20_Shape/"+label+ VarTest+opts.kMass+"_" + datNameTmp datacard=open(datName,"w") datacard.write("-------------------------------------\n") @@ -1032,19 +914,18 @@ def importStat(): elif "CMS_scale_SDMass_qcd_tx_above" in systStore[syst]["wsname"]: writeSystShape(systStore[syst],systStore[syst]["proc"],["above"]) - elif "CMS_scale_Pol_qcd_tx_one_in" in systStore[syst]["wsname"]: - writeSystShape(systStore[syst],systStore[syst]["proc"],["in","below","above"]) - elif "CMS_scale_Pol_qcd_tx_two_in" in systStore[syst]["wsname"]: - writeSystShape(systStore[syst],systStore[syst]["proc"],["in","below","above"]) - elif "CMS_scale_Pol_qcd_tx_three_in" in systStore[syst]["wsname"]: - writeSystShape(systStore[syst],systStore[syst]["proc"],["in","below","above"]) - - elif "CMS_scale_Pol_qcd_wx_one_in" in systStore[syst]["wsname"]: - writeSystShape(systStore[syst],systStore[syst]["proc"],["in","below","above"]) - elif "CMS_scale_Pol_qcd_wx_two_in" in systStore[syst]["wsname"]: - writeSystShape(systStore[syst],systStore[syst]["proc"],["in","below","above"]) - elif "CMS_scale_Pol_qcd_wx_three_in" in systStore[syst]["wsname"]: - writeSystShape(systStore[syst],systStore[syst]["proc"],["in","below","above"]) + elif "CMS_scale_Pol_qcd_tx_one_in" in systStore[syst]["wsname"]: + writeSystShape(systStore[syst],systStore[syst]["proc"],["in","below","above"]) + elif "CMS_scale_Pol_qcd_tx_two_in" in systStore[syst]["wsname"]: + writeSystShape(systStore[syst],systStore[syst]["proc"],["in","below","above"]) + elif "CMS_scale_Pol_qcd_tx_three_in_" in systStore[syst]["wsname"]: + writeSystShape(systStore[syst],systStore[syst]["proc"],["in","below","above"]) + elif "CMS_scale_Pol_qcd_wx_one_in" in systStore[syst]["wsname"]: + writeSystShape(systStore[syst],systStore[syst]["proc"],["in","below","above"]) + elif "CMS_scale_Pol_qcd_wx_two_in" in systStore[syst]["wsname"]: + writeSystShape(systStore[syst],systStore[syst]["proc"],["in","below","above"]) + elif "CMS_scale_Pol_qcd_wx_three_in" in systStore[syst]["wsname"]: + writeSystShape(systStore[syst],systStore[syst]["proc"],["in","below","above"]) elif "CMS_scale_Pol_qcd_wx_one_1l" in systStore[syst]["wsname"]: writeSystShape(systStore[syst],systStore[syst]["proc"],["1l"]) @@ -1089,16 +970,22 @@ def importStat(): if doSyst: writeNormSyst("CMS_HPTB_QCDnonclosure_wx_one_sr",["1.50"],["qcd_wx_one"],["OneBOneFat_.*"]) if doSyst: writeNormSyst("CMS_HPTB_QCDnonclosure_wx_two_sr",["1.50"],["qcd_wx_two"],["OneBOneFat_.*"]) if doSyst: writeNormSyst("CMS_HPTB_QCDnonclosure_wx_three_sr",["1.50"],["qcd_wx_three"],["OneBOneFat_.*"]) -if doSyst: writeNormSyst("CMS_HPTB_QCDnonclosure_tx_one_sr",["1.50"],["qcd_tx_one"],["OneBOneFat_.*"]) -if doSyst: writeNormSyst("CMS_HPTB_QCDnonclosure_tx_two_sr",["1.50"],["qcd_tx_two"],["OneBOneFat_.*"]) -if doSyst: writeNormSyst("CMS_HPTB_QCDnonclosure_tx_three_sr",["1.50"],["qcd_tx_three"],["OneBOneFat_.*"]) +if doSyst: writeNormSyst("CMS_HPTB_QCDnonclosure_t0_one_sr",["1.50"],["qcd_tx_one"],["OneBOneFat_.*_t0.*"]) +if doSyst: writeNormSyst("CMS_HPTB_QCDnonclosure_t0_two_sr",["1.50"],["qcd_tx_two"],["OneBOneFat_.*_t0.*"]) +if doSyst: writeNormSyst("CMS_HPTB_QCDnonclosure_t0_three_sr",["1.50"],["qcd_tx_three"],["OneBOneFat_.*_t0.*"]) +if doSyst: writeNormSyst("CMS_HPTB_QCDnonclosure_t1_one_sr",["1.50"],["qcd_tx_one"],["OneBOneFat_.*_t1.*"]) +if doSyst: writeNormSyst("CMS_HPTB_QCDnonclosure_t1_two_sr",["1.50"],["qcd_tx_two"],["OneBOneFat_.*_t1.*"]) +if doSyst: writeNormSyst("CMS_HPTB_QCDnonclosure_t1_three_sr",["1.50"],["qcd_tx_three"],["OneBOneFat_.*_t1.*"]) if doSyst: writeNormSyst("CMS_HPTB_QCDnonclosure_wx_one_mr",["1.50"],["qcd_wx_one"],["OneBOneMirrorFat_.*"]) if doSyst: writeNormSyst("CMS_HPTB_QCDnonclosure_wx_two_mr",["1.50"],["qcd_wx_two"],["OneBOneMirrorFat_.*"]) if doSyst: writeNormSyst("CMS_HPTB_QCDnonclosure_wx_three_mr",["1.50"],["qcd_wx_three"],["OneBOneMirrorFat_.*"]) -if doSyst: writeNormSyst("CMS_HPTB_QCDnonclosure_tx_one_mr",["1.50"],["qcd_tx_one"],["OneBOneMirrorFat_.*"]) -if doSyst: writeNormSyst("CMS_HPTB_QCDnonclosure_tx_two_mr",["1.50"],["qcd_tx_two"],["OneBOneMirrorFat_.*"]) -if doSyst: writeNormSyst("CMS_HPTB_QCDnonclosure_tx_three_mr",["1.50"],["qcd_tx_three"],["OneBOneMirrorFat_.*"]) +if doSyst: writeNormSyst("CMS_HPTB_QCDnonclosure_t0_one_mr",["1.50"],["qcd_tx_one"],["OneBOneMirrorFat_.*_t0.*"]) +if doSyst: writeNormSyst("CMS_HPTB_QCDnonclosure_t0_two_mr",["1.50"],["qcd_tx_two"],["OneBOneMirrorFat_.*_t0.*"]) +if doSyst: writeNormSyst("CMS_HPTB_QCDnonclosure_t0_three_mr",["1.50"],["qcd_tx_three"],["OneBOneMirrorFat_.*_t0.*"]) +if doSyst: writeNormSyst("CMS_HPTB_QCDnonclosure_t1_one_mr",["1.50"],["qcd_tx_one"],["OneBOneMirrorFat_.*_t1.*"]) +if doSyst: writeNormSyst("CMS_HPTB_QCDnonclosure_t1_two_mr",["1.50"],["qcd_tx_two"],["OneBOneMirrorFat_.*_t1.*"]) +if doSyst: writeNormSyst("CMS_HPTB_QCDnonclosure_t1_three_mr",["1.50"],["qcd_tx_three"],["OneBOneMirrorFat_.*_t1.*"]) ## "ewk" get the envelop of the DY and W+jets if doSyst: writeNormSyst("QCDscale_ewk",["0.996/1.008"],["ewk"]) @@ -1266,7 +1153,7 @@ def creatPolShape(tfile,togetNom, s) : for iBin in range(1,h.GetNbinsX()+1): c = h.GetBinContent(iBin) - flo = c * (h.GetBinCenter(iBin)) * 0.25/1000 + flo = c * (h.GetBinCenter(iBin)) * 0.30/1000 # flo = c * (h.GetBinCenter(iBin)) * 0.1/1000 #linear, 10%/1TeV, range from 5%-500 GeV to 50%-5000GeV #flo = c * math.log10(h.GetBinCenter(iBin)) * 0.1 #log10, 10%*log(HT/1GeV), range from 27%-500eV to 37%-5000GeV @@ -1274,8 +1161,8 @@ def creatPolShape(tfile,togetNom, s) : h.SetBinContent(iBin,c+flo) if 'Down' in s: - h.SetBinContent(iBin,c-flo) - + if c-flo > 0: h.SetBinContent(iBin,c-flo) + else: h.SetBinContent(iBin,0) normnew = h.Integral() h.Scale(normold/normnew) @@ -1421,8 +1308,8 @@ def importPdfFromTH1(cat,mc,myBin,LikelihoodMapping,syst=None): print "<*> Hist '"+toget+"' doesn't exist" # raise IOError ## raise error only if is on the 2Third and for the syst central value - if not ( "ST" in mc["hist"] or "ewk" in mc["hist"] or "TTX" in mc["hist"]) : - raise IOError + if "ST" in mc["hist"] or "ewk" in mc["hist"] or "TTX" in mc["hist"] : continue + else: raise IOError # not using the 1/3 and 2/3 # if ( mc["name"]=="ttb" or mc["name"]=="ttc" or mc["name"]=="ttlight" or "qcd" in mc["name"] ) and hTmp: @@ -1483,29 +1370,31 @@ def importPdfFromTH1(cat,mc,myBin,LikelihoodMapping,syst=None): print "* Importing ",target - for i in range(0,len(arglist_obs)): - if cat["name"] in arglist_obs.at(i).GetName(): - al = arglist_obs.at(i) + if h: + + for i in range(0,len(arglist_obs)): + if cat["name"] in arglist_obs.at(i).GetName(): + al = arglist_obs.at(i) ## print "-> with var", al[0] - roo_mc = ROOT.RooDataHist(target,target,ROOT.RooArgList(al),h) - pdf_mc = roo_mc + roo_mc = ROOT.RooDataHist(target,target,ROOT.RooArgList(al),h) + pdf_mc = roo_mc # hBIS = roo_mc.createHistogram("test", al) - getattr(w,'import')(pdf_mc,ROOT.RooCmdArg()) - g.extend([h,roo_mc,pdf_mc]) + getattr(w,'import')(pdf_mc,ROOT.RooCmdArg()) + g.extend([h,roo_mc,pdf_mc]) # w.writeToFile(fileTmp) ### WRITE HISTOGRAMS f = ROOT.TFile.Open(fileTmp,"update") - h.SetName(target) - h.Write() + if h: h.SetName(target) + if h: h.Write() f.Write() f.Close() - if syst==None and m< 10 : # not for signal, + if h and syst==None and m< 10 : # not for signal, print "DEBUG calling stat with target",target histName=cat["name"] if histName not in statStore: From b3c63f54520a632758d77004a5109f4c3e0a91ae Mon Sep 17 00:00:00 2001 From: maria Date: Fri, 23 Nov 2018 12:38:36 +0100 Subject: [PATCH 57/60] script leptonic: ewk --- script/bwsTB.py | 80 ++++++++++++++++++++++++++----------------------- 1 file changed, 43 insertions(+), 37 deletions(-) diff --git a/script/bwsTB.py b/script/bwsTB.py index 3868c9f6..82a62fea 100644 --- a/script/bwsTB.py +++ b/script/bwsTB.py @@ -395,17 +395,13 @@ def RebinN(h,nBin): ## set the MC sample if x=="charmCR": - catStore[name]["hasMC"]=["ttlf","ttb","ttcc","top","ewk","Hptb","ttx"] -# catStore[name]["hasMC"]=["ttlf","ttb","ttcc","top","ewk","dy_hf","Hptb","ttx"] + catStore[name]["hasMC"]=["ttlf","ttb","ttcc","top","ewk","ewk_hf","Hptb","ttx"] if "extraRadCR" in x: - catStore[name]["hasMC"]=["ttlf","ttb","ttcc","top","ewk","Hptb","ttx"] -# catStore[name]["hasMC"]=["ttlf","ttb","ttcc","top","ewk","dy_hf","Hptb","ttx"] + catStore[name]["hasMC"]=["ttlf","ttb","ttcc","top","ewk","ewk_hf","Hptb","ttx"] if "topCR" in x: - catStore[name]["hasMC"]=["ttlf","ttb","ttcc","top","ewk","Hptb","ttx"] -# catStore[name]["hasMC"]=["ttlf","ttb","ttcc","top","ewk","dy_hf","Hptb","ttx"] + catStore[name]["hasMC"]=["ttlf","ttb","ttcc","top","ewk","ewk_hf","Hptb","ttx"] if x=="Baseline": - catStore[name]["hasMC"]=["ttlf","ttb","ttcc","top","ewk","Hptb","ttx"] -# catStore[name]["hasMC"]=["ttlf","ttb","ttcc","top","ewk","dy_hf","Hptb","ttx"] + catStore[name]["hasMC"]=["ttlf","ttb","ttcc","top","ewk","ewk_hf","Hptb","ttx"] if y == "1Ele" or y == "1Mu" or y == "1L": mcStore={ @@ -423,8 +419,9 @@ def RebinN(h,nBin): "ttb":{ "name":"ttb","hist":["tt2b_TT_TuneCUETP8M2T4_13TeV-powheg-pythia8","tt2bMerged_TT_TuneCUETP8M2T4_13TeV-powheg-pythia8","tt1b_TT_TuneCUETP8M2T4_13TeV-powheg-pythia8"],"num":2}, "ttcc":{ "name":"ttcc","hist":["ttc_TT_TuneCUETP8M2T4_13TeV-powheg-pythia8"],"num":3}, "ttlf":{ "name":"ttlf","hist":["ttlight_TT_TuneCUETP8M2T4_13TeV-powheg-pythia8"],"num":1}, -## - "ewk":{ "name":"ewk","hist":["WJetsToLNu_HT","DYJetsToLL_M-50_HT","DYJetsToLL_M-5to50_HT","EWK"],"num":4}, +## "ewk":{ "name":"ewk","hist":["WJetsToLNu_HT","DYJetsToLL_M-50_HT","DYJetsToLL_M-5to50_HT","EWK"],"num":4}, + "ewk":{ "name":"ewk","hist":["light_WJetsToLNu_HT","DYJetsToLL_M-50_HT"],"num":4}, + "ewk_hf":{ "name":"ewk_hf","hist":["bb_WJetsToLNu_HT"],"num":6}, "top":{ "name":"top","hist":["ST"],"num":5}, "ttx":{ "name":"ttx","hist":["TTX"],"num":7} # "qcd":{ "name":"top","hist":["QCD_HT"],"num":8} @@ -441,13 +438,12 @@ def RebinN(h,nBin): ### "ttbb":{ "name":"ttbb","hist":["tt2b_TT_TuneCUETP8M2T4_13TeV-powheg-pythia8"],"num":3}, ### "tt2b":{ "name":"tt2b","hist":["tt2bMerged_TT_TuneCUETP8M2T4_13TeV-powheg-pythia8"],"num":4}, ### "ttbb":{ "name":"ttbb","hist":["tt2b_TT_TuneCUETP8M2T4_13TeV-powheg-pythia8","tt2bMerged_TT_TuneCUETP8M2T4_13TeV-powheg-pythia8"],"num":3}, -#### NOMINAL "ttb":{ "name":"ttb","hist":["tt2b_TT_TuneCUETP8M2T4_13TeV-powheg-pythia8","tt2bMerged_TT_TuneCUETP8M2T4_13TeV-powheg-pythia8","tt1b_TT_TuneCUETP8M2T4_13TeV-powheg-pythia8"],"num":2}, "ttcc":{ "name":"ttcc","hist":["ttc_TT_TuneCUETP8M2T4_13TeV-powheg-pythia8"],"num":3}, "ttlf":{ "name":"ttlf","hist":["ttlight_TT_TuneCUETP8M2T4_13TeV-powheg-pythia8"],"num":1}, ## "ewk":{ "name":"ewk","hist":["WJetsToLNu_HT","DYJetsToLL_M-50_HT","EWK"],"num":4}, - "ewk":{ "name":"ewk","hist":["WJetsToLNu_HT","light_DYJetsToLL_M-50_HT","EWK"],"num":4}, - "dy_hf":{ "name":"dy_hf","hist":["bb_DYJetsToLL_M-50_HT"],"num":6}, + "ewk":{ "name":"ewk","hist":["WJetsToLNu_HT","light_DYJetsToLL_M-50_HT"],"num":4}, + "ewk_hf":{ "name":"ewk_hf","hist":["bb_DYJetsToLL_M-50_HT"],"num":6}, "top":{ "name":"top","hist":["ST"],"num":5}, "ttx":{ "name":"ttx","hist":["TTX"],"num":7} # "qcd":{ "name":"top","hist":["QCD_HT"],"num":8} @@ -472,21 +468,20 @@ def RebinN(h,nBin): #### Theo #### # "CMS_topreweight":{"type":"shape", "wsname":"CMS_topreweight","name":"TOPRW","proc":["ttlf","ttb","ttcc"]}, ## name used for shape - "CMS_HPTB_mcreweight_ewk":{"type":"shape", "wsname":"CMS_HPTB_mcreweight_ewk","name":"htRECO","proc":["ewk","dy_hf"]}, ## name used for shape + "CMS_HPTB_mcreweight_ewk":{"type":"shape", "wsname":"CMS_HPTB_mcreweight_ewk","name":"htRECO","proc":["ewk","ewk_hf"]}, ## name used for shape ## "QCDscale":{"type":"shape", "wsname":"QCDscale","name":"ScaleRF","proc":["Hptb","ttlf","ttb","ttbb","tt2b","ttcc"]} ## name used for shape # "muRFenv_ttbar":{"type":"shape", "wsname":"muRFenv_ttbar","name":"Scale","proc":["ttlf","ttb","ttcc"]}, ## name used for shape - "muRF_ttbar":{"type":"shape", "wsname":"muRF_ttbar","name":"ScaleRF","proc":["ttlf","ttb","ttcc"]}, ## name used for shape +# "muRF_ttbar":{"type":"shape", "wsname":"muRF_ttbar","name":"ScaleRF","proc":["ttlf","ttb","ttcc"]}, ## name used for shape "muR_ttbar":{"type":"shape", "wsname":"muR_ttbar","name":"ScaleR","proc":["ttlf","ttb","ttcc"]}, ## name used for shape "muF_ttbar":{"type":"shape", "wsname":"muF_ttbar","name":"ScaleF","proc":["ttlf","ttb","ttcc"]}, ## name used for shape -# "muRFenv_ewk":{"type":"shape", "wsname":"muRFenv_ewk","name":"Scale","proc":["ewk"]}, ## name used for shape # "muRFenv_ewk":{"type":"shape", "wsname":"muRFenv_ewk","name":"Scale","proc":["ewk","dy_hf"]}, ## name used for shape - "muRF_ewk":{"type":"shape", "wsname":"muRF_ewk","name":"ScaleRF","proc":["ewk","dy_hf"]}, ## name used for shape - "muR_ewk":{"type":"shape", "wsname":"muR_ewk","name":"ScaleR","proc":["ewk","dy_hf"]}, ## name used for shape - "muF_ewk":{"type":"shape", "wsname":"muF_ewk","name":"ScaleF","proc":["ewk","dy_hf"]}, ## name used for shape +# "muRF_ewk":{"type":"shape", "wsname":"muRF_ewk","name":"ScaleRF","proc":["ewk","ewk_hf"]}, ## name used for shape + "muR_ewk":{"type":"shape", "wsname":"muR_ewk","name":"ScaleR","proc":["ewk","ewk_hf"]}, ## name used for shape + "muF_ewk":{"type":"shape", "wsname":"muF_ewk","name":"ScaleF","proc":["ewk","ewk_hf"]}, ## name used for shape # "muRFenv_Hptb":{"type":"shape", "wsname":"muRFenv_Hptb","name":"Scale","proc":["Hptb"]}, ## name used for shape - "muRF_Hptb":{"type":"shape", "wsname":"muRF_Hptb","name":"ScaleRF","proc":["Hptb"]}, ## name used for shape +# "muRF_Hptb":{"type":"shape", "wsname":"muRF_Hptb","name":"ScaleRF","proc":["Hptb"]}, ## name used for shape "muR_Hptb":{"type":"shape", "wsname":"muR_Hptb","name":"ScaleR","proc":["Hptb"]}, ## name used for shape "muF_Hptb":{"type":"shape", "wsname":"muF_Hptb","name":"ScaleF","proc":["Hptb"]}, ## name used for shape @@ -496,7 +491,7 @@ def RebinN(h,nBin): # "muF_top":{"type":"shape", "wsname":"muF_top","name":"Scale","proc":["top"]}, ## name used for shape # "muRFenv_ttx":{"type":"shape", "wsname":"muRFenv_ttx","name":"Scale","proc":["ttx"]}, ## name used for shape - "muRF_ttx":{"type":"shape", "wsname":"muRF_ttx","name":"ScaleRF","proc":["ttx"]}, ## name used for shape +# "muRF_ttx":{"type":"shape", "wsname":"muRF_ttx","name":"ScaleRF","proc":["ttx"]}, ## name used for shape "muR_ttx":{"type":"shape", "wsname":"muR_ttx","name":"ScaleR","proc":["ttx"]}, ## name used for shape "muF_ttx":{"type":"shape", "wsname":"muF_ttx","name":"ScaleF","proc":["ttx"]}, ## name used for shape @@ -563,12 +558,12 @@ def RebinN(h,nBin): #print "---------------------- --------" #fileTmp="AUG6_HT/"+label+VarTest+opts.output -fileTmp="NOV17_HT200_UE_1Mu_muRF/"+ label + VarTest + str(opts.kMass) + opts.output +fileTmp="NOV23_HT200_UE_1Mu/"+ label + VarTest + str(opts.kMass) + opts.output w = ROOT.RooWorkspace("w","w") datNameTmp = opts.datCardName #datName = "AUG6_HT/"+ label + VarTest + datNameTmp -datName = "NOV17_HT200_UE_1Mu_muRF/"+ label + VarTest + str(opts.kMass) + datNameTmp +datName = "NOV23_HT200_UE_1Mu/"+ label + VarTest + str(opts.kMass) + datNameTmp datacard=open(datName,"w") datacard.write("-------------------------------------\n") @@ -1011,7 +1006,7 @@ def importStat(): ##if doSyst: writeNormSyst("bgnorm_tt2b",["1.50"],["tt2b"]) ## V+jets HF -#if doSyst: writeNormSyst("bgnorm_dy_hf",["1.50"],["dy_hf"]) +#if doSyst: writeNormSyst("bgnorm_ewk_hf",["1.50"],["ewk_hf"]) ## "top" get the value od the single top if doSyst: writeNormSyst("QCDscale_top",["0.977/1.028"],["top"]) @@ -1019,8 +1014,10 @@ def importStat(): if doSyst: writeNormSyst("CMS_mass_top",["1.022"],["top"]) ## "ewk" get the envelop of the DY and W+jets from the AN2017_063_v11 -if doSyst: writeNormSyst("QCDscale_ewk",["0.996/1.008"],["ewk"]) -if doSyst: writeNormSyst("pdf_qqbar",["1.04"],["ewk"]) +#if doSyst: writeNormSyst("QCDscale_ewk",["0.996/1.008"],["ewk"]) +#if doSyst: writeNormSyst("pdf_qqbar",["1.04"],["ewk"]) +if doSyst: writeNormSyst("QCDscale_ewk",["0.996/1.008","0.996/1.008"],["ewk","ewk_hf"]) +if doSyst: writeNormSyst("pdf_qqbar",["1.04","1.04"],["ewk","ewk_hf"]) #if doSyst: writeNormSyst("QCDscale_ewk",["0.996/1.008","0.996/1.008"],["ewk","dy_hf"]) #if doSyst: writeNormSyst("pdf_qqbar",["1.04","1.04"],["ewk","dy_hf"]) @@ -1116,14 +1113,13 @@ def MergeCategory(tfile,hname): if hTmp!=None and hTmp2!=None: hTmp.Add(hTmp2) if hTmp!=None and hTmp3!=None: hTmp.Add(hTmp3) else: - - hTmp=tfile.Get(hname) +# hTmp=tfile.Get(hname) ## temporaty need to fix for the merged categories -# print 'MergeCategory ',hname -# if "bb_DYJetsTo" in hname: -# hTmp = MergeDYHF(tfile,hname) -# else: hTmp=tfile.Get(hname) - + if "bb_DYJetsTo" in hname: + hTmp = MergeDYHF(tfile,hname) + elif "bb_WJetsToLNu" in hname: + hTmp = MergeWHF(tfile,hname) + else: hTmp=tfile.Get(hname) #nominal if hTmp!= None and "bdt" in hname: @@ -1139,7 +1135,6 @@ def MergeCategory(tfile,hname): def SmoothAndMergeSyst(tfile,togetNom,togetSyst,s): - hTmpNom=MergeCategory(tfile,togetNom) hTmpUp=MergeCategory(tfile,togetSyst+'Up') hTmpDown=MergeCategory(tfile,togetSyst+'Down') @@ -1209,14 +1204,25 @@ def envelop(tfile,togetNom, togetSyst, s) : def MergeDYHF(tfile,hname): - hname_1=hname.replace("bb_DYJetsTo", "b_DYJetsTo") - hname_2=hname.replace("bb_DYJetsTo", "other_DYJetsTo") + hname_1=hname.replace("bb_DYJetsTo", "b_DYJetsTo") + hname_2=hname.replace("bb_DYJetsTo", "other_DYJetsTo") + hTmp=tfile.Get(hname) + hTmp1=tfile.Get(hname_1) + hTmp2=tfile.Get(hname_2) + if hTmp!=None and hTmp1!=None: hTmp.Add(hTmp1) + if hTmp!=None and hTmp2!=None: hTmp.Add(hTmp2) + + return hTmp + + +def MergeWHF(tfile,hname): + hname_1=hname.replace("bb_WJetsToLNu", "b_WJetsToLNu_HT") + hname_2=hname.replace("bb_WJetsToLNu", "other_WJetsToLNu") hTmp=tfile.Get(hname) hTmp1=tfile.Get(hname_1) hTmp2=tfile.Get(hname_2) if hTmp!=None and hTmp1!=None: hTmp.Add(hTmp1) if hTmp!=None and hTmp2!=None: hTmp.Add(hTmp2) - return hTmp From 2bb49fd73b2596ade5193056402ad8d82f7cca50 Mon Sep 17 00:00:00 2001 From: maria Date: Mon, 3 Dec 2018 21:32:41 +0100 Subject: [PATCH 58/60] dec3: post jan comments --- script/bwsFullHadTB.py | 36 +++++++++++++++++------------------- 1 file changed, 17 insertions(+), 19 deletions(-) diff --git a/script/bwsFullHadTB.py b/script/bwsFullHadTB.py index 428264cb..a02291c3 100644 --- a/script/bwsFullHadTB.py +++ b/script/bwsFullHadTB.py @@ -510,7 +510,7 @@ def mergeCategory(tfile,toget): if doSyst: systStore={ "None":None, - "lumi_13TeV":{"type":"lnN", "value":["1.025"] ,"proc":[".*"],"wsname":"lumi_13TeV","name":"XXX"}, + "lumi_13TeV":{"type":"lnN", "value":["1.025","1.025","1.025","1.025"] ,"proc":["ttbar","top","Hptb","ewk"],"wsname":"lumi_13TeV","name":"XXX"}, ### lepton veto "CMS_eff_l":{"type":"lnN", "value":["0.96","0.96","0.96","0.96"] ,"proc":["ttbar","top","Hptb","ewk"],"wsname":"CMS_eff_l","name":"XXX"}, ## name used for shape "CMS_eff_t":{"type":"lnN", "value":["1.03","1.03","1.03","1.03"] ,"proc":["ttbar","top","Hptb","ewk"],"wsname":"CMS_eff_t","name":"XXX"}, ## name used for shape @@ -520,6 +520,7 @@ def mergeCategory(tfile,toget): ## "CMS_topreweight":{"type":"shape", "wsname":"CMS_topreweight","name":"TOPRW","proc":["ttbar"]}, "muRF_Hptb":{"type":"shape", "wsname":"muRF_Hptb","name":"Scale","proc":["Hptb"]}, "muRF_ttbar":{"type":"shape", "wsname":"muRF_ttbar","name":"Scale","proc":["ttbar"]}, + "muRF_ewk":{"type":"shape", "wsname":"muRF_ewk","name":"Scale","proc":["ewk"]}, # "muRF_ttbar":{"type":"shape", "wsname":"muRF_ttbar","name":"ScaleRF","proc":["ttbar"]}, # "muF_ttbar":{"type":"shape", "wsname":"muF_ttbar","name":"ScaleF","proc":["ttbar"]}, # "muR_ttbar":{"type":"shape", "wsname":"muR_ttbar","name":"ScaleR","proc":["ttbar"]}, @@ -528,7 +529,7 @@ def mergeCategory(tfile,toget): # "muRF_ttbar_above":{"type":"shape", "wsname":"muRF_ttbar_above","name":"Scale","proc":["ttbar"]}, ### MET-Jets-PU "CMS_pileup":{"type":"shape", "wsname":"CMS_pileup","name":"PU","proc":["qcd_wx_one","qcd_wx_two","qcd_wx_three","qcd_tx_one","qcd_tx_two","qcd_tx_three","ttbar","top","Hptb","ewk"]}, - "CMS_scale_uncluster":{"type":"shape", "wsname":"CMS_scale_uncluster","name":"UNCLUSTER","proc":["qcd_wx_one","qcd_wx_two","qcd_wx_three","qcd_tx_one","qcd_tx_two","qcd_tx_three","ttbar","top","Hptb","ewk"]}, + "CMS_scale_uncluster":{"type":"shape", "wsname":"CMS_scale_uncluster","name":"UNCLUSTER","proc":["ttbar","top","Hptb","ewk"]}, ## SDmass "CMS_scale_SDMass":{"type":"shape", "wsname":"CMS_scale_SDMass","name":"SDMassSCALE","proc":["ttbar","top","Hptb"]}, "CMS_scale_SDMass_qcd_wx_below":{"type":"shape", "wsname":"CMS_scale_SDMass_qcd_wx_below","name":"SDMassSCALE","proc":["qcd_wx_one","qcd_wx_two","qcd_wx_three"]}, @@ -547,19 +548,19 @@ def mergeCategory(tfile,toget): "CMS_scale_j_qcd_tx":{"type":"shape", "wsname":"CMS_scale_j_qcd_tx","name":"JESANDCSV","proc":["qcd_tx_one","qcd_tx_two","qcd_tx_three"]}, ## b-tagging ##Light jets Heavy flavor contamination - "CMS_btag_HF":{"type":"shape", "wsname":"CMS_btag_HF","name":"CSVRHF","proc":["ttbar","top","Hptb"]}, + "CMS_btag_HF":{"type":"shape", "wsname":"CMS_btag_HF","name":"CSVRHF","proc":["ttbar","top","Hptb","ewk"]}, "CMS_btag_HF_qcd":{"type":"shape", "wsname":"CMS_btag_HF_qcd","name":"CSVRHF","proc":["qcd_wx_one","qcd_wx_two","qcd_wx_three","qcd_tx_one","qcd_tx_two","qcd_tx_three"]}, ##Heavy jets light flavor contamination - "CMS_btag_LF":{"type":"shape", "wsname":"CMS_btag_LF","name":"CSVRLF","proc":["ttbar","top","Hptb"]}, - "CMS_btag_LF_qcd":{"type":"shape", "wsname":"CMS_btag_LF_qcd","name":"CSVRLF","proc":["qcd_wx_one","qcd_wx_two","qcd_wx_three","qcd_tx_one","qcd_tx_two","qcd_tx_three"]}, + "CMS_btag_LF":{"type":"shape", "wsname":"CMS_btag_LF","name":"CSVRLF","proc":["ttbar","top","Hptb","ewk"]}, + "CMS_btag_LF_qcd":{"type":"shape", "wsname":"CMS_btag_LF_qcd","name":"CSVRLF","proc":["qcd_wx_one","qcd_wx_two","qcd_wx_three","qcd_tx_one","qcd_tx_two","qcd_tx_three"]}, ##Linear and quadratic uncertainties # note decouple the qcd - "CMS_btag_HFstat1":{"type":"shape", "wsname":"CMS_btag_HFstat1","name":"CSVRHFSTAT1","proc":["ttbar","top","Hptb"]}, - "CMS_btag_HFstat2":{"type":"shape", "wsname":"CMS_btag_HFstat2","name":"CSVRHFSTAT2","proc":["ttbar","top","Hptb"]}, - "CMS_btag_LFstat1":{"type":"shape", "wsname":"CMS_btag_LFstat1","name":"CSVRLFSTAT1","proc":["ttbar","top","Hptb"]}, - "CMS_btag_LFstat2":{"type":"shape", "wsname":"CMS_btag_LFstat2","name":"CSVRLFSTAT2","proc":["ttbar","top","Hptb"]}, - "CMS_btag_CFerr1":{"type":"shape", "wsname":"CMS_btag_CFerr1","name":"CSVRCERR1","proc":["ttbar","top","Hptb"]}, - "CMS_btag_CFerr2":{"type":"shape", "wsname":"CMS_btag_CFerr2","name":"CSVRCERR2","proc":["ttbar","top","Hptb"]}, + "CMS_btag_HFstat1":{"type":"shape", "wsname":"CMS_btag_HFstat1","name":"CSVRHFSTAT1","proc":["ttbar","top","Hptb","ewk"]}, + "CMS_btag_HFstat2":{"type":"shape", "wsname":"CMS_btag_HFstat2","name":"CSVRHFSTAT2","proc":["ttbar","top","Hptb","ewk"]}, + "CMS_btag_LFstat1":{"type":"shape", "wsname":"CMS_btag_LFstat1","name":"CSVRLFSTAT1","proc":["ttbar","top","Hptb","ewk"]}, + "CMS_btag_LFstat2":{"type":"shape", "wsname":"CMS_btag_LFstat2","name":"CSVRLFSTAT2","proc":["ttbar","top","Hptb","ewk"]}, + "CMS_btag_CFerr1":{"type":"shape", "wsname":"CMS_btag_CFerr1","name":"CSVRCERR1","proc":["ttbar","top","Hptb","ewk"]}, + "CMS_btag_CFerr2":{"type":"shape", "wsname":"CMS_btag_CFerr2","name":"CSVRCERR2","proc":["ttbar","top","Hptb","ewk"]}, ## "CMS_btag_HFstat1_qcd":{"type":"shape", "wsname":"CMS_btag_HFstat1_qcd","name":"CSVRHFSTAT1","proc":["qcd_wx_one","qcd_wx_two","qcd_wx_three","qcd_tx_one","qcd_tx_two","qcd_tx_three"]}, "CMS_btag_HFstat2_qcd":{"type":"shape", "wsname":"CMS_btag_HFstat2_qcd","name":"CSVRHFSTAT2","proc":["qcd_wx_one","qcd_wx_two","qcd_wx_three","qcd_tx_one","qcd_tx_two","qcd_tx_three"]}, @@ -878,14 +879,11 @@ def importStat(): if systStore[syst]["type"] == "lnN": if "CMS_eff_Tau21" in systStore[syst]["wsname"]: - writeNormSyst(syst,["1.08","1.08","1.08"],systStore[syst]["proc"],["OneBOneFat_.*_wbb","OneBOneFat_.*_wbj","OneBOneFat1l_.*_wbb","OneBOneFat1l_.*_wbb"]) - writeNormSyst(syst,["0.92","0.92","0.92"],systStore[syst]["proc"],["OneBOneMirrorFat_.*_wbb","OneBOneMirrorFat_.*_wbj"]) + writeNormSyst(syst,["1.08","1.08","1.08","1.08","0.92","0.92"],systStore[syst]["proc"],["OneBOneFat_.*_wbb","OneBOneFat_.*_wbj","OneBOneFat1l_.*_wbb","OneBOneFat1l_.*_wbb","OneBOneMirrorFat_.*_wbb","OneBOneMirrorFat_.*_wbj"]) elif "CMS_eff_Tau32" in systStore[syst]["wsname"]: - writeNormSyst(syst,["1.02","1.02","1.02"],systStore[syst]["proc"],["OneBOneFat_.*_t0b","OneBOneFat_.*_t1b","OneBOneFat1l_.*_t0b","OneBOneFat1l_.*_t1b"]) - writeNormSyst(syst,["0.98","0.98","0.98"],systStore[syst]["proc"],["OneBOneMirrorFat_.*_t0b","OneBOneMirrorFat_.*_t1b"]) + writeNormSyst(syst,["1.02","1.02","1.02","1.02","0.98","0.98"],systStore[syst]["proc"],["OneBOneFat_.*_t0b","OneBOneFat_.*_t1b","OneBOneFat1l_.*_t0b","OneBOneFat1l_.*_t1b","OneBOneMirrorFat_.*_t0b","OneBOneMirrorFat_.*_t1b"]) elif "CMS_eff_l" in systStore[syst]["wsname"]: - writeNormSyst(syst,["1.04","1.04","1.04","1.04"],systStore[syst]["proc"],["OneBOneFat1l_"]) - writeNormSyst(syst,["0.96","0.96","0.96","0.96"],systStore[syst]["proc"],["OneBOneFat_","OneBOneMirrorFat_"]) + writeNormSyst(syst,["1.04","0.96","0.96"],systStore[syst]["proc"],["OneBOneFat1l_","OneBOneFat_","OneBOneMirrorFat_"]) else: writeNormSyst(syst,systStore[syst]["value"],systStore[syst]["proc"]) @@ -945,12 +943,12 @@ def importStat(): if doSyst: writeNormSyst("QCDscale_ttbar",["0.965/1.024"],["ttbar"]) if doSyst: writeNormSyst("pdf_gg",["1.042"],["ttbar"]) -if doSyst: writeNormSyst("CMS_mass_top",["1.027"],["ttbar"]) +#if doSyst: writeNormSyst("CMS_mass_top",["1.027"],["ttbar"]) ## "top" get the value od the single top if doSyst: writeNormSyst("QCDscale_top",["0.977/1.028"],["top"]) if doSyst: writeNormSyst("pdf_top",["1.026"],["top"]) -if doSyst: writeNormSyst("CMS_mass_top",["1.022"],["top"]) +if doSyst: writeNormSyst("CMS_mass_top",["1.027","1.022"],["ttbar","top"]) #if doSyst: writeNormSyst("bgnorm_tt2b",["1.50"],["tt2b"]) #if doSyst: writeNormSyst("bgnorm_ttb",["1.30"],["ttb"]) From 247fd056c023e94e5749a876158b527282af92f9 Mon Sep 17 00:00:00 2001 From: maria Date: Sun, 9 Dec 2018 21:53:11 +0100 Subject: [PATCH 59/60] fix muRF --- script/bwsFullHadTB.py | 26 +++++++++++++++----------- 1 file changed, 15 insertions(+), 11 deletions(-) diff --git a/script/bwsFullHadTB.py b/script/bwsFullHadTB.py index a02291c3..657f6939 100644 --- a/script/bwsFullHadTB.py +++ b/script/bwsFullHadTB.py @@ -518,9 +518,14 @@ def mergeCategory(tfile,toget): "CMS_eff_trigger":{"type":"lnN", "value":["1.05"] ,"proc":[".*"],"wsname":"CMS_eff_triggger","name":"XXX"}, ### Theory modeling ## "CMS_topreweight":{"type":"shape", "wsname":"CMS_topreweight","name":"TOPRW","proc":["ttbar"]}, - "muRF_Hptb":{"type":"shape", "wsname":"muRF_Hptb","name":"Scale","proc":["Hptb"]}, - "muRF_ttbar":{"type":"shape", "wsname":"muRF_ttbar","name":"Scale","proc":["ttbar"]}, - "muRF_ewk":{"type":"shape", "wsname":"muRF_ewk","name":"Scale","proc":["ewk"]}, +## "muRF_Hptb":{"type":"shape", "wsname":"muRF_Hptb","name":"Scale","proc":["Hptb"]}, + "muR_Hptb":{"type":"shape", "wsname":"muR_Hptb","name":"Scale","proc":["Hptb"]}, + "muF_Hptb":{"type":"shape", "wsname":"muF_Hptb","name":"Scale","proc":["Hptb"]}, +## "muRF_ttbar":{"type":"shape", "wsname":"muRF_ttbar","name":"Scale","proc":["ttbar"]}, + "muF_ttbar":{"type":"shape", "wsname":"muF_ttbar","name":"Scale","proc":["ttbar"]}, + "muR_ttbar":{"type":"shape", "wsname":"muR_ttbar","name":"Scale","proc":["ttbar"]}, + "muF_ewk":{"type":"shape", "wsname":"muF_ewk","name":"ScaleF","proc":["ewk"]}, + "muR_ewk":{"type":"shape", "wsname":"muR_ewk","name":"ScaleR","proc":["ewk"]}, # "muRF_ttbar":{"type":"shape", "wsname":"muRF_ttbar","name":"ScaleRF","proc":["ttbar"]}, # "muF_ttbar":{"type":"shape", "wsname":"muF_ttbar","name":"ScaleF","proc":["ttbar"]}, # "muR_ttbar":{"type":"shape", "wsname":"muR_ttbar","name":"ScaleR","proc":["ttbar"]}, @@ -593,11 +598,11 @@ def mergeCategory(tfile,toget): print "* ",cat,":",catStore[cat] print "---------------------- --------" -fileTmp="MIAO_NOV20_Shape/"+label+VarTest+opts.kMass+"_"+opts.output +fileTmp="MIAO_TEST/"+label+VarTest+opts.kMass+"_"+opts.output w = ROOT.RooWorkspace("w","w") datNameTmp = opts.datCardName -datName = "MIAO_NOV20_Shape/"+label+ VarTest+opts.kMass+"_" + datNameTmp +datName = "MIAO_TEST/"+label+ VarTest+opts.kMass+"_" + datNameTmp datacard=open(datName,"w") datacard.write("-------------------------------------\n") @@ -877,18 +882,17 @@ def importStat(): for syst in systStore: if syst == "None": continue if systStore[syst]["type"] == "lnN": - if "CMS_eff_Tau21" in systStore[syst]["wsname"]: - writeNormSyst(syst,["1.08","1.08","1.08","1.08","0.92","0.92"],systStore[syst]["proc"],["OneBOneFat_.*_wbb","OneBOneFat_.*_wbj","OneBOneFat1l_.*_wbb","OneBOneFat1l_.*_wbb","OneBOneMirrorFat_.*_wbb","OneBOneMirrorFat_.*_wbj"]) + writeNormSyst(syst,["1.08","1.08","0.92","0.92","1.08","1.08","0.92","0.92","1.08","1.08","0.92","0.92"],systStore[syst]["proc"],["OneBOneFat.*_wbb","OneBOneFat.*_wbj","OneBOneMirrorFat_.*_wbb","OneBOneMirrorFat_.*_wbj"]) elif "CMS_eff_Tau32" in systStore[syst]["wsname"]: - writeNormSyst(syst,["1.02","1.02","1.02","1.02","0.98","0.98"],systStore[syst]["proc"],["OneBOneFat_.*_t0b","OneBOneFat_.*_t1b","OneBOneFat1l_.*_t0b","OneBOneFat1l_.*_t1b","OneBOneMirrorFat_.*_t0b","OneBOneMirrorFat_.*_t1b"]) - elif "CMS_eff_l" in systStore[syst]["wsname"]: - writeNormSyst(syst,["1.04","0.96","0.96"],systStore[syst]["proc"],["OneBOneFat1l_","OneBOneFat_","OneBOneMirrorFat_"]) + writeNormSyst(syst,["1.02","1.02","0.98","0.98","1.02","1.02","0.98","0.98","1.02","1.02","0.98","0.98"],systStore[syst]["proc"],["OneBOneFat.*_t0b","OneBOneFat.*_t1b","OneBOneMirrorFat_.*_t0b","OneBOneMirrorFat_.*_t1b"]) + elif "CMS_eff_l" in systStore[syst]["wsname"]: + writeNormSyst(syst,["1.04","0.96","0.96","1.04","0.96","0.96","1.04","0.96","0.96","1.04","0.96","0.96"],systStore[syst]["proc"],["OneBOneFat1l_.*","OneBOneFat_.*","OneBOneMirrorFat_.*"]) else: writeNormSyst(syst,systStore[syst]["value"],systStore[syst]["proc"]) if systStore[syst]["type"] == "shape": - if "muRF_Hptb" in systStore[syst]["wsname"]: + if "muRF_Hptb" in systStore[syst]["wsname"] or "muF_Hptb" in systStore[syst]["wsname"] or "muF_Hptb" in systStore[syst]["wsname"]: if not doSChannel: writeSystShape(systStore[syst],systStore[syst]["proc"]) ## # elif "muRF_ttbar_below" in systStore[syst]["wsname"]: From 14a3db6e1b5b51f9d224ffda8b5ffb15dab40649 Mon Sep 17 00:00:00 2001 From: maria Date: Mon, 10 Dec 2018 19:48:36 +0100 Subject: [PATCH 60/60] fix Pol decorrelation; recover some region --- script/bwsFullHadTB.py | 97 +++++++++++++++++++++++++++++++----------- 1 file changed, 71 insertions(+), 26 deletions(-) diff --git a/script/bwsFullHadTB.py b/script/bwsFullHadTB.py index 657f6939..ec443ad6 100644 --- a/script/bwsFullHadTB.py +++ b/script/bwsFullHadTB.py @@ -409,12 +409,12 @@ def mergeCategory(tfile,toget): if opts.kMass=="650": if "OneBOneMirrorFat_two_lowj" in x and y=="wbj" and "in" in reg: continue - if opts.kMass=="1500" and not doSChannel: - if "OneBOneMirrorFat_three_highj" in x and y=="wbb" and "in" in reg: continue +# if opts.kMass=="1500" and not doSChannel: +# if "OneBOneMirrorFat_three_highj" in x and y=="wbb" and "in" in reg: continue if opts.kMass=="2500" and not doSChannel: if "OneBOneFat_three_highj" in x and (y=="t0b" or y=="t1b") and "in" in reg: continue - if "OneBOneFat_three_highj" in x and y=="t0b" and "above" in reg: continue +# if "OneBOneFat_three_highj" in x and y=="t0b" and "above" in reg: continue # # this one below has overflow # if "OneBOneFat_three_highj" in x and y=="t1b" and "above" in reg: continue @@ -519,11 +519,11 @@ def mergeCategory(tfile,toget): ### Theory modeling ## "CMS_topreweight":{"type":"shape", "wsname":"CMS_topreweight","name":"TOPRW","proc":["ttbar"]}, ## "muRF_Hptb":{"type":"shape", "wsname":"muRF_Hptb","name":"Scale","proc":["Hptb"]}, - "muR_Hptb":{"type":"shape", "wsname":"muR_Hptb","name":"Scale","proc":["Hptb"]}, - "muF_Hptb":{"type":"shape", "wsname":"muF_Hptb","name":"Scale","proc":["Hptb"]}, + "muR_Hptb":{"type":"shape", "wsname":"muR_Hptb","name":"ScaleR","proc":["Hptb"]}, + "muF_Hptb":{"type":"shape", "wsname":"muF_Hptb","name":"ScaleF","proc":["Hptb"]}, ## "muRF_ttbar":{"type":"shape", "wsname":"muRF_ttbar","name":"Scale","proc":["ttbar"]}, - "muF_ttbar":{"type":"shape", "wsname":"muF_ttbar","name":"Scale","proc":["ttbar"]}, - "muR_ttbar":{"type":"shape", "wsname":"muR_ttbar","name":"Scale","proc":["ttbar"]}, + "muF_ttbar":{"type":"shape", "wsname":"muF_ttbar","name":"ScaleF","proc":["ttbar"]}, + "muR_ttbar":{"type":"shape", "wsname":"muR_ttbar","name":"ScaleR","proc":["ttbar"]}, "muF_ewk":{"type":"shape", "wsname":"muF_ewk","name":"ScaleF","proc":["ewk"]}, "muR_ewk":{"type":"shape", "wsname":"muR_ewk","name":"ScaleR","proc":["ewk"]}, # "muRF_ttbar":{"type":"shape", "wsname":"muRF_ttbar","name":"ScaleRF","proc":["ttbar"]}, @@ -581,12 +581,24 @@ def mergeCategory(tfile,toget): "CMS_scale_Pol_qcd_wx_two_1l":{"type":"shape", "wsname":"CMS_scale_Pol_qcd_wx_two_1l","name":"XXX","proc":["qcd_wx_two"]}, "CMS_scale_Pol_qcd_wx_three_1l":{"type":"shape", "wsname":"CMS_scale_Pol_qcd_wx_three_1l","name":"XXX","proc":["qcd_wx_three"]}, ## - "CMS_scale_Pol_qcd_tx_one_in":{"type":"shape", "wsname":"CMS_scale_Pol_qcd_tx_one_in","name":"XXX","proc":["qcd_tx_one"]}, + "CMS_scale_Pol_qcd_tx_one_below":{"type":"shape", "wsname":"CMS_scale_Pol_qcd_tx_one_below","name":"XXX","proc":["qcd_tx_one"]}, + "CMS_scale_Pol_qcd_tx_two_below":{"type":"shape", "wsname":"CMS_scale_Pol_qcd_tx_two_below","name":"XXX","proc":["qcd_tx_two"]}, + "CMS_scale_Pol_qcd_tx_three_below":{"type":"shape", "wsname":"CMS_scale_Pol_qcd_tx_three_below","name":"XXX","proc":["qcd_tx_three"]}, + "CMS_scale_Pol_qcd_wx_one_below":{"type":"shape", "wsname":"CMS_scale_Pol_qcd_wx_one_below","name":"XXX","proc":["qcd_wx_one"]}, + "CMS_scale_Pol_qcd_wx_two_below":{"type":"shape", "wsname":"CMS_scale_Pol_qcd_wx_two_below","name":"XXX","proc":["qcd_wx_two"]}, + "CMS_scale_Pol_qcd_wx_three_below":{"type":"shape", "wsname":"CMS_scale_Pol_qcd_wx_three_below","name":"XXX","proc":["qcd_wx_three"]}, + "CMS_scale_Pol_qcd_tx_one_in":{"type":"shape", "wsname":"CMS_scale_Pol_qcd_tx_one_in","name":"XXX","proc":["qcd_tx_one"]}, "CMS_scale_Pol_qcd_tx_two_in":{"type":"shape", "wsname":"CMS_scale_Pol_qcd_tx_two_in","name":"XXX","proc":["qcd_tx_two"]}, "CMS_scale_Pol_qcd_tx_three_in":{"type":"shape", "wsname":"CMS_scale_Pol_qcd_tx_three_in","name":"XXX","proc":["qcd_tx_three"]}, "CMS_scale_Pol_qcd_wx_one_in":{"type":"shape", "wsname":"CMS_scale_Pol_qcd_wx_one_in","name":"XXX","proc":["qcd_wx_one"]}, "CMS_scale_Pol_qcd_wx_two_in":{"type":"shape", "wsname":"CMS_scale_Pol_qcd_wx_two_in","name":"XXX","proc":["qcd_wx_two"]}, - "CMS_scale_Pol_qcd_wx_three_in":{"type":"shape", "wsname":"CMS_scale_Pol_qcd_wx_three_in","name":"XXX","proc":["qcd_wx_three"]} + "CMS_scale_Pol_qcd_wx_three_in":{"type":"shape", "wsname":"CMS_scale_Pol_qcd_wx_three_in","name":"XXX","proc":["qcd_wx_three"]}, + "CMS_scale_Pol_qcd_tx_one_above":{"type":"shape", "wsname":"CMS_scale_Pol_qcd_tx_one_above","name":"XXX","proc":["qcd_tx_one"]}, + "CMS_scale_Pol_qcd_tx_two_above":{"type":"shape", "wsname":"CMS_scale_Pol_qcd_tx_two_above","name":"XXX","proc":["qcd_tx_two"]}, + "CMS_scale_Pol_qcd_tx_three_above":{"type":"shape", "wsname":"CMS_scale_Pol_qcd_tx_three_above","name":"XXX","proc":["qcd_tx_three"]}, + "CMS_scale_Pol_qcd_wx_one_above":{"type":"shape", "wsname":"CMS_scale_Pol_qcd_wx_one_above","name":"XXX","proc":["qcd_wx_one"]}, + "CMS_scale_Pol_qcd_wx_two_above":{"type":"shape", "wsname":"CMS_scale_Pol_qcd_wx_two_above","name":"XXX","proc":["qcd_wx_two"]}, + "CMS_scale_Pol_qcd_wx_three_above":{"type":"shape", "wsname":"CMS_scale_Pol_qcd_wx_three_above","name":"XXX","proc":["qcd_wx_three"]} } else: systStore={ @@ -598,11 +610,11 @@ def mergeCategory(tfile,toget): print "* ",cat,":",catStore[cat] print "---------------------- --------" -fileTmp="MIAO_TEST/"+label+VarTest+opts.kMass+"_"+opts.output +fileTmp="MIAO_DEC10/"+label+VarTest+opts.kMass+"_"+opts.output w = ROOT.RooWorkspace("w","w") datNameTmp = opts.datCardName -datName = "MIAO_TEST/"+label+ VarTest+opts.kMass+"_" + datNameTmp +datName = "MIAO_DEC10/"+label+ VarTest+opts.kMass+"_" + datNameTmp datacard=open(datName,"w") datacard.write("-------------------------------------\n") @@ -778,10 +790,13 @@ def writeNormSyst(name="lumi",valueL=["1.027","1.026"], regexpL=["TT","ST",""],r idx2=i break - if (idx>=0 and (idx2>=0 or len(regexpCat)==0 )): - datacard.write("\t"+valueL[idx]) + if (idx>=0 and len(regexpCat)==0): + datacard.write("\t"+valueL[idx]) + elif (idx>=0 and idx2>=0): + datacard.write("\t"+valueL[idx * len(regexpCat) + idx2]) else: - datacard.write("\t-") + datacard.write("\t-") + datacard.write("\n") def writeSystShape(syst,regexpL=[],regexpCat=[]): @@ -892,7 +907,7 @@ def importStat(): writeNormSyst(syst,systStore[syst]["value"],systStore[syst]["proc"]) if systStore[syst]["type"] == "shape": - if "muRF_Hptb" in systStore[syst]["wsname"] or "muF_Hptb" in systStore[syst]["wsname"] or "muF_Hptb" in systStore[syst]["wsname"]: + if "muRF_Hptb" in systStore[syst]["wsname"] or "muF_Hptb" in systStore[syst]["wsname"] or "muR_Hptb" in systStore[syst]["wsname"]: if not doSChannel: writeSystShape(systStore[syst],systStore[syst]["proc"]) ## # elif "muRF_ttbar_below" in systStore[syst]["wsname"]: @@ -916,18 +931,44 @@ def importStat(): elif "CMS_scale_SDMass_qcd_tx_above" in systStore[syst]["wsname"]: writeSystShape(systStore[syst],systStore[syst]["proc"],["above"]) + + elif "CMS_scale_Pol_qcd_tx_one_below" in systStore[syst]["wsname"]: + writeSystShape(systStore[syst],systStore[syst]["proc"],["below"]) elif "CMS_scale_Pol_qcd_tx_one_in" in systStore[syst]["wsname"]: - writeSystShape(systStore[syst],systStore[syst]["proc"],["in","below","above"]) - elif "CMS_scale_Pol_qcd_tx_two_in" in systStore[syst]["wsname"]: - writeSystShape(systStore[syst],systStore[syst]["proc"],["in","below","above"]) - elif "CMS_scale_Pol_qcd_tx_three_in_" in systStore[syst]["wsname"]: - writeSystShape(systStore[syst],systStore[syst]["proc"],["in","below","above"]) - elif "CMS_scale_Pol_qcd_wx_one_in" in systStore[syst]["wsname"]: - writeSystShape(systStore[syst],systStore[syst]["proc"],["in","below","above"]) - elif "CMS_scale_Pol_qcd_wx_two_in" in systStore[syst]["wsname"]: - writeSystShape(systStore[syst],systStore[syst]["proc"],["in","below","above"]) - elif "CMS_scale_Pol_qcd_wx_three_in" in systStore[syst]["wsname"]: - writeSystShape(systStore[syst],systStore[syst]["proc"],["in","below","above"]) + writeSystShape(systStore[syst],systStore[syst]["proc"],["in"]) + elif "CMS_scale_Pol_qcd_tx_one_above" in systStore[syst]["wsname"]: + writeSystShape(systStore[syst],systStore[syst]["proc"],["above"]) + elif "CMS_scale_Pol_qcd_tx_two_below" in systStore[syst]["wsname"]: + writeSystShape(systStore[syst],systStore[syst]["proc"],["below"]) + elif "CMS_scale_Pol_qcd_tx_two_in" in systStore[syst]["wsname"]: + writeSystShape(systStore[syst],systStore[syst]["proc"],["in"]) + elif "CMS_scale_Pol_qcd_tx_two_above" in systStore[syst]["wsname"]: + writeSystShape(systStore[syst],systStore[syst]["proc"],["above"]) + elif "CMS_scale_Pol_qcd_tx_three_below" in systStore[syst]["wsname"]: + writeSystShape(systStore[syst],systStore[syst]["proc"],["below"]) + elif "CMS_scale_Pol_qcd_tx_three_in" in systStore[syst]["wsname"]: + writeSystShape(systStore[syst],systStore[syst]["proc"],["in"]) + elif "CMS_scale_Pol_qcd_tx_three_above" in systStore[syst]["wsname"]: + writeSystShape(systStore[syst],systStore[syst]["proc"],["above"]) + + elif "CMS_scale_Pol_qcd_wx_one_below" in systStore[syst]["wsname"]: + writeSystShape(systStore[syst],systStore[syst]["proc"],["below"]) + elif "CMS_scale_Pol_qcd_wx_one_in" in systStore[syst]["wsname"]: + writeSystShape(systStore[syst],systStore[syst]["proc"],["in"]) + elif "CMS_scale_Pol_qcd_wx_one_above" in systStore[syst]["wsname"]: + writeSystShape(systStore[syst],systStore[syst]["proc"],["above"]) + elif "CMS_scale_Pol_qcd_wx_two_below" in systStore[syst]["wsname"]: + writeSystShape(systStore[syst],systStore[syst]["proc"],["below"]) + elif "CMS_scale_Pol_qcd_wx_two_in" in systStore[syst]["wsname"]: + writeSystShape(systStore[syst],systStore[syst]["proc"],["in"]) + elif "CMS_scale_Pol_qcd_wx_two_above" in systStore[syst]["wsname"]: + writeSystShape(systStore[syst],systStore[syst]["proc"],["above"]) + elif "CMS_scale_Pol_qcd_wx_three_below" in systStore[syst]["wsname"]: + writeSystShape(systStore[syst],systStore[syst]["proc"],["below"]) + elif "CMS_scale_Pol_qcd_wx_three_in" in systStore[syst]["wsname"]: + writeSystShape(systStore[syst],systStore[syst]["proc"],["in"]) + elif "CMS_scale_Pol_qcd_wx_three_above" in systStore[syst]["wsname"]: + writeSystShape(systStore[syst],systStore[syst]["proc"],["above"]) elif "CMS_scale_Pol_qcd_wx_one_1l" in systStore[syst]["wsname"]: writeSystShape(systStore[syst],systStore[syst]["proc"],["1l"]) @@ -1064,6 +1105,10 @@ def SmoothAndMergeSyst(tfile,togetNom,togetSyst,s): if hTmpUp==None: return hTmpNom if hTmpDown==None: return hTmpNom + if hTmpUp.Integral()<=0: return hTmpNom + if hTmpDown.Integral()<=0: return hTmpNom + + for iBin in range(1,hTmpNom.GetNbinsX()+1): # c= hTmpNom.SetBinError(iBin,0) c= hTmpUp.SetBinError(iBin,0)