forked from cms-sw/cmssw
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request cms-sw#13 from gpetruc/HZZ4L-76X
H → ZZ → 4L update to 76X (part 1)
- Loading branch information
Showing
47 changed files
with
946 additions
and
35 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
hlt: ( abs(WZ_z_l1_pdgId)==13 && HLT_DoubleMu ) || ( abs(WZ_z_l1_pdgId)==11 && HLT_DoubleEl ) | ||
nWZ: nWZ == 1 | ||
mZ1: WZ_z_mass > 55 | ||
num : WZ_lep3_relIsoAfterFSR < if3(abs(WZ_lep3_pdgId)==11, 0.5, 0.4) && WZ_lep3_tightId |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
T=/afs/cern.ch/work/g/gpetrucc/TREES_HZZ4L_231115/3L | ||
PDIR=plots/251115/cr_zl/effs | ||
|
||
BASE=" -l 2.47 -P $T cr_zl/mca.txt cr_zl/cuts.txt --s2v " | ||
EFFBASE="python mcEfficiencies.py $BASE -X num -j 8 -f --showRatio cr_zl/nums.txt cr_zl/plots.txt --groupBy cut " | ||
|
||
function doFRs { | ||
SUBDIR=$1; shift; | ||
EFF="$EFFBASE --AP -p DY,data,WZ,Top --sp WZ --compare DY,total,data " | ||
EFF="$EFF --sP pass --sP l3pt_coarse --yrange 0 0.2 --ratioRange 0 2.8 --legend=TL" | ||
echo "$EFF -o $PDIR/$SUBDIR/mu_barrel.root -A nWZ mu 'abs(WZ_lep3_pdgId)==13 && abs(WZ_lep3_eta)<1.2 ' $*" | ||
echo "$EFF -o $PDIR/$SUBDIR/mu_endcap.root -A nWZ mu 'abs(WZ_lep3_pdgId)==13 && abs(WZ_lep3_eta)>1.2 ' $*" | ||
echo "$EFF -o $PDIR/$SUBDIR/el_barrel.root -A nWZ el 'abs(WZ_lep3_pdgId)==11 && abs(WZ_lep3_eta)<1.479' $*" | ||
echo "$EFF -o $PDIR/$SUBDIR/el_endcap.root -A nWZ el 'abs(WZ_lep3_pdgId)==11 && abs(WZ_lep3_eta)>1.479' $*" | ||
} | ||
|
||
doFRs prefit " -A nWZ met 'met_pt < 25' $* " ; | ||
doFRs prefit-mZ_10GeV " -A nWZ met 'met_pt < 25 && abs(WZ_z_mass-91.1876)<10 ' $* " ; | ||
doFRs prefit-mZ_7GeV " -A nWZ met 'met_pt < 25 && abs(WZ_z_mass-91.1876)<7 ' $* " ; | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,45 @@ | ||
T=/afs/cern.ch/work/g/gpetrucc/TREES_HZZ4L_231115/3L | ||
PDIR=plots/251115/cr_zl | ||
|
||
BASE=" -l 2.47 -P $T cr_zl/mca.txt cr_zl/cuts.txt --s2v " | ||
PLOTBASE="python mcPlots.py $BASE -j 8 -f --showRatio --maxRatioRange 0 2.48 cr_zl/plots.txt " | ||
|
||
function doPlots { | ||
SUBDIR=$1; shift; | ||
echo "$PLOTBASE --pdir $PDIR/$SUBDIR/mu/den -X num -A nWZ mu 'abs(WZ_lep3_pdgId)==13' $*" | ||
echo "$PLOTBASE --pdir $PDIR/$SUBDIR/mu/num -A nWZ mu 'abs(WZ_lep3_pdgId)==13' $*" | ||
echo "$PLOTBASE --pdir $PDIR/$SUBDIR/el/den -X num -A nWZ el 'abs(WZ_lep3_pdgId)==11' $*" | ||
echo "$PLOTBASE --pdir $PDIR/$SUBDIR/el/num -A nWZ el 'abs(WZ_lep3_pdgId)==11' $*" | ||
} | ||
function doScaledPlots { | ||
SUBDIR=$1; shift; | ||
PLOT="${PLOTBASE/--showRatio/} --sp '.*' --scaleSigToData" | ||
echo "$PLOT --pdir $PDIR/$SUBDIR/mu/den -X num -A nWZ mu 'abs(WZ_lep3_pdgId)==13' $*" | ||
echo "$PLOT --pdir $PDIR/$SUBDIR/mu/num -A nWZ mu 'abs(WZ_lep3_pdgId)==13' $*" | ||
echo "$PLOT --pdir $PDIR/$SUBDIR/el/den -X num -A nWZ el 'abs(WZ_lep3_pdgId)==11' $*" | ||
echo "$PLOT --pdir $PDIR/$SUBDIR/el/num -A nWZ el 'abs(WZ_lep3_pdgId)==11' $*" | ||
} | ||
function doPromptFit { | ||
SUBDIR=$1; shift; | ||
CHANGE="-A nWZ met 'met_pt > 20' --fitData --flp WZ,Top,DY --peg-process Top WZ " | ||
J0="-A nWZ 0j 'nJet30 == 0' " | ||
J1="-A nWZ 1j 'Jet1_pt > 40' --rebin 2" | ||
B1="-A nWZ 1b 'Jet1_pt > 40 && Jet1_btagCSV > 0.89' --rebin 2" | ||
|
||
echo "$PLOTBASE --pdir $PDIR/$SUBDIR/mu/ -A nWZ mu 'abs(WZ_lep3_pdgId)==13' $CHANGE --sP WZ --sP 'mtW,met,mZ1_wide' " | ||
echo "$PLOTBASE --pdir $PDIR/$SUBDIR/mu/0j -A nWZ mu 'abs(WZ_lep3_pdgId)==13' $CHANGE $J0 --sP WZ --sP 'mtW,met,mZ1_wide' " | ||
echo "$PLOTBASE --pdir $PDIR/$SUBDIR/mu/1j40 -A nWZ mu 'abs(WZ_lep3_pdgId)==13' $CHANGE $J1 --sP Top --sP 'mtW,met,j1_.*,mZ1_wide' " | ||
echo "$PLOTBASE --pdir $PDIR/$SUBDIR/mu/bj40 -A nWZ mu 'abs(WZ_lep3_pdgId)==13' $CHANGE $B1 --sP Top --sP 'mtW,met,j1_.*,mZ1_wide' " | ||
|
||
echo "$PLOTBASE --pdir $PDIR/$SUBDIR/el/ -A nWZ el 'abs(WZ_lep3_pdgId)==11' $CHANGE --sP WZ --sP 'mtW,met,mZ1_wide' " | ||
echo "$PLOTBASE --pdir $PDIR/$SUBDIR/el/0j -A nWZ el 'abs(WZ_lep3_pdgId)==11' $CHANGE $J0 --sP WZ --sP 'mtW,met,mZ1_wide' " | ||
echo "$PLOTBASE --pdir $PDIR/$SUBDIR/el/1j40 -A nWZ el 'abs(WZ_lep3_pdgId)==11' $CHANGE $J1 --sP Top --sP 'mtW,met,j1_.*,mZ1_wide' " | ||
echo "$PLOTBASE --pdir $PDIR/$SUBDIR/el/bj40 -A nWZ el 'abs(WZ_lep3_pdgId)==11' $CHANGE $B1 --sP Top --sP 'mtW,met,j1_.*,mZ1_wide' " | ||
} | ||
|
||
#doPlots prefit-nomet " $* "; | ||
doPlots prefit " -A nWZ met 'met_pt < 20' $* " ; | ||
doScaledPlots prefit-scaled " -A nWZ met 'met_pt < 20' $* " ; | ||
doPlots postfit-mtW " -A nWZ met 'met_pt < 20' --preFitData mtW --flp DY --peg-process Top WZ $*" ; | ||
doPlots postfit-l3pt " -A nWZ met 'met_pt < 20' --preFitData l3pt --flp DY --peg-process Top WZ $*" ; | ||
doPromptFit prompt-fit " $*"; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
# vim: syntax=sh | ||
# DEFAULTS FOR ALL TREES | ||
* ; TreeName="threeLeptonTreeProducer" | ||
|
||
DY : DYJetsToLL_LO_M50 : xsec: 1; FillColor=ROOT.kGreen+2, Label="Z+jets", SkipMe=True | ||
DYb : DYJetsToLL_LO_M50 : xsec: WZ_lep3_mcMatchAny >=4 ; FillColor=ROOT.kGreen+2, Label="Z+b/c" | ||
DYl : DYJetsToLL_LO_M50 : xsec: WZ_lep3_mcMatchAny > 0 && WZ_lep3_mcMatchAny < 4 ; FillColor=ROOT.kSpring-9, Label="Z+light" | ||
DYf : DYJetsToLL_LO_M50 : xsec: WZ_lep3_mcMatchAny == 0; FillColor=ROOT.kAzure+6, Label="Z+fake" | ||
WZ : WZTo3LNu : xsec : 1 ; FillColor=ROOT.kOrange-2, Label="WZ" | ||
Top : TTLep : xsec : 1 ; FillColor=ROOT.kOrange-7, Label="t\#bar{t}\, tW" | ||
Top : TBar_tWch : xsec : 1 ; FillColor=ROOT.kOrange-7, Label="t\#bar{t}\, tW" | ||
Top : T_tWch: xsec : 1 ; FillColor=ROOT.kOrange-7, Label="t\#bar{t}\, tW" | ||
|
||
data : DoubleEG_Run2015B_05Oct2015_50ns; FillColor=ROOT.kBlack | ||
data : DoubleEG_Run2015C_05Oct2015_25ns | ||
data : DoubleEG_Run2015C_05Oct2015_50ns | ||
data : DoubleEG_Run2015D_05Oct2015_25ns | ||
data : DoubleEG_Run2015D_PromptV4_25ns | ||
data : DoubleEG_Run2015D_Silver_05Oct2015_25ns | ||
data : DoubleEG_Run2015D_Silver_PromptV4_25ns | ||
data : DoubleMuon_Run2015B_05Oct2015_50ns | ||
data : DoubleMuon_Run2015C_05Oct2015_25ns | ||
data : DoubleMuon_Run2015C_05Oct2015_50ns | ||
data : DoubleMuon_Run2015D_05Oct2015_25ns | ||
data : DoubleMuon_Run2015D_PromptV4_25ns | ||
data : DoubleMuon_Run2015D_Silver_05Oct2015_25ns | ||
data : DoubleMuon_Run2015D_Silver_PromptV4_25ns | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
pass : WZ_lep3_relIsoAfterFSR < if3(abs(WZ_lep3_pdgId)==11, 0.5, 0.4) && WZ_lep3_tightId : 2,-0.5,1.5; XTitle="Pass ID+Iso" | ||
pass_ID : WZ_lep3_tightId : 2,-0.5,1.5; XTitle="Pass ID" | ||
pass_Iso : WZ_lep3_relIsoAfterFSR < if3(abs(WZ_lep3_pdgId)==11, 0.5, 0.4) : 2,-0.5,1.5; XTitle="Pass Iso" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,56 @@ | ||
from array import array | ||
import re, sys | ||
sys.argv.append('-b-') | ||
import ROOT | ||
ROOT.gROOT.SetBatch(True) | ||
sys.argv.remove('-b-') | ||
|
||
def makeH2D(name,graphs): | ||
etaRanges = graphs.keys() | ||
etaVals = [ r[0] for r in etaRanges ] + [ max(r[1] for r in etaRanges) ] | ||
etaVals.sort() | ||
oneGraph = graphs.values()[0] | ||
ptVals = [ oneGraph.GetX()[i] + oneGraph.GetErrorXhigh(i) for i in xrange(oneGraph.GetN()) ] | ||
ptVals.insert(0, oneGraph.GetX()[0] - oneGraph.GetErrorXlow(0)) | ||
th2 = ROOT.TH2F(name,name,len(ptVals)-1,array('f',ptVals),len(etaVals)-1,array('f',etaVals)) | ||
for etabin in xrange(1,th2.GetNbinsY()+1): | ||
etaval = th2.GetYaxis().GetBinCenter(etabin) | ||
for etaRange, graph in graphs.iteritems(): | ||
if etaRange[0] <= etaval and etaval < etaRange[1]: | ||
break | ||
for ptbin in xrange(1,th2.GetNbinsX()+1): | ||
th2.SetBinContent(ptbin,etabin,graph.GetY()[ptbin-1]) | ||
th2.SetBinError(ptbin,etabin,max(graph.GetErrorYlow(ptbin-1),graph.GetErrorYhigh(ptbin-1))) | ||
return th2 | ||
|
||
def readGraph(filename,plotname): | ||
slicefile = ROOT.TFile.Open(filename) | ||
if not slicefile: raise RuntimeError, "Cannot open "+filename | ||
plot = slicefile.Get(plotname) | ||
if not plot: | ||
slicefile.ls() | ||
raise RuntimeError, "Cannot find "+plotname+" in "+filename | ||
ret = plot.Clone() | ||
slicefile.Close() | ||
return ret | ||
|
||
def assemble2D(out,name,filepattern,slices,plotname): | ||
graphs = dict([(r, readGraph(filepattern % n,plotname)) for (n,r) in slices.iteritems()]) | ||
out.cd() | ||
th2 = makeH2D(name,graphs) | ||
out.WriteTObject(th2) | ||
return th2 | ||
|
||
if __name__ == "__main__": | ||
from optparse import OptionParser | ||
parser = OptionParser(usage="%prog [options] what path out") | ||
parser.add_option("-s", "--sel", dest="sel", default=None, help="Select"); | ||
(options, args) = parser.parse_args() | ||
(what,path,outname) = args | ||
outfile = ROOT.TFile.Open(outname,"RECREATE") | ||
muSlices = { 'barrel':(0,1.2), 'endcap':(1.2,2.4) } | ||
elSlices = { 'barrel':(0,1.479), 'endcap':(1.479,2.5) } | ||
for p in "data", "DY": | ||
for l,slices in [('mu',muSlices),('el',elSlices)]: | ||
assemble2D(outfile,"_".join([what,l,p]),path+"/%s_%%s.root"%l,slices,"pass_l3pt_coarse_"+p) | ||
outfile.ls() |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
nJet30 : nJet30 : [-0.5,0.5,1.5,2.5,3.5] : XTitle="N(Jets)", Logy | ||
j1_btag : Jet1_btagCSV : 20,0,1 ; XTitle="Leading jet b-tag" | ||
j1_pt : Jet1_pt : 24,0,200 ; XTitle="Leading jet b-tag", Logy | ||
l3pt: WZ_lep3_pt : 24,0,100; XTitle="l_{3} p_{T} [GeV]", Logy | ||
l3pt_coarse: min(WZ_lep3_pt,59.99) : [0,5,10,15,20,30,45,60]; XTitle="l_{3} p_{T} [GeV]" | ||
l3eta: WZ_lep3_eta : 20,-2.5,2.5; XTitle="l_{3} #eta" | ||
l3relIsoAfterFSR: WZ_lep3_relIsoAfterFSR : 20,0,4.5; XTitle="l_{3} relIso" | ||
l3mvaId: WZ_lep3_mvaIdSpring15 : 20,-1,1; XTitle="l_{3} mva eleID" | ||
l3segComp: WZ_lep3_segmentCompatibility : 20,0,1; XTitle="l_{3} segm comp" | ||
|
||
mZ1: WZ_z_mass : 15,80,110; XTitle="m(Z) [GeV]", IncludeOverflows=False | ||
mZ1_wide: WZ_z_mass : 24,55,180; XTitle="m(Z}) [GeV]" | ||
m3l: WZ_mass : 15,80,200; XTitle="m(3l) [GeV]" | ||
met: met_pt : 24,0,90; XTitle="E_{T}^{miss} [GeV]" | ||
mtW: mt_2(met_pt,met_phi,WZ_lep3_pt,WZ_lep3_phi) : 15,0,90; XTitle="m_{T}(E_{T}^{miss}\, l_{3}) [GeV]" | ||
#metNoHF: metNoHF_pt : 15,0,90; XTitle="E_{T}^{miss} [GeV]", Logy | ||
#mtWNoHF: mt_2(metNoHF_pt,metNoHF_phi,WZ_lep3_pt,WZ_lep3_phi) : 15,0,90; XTitle="m_{T}(E_{T}^{miss}\, l_{3}) [GeV]" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
hlt: HLT_Signal | ||
base: zz1_mass > 70 | ||
z4l: zz1_mass > 70 && zz1_mass < 110 ; Disable=True | ||
high: zz1_mass > 150 ; Disable=True | ||
window: zz1_mass > 110 and zz1_mass < 150 ; Disable=True |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
T=/afs/cern.ch/work/g/gpetrucc/TREES_HZZ4L_231115/4L | ||
BASE="python mcPlots.py --s2v -f -j 8 -P $T cr_zll/mca.txt -l 2.47 " | ||
PDIR=plots/251115/cr_zll | ||
|
||
WHAT=$1; shift; | ||
POST=""; if [[ $1 != "" ]]; then POST=$1; shift; fi; | ||
case $WHAT in | ||
ss|2p2f|3p1f) | ||
BASE="$BASE --mcc cr_zll/mcc-$WHAT.txt cr_zll/cuts.txt cr_zll/plots.txt --showRatio --maxRatioRange 0 2.48" | ||
REBIN="1"; [[ "$WHAT" == "3p1f" ]] && REBIN=2; | ||
for ll in all 2x2e 2x2mu; do | ||
case $ll in | ||
all) RUN="$BASE "; SUB="" ;; | ||
2x2e) RUN="$BASE -A hlt 2x2e 'abs(zz1_z2_l1_pdgId)==11' "; SUB="$ll" ;; | ||
2x2mu) RUN="$BASE -A hlt 2x2mu 'abs(zz1_z2_l1_pdgId)==13' "; SUB="$ll"; REBIN=$(( $REBIN * 2 ));; | ||
esac; | ||
echo "( $RUN --pdir=$PDIR/$WHAT/$POST/$SUB --rebin $REBIN $* )"; | ||
echo "( $RUN --pdir=$PDIR/$WHAT/$POST/$SUB/fits --sP mZ1_wide,met --fitData --flp DY,Top --rebin $(( $REBIN * 2 )) $* )"; | ||
echo "( ${RUN/--showRatio/} --pdir=$PDIR/$WHAT/$POST/$SUB/zscaled --scaleSigToData --sp DY --rebin $(( $REBIN * 2 )) $* )"; | ||
done | ||
;; | ||
all) | ||
for W in ss 2p2f 3p1f; do | ||
bash $0 $W; | ||
done | ||
esac |
Oops, something went wrong.