4 from array
import array
8 import ProviderHistoHelpers
10 SystematicNames = {
'EtaIntercalibration_TotalStat' :
'EtaIntercalibration_TotalStat',\
11 'EtaIntercalibration_TotalSyst' :
'EtaIntercalibration_Modelling',\
12 'EtaIntercalibration_NonClosure' :
'EtaIntercalibration_NonClosure'
16 'AntiKt4EMTopo' :
'AntiKt4Topo_EMJES',
17 'AntiKt6EMTopo' :
'AntiKt6Topo_EMJES',
18 'AntiKt4LCTopo' :
'AntiKt4Topo_LCJES',
19 'AntiKt6LCTopo' :
'AntiKt6Topo_LCJES'
23 if not dirName.endswith(
"/"):
24 dirName = dirName +
"/"
28 files =
sorted(glob.glob(dirName+
"*.root"))
29 for aFileName
in files:
32 for aFileDef,aJetDef
in jetDefDict.iteritems():
33 if aFileDef
in aFileName:
37 print "Failed to determine jet definition for file:",aFileName
39 if jetDef
not in histos.keys() :
43 inFile = TFile(aFileName,
"READ")
44 for aName
in SystematicNames.keys():
45 getsystematicName = aName +
"_" + jetDef.replace(
"Topo",
"")
46 systematicName = SystematicNames[aName] +
"_" + jetDef
48 histo = inFile.Get(getsystematicName)
50 print "Failed to get histogram:",getsystematicName
52 histo.SetName(systematicName+
"_old")
56 histoNew.SetDirectory(0)
57 histos[jetDef][SystematicNames[aName]] = histoNew