Skip to content

Commit

Permalink
Merge pull request #1 from vischia/80X_M17
Browse files Browse the repository at this point in the history
Cumulative option ;)
  • Loading branch information
Juan Rodrigo González Fernández authored Feb 27, 2017
2 parents 985ab2a + 2661838 commit c66b318
Show file tree
Hide file tree
Showing 228 changed files with 16,780 additions and 1,464 deletions.
1,918 changes: 1,918 additions & 0 deletions TTHAnalysis/data/btag/CSVv2_Moriond17_B_H.csv

Large diffs are not rendered by default.

28 changes: 28 additions & 0 deletions TTHAnalysis/data/btag/fastsim_csvv2_ttbar_26_1_2017_fixed.csv
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
CSVv2;OperatingPoint, measurementType, sysType, jetFlavor, etaMin, etaMax, ptMin, ptMax, discrMin, discrMax, formula
0, fastsim, central, 0, -2.4, 2.4, 20, 1000, 0, 1, "x<160 ? (x<60 ? (x<40 ? (x<30 ? (x<20 ? 0:0.996575) : (0.993426)) : (x<50 ? 0.989736:0.990057)) : (x<100 ? (x<80 ? (x<70 ? 0.989859:0.988486) : (0.98739)) : (x<120 ? 0.985417:0.988443))) : (x<500 ? (x<320 ? (x<260 ? (x<210 ? 0.988278:0.986916) : (0.987121)) : (x<400 ? 0.990856:0.987617)) : (x<800 ? (x<670 ? 1.01086:0.999093) : (x<1000 ? 1.04879:0)))"
0, fastsim, central, 1, -2.4, 2.4, 20, 1000, 0, 1, "x<160 ? (x<60 ? (x<40 ? (x<30 ? (x<20 ? 0:1.02558) : (1.01382)) : (x<50 ? 0.994626:0.999015)) : (x<100 ? (x<80 ? (x<70 ? 0.992179:0.993163) : (0.987011)) : (x<120 ? 0.986577:1.00223))) : (x<500 ? (x<320 ? (x<260 ? (x<210 ? 1.0096:1.00466) : (1.03288)) : (x<400 ? 1.07286:1.08376)) : (x<800 ? (x<670 ? 1.16661:1.27239) : (x<1000 ? 1.2999:0)))"
0, fastsim, central, 2, -2.4, 2.4, 20, 1000, 0, 1, "x<160 ? (x<60 ? (x<40 ? (x<30 ? (x<20 ? 0:1.49178) : (1.44899)) : (x<50 ? 1.45367:1.48785)) : (x<100 ? (x<80 ? (x<70 ? 1.48876:1.49658) : (1.50374)) : (x<120 ? 1.5207:1.61757))) : (x<500 ? (x<320 ? (x<260 ? (x<210 ? 1.72861:1.87661) : (1.94864)) : (x<400 ? 2.15135:2.53278)) : (x<800 ? (x<670 ? 2.98777:3.21735) : (x<1000 ? 3.56723:0)))"
0, fastsim, down, 0, -2.4, 2.4, 20, 1000, 0, 1, "x<160 ? (x<60 ? (x<40 ? (x<30 ? (x<20 ? 0:0.994734) : (0.991774)) : (x<50 ? 0.988137:0.988437)) : (x<100 ? (x<80 ? (x<70 ? 0.988157:0.986658) : (0.985911)) : (x<120 ? 0.983583:0.986608))) : (x<500 ? (x<320 ? (x<260 ? (x<210 ? 0.985482:0.982062) : (0.979722)) : (x<400 ? 0.979919:0.971081)) : (x<800 ? (x<670 ? 0.988161:0.955229) : (x<1000 ? 0.986852:0)))"
0, fastsim, down, 1, -2.4, 2.4, 20, 1000, 0, 1, "x<160 ? (x<60 ? (x<40 ? (x<30 ? (x<20 ? 0:1.02213) : (1.01044)) : (x<50 ? 0.991052:0.995162)) : (x<100 ? (x<80 ? (x<70 ? 0.987959:0.988474) : (0.98313)) : (x<120 ? 0.981608:0.997221))) : (x<500 ? (x<320 ? (x<260 ? (x<210 ? 1.00187:0.991466) : (1.01259)) : (x<400 ? 1.04362:1.0469)) : (x<800 ? (x<670 ? 1.11052:1.11359) : (x<1000 ? 1.04875:0)))"
0, fastsim, down, 2, -2.4, 2.4, 20, 1000, 0, 1, "x<160 ? (x<60 ? (x<40 ? (x<30 ? (x<20 ? 0:1.48751) : (1.44459)) : (x<50 ? 1.4483:1.48151)) : (x<100 ? (x<80 ? (x<70 ? 1.48151:1.48841) : (1.49679)) : (x<120 ? 1.51145:1.60807))) : (x<500 ? (x<320 ? (x<260 ? (x<210 ? 1.71367:1.85131) : (1.91264)) : (x<400 ? 2.09951:2.45006)) : (x<800 ? (x<670 ? 2.85465:2.92135) : (x<1000 ? 3.08888:0)))"
0, fastsim, up, 0, -2.4, 2.4, 20, 1000, 0, 1, "x<160 ? (x<60 ? (x<40 ? (x<30 ? (x<20 ? 0:0.998417) : (0.995079)) : (x<50 ? 0.991334:0.991678)) : (x<100 ? (x<80 ? (x<70 ? 0.991562:0.990313) : (0.988868)) : (x<120 ? 0.98725:0.990277))) : (x<500 ? (x<320 ? (x<260 ? (x<210 ? 0.991074:0.991769) : (0.99452)) : (x<400 ? 1.00179:1.00415)) : (x<800 ? (x<670 ? 1.03357:1.04296) : (x<1000 ? 1.11074:0)))"
0, fastsim, up, 1, -2.4, 2.4, 20, 1000, 0, 1, "x<160 ? (x<60 ? (x<40 ? (x<30 ? (x<20 ? 0:1.02903) : (1.01721)) : (x<50 ? 0.9982:1.00287)) : (x<100 ? (x<80 ? (x<70 ? 0.996399:0.997851) : (0.990891)) : (x<120 ? 0.991546:1.00724))) : (x<500 ? (x<320 ? (x<260 ? (x<210 ? 1.01732:1.01785) : (1.05317)) : (x<400 ? 1.1021:1.12062)) : (x<800 ? (x<670 ? 1.2227:1.43119) : (x<1000 ? 1.55105:0)))"
0, fastsim, up, 2, -2.4, 2.4, 20, 1000, 0, 1, "x<160 ? (x<60 ? (x<40 ? (x<30 ? (x<20 ? 0:1.49604) : (1.45339)) : (x<50 ? 1.45904:1.49418)) : (x<100 ? (x<80 ? (x<70 ? 1.49601:1.50474) : (1.51068)) : (x<120 ? 1.52996:1.62707))) : (x<500 ? (x<320 ? (x<260 ? (x<210 ? 1.74354:1.90192) : (1.98464)) : (x<400 ? 2.20319:2.61551)) : (x<800 ? (x<670 ? 3.12088:3.51334) : (x<1000 ? 4.04558:0)))"
1, fastsim, central, 0, -2.4, 2.4, 20, 1000, 0, 1, "x<160 ? (x<60 ? (x<40 ? (x<30 ? (x<20 ? 0:0.943388) : (0.950158)) : (x<50 ? 0.946719:0.950268)) : (x<100 ? (x<80 ? (x<70 ? 0.949714:0.946783) : (0.946615)) : (x<120 ? 0.942133:0.944613))) : (x<500 ? (x<320 ? (x<260 ? (x<210 ? 0.942324:0.931784) : (0.929819)) : (x<400 ? 0.918163:0.906767)) : (x<800 ? (x<670 ? 0.915891:0.878004) : (x<1000 ? 0.9353:0)))"
1, fastsim, central, 1, -2.4, 2.4, 20, 1000, 0, 1, "x<160 ? (x<60 ? (x<40 ? (x<30 ? (x<20 ? 0:0.915938) : (0.915629)) : (x<50 ? 0.898799:0.907626)) : (x<100 ? (x<80 ? (x<70 ? 0.904619:0.903819) : (0.890411)) : (x<120 ? 0.887268:0.898186))) : (x<500 ? (x<320 ? (x<260 ? (x<210 ? 0.904885:0.871803) : (0.903298)) : (x<400 ? 0.93656:0.976271)) : (x<800 ? (x<670 ? 1.03353:1.09273) : (x<1000 ? 0.742679:0)))"
1, fastsim, central, 2, -2.4, 2.4, 20, 1000, 0, 1, "x<160 ? (x<60 ? (x<40 ? (x<30 ? (x<20 ? 0:1.50728) : (1.63254)) : (x<50 ? 1.67084:1.69304)) : (x<100 ? (x<80 ? (x<70 ? 1.68617:1.68904) : (1.73264)) : (x<120 ? 1.77494:2.06226))) : (x<500 ? (x<320 ? (x<260 ? (x<210 ? 2.28968:2.91799) : (3.228)) : (x<400 ? 3.65251:4.8308)) : (x<800 ? (x<670 ? 4.76516:5.74764) : (x<1000 ? 3.76507:0)))"
1, fastsim, down, 0, -2.4, 2.4, 20, 1000, 0, 1, "x<160 ? (x<60 ? (x<40 ? (x<30 ? (x<20 ? 0:0.941445) : (0.948448)) : (x<50 ? 0.945075:0.948603)) : (x<100 ? (x<80 ? (x<70 ? 0.947969:0.944915) : (0.945105)) : (x<120 ? 0.940264:0.942742))) : (x<500 ? (x<320 ? (x<260 ? (x<210 ? 0.939454:0.926806) : (0.922182)) : (x<400 ? 0.906925:0.889573)) : (x<800 ? (x<670 ? 0.892168:0.832766) : (x<1000 ? 0.870808:0)))"
1, fastsim, down, 1, -2.4, 2.4, 20, 1000, 0, 1, "x<160 ? (x<60 ? (x<40 ? (x<30 ? (x<20 ? 0:0.911043) : (0.910927)) : (x<50 ? 0.893712:0.902072)) : (x<100 ? (x<80 ? (x<70 ? 0.898582:0.897169) : (0.884981)) : (x<120 ? 0.88049:0.891352))) : (x<500 ? (x<320 ? (x<260 ? (x<210 ? 0.894323:0.85395) : (0.875282)) : (x<400 ? 0.895631:0.921424)) : (x<800 ? (x<670 ? 0.94979:0.854501) : (x<1000 ? 0.433723:0)))"
1, fastsim, down, 2, -2.4, 2.4, 20, 1000, 0, 1, "x<160 ? (x<60 ? (x<40 ? (x<30 ? (x<20 ? 0:1.49469) : (1.61798)) : (x<50 ? 1.65223:1.67107)) : (x<100 ? (x<80 ? (x<70 ? 1.66138:1.66073) : (1.70841)) : (x<120 ? 1.74253:2.02584))) : (x<500 ? (x<320 ? (x<260 ? (x<210 ? 2.22832:2.7924) : (3.04061)) : (x<400 ? 3.39589:4.34027)) : (x<800 ? (x<670 ? 4.13446:4.19816) : (x<1000 ? 2.39452:0)))"
1, fastsim, up, 0, -2.4, 2.4, 20, 1000, 0, 1, "x<160 ? (x<60 ? (x<40 ? (x<30 ? (x<20 ? 0:0.94533) : (0.951868)) : (x<50 ? 0.948363:0.951932)) : (x<100 ? (x<80 ? (x<70 ? 0.951458:0.948651) : (0.948126)) : (x<120 ? 0.944002:0.946484))) : (x<500 ? (x<320 ? (x<260 ? (x<210 ? 0.945195:0.936762) : (0.937455)) : (x<400 ? 0.929402:0.92396)) : (x<800 ? (x<670 ? 0.939614:0.923243) : (x<1000 ? 0.999792:0)))"
1, fastsim, up, 1, -2.4, 2.4, 20, 1000, 0, 1, "x<160 ? (x<60 ? (x<40 ? (x<30 ? (x<20 ? 0:0.920833) : (0.92033)) : (x<50 ? 0.903886:0.913179)) : (x<100 ? (x<80 ? (x<70 ? 0.910656:0.910469) : (0.895841)) : (x<120 ? 0.894046:0.905019))) : (x<500 ? (x<320 ? (x<260 ? (x<210 ? 0.915446:0.889655) : (0.931313)) : (x<400 ? 0.977489:1.03112)) : (x<800 ? (x<670 ? 1.11726:1.33096) : (x<1000 ? 1.05163:0)))"
1, fastsim, up, 2, -2.4, 2.4, 20, 1000, 0, 1, "x<160 ? (x<60 ? (x<40 ? (x<30 ? (x<20 ? 0:1.51986) : (1.64711)) : (x<50 ? 1.68944:1.71501)) : (x<100 ? (x<80 ? (x<70 ? 1.71095:1.71735) : (1.75688)) : (x<120 ? 1.80736:2.09868))) : (x<500 ? (x<320 ? (x<260 ? (x<210 ? 2.35105:3.04359) : (3.41539)) : (x<400 ? 3.90913:5.32134)) : (x<800 ? (x<670 ? 5.39586:7.29712) : (x<1000 ? 5.13562:0)))"
2, fastsim, central, 0, -2.4, 2.4, 20, 1000, 0, 1, "x<160 ? (x<60 ? (x<40 ? (x<30 ? (x<20 ? 0:0.868645) : (0.883126)) : (x<50 ? 0.885878:0.89094)) : (x<100 ? (x<80 ? (x<70 ? 0.886239:0.882978) : (0.881133)) : (x<120 ? 0.875527:0.874283))) : (x<500 ? (x<320 ? (x<260 ? (x<210 ? 0.866841:0.841855) : (0.830506)) : (x<400 ? 0.806618:0.763691)) : (x<800 ? (x<670 ? 0.74365:0.781259) : (x<1000 ? 0.69783:0)))"
2, fastsim, central, 1, -2.4, 2.4, 20, 1000, 0, 1, "x<160 ? (x<60 ? (x<40 ? (x<30 ? (x<20 ? 0:0.808014) : (0.805109)) : (x<50 ? 0.80035:0.822393)) : (x<100 ? (x<80 ? (x<70 ? 0.796249:0.786409) : (0.809024)) : (x<120 ? 0.776376:0.802683))) : (x<500 ? (x<320 ? (x<260 ? (x<210 ? 0.832912:0.752838) : (0.777262)) : (x<400 ? 0.812707:1.08691)) : (x<800 ? (x<670 ? 1.01953:1.44063) : (x<1000 ? 4.7618:0)))"
2, fastsim, central, 2, -2.4, 2.4, 20, 1000, 0, 1, "x<160 ? (x<60 ? (x<40 ? (x<30 ? (x<20 ? 0:1.13683) : (1.75442)) : (x<50 ? 1.84374:1.89234)) : (x<100 ? (x<80 ? (x<70 ? 2.20596:1.97945) : (2.1121)) : (x<120 ? 2.08129:2.33299))) : (x<500 ? (x<320 ? (x<260 ? (x<210 ? 2.44382:3.03172) : (3.67249)) : (x<400 ? 3.33922:9.93412)) : (x<800 ? (x<670 ? 4.06458:6.30476) : (x<1000 ? 4.39227:0)))"
2, fastsim, down, 0, -2.4, 2.4, 20, 1000, 0, 1, "x<160 ? (x<60 ? (x<40 ? (x<30 ? (x<20 ? 0:0.866505) : (0.88129)) : (x<50 ? 0.884135:0.889184)) : (x<100 ? (x<80 ? (x<70 ? 0.884402:0.881011) : (0.879548)) : (x<120 ? 0.873574:0.872329))) : (x<500 ? (x<320 ? (x<260 ? (x<210 ? 0.86382:0.836618) : (0.822416)) : (x<400 ? 0.794582:0.745094)) : (x<800 ? (x<670 ? 0.717669:0.729937) : (x<1000 ? 0.634819:0)))"
2, fastsim, down, 1, -2.4, 2.4, 20, 1000, 0, 1, "x<160 ? (x<60 ? (x<40 ? (x<30 ? (x<20 ? 0:0.798486) : (0.795437)) : (x<50 ? 0.790375:0.81137)) : (x<100 ? (x<80 ? (x<70 ? 0.784224:0.77306) : (0.797848)) : (x<120 ? 0.763525:0.789319))) : (x<500 ? (x<320 ? (x<260 ? (x<210 ? 0.812263:0.719121) : (0.723031)) : (x<400 ? 0.734211:0.954187)) : (x<800 ? (x<670 ? 0.842871:0.880773) : (x<1000 ? 1.32711:0)))"
2, fastsim, down, 2, -2.4, 2.4, 20, 1000, 0, 1, "x<160 ? (x<60 ? (x<40 ? (x<30 ? (x<20 ? 0:1.1118) : (1.70039)) : (x<50 ? 1.77559:1.81116)) : (x<100 ? (x<80 ? (x<70 ? 2.09729:1.86825) : (2.01974)) : (x<120 ? 1.97155:2.21542))) : (x<500 ? (x<320 ? (x<260 ? (x<210 ? 2.26438:2.68956) : (3.12959)) : (x<400 ? 2.79358:6.67696)) : (x<800 ? (x<670 ? 2.70031:2.10188) : (x<1000 ? 0.583074:0)))"
2, fastsim, up, 0, -2.4, 2.4, 20, 1000, 0, 1, "x<160 ? (x<60 ? (x<40 ? (x<30 ? (x<20 ? 0:0.870785) : (0.884963)) : (x<50 ? 0.88762:0.892696)) : (x<100 ? (x<80 ? (x<70 ? 0.888075:0.884945) : (0.882719)) : (x<120 ? 0.877479:0.876237))) : (x<500 ? (x<320 ? (x<260 ? (x<210 ? 0.869861:0.847092) : (0.838596)) : (x<400 ? 0.818655:0.782288)) : (x<800 ? (x<670 ? 0.76963:0.832582) : (x<1000 ? 0.76084:0)))"
2, fastsim, up, 1, -2.4, 2.4, 20, 1000, 0, 1, "x<160 ? (x<60 ? (x<40 ? (x<30 ? (x<20 ? 0:0.817543) : (0.814781)) : (x<50 ? 0.810324:0.833416)) : (x<100 ? (x<80 ? (x<70 ? 0.808273:0.799758) : (0.8202)) : (x<120 ? 0.789226:0.816048))) : (x<500 ? (x<320 ? (x<260 ? (x<210 ? 0.853561:0.786556) : (0.831494)) : (x<400 ? 0.891203:1.21964)) : (x<800 ? (x<670 ? 1.19619:2.00049) : (x<1000 ? 8.1965:0)))"
2, fastsim, up, 2, -2.4, 2.4, 20, 1000, 0, 1, "x<160 ? (x<60 ? (x<40 ? (x<30 ? (x<20 ? 0:1.16186) : (1.80846)) : (x<50 ? 1.91189:1.97352)) : (x<100 ? (x<80 ? (x<70 ? 2.31462:2.09066) : (2.20447)) : (x<120 ? 2.19102:2.45056))) : (x<500 ? (x<320 ? (x<260 ? (x<210 ? 2.62327:3.37389) : (4.21539)) : (x<400 ? 3.88486:13.1913)) : (x<800 ? (x<670 ? 5.42884:10.5076) : (x<1000 ? 8.20147:0)))"
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
24 changes: 24 additions & 0 deletions TTHAnalysis/macros/findEventNew.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
import sys, os
import ROOT

# this script can be used to count how many entries in a list of tree or friend tree files satisfy a certain requirement
# (useful to look for event numbers)

for dd in os.listdir(sys.argv[2]):
d = sys.argv[2].rstrip("/")+"/"+dd
if not os.path.isdir(d): continue
if not os.path.isdir(d + "/treeProducerSusyMultilepton"): continue
path = None
if os.path.exists(d + "/treeProducerSusyMultilepton/tree.root"):
path = d + "/treeProducerSusyMultilepton/tree.root"
elif os.path.exists(d + "/treeProducerSusyMultilepton/tree.root.url"):
path = open(d + "/treeProducerSusyMultilepton/tree.root.url").readlines()[0].rstrip("\n")
else:
continue
f = ROOT.TFile.Open(path)
t = f.Get("tree")
if not t: t = f.Get("sf/t")
if not t: continue
n = t.GetEntries(sys.argv[1])
if n>0: print n,'entries in',dd
f.Close()
4 changes: 3 additions & 1 deletion TTHAnalysis/macros/verifyFTree.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
def openRootOrUrl(myfile):
_f_t = None
if os.path.exists(myfile):
_f_t = ROOT.TFile.Open(myfile)
_f_t = ROOT.TFile.Open("dcap://t3se01.psi.ch:22125/"+myfile if "/pnfs/psi.ch" in myfile else myfile)
elif os.path.exists(myfile+'.url'):
with open(myfile+'.url','r') as urlf:
myfile = urlf.readline().replace('\n','')
Expand All @@ -35,3 +35,5 @@ def openRootOrUrl(myfile):
n_f = t_f.GetEntries()
f_f.Close()
print '%s: %d - %d : %s'%(dset,n_t,n_f,'OK' if n_t==n_f else 'ERROR '*15+' !!!')


2 changes: 1 addition & 1 deletion TTHAnalysis/python/plotter/fakeRate.cc
Original file line number Diff line number Diff line change
Expand Up @@ -699,7 +699,7 @@ float fakeRateWeight_3l(float l1fr, int l1pass, float l2fr, int l2pass, float l3
float ret = -1.0f;
if (!l1pass) ret *= -l1fr/(1.0f-l1fr);
if (!l2pass) ret *= -l2fr/(1.0f-l2fr);
if (!l3pass) ret *= -l2fr/(1.0f-l2fr);
if (!l3pass) ret *= -l3fr/(1.0f-l3fr);
if (ret == -1.0f) ret = 0.0f;
return ret;
}
Expand Down
6 changes: 6 additions & 0 deletions TTHAnalysis/python/plotter/makeShapeCardsSusy.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@
parser.add_option("--ignore",dest="ignore", type="string", default=[], action="append", help="Ignore processes when loading infile")
parser.add_option("--noNegVar",dest="noNegVar", action="store_true", default=False, help="Replace negative variations per bin by 0.1% of central value")
parser.add_option("--hardZero",dest="hardZero", action="store_true", default=False, help="Hard cut-off of processes")
parser.add_option("--ms", dest="multiplesignals", action="store_true", default=False, help="If specified, put all signals into one datacard")
parser.add_option("--frFile" ,dest="frFile" , type="string", default=None, help="Path to the FR file to extract most probable FR for postfix.")
parser.add_option("--frMap" ,dest="frMap" , type="string", default=None, help="Format of the name of the FR map in the FR file, put FL for el/mu")

Expand Down Expand Up @@ -389,6 +390,11 @@ def compilePostFixMap(inlist,relist):
myout = outdir
myout += "%s/" % signal
myprocs = ( backgrounds + [ signal ] ) if signal in signals else backgrounds
if options.multiplesignals:
# I should put a break after the first run, since looping with multiple signals produces multiple times the same card with different column order, but it is not a large overhead (<<1sec).
myout = outdir
myout += "card/"
myprocs = backgrounds + signals
if not os.path.exists(myout): os.system("mkdir -p "+myout)
myyields = dict([(k,v) for (k,v) in allyields.iteritems()])
datacard = open(myout+filename+".card.txt", "w");
Expand Down
Loading

0 comments on commit c66b318

Please sign in to comment.