60 print "Creating MCID, GammapT mapping"
61 GammapTMapping = dict()
64 print "Loading histograms with weights"
68 fileWithWeights =
"/cvmfs/atlas.cern.ch/repo/sw/database/GroupData/dev/SUSYTools/GammaJets_SysParameterization/AllVariationsGamma.root"
70 g = ROOT.TFile(fileWithWeights)
71 systList = [
"ckkw15",
"ckkw30",
"fact025",
"fact4",
"renorm025",
"renorm4",
"qsf025",
"qsf4"]
75 h = ROOT.TH2F(g.Get(syst))
79 f = ROOT.TFile(infile,
"update")
86 treeName =
"GAMMA_CRY"
94 ckkw15 =
array(
'f', [0.])
95 ckkw30 =
array(
'f', [0.])
96 fact025 =
array(
'f', [0.])
97 fact4 =
array(
'f', [0.])
98 renorm025 =
array(
'f', [0.])
99 renorm4 =
array(
'f', [0.])
100 qsf025 =
array(
'f', [0.])
101 qsf4 =
array(
'f', [0.])
105 ckkw15branch = T.Branch(
"ckkw15_Weight", ckkw15,
"ckkw15_Weight/F")
106 ckkw30branch = T.Branch(
"ckkw30_Weight", ckkw30,
"ckkw30_Weight/F")
107 fact025branch = T.Branch(
"fact025_Weight", fact025,
"fact025_Weight/F")
108 fact4branch = T.Branch(
"fact4_Weight", fact4,
"fact4_Weight/F")
109 renorm025branch = T.Branch(
"renorm025_Weight", renorm025,
"renorm025_Weight/F")
110 renorm4branch = T.Branch(
"renorm4_Weight", renorm4,
"renorm4_Weight/F")
111 qsf025branch = T.Branch(
"qsf025_Weight", qsf025,
"qsf025_Weight/F")
112 qsf4branch = T.Branch(
"qsf4_Weight", qsf4,
"qsf4_Weight/F")
114 print "Adding Weights"
115 nEvts = T.GetEntries()
116 for iEvt
in range(nEvts):
119 print "Current Event being Processed is: ", iEvt
128 GammapTBin = GammapTMapping.get(MCID)
129 TruthJetBin = nTruthJets+1
132 if GammapTBin ==
None:
144 ckkw15[0] = Histograms[0].GetBinContent(GammapTBin,TruthJetBin)
145 ckkw30[0] = Histograms[1].GetBinContent(GammapTBin,TruthJetBin)
146 fact025[0] = Histograms[2].GetBinContent(GammapTBin,TruthJetBin)
147 fact4[0] = Histograms[3].GetBinContent(GammapTBin,TruthJetBin)
148 renorm025[0] = Histograms[4].GetBinContent(GammapTBin,TruthJetBin)
149 renorm4[0] = Histograms[5].GetBinContent(GammapTBin,TruthJetBin)
150 qsf025[0] = Histograms[6].GetBinContent(GammapTBin,TruthJetBin)
151 qsf4[0] = Histograms[7].GetBinContent(GammapTBin,TruthJetBin)
157 renorm025branch.Fill()