4 from array
import array
8 import ProviderHistoHelpers
11 'AntiKt4EMTopo' :
'AntiKt4Topo_EMJES',
13 'AntiKt4LCTopo' :
'AntiKt4Topo_LCJES',
18 if not dirName.endswith(
"/"):
19 dirName = dirName +
"/"
21 print "\n\n\ndoobledoobledooble"
26 files =
sorted(glob.glob(dirName+
"bJES*GSC.root"))
29 print "Not what I expected!"
33 print "#######################"
34 print "Beginning bJES fetcher on file",aFileName
37 inFile = TFile(aFileName,
"READ")
38 for inFileDef
in jetDefDict.keys() :
39 jetDef = jetDefDict[inFileDef]
40 if jetDef
not in histos.keys() :
42 fetchName =
"bJES_" + inFileDef
43 systematicName =
"bJES_" + jetDef
44 histo = inFile.Get(fetchName)
46 print "Failed to get histogram:",systematicName
49 nbinsx = histo.GetNbinsX()
50 binsx = histo.GetXaxis().GetXbins()
51 newhisto = TH2D(
"bJES_extendedEta_{0}".
format(jetDef),
"bJES_extendedEta_{0}".
format(jetDef),nbinsx,binsx.GetArray(),2,-4.4,4.4)
52 newhisto.SetDirectory(0)
57 for ptbin
in range(1,histo.GetNbinsX()+1) :
61 for etabin
in range(1,histo.GetNbinsY()) :
62 thisVal = histo.GetBinContent(ptbin,etabin)
63 if thisVal > maxVal : maxVal = thisVal
64 for etabin
in range(1,newhisto.GetNbinsY()+1) :
65 newhisto.SetBinContent(ptbin,etabin,maxVal)
67 histos[jetDef][
'bJES'] = newhisto
72 print "#######################"
73 print "bJES fetcher returning:"