9 AtlasStylePath = os.environ[
'HOME']+
'/RootUtils/AtlasStyle'
10 AtlasStyle = os.path.exists(AtlasStylePath)
12 ROOT.gROOT.LoadMacro(AtlasStylePath+
"/AtlasStyle.C")
13 ROOT.gROOT.LoadMacro(
"common/AtlasLabels.C")
14 ROOT.gROOT.LoadMacro(
"common/AtlasUtils.C")
17 particles = [
"other",
"gamma",
"e-",
"neutron",]
18 otherParticles = [
"nucleus",
"proton",
"e+"]
21 egamma = [
"gamma",
"e-",
"e+"]
22 electrons = [
"e-",
"e+"]
23 neutrons = [
"neutron"]
24 hadrons = [
"proton",
"neutron",
"nucleus"]
29 'neutron':ROOT.kBlue-9,
33 'nucleus':ROOT.kCyan-4,
34 'proton':ROOT.kPink+2,
40 'neutron':ROOT.kBlue-2,
45 'proton':ROOT.kPink+6,
69 'Section':
'ID services',
77 'Cryo':
'LAr services',
78 'Service':
'ID services',
83 'stepLength':
'log( step length [mm] )',
84 'stepEnergyDeposit':
'log( energy deposit [MeV] )',
85 'stepSecondaryKinetic':
'log( kinetic energy of the secondary [MeV] )',
86 'stepEnergyNonIonDeposit':
'log( non-ionizing energy deposit [MeV] )',
87 'stepKineticEnergy':
'log( kinetic energy in current step [MeV] )',
88 'stepPseudorapidity':
'#eta in current step',
92 'numberOfSteps':
'number of steps',
93 'numberOfStepsPerInitialE':
'log( Initial kinetic [MeV] )',
94 'CumulativeNumberOfStepsPerInitialE':
'log( Initial kinetic [MeV] )',
95 'InitialE':
'log( Initial kinetic [MeV] )',
96 'CumulativeInitialE':
'log( Initial kinetic [MeV] )',
97 'averageNumberOfStepsPerInitialE':
'log( Initial kinetic [MeV] )',
110 yaxis =
"Steps / Event"
113 canv = ROOT.TCanvas(uniqueName,uniqueName,700,600)
114 pad1 = ROOT.TPad(
"pad1"+uniqueName,
"top pad"+uniqueName,0.,self.
rsplit,1.,1.)
119 pad2 = ROOT.TPad(
"pad2"+uniqueName,
"bottom pad"+uniqueName,0,0,1,self.
rsplit)
126 return canv, pad1, pad2
129 hs1.GetXaxis().SetLabelSize(0)
130 hs1.GetYaxis().SetLabelSize(0.075)
131 hs1.GetYaxis().SetTitleSize(0.082)
132 hs1.GetYaxis().SetTitleOffset(0.7)
133 hs1.GetYaxis().SetTitle(self.
yaxis)
134 ROOT.gPad.RedrawAxis()
139 h2.GetXaxis().SetTitle(xaxis)
140 h2.GetYaxis().SetTitle(yaxisr)
141 h2.GetYaxis().SetRangeUser(1.0 - ratiodn, 1.0 + ratioup)
142 h2.SetLineColor(ROOT.kBlack)
143 h2.GetXaxis().LabelsOption(
"v")
144 h2.GetXaxis().SetLabelSize(0.15)
145 h2.GetXaxis().SetLabelOffset(0.02)
146 h2.GetXaxis().SetTitleOffset(2.2)
147 h2.GetXaxis().SetTitleSize(0.14)
148 h2.GetYaxis().SetLabelSize(0.11)
149 h2.GetYaxis().SetNdivisions(3)
150 h2.GetYaxis().SetTitleOffset(0.5)
151 h2.GetYaxis().SetTitleSize(0.12)
152 ROOT.gPad.RedrawAxis()
163 def getCanvas(self, uniqueName, nologx = False, nology = False):
164 canv = ROOT.TCanvas(uniqueName,uniqueName,800,600)
165 pad1 = ROOT.TPad(
"pad1"+uniqueName,
"top pad"+uniqueName,0.,self.
rsplit,1.,1.)
174 pad2 = ROOT.TPad(
"pad2"+uniqueName,
"bottom pad"+uniqueName,0,0,1,self.
rsplit)
184 return canv, pad1, pad2
187 hs1.GetXaxis().SetLabelSize(0)
188 hs1.GetYaxis().SetLabelSize(0.06)
189 hs1.GetYaxis().SetTitleSize(0.06)
190 hs1.GetYaxis().SetTitleOffset(0.95)
191 hs1.GetYaxis().SetTitle(self.
yaxis if yaxis==
"" else yaxis)
192 ROOT.gPad.RedrawAxis()
195 h2.GetXaxis().SetTitle(xaxis)
196 h2.GetYaxis().SetTitle(yaxisr)
197 h2.GetXaxis().SetTitleSize(0.13)
198 h2.GetXaxis().SetTitleOffset(0.9)
199 h2.GetXaxis().SetLabelSize(0.10)
200 h2.GetYaxis().SetTitleSize(0.12)
201 h2.GetYaxis().SetTitleOffset(0.5)
202 h2.GetYaxis().SetLabelSize(0.10)
203 h2.GetYaxis().SetLabelOffset(0.015)
204 h2.GetYaxis().SetRangeUser(0.5,1.5)
205 h2.GetYaxis().SetNdivisions(6)
206 h2.SetMinimum(1.0 - ratio)
207 h2.SetMaximum(1.0 + ratio)
208 ROOT.gPad.RedrawAxis()