ATLAS Offline Software
Loading...
Searching...
No Matches
ParsebJESInput Namespace Reference

Functions

 ReadBJESHistograms (dirName)

Variables

dict SystematicNameDictionary
dict jetDefDict

Function Documentation

◆ ReadBJESHistograms()

ParsebJESInput.ReadBJESHistograms ( dirName)

Definition at line 24 of file Final2012/ParsebJESInput.py.

24def ReadBJESHistograms(dirName):
25 if not dirName.endswith("/"):
26 dirName = dirName + "/"
27
28 # Run over each file (one per jet definition)
29 # Skip files that don't start with b-JES and contain GSC
30 histos = {}
31 files = sorted(glob.glob(dirName+"b-JES*GSC.root"))
32 for aFileName in files:
33 # Determine the jet definition
34 jetDef = ""
35 for aFileDef,aJetDef in jetDefDict.iteritems():
36 if aFileDef in aFileName:
37 jetDef = aJetDef
38 break
39 if jetDef == "":
40 print "Failed to determine jet definition for file:",aFileName
41 return None
42 histos[jetDef] = {}
43
44 # Read in the histograms of interest from the file
45 inFile = TFile(aFileName,"READ")
46 for aName,aSystName in SystematicNameDictionary.iteritems():
47 systematicName = aSystName + "_" + jetDef
48 histo = inFile.Get(aName)
49 if histo is None:
50 print "Failed to get histogram:",systematicName
51 return None
52
53 histo2D = ProviderHistoHelpers.ConvertTGraphToProviderHisto(histo,systematicName)
54 histo2D.SetDirectory(0)
55
56 # It's currently response, set to difference from 1
57 for ptBin in range(1,histo2D.GetNbinsX()+1):
58 for etaBin in range(1,histo2D.GetNbinsY()+1):
59 histo2D.SetBinContent(ptBin,etaBin,1-histo2D.GetBinContent(ptBin,etaBin))
60
61 histos[jetDef][aSystName] = histo2D
62
63 # Done reading, close the file
64 inFile.Close()
65
66 # Make one quadrature sum histo of the desired components for now
67 # The new provider design should make this irrelevant for multijet components too, but for now...
68 for aDef,aHistoSet in histos.iteritems():
69 # We want one histo of herwigpp and distorted_geometry (leave out FTFP_BERT)
70 histos[aDef]['bJES'] = ProviderHistoHelpers.QuadratureSumHisto('bJES',[histos[aDef]['bJES_Generator'],histos[aDef]['bJES_Geometry']])
71 histos[aDef]['bJES'].SetDirectory(0)
72
73 return histos
74
ConvertTGraphToProviderHisto(graph, histoName)

Variable Documentation

◆ jetDefDict

dict ParsebJESInput.jetDefDict
Initial value:
1= {
2 'AntiKt4TopoEM' : 'AntiKt4Topo_EMJES',
3 'AntiKt6TopoEM' : 'AntiKt6Topo_EMJES',
4 'AntiKt4LCTopo' : 'AntiKt4Topo_LCJES',
5 'AntiKt6LCTopo' : 'AntiKt6Topo_LCJES'
6 }

Definition at line 17 of file Final2012/ParsebJESInput.py.

◆ SystematicNameDictionary

dict ParsebJESInput.SystematicNameDictionary
Initial value:
1= {
2 'herwigpp' : 'bJES_Generator',
3 'distorted_geometry' : 'bJES_Geometry',
4 'FTFP_BERT' : 'bJES_HadIntModel'
5 }

Definition at line 11 of file Final2012/ParsebJESInput.py.