2 from array
import array
6 import ProviderHistoHelpers
14 SystematicNames = [
'Pileup_OffsetNPV',
'Pileup_OffsetMu',
'Pileup_PtTerm_npv',
'Pileup_PtTerm_mu',
'Pileup_RhoTopology']
16 jetDefs = {
'AntiKt4EMTopo':
'AntiKt4Topo_EMJES',
'AntiKt4EMPFlow':
'AntiKt4PFlow_EMJES'}
19 if not dirName.endswith(
"/"):
20 dirName = dirName +
"/"
24 rootFileList =
sorted(glob.glob(dirName+
"*.root"))
28 for aJetDef
in jetDefs.keys():
29 histos[jetDefs[aJetDef]] = {}
31 for file
in rootFileList :
32 rootFile = TFile(file,
"READ")
35 for aSystName
in SystematicNames:
36 systematicName = aSystName +
"_" + aJetDef
37 if systematicName
not in rootFile.GetKeyNames() :
39 histo = rootFile.Get(systematicName)
42 histos[jetDefs[aJetDef]][aSystName] = histo
49 for aJetDef
in jetDefs.keys():
50 print "Beginning jetDef",aJetDef
51 for aSystName
in SystematicNames:
52 print "Beginning systName",aSystName
53 if not aSystName
in histos[jetDefs[aJetDef]].
keys() :
54 print "Failed to find histogram:",aSystName,
"for jet definition",aJetDef