diff --git a/Weights/MVAID/CSEVroot.py b/Weights/MVAID/CSEVroot.py new file mode 100644 index 0000000..d83babf --- /dev/null +++ b/Weights/MVAID/CSEVroot.py @@ -0,0 +1,121 @@ +from ROOT import * +from array import array + +etabins = [-2.5, -1.566, -1.4442, -1.0, 0.0, 1.0, 1.4442, 1.566, 2.5] +ptbins = [20, 30, 40, 50, 200] + +nbins_eta = len(etabins)-1 +nbins_pt = len(ptbins)-1 + +sfs = [[ [0,0] for x in range(nbins_pt)] for y in range(nbins_eta)] + +##20-30, -2.5, -1.56 +sfs[0][0][0] = 1#0.989453 +sfs[0][0][1] = 1#0.0400067 +##20-30, -1.56, -1.44 +sfs[1][0][0] = 0 +sfs[1][0][1] = 0 +##20-30, -1.44, -1 +sfs[2][0][0] = 1#0.997501 +sfs[2][0][1] = 1#0.0744126 +##20-30, -1, 0 +sfs[3][0][0] = 1#0.999754 +sfs[3][0][1] = 1#0.0258297 +##20-30, 0, 1 +sfs[4][0][0] = 1#1.01528 +sfs[4][0][1] = 1#0.0218661 +##20-30, 1, 1.44 +sfs[5][0][0] = 1#0.955474 +sfs[5][0][1] = 1#0.1803399 +##20-30, 1.44, 1.566 +sfs[6][0][0] = 0 +sfs[6][0][1] = 0 +##20-30, 1.566, +sfs[7][0][0] = 1#0.977028 +sfs[7][0][1] = 1#0.0965378 + +##30-40, -2.5, -1.56 +sfs[0][1][0] = 1#0.99054 +sfs[0][1][1] = 1#0.0131795 +##30-40, -1.56, -1.44 +sfs[1][1][0] = 0 +sfs[1][1][1] = 0 +##30-40, -1.44, -1 +sfs[2][1][0] = 1#0.994976 +sfs[2][1][1] = 1#0.0245861 +##30-40, -1, 0 +sfs[3][1][0] = 1#0.997789 +sfs[3][1][1] = 1#0.0103248 +##30-40, 0, 1 +sfs[4][1][0] = 1#0.997776 +sfs[4][1][1] = 1#0.0271587 +##30-40, 1, 1.44 +sfs[5][1][0] = 1#0.996409 +sfs[5][1][1] = 1#0.0219291 +##30-40, 1.44, 1.566 +sfs[6][1][0] = 0 +sfs[6][1][1] = 0 +##30-40, 1.566, +sfs[7][1][0] = 1#0.994255 +sfs[7][1][1] = 1#0.0162298 + +##40-50, -2.5, -1.56 +sfs[0][2][0] = 1#0.992323 +sfs[0][2][1] = 1#0.0106739 +##40-50, -1.56, -1.44 +sfs[1][2][0] = 0 +sfs[1][2][1] = 0 +##40-50, -1.44, -1 +sfs[2][2][0] = 1#0.996538 +sfs[2][2][1] = 1#0.0076656 +##40-50, -1, 0 +sfs[3][2][0] = 1#0.997529 +sfs[3][2][1] = 1#0.0058141 +##40-50, 0, 1 +sfs[4][2][0] = 1#1.00076 +sfs[4][2][1] = 1#0.0063664 +##40-50, 1, 1.44 +sfs[5][2][0] = 1#1.00054 +sfs[5][2][1] = 1#0.0076592 +##40-50, 1.44, 1.566 +sfs[6][2][0] = 0 +sfs[6][2][1] = 0 +##40-50, 1.566, +sfs[7][2][0] = 1#0.991665 +sfs[7][2][1] = 1#0.0109673 + +##50-200, -2.5, -1.56 +sfs[0][3][0] = 1#0.984755 +sfs[0][3][1] = 1#0.0112026 +##50-200, -1.56, -1.44 +sfs[1][3][0] = 0 +sfs[1][3][1] = 0 +##50-200, -1.44, -1 +sfs[2][3][0] = 1#0.989592 +sfs[2][3][1] = 1#0.0121205 +##50-200, -1, 0 +sfs[3][3][0] = 1#0.994825 +sfs[3][3][1] = 1#0.0125226 +##50-200, 0, 1 +sfs[4][3][0] = 1#0.998808 +sfs[4][3][1] = 1#0.0135373 +##50-200, 1, 1.44 +sfs[5][3][0] = 1#0.990307 +sfs[5][3][1] = 1#0.0264489 +##50-200, 1.44, 1.566 +sfs[6][3][0] = 0 +sfs[6][3][1] = 0 +##50-200, 1.566, +sfs[7][3][0] = 1#0.994873 +sfs[7][3][1] = 1#0.0096489 + +fout = TFile("csevsf.root", "RECREATE") +sf2d = TH2F("csev_sfs", "csev_sfs", len(etabins)-1, array('d',etabins), len(ptbins)-1, array('d',ptbins)) +for i,pt in enumerate(sfs): + for j,eta in enumerate(pt): + sf2d.SetBinContent(i+1, j+1, eta[0]) + sf2d.SetBinError(i+1, j+1, eta[1]) + +fout.cd() +sf2d.Write() +fout.Close() diff --git a/Weights/MVAID/MVAIDroot.py b/Weights/MVAID/MVAIDroot.py new file mode 100644 index 0000000..23deb03 --- /dev/null +++ b/Weights/MVAID/MVAIDroot.py @@ -0,0 +1,121 @@ +from ROOT import * +from array import array + +etabins = [-2.5, -1.566, -1.4442, -1.0, 0.0, 1.0, 1.4442, 1.566, 2.5] +ptbins = [20, 30, 40, 50, 200] + +nbins_eta = len(etabins)-1 +nbins_pt = len(ptbins)-1 + +sfs = [[ [0,0] for x in range(nbins_pt)] for y in range(nbins_eta)] + +##20-30, -2.5, -1.56 +sfs[0][0][0] = 0.989453 +sfs[0][0][1] = 0.0400067 +##20-30, -1.56, -1.44 +sfs[1][0][0] = 0 +sfs[1][0][1] = 0 +##20-30, -1.44, -1 +sfs[2][0][0] = 0.997501 +sfs[2][0][1] = 0.0744126 +##20-30, -1, 0 +sfs[3][0][0] = 0.999754 +sfs[3][0][1] = 0.0258297 +##20-30, 0, 1 +sfs[4][0][0] = 1.01528 +sfs[4][0][1] = 0.0218661 +##20-30, 1, 1.44 +sfs[5][0][0] = 0.955474 +sfs[5][0][1] = 0.1803399 +##20-30, 1.44, 1.566 +sfs[6][0][0] = 0 +sfs[6][0][1] = 0 +##20-30, 1.566, +sfs[7][0][0] = 0.977028 +sfs[7][0][1] = 0.0965378 + +##30-40, -2.5, -1.56 +sfs[0][1][0] = 0.99054 +sfs[0][1][1] = 0.0131795 +##30-40, -1.56, -1.44 +sfs[1][1][0] = 0 +sfs[1][1][1] = 0 +##30-40, -1.44, -1 +sfs[2][1][0] = 0.994976 +sfs[2][1][1] = 0.0245861 +##30-40, -1, 0 +sfs[3][1][0] = 0.997789 +sfs[3][1][1] = 0.0103248 +##30-40, 0, 1 +sfs[4][1][0] = 0.997776 +sfs[4][1][1] = 0.0271587 +##30-40, 1, 1.44 +sfs[5][1][0] = 0.996409 +sfs[5][1][1] = 0.0219291 +##30-40, 1.44, 1.566 +sfs[6][1][0] = 0 +sfs[6][1][1] = 0 +##30-40, 1.566, +sfs[7][1][0] = 0.994255 +sfs[7][1][1] = 0.0162298 + +##40-50, -2.5, -1.56 +sfs[0][2][0] = 0.992323 +sfs[0][2][1] = 0.0106739 +##40-50, -1.56, -1.44 +sfs[1][2][0] = 0 +sfs[1][2][1] = 0 +##40-50, -1.44, -1 +sfs[2][2][0] = 0.996538 +sfs[2][2][1] = 0.0076656 +##40-50, -1, 0 +sfs[3][2][0] = 0.997529 +sfs[3][2][1] = 0.0058141 +##40-50, 0, 1 +sfs[4][2][0] = 1.00076 +sfs[4][2][1] = 0.0063664 +##40-50, 1, 1.44 +sfs[5][2][0] = 1.00054 +sfs[5][2][1] = 0.0076592 +##40-50, 1.44, 1.566 +sfs[6][2][0] = 0 +sfs[6][2][1] = 0 +##40-50, 1.566, +sfs[7][2][0] = 0.991665 +sfs[7][2][1] = 0.0109673 + +##50-200, -2.5, -1.56 +sfs[0][3][0] = 0.984755 +sfs[0][3][1] = 0.0112026 +##50-200, -1.56, -1.44 +sfs[1][3][0] = 0 +sfs[1][3][1] = 0 +##50-200, -1.44, -1 +sfs[2][3][0] = 0.989592 +sfs[2][3][1] = 0.0121205 +##50-200, -1, 0 +sfs[3][3][0] = 0.994825 +sfs[3][3][1] = 0.0125226 +##50-200, 0, 1 +sfs[4][3][0] = 0.998808 +sfs[4][3][1] = 0.0135373 +##50-200, 1, 1.44 +sfs[5][3][0] = 0.990307 +sfs[5][3][1] = 0.0264489 +##50-200, 1.44, 1.566 +sfs[6][3][0] = 0 +sfs[6][3][1] = 0 +##50-200, 1.566, +sfs[7][3][0] = 0.994873 +sfs[7][3][1] = 0.0096489 + +fout = TFile("mvaIDsf.root", "RECREATE") +sf2d = TH2F("mva_id_sfs", "mva_id_sfs", len(etabins)-1, array('d',etabins), len(ptbins)-1, array('d',ptbins)) +for i,pt in enumerate(sfs): + for j,eta in enumerate(pt): + sf2d.SetBinContent(i+1, j+1, eta[0]) + sf2d.SetBinError(i+1, j+1, eta[1]) + +fout.cd() +sf2d.Write() +fout.Close() diff --git a/Weights/MVAID/ScalingFactors_80X_Summer16.root b/Weights/MVAID/ScalingFactors_80X_Summer16.root new file mode 100644 index 0000000..20b03af Binary files /dev/null and b/Weights/MVAID/ScalingFactors_80X_Summer16.root differ diff --git a/Weights/MVAID/csevsf.root b/Weights/MVAID/csevsf.root new file mode 100644 index 0000000..21d2e3b Binary files /dev/null and b/Weights/MVAID/csevsf.root differ diff --git a/Weights/MVAID/egammaEffi.txt_EGM2D.root b/Weights/MVAID/egammaEffi.txt_EGM2D.root new file mode 100644 index 0000000..073f81a Binary files /dev/null and b/Weights/MVAID/egammaEffi.txt_EGM2D.root differ diff --git a/Weights/MVAID/mvaIDsf.root b/Weights/MVAID/mvaIDsf.root new file mode 100644 index 0000000..f7efc77 Binary files /dev/null and b/Weights/MVAID/mvaIDsf.root differ diff --git a/Weights/TriggerSF/MakeTSFHistograms.py b/Weights/TriggerSF/MakeTSFHistograms.py new file mode 100644 index 0000000..b88f141 --- /dev/null +++ b/Weights/TriggerSF/MakeTSFHistograms.py @@ -0,0 +1,183 @@ +from ROOT import * +from array import array + +leadPhotonSF = [ +[ [0.0,0.0,0.0], [0.54,1.5,33.3333], 0.6810978055, [0.00519262468286,0.00519262468286] ], +[ [0.0,0.0,33.3333], [0.54,1.5,35.0], 0.762424051762, [0.00606810658022,0.00606810658022] ], +[ [0.0,0.0,35.0], [0.54,1.5,40.0], 0.778700113297, [0.00311642304626,0.00311642304626] ], +[ [0.0,0.0,40.0], [0.54,1.5,45.0], 0.795413970947, [0.00303555330709,0.00303555330709] ], +[ [0.0,0.0,45.0], [0.54,1.5,50.0], 0.808078825474, [0.00422688722282,0.00422688722282] ], +[ [0.0,0.0,50.0], [0.54,1.5,60.0], 0.819607198238, [0.0074540959624,0.0074540959624] ], +[ [0.0,0.0,60.0], [0.54,1.5,70.0], 0.851548194885, [0.0158679720146,0.0158679720146] ], +[ [0.0,0.0,70.0], [0.54,1.5,90.0], 0.868812680244, [0.0302805485333,0.0302805485333] ], +[ [0.0,0.0,90.0], [0.54,1.5,99999999], 0.84904062748, [0.0736341456908,0.0736341456908] ], +[ [0.54,0.0,0.0], [0.85,1.5,33.3333], 0.898902833462, [0.00100959242125,0.00100959242125] ], +[ [0.54,0.0,33.3333], [0.85,1.5,35.0], 0.958884656429, [0.000808069907818,0.000808069907818] ], +[ [0.54,0.0,35.0], [0.85,1.5,40.0], 0.965837776661, [0.000305692172361,0.000305692172361] ], +[ [0.54,0.0,40.0], [0.85,1.5,45.0], 0.970546543598, [0.00026519245806,0.00026519245806] ], +[ [0.54,0.0,45.0], [0.85,1.5,50.0], 0.973720788956, [0.000322496232078,0.000322496232078] ], +[ [0.54,0.0,50.0], [0.85,1.5,60.0], 0.976857423782, [0.00049804973141,0.00049804973141] ], +[ [0.54,0.0,60.0], [0.85,1.5,70.0], 0.980784952641, [0.000875908397042,0.000875908397042] ], +[ [0.54,0.0,70.0], [0.85,1.5,90.0], 0.985170722008, [0.00134766564404,0.00134766564404] ], +[ [0.54,0.0,90.0], [0.85,1.5,99999999], 0.989234626293, [0.00161217085916,0.00161217085916] ], +[ [0.85,0.0,0.0], [999,1.5,33.3333], 0.924440562725, [0.000377342171653,0.000377342171653] ], +[ [0.85,0.0,33.3333], [999,1.5,35.0], 0.971459209919, [0.000281199348832,0.000281199348832] ], +[ [0.85,0.0,35.0], [999,1.5,40.0], 0.979482769966, [0.000115534010648,0.000115534010648] ], +[ [0.85,0.0,40.0], [999,1.5,45.0], 0.982116281986, [9.05590478798e-05,9.05590478798e-05] ], +[ [0.85,0.0,45.0], [999,1.5,50.0], 0.98511326313, [0.000105097340197,0.000105097340197] ], +[ [0.85,0.0,50.0], [999,1.5,60.0], 0.984966993332, [0.00111781327877,0.00111781327877] ], +[ [0.85,0.0,60.0], [999,1.5,70.0], 0.986653208733, [0.000295146360226,0.000295146360226] ], +[ [0.85,0.0,70.0], [999,1.5,90.0], 0.98967808485, [0.000409470102893,0.000409470102893] ], +[ [0.85,0.0,90.0], [999,1.5,99999999], 0.991826117039, [0.000323844893609,0.000323844893609] ], +[ [0.0,1.5,0.0], [0.84,3.0,33.3333], 0.632706999779, [0.00549277181579,0.00549277181579] ], +[ [0.0,1.5,33.3333], [0.84,3.0,35.0], 0.705228030682, [0.00671890259184,0.00671890259184] ], +[ [0.0,1.5,35.0], [0.84,3.0,40.0], 0.729334890842, [0.00316854098441,0.00316854098441] ], +[ [0.0,1.5,40.0], [0.84,3.0,45.0], 0.752555906773, [0.00315251887441,0.00315251887441] ], +[ [0.0,1.5,45.0], [0.84,3.0,50.0], 0.770330071449, [0.00465503941806,0.00465503941806] ], +[ [0.0,1.5,50.0], [0.84,3.0,60.0], 0.786793231964, [0.00682801354333,0.00682801354333] ], +[ [0.0,1.5,60.0], [0.84,3.0,70.0], 0.816314458847, [0.0133762782917,0.0133762782917] ], +[ [0.0,1.5,70.0], [0.84,3.0,90.0], 0.857941806316, [0.0154562893515,0.0154562893515] ], +[ [0.,1.5,90.0], [0.84,3.0,99999999], 0.886136233807, [0.0226681113534,0.0226681113534] ], +[ [0.84,1.5,0.0], [0.9,3.0,33.3333], 0.872963190079, [0.00255836970587,0.00255836970587] ], +[ [0.84,1.5,33.3333], [0.9,3.0,35.0], 0.971260070801, [0.00169839848133,0.00169839848133] ], +[ [0.84,1.5,35.0], [0.9,3.0,40.0], 0.98152244091, [0.000588619026864,0.000588619026864] ], +[ [0.84,1.5,40.0], [0.9,3.0,45.0], 0.986895382404, [0.000503406678232,0.000503406678232] ], +[ [0.84,1.5,45.0], [0.9,3.0,50.0], 0.98783403635, [0.000744728019948,0.000744728019948] ], +[ [0.84,1.5,50.0], [0.9,3.0,60.0], 0.988175034523, [0.00106780215648,0.00106780215648] ], +[ [0.84,1.5,60.0], [0.9,3.0,70.0], 0.990262210369, [0.0019675187127,0.0019675187127] ], +[ [0.84,1.5,70.0], [0.9,3.0,90.0], 0.990519165993, [0.00309011400271,0.00309011400271] ], +[ [0.84,1.5,90.0], [0.9,3.0,99999999], 0.997375607491, [0.00160821560062,0.00160821560062] ], +[ [0.9,1.5,0.0], [999,3.0,33.3333], 0.827793955803, [0.000860672672767,0.000860672672767] ], +[ [0.9,1.5,33.3333], [999,3.0,35.0], 0.966853737831, [0.00050528634985,0.00050528634985] ], +[ [0.9,1.5,35.0], [999,3.0,40.0], 0.980059444904, [0.000211483705081,0.000211483705081] ], +[ [0.9,1.5,40.0], [999,3.0,45.0], 0.98436075449, [0.000193397430742,0.000193397430742] ], +[ [0.9,1.5,45.0], [999,3.0,50.0], 0.985809862614, [0.000283829305427,0.000283829305427] ], +[ [0.9,1.5,50.0], [999,3.0,60.0], 0.985918521881, [0.0011583820968,0.0011583820968] ], +[ [0.9,1.5,60.0], [999,3.0,70.0], 0.990703165531, [0.000662821684507,0.000662821684507] ], +[ [0.9,1.5,70.0], [999,3.0,90.0], 0.994281888008, [0.000630687802869,0.000630687802869] ], +[ [0.9,1.5,90.0], [999,3.0,99999999], 0.997075855732, [0.000553451337113,0.000553451337113] ], +[ [0.0,3.,0], [999,999,999999], 1.0, [1.,1.] ] +] + +subleadingPhotonSF = [ +[ [0.0,0.0,0.0], [0.54,1.5,22.5], 0.735150516033, [0.0124989687013,0.0124989687013] ], +[ [0.0,0.0,22.5], [0.54,1.5,25.0], 0.741944074631, [0.0104878349021,0.0104878349021] ], +[ [0.0,0.0,25.0], [0.54,1.5,27.5], 0.759739041328, [0.0085182165305,0.0085182165305] ], +[ [0.0,0.0,27.5], [0.54,1.5,30.0], 0.768184542656, [0.00742963937731,0.00742963937731] ], +[ [0.0,0.0,30.0], [0.54,1.5,32.5], 0.781085252762, [0.00607655931058,0.00607655931058] ], +[ [0.0,0.0,32.5], [0.54,1.5,35.0], 0.787775456905, [0.00543688578024,0.00543688578024] ], +[ [0.0,0.0,35.0], [0.54,1.5,40.0], 0.804114878178, [0.00298680600149,0.00298680600149] ], +[ [0.0,0.0,40.0], [0.54,1.5,45.0], 0.819701194763, [0.00290229435272,0.00290229435272] ], +[ [0.0,0.0,45.0], [0.54,1.5,50.0], 0.832450091839, [0.00402395578062,0.00402395578062] ], +[ [0.0,0.0,50.0], [0.54,1.5,60.0], 0.840809226036, [0.00712945852573,0.00712945852573] ], +[ [0.0,0.0,60.0], [0.54,1.5,70.0], 0.863569915295, [0.0158928774505,0.0158928774505] ], +[ [0.0,0.0,70.0], [0.54,1.5,90.0], 0.873844146729, [0.0302822319315,0.0302822319315] ], +[ [0.0,0.0,90.0], [0.54,1.5,99999999], 0.880566418171, [0.0771217355214,0.0771217355214] ], +[ [0.54,0.0,0.0], [0.85,1.5,22.5], 0.986665070057, [0.00290137137345,0.00290137137345] ], +[ [0.54,0.0,22.5], [0.85,1.5,25.0], 0.991021811962, [0.000881010903373,0.000881010903373] ], +[ [0.54,0.0,25.0], [0.85,1.5,27.5], 0.993968784809, [0.000365351913748,0.000365351913748] ], +[ [0.54,0.0,27.5], [0.85,1.5,30.0], 0.992568671703, [0.00080863027601,0.00080863027601] ], +[ [0.54,0.0,30.0], [0.85,1.5,32.5], 0.992429018021, [0.000927701357281,0.000927701357281] ], +[ [0.54,0.0,32.5], [0.85,1.5,35.0], 0.993385374546, [0.000273290379079,0.000273290379079] ], +[ [0.54,0.0,35.0], [0.85,1.5,40.0], 0.993640601635, [0.000134285419182,0.000134285419182] ], +[ [0.54,0.0,40.0], [0.85,1.5,45.0], 0.994162678719, [0.000117730435885,0.000117730435885] ], +[ [0.54,0.0,45.0], [0.85,1.5,50.0], 0.993752419949, [0.000159345143113,0.000159345143113] ], +[ [0.54,0.0,50.0], [0.85,1.5,60.0], 0.993596553802, [0.000408447927548,0.000408447927548] ], +[ [0.54,0.0,60.0], [0.85,1.5,70.0], 0.993239223957, [0.000583930534644,0.000583930534644] ], +[ [0.54,0.0,70.0], [0.85,1.5,90.0], 0.992464900017, [0.00420925695041,0.00420925695041] ], +[ [0.54,0.0,90.0], [0.85,1.5,99999999], 0.992560684681, [0.001409051152,0.001409051152] ], +[ [0.85,0.0,0.0], [999,1.5,22.5], 0.99289894104, [0.000459394846531,0.000459394846531] ], +[ [0.85,0.0,22.5], [999,1.5,25.0], 0.994199693203, [0.000459394846531,0.000459394846531] ], +[ [0.85,0.0,25.0], [999,1.5,27.5], 0.996753513813, [0.00019635266302,0.00019635266302] ], +[ [0.85,0.0,27.5], [999,1.5,30.0], 0.997437953949, [0.000105276812567,0.000105276812567] ], +[ [0.85,0.0,30.0], [999,1.5,32.5], 0.998195171356, [0.000120250429564,0.000120250429564] ], +[ [0.85,0.0,32.5], [999,1.5,35.0], 0.998485267162, [5.53143156827e-05,5.53143156827e-05] ], +[ [0.85,0.0,35.0], [999,1.5,40.0], 0.999016582966, [2.49504923609e-05,2.49504923609e-05] ], +[ [0.85,0.0,40.0], [999,1.5,45.0], 0.999399483204, [1.67820877013e-05,1.67820877013e-05] ], +[ [0.85,0.0,45.0], [999,1.5,50.0], 0.999610304832, [1.71324623735e-05,1.71324623735e-05] ], +[ [0.85,0.0,50.0], [999,1.5,60.0], 0.999711513519, [2.13249403322e-05,2.13249403322e-05] ], +[ [0.85,0.0,60.0], [999,1.5,70.0], 0.99971395731, [4.15814070615e-05,4.15814070615e-05] ], +[ [0.85,0.0,70.0], [999,1.5,90.0], 0.999810993671, [4.80188315009e-05,4.80188315009e-05] ], +[ [0.85,0.0,90.0], [999,1.5,99999999], 0.999862849712, [4.13267813275e-05,4.13267813275e-05] ], +[ [0.0,1.5,0.0], [0.84,3.0,22.5], 0.660493433475, [0.0189502448237,0.0189502448237] ], +[ [0.0,1.5,22.5], [0.84,3.0,25.0], 0.675408184528, [0.0141567263708,0.0141567263708] ], +[ [0.0,1.5,25.0], [0.84,3.0,27.5], 0.694644391537, [0.0109544486394,0.0109544486394] ], +[ [0.0,1.5,27.5], [0.84,3.0,30.0], 0.705103397369, [0.00740787194485,0.00740787194485] ], +[ [0.0,1.5,30.0], [0.84,3.0,32.5], 0.712502062321, [0.00673718942098,0.00673718942098] ], +[ [0.0,1.5,32.5], [0.84,3.0,35.0], 0.719795048237, [0.00535038292038,0.00535038292038] ], +[ [0.0,1.5,35.0], [0.84,3.0,40.0], 0.736499130726, [0.00315590127157,0.00315590127157] ], +[ [0.0,1.5,40.0], [0.84,3.0,45.0], 0.757362127304, [0.00315107032637,0.00315107032637] ], +[ [0.0,1.5,45.0], [0.84,3.0,50.0], 0.77392333746, [0.00466395309879,0.00466395309879] ], +[ [0.0,1.5,50.0], [0.84,3.0,60.0], 0.78893083334, [0.00687048443179,0.00687048443179] ], +[ [0.0,1.5,60.0], [0.84,3.0,70.0], 0.818382263184, [0.0135113622786,0.0135113622786] ], +[ [0.0,1.5,70.0], [0.84,3.0,90.0], 0.841334581375, [0.0180361620001,0.0180361620001] ], +[ [0.0,1.5,90.0], [0.84,3.0,99999999], 0.868076682091, [0.0243523219982,0.0243523219982] ], +[ [0.84,1.5,0.0], [0.9,3.0,22.5], 0.976537823677, [0.00489157641841,0.00489157641841] ], +[ [0.84,1.5,22.5], [0.9,3.0,25.0], 0.987386524677, [0.00432063989045,0.00432063989045] ], +[ [0.84,1.5,25.0], [0.9,3.0,27.5], 0.986037313938, [0.00208121288909,0.00208121288909] ], +[ [0.84,1.5,27.5], [0.9,3.0,30.0], 0.989064216614, [0.00131255284358,0.00131255284358] ], +[ [0.84,1.5,30.0], [0.9,3.0,32.5], 0.990115821362, [0.000987952486947,0.000987952486947] ], +[ [0.84,1.5,32.5], [0.9,3.0,35.0], 0.991321563721, [0.00064998825176,0.00064998825176] ], +[ [0.84,1.5,35.0], [0.9,3.0,40.0], 0.992424309254, [0.000392538029826,0.000392538029826] ], +[ [0.84,1.5,40.0], [0.9,3.0,45.0], 0.993506371975, [0.000357896360151,0.000357896360151] ], +[ [0.84,1.5,45.0], [0.9,3.0,50.0], 0.992881655693, [0.000667513509479,0.000667513509479] ], +[ [0.84,1.5,50.0], [0.9,3.0,60.0], 0.99330842495, [0.000823890634755,0.000823890634755] ], +[ [0.84,1.5,60.0], [0.9,3.0,70.0], 0.991472125053, [0.00186896480055,0.00186896480055] ], +[ [0.84,1.5,70.0], [0.9,3.0,90.0], 0.999999046326, [0.000123650174015,0.000123650174015] ], +[ [0.84,1.5,90.0], [0.9,3.0,99999999], 0.992282807827, [0.00316821950182,0.00316821950182] ], +[ [0.9,1.5,0.0], [999,3.0,22.5], 0.99313390255, [0.000574329725221,0.000574329725221] ], +[ [0.9,1.5,22.5], [999,3.0,25.0], 0.998826920986, [0.000196940017181,0.000196940017181] ], +[ [0.9,1.5,25.0], [999,3.0,27.5], 0.998663425446, [0.000196940017181,0.000196940017181] ], +[ [0.9,1.5,27.5], [999,3.0,30.0], 0.998753978656, [0.000196940017181,0.000196940017181] ], +[ [0.9,1.5,30.0], [999,3.0,32.5], 0.998868584633, [9.19086602694e-05,9.19086602694e-05] ], +[ [0.9,1.5,32.5], [999,3.0,35.0], 0.999282956123, [6.61051993856e-05,6.61051993856e-05] ], +[ [0.9,1.5,35.0], [999,3.0,40.0], 0.999356508255, [4.28383970185e-05,4.28383970185e-05] ], +[ [0.9,1.5,40.0], [999,3.0,45.0], 0.999553442001, [3.74810811141e-05,3.74810811141e-05] ], +[ [0.9,1.5,45.0], [999,3.0,50.0], 0.999633073807, [4.60404995528e-05,4.60404995528e-05] ], +[ [0.9,1.5,50.0], [999,3.0,60.0], 0.999295592308, [8.84144904368e-05,8.84144904368e-05] ], +[ [0.9,1.5,60.0], [999,3.0,70.0], 0.999351680279, [0.00015872505313,0.00015872505313] ], +[ [0.9,1.5,70.0], [999,3.0,90.0], 0.999379456043, [0.000199756405112,0.000199756405112] ], +[ [0.9,1.5,90.0], [999,3.0,99999999], 0.99986666441, [0.000145852311423,0.000145852311423] ], +[ [0.0,3.,0], [999,999,999999] , 1.0, [1.0,1.0] ] +] + +def GetSF(pt, r9, eta, arr, db=0): + for aa in arr: + if r9 >= aa[0][0] and r9 <= aa[1][0]: + if db: print 'Found r9:', r9, aa[0][0], aa[1][0] + if abs(eta) >= aa[0][1] and abs(eta) <= aa[1][1]: + if db: print 'Found eta:', eta, aa[0][1], aa[1][1], aa[0][2], aa[1][2] + if pt >= aa[0][2] and pt <= aa[1][2]: + if db: print 'Found pt:', pt, aa[0][2], aa[1][2] + return [aa[2], aa[3][0]] + return [1, 1] + +tfile = TFile("TriggerSFs.root", "RECREATE") + +r9Bins = [0, 0.54, 0.84, 0.9, 999] +etaBins = [0, 1.5, 3.0, 999] +ptBins = [0, 22.5, 25, 27.5, 30.0, 32.5, 35, 40, 45, 50, 60, 70, 90, 99999999] +lSFs = TH3F("leadingPhotonTSF", "leadingPhotonTSF", len(r9Bins)-1, array('d', r9Bins), len(etaBins)-1, array('d', etaBins), len(ptBins)-1, array('d', ptBins)) +sSFs = TH3F("subleadingPhotonTSF", "subleadingPhotonTSF", len(r9Bins)-1, array('d', r9Bins), len(etaBins)-1, array('d', etaBins), len(ptBins)-1, array('d', ptBins)) + +xbins = lSFs.GetNbinsX() +ybins = lSFs.GetNbinsY() +zbins = lSFs.GetNbinsZ() + +for xx in range(1, xbins+1): + mR9 = lSFs.GetXaxis().GetBinCenter(xx) + print mR9 + for yy in range(1, ybins+1): + mEta = lSFs.GetYaxis().GetBinCenter(yy) + for zz in range(1, zbins+1): + mPt = lSFs.GetZaxis().GetBinCenter(zz) + lSf = GetSF(mPt, mR9, mEta, leadPhotonSF) + sSf = GetSF(mPt, mR9, mEta, subleadingPhotonSF) + lSFs.SetBinContent(xx, yy, zz, lSf[0]) + lSFs.SetBinError(xx, yy, zz, lSf[1]) + sSFs.SetBinContent(xx, yy, zz, sSf[0]) + sSFs.SetBinError(xx, yy, zz, sSf[1]) + +tfile.cd() +lSFs.Write() +sSFs.Write() diff --git a/Weights/TriggerSF/TriggerSFs.root b/Weights/TriggerSF/TriggerSFs.root new file mode 100644 index 0000000..734e1fe Binary files /dev/null and b/Weights/TriggerSF/TriggerSFs.root differ diff --git a/templates/models_2D_higgs_mjj70_vars.rs b/templates/models_2D_higgs_mjj70_vars.rs new file mode 100644 index 0000000..c395398 --- /dev/null +++ b/templates/models_2D_higgs_mjj70_vars.rs @@ -0,0 +1,4 @@ +mgg[100,180]; +mjj[70,190]; +mtot[200,1600]; +ttHTagger[-1,1];