|
ATLAS Offline Software
|
|
def | fillBarrelHists (x1, y1, z1, x2, y2, z2, theHists) |
|
def | fillEndcapHists (x1, y1, z1, x2, y2, z2, theHists, side) |
|
def | makeSubSysGeometryHist (name, title, color) |
|
def | makeSubSysDiffHist (name, title, xName, xMins, xMaxes, yName, yRange, color, nBins=120) |
|
def | make1D_SubSysDiffHist (name, title, xName, xMins, xMaxes, yName, color) |
|
def | WriteHist (title, hists, drawEndcapLines=False, drawTRTFirst=False) |
|
def | readInData (inputfile) |
|
def | DrawTRTEndcapCLines (yRange) |
|
def | DrawTRTEndcapALines (yRange) |
|
def | globalStrawLayer (wheel, strawlayer) |
|
def | drawStrawPlaneTransCan (bec, wheel, strawlayer, x1, y1, x2, y2) |
|
◆ drawStrawPlaneTransCan()
def comparisonUtils.drawStrawPlaneTransCan |
( |
|
bec, |
|
|
|
wheel, |
|
|
|
strawlayer, |
|
|
|
x1, |
|
|
|
y1, |
|
|
|
x2, |
|
|
|
y2 |
|
) |
| |
Definition at line 342 of file comparisonUtils.py.
349 if strawPlane >= len(trtEndcapAStrawPlanes):
352 trtEndcapAStrawPlanes[strawPlane].
cd()
354 line.SetLineColor(kGreen+1)
355 line.DrawArrow(x1,y1,x1+TRASL_FACTOR*(x1-x2),y1+TRASL_FACTOR*(y1-y2),0.01,
"")
358 if strawPlane >= len(trtEndcapCStrawPlanes):
361 trtEndcapCStrawPlanes[strawPlane].
cd()
362 line.SetLineColor(kGreen+1)
363 line.DrawArrow(x1,y1,x1+TRASL_FACTOR*(x1-x2),y1+TRASL_FACTOR*(y1-y2),0.01,
"")
◆ DrawTRTEndcapALines()
def comparisonUtils.DrawTRTEndcapALines |
( |
|
yRange | ) |
|
Definition at line 304 of file comparisonUtils.py.
308 bWheels = 2710 - 122*i
309 bLines.append(TLine(bWheels,-1*yRange,bWheels,yRange))
310 bLines[i].SetLineStyle(2)
313 seperator = TLine(1725,-1*yRange,1725,yRange)
314 seperator.SetLineColor(kRed)
322 aWheels = 1705 - 142 *i;
323 aLines.append(TLine(aWheels,-1*yRange,aWheels,yRange))
324 aLines[i].SetLineStyle(2)
328 aWheels = 1705 - 71 *i;
329 aLines.append(TLine(aWheels,-1*yRange,aWheels,yRange))
330 aLines[i].SetLineStyle(2)
332 return bLines, seperator, aLines
◆ DrawTRTEndcapCLines()
def comparisonUtils.DrawTRTEndcapCLines |
( |
|
yRange | ) |
|
Definition at line 270 of file comparisonUtils.py.
275 bWheels = -2710 + 122*i
276 bLines.append(TLine(bWheels,-1*yRange,bWheels,yRange))
277 bLines[i].SetLineStyle(2)
280 seperator = TLine(-1725,-1*yRange,-1725,yRange)
281 seperator.SetLineColor(kRed)
290 aWheels = -1705 + 142 *i;
291 aLines.append(TLine(aWheels,-1*yRange,aWheels,yRange))
292 aLines[i].SetLineStyle(2)
297 aWheels = -1705 + 71 *i;
298 aLines.append(TLine(aWheels,-1*yRange,aWheels,yRange))
299 aLines[i].SetLineStyle(2)
302 return bLines, seperator, aLines
◆ fillBarrelHists()
def comparisonUtils.fillBarrelHists |
( |
|
x1, |
|
|
|
y1, |
|
|
|
z1, |
|
|
|
x2, |
|
|
|
y2, |
|
|
|
z2, |
|
|
|
theHists |
|
) |
| |
Definition at line 5 of file comparisonUtils.py.
14 h_geo1 = theHists.geo1[1]
15 h_geo2 = theHists.geo2[1]
16 h_XvsR = theHists.DxVsR[1]
17 h_XvsZ = theHists.DxVsZ[1]
18 h_YvsR = theHists.DyVsR[1]
19 h_YvsZ = theHists.DyVsZ[1]
20 h_PhivsZ = theHists.DphiVsZ[1]
21 h_XYvsR = theHists.DxyVsR[1]
22 h_PhivsR = theHists.DphiVsR[1]
23 h_RvsR = theHists.DrVsR[1]
24 h_ZvsR = theHists.DzVsR[1]
25 h_XYvsZ = theHists.DxyVsZ[1]
26 h_RvsPhi = theHists.DrVsPhi[1]
34 h_XvsR.Fill(sqrt(
pow(x2,2) +
pow(y2,2)),x1 - x2)
35 h_XvsZ.Fill(z2,x1 - x2)
37 h_YvsR.Fill(sqrt(
pow(x2,2) +
pow(y2,2)),y1 - y2)
38 h_YvsZ.Fill(z2,y1 - y2)
40 h_PhivsZ.Fill(z2,atan2(y1,x1)-atan2(y2,x2))
42 h_XYvsR.Fill(sqrt(
pow(x2,2) +
pow(y2,2)),sqrt(
pow(x1 - x2,2)+
pow(y1 - y2 ,2)))
45 if not sqrt(x1*x1+y1*y1) == 0:
46 h_PhivsR.Fill(sqrt(
pow(x2,2) +
pow(y2,2)),1.0/sqrt(x1*x1+y1*y1)*((x1 - x2)*y1 - (y1 - y2)* x1))
48 h_RvsR.Fill(sqrt(
pow(x2,2) +
pow(y2,2)), (1.0/sqrt(x1*x1+y1*y1)*((x1 - x2)*x1 + (y1 - y2)* y1)))
55 h_ZvsR.Fill(sqrt(
pow(x2,2) +
pow(y2,2)),sqrt(
pow(z1 - z2,2)))
57 h_XYvsZ.Fill(z2,sqrt(
pow(x1 - x2,2)+
pow(y1 - y2 ,2)))
60 h_RvsPhi.Fill(atan2(y2,x2),sqrt(
pow(x1,2)+
pow(y1,2)) -sqrt(
pow(x2,2)+
pow(y2,2)))
◆ fillEndcapHists()
def comparisonUtils.fillEndcapHists |
( |
|
x1, |
|
|
|
y1, |
|
|
|
z1, |
|
|
|
x2, |
|
|
|
y2, |
|
|
|
z2, |
|
|
|
theHists, |
|
|
|
side |
|
) |
| |
Definition at line 65 of file comparisonUtils.py.
75 h_geo1 = theHists.geo1[side]
76 h_geo2 = theHists.geo2[side]
77 h_XvsR = theHists.DxVsR[side]
78 h_XvsZ = theHists.DxVsZ[side]
79 h_YvsR = theHists.DyVsR[side]
80 h_YvsZ = theHists.DyVsZ[side]
81 h_PhivsZ = theHists.DphiVsZ[side]
82 h_XYvsR = theHists.DxyVsR[side]
83 h_PhivsR = theHists.DphiVsR[side]
84 h_RvsR = theHists.DrVsR[side]
85 h_ZvsR = theHists.DzVsR[side]
86 h_XYvsZ = theHists.DxyVsZ[side]
87 h_RvsPhi = theHists.DrVsPhi[side]
88 h_X = theHists.Dx[side]
89 h_Y = theHists.Dy[side]
90 h_Z = theHists.Dz[side]
92 h_geo1.Fill(z1,atan2(y1,x1))
93 h_geo2.Fill(z2,atan2(y2,x2))
95 h_XvsR.Fill(sqrt(
pow(x2,2) +
pow(y2,2)),x1 - x2)
96 h_XvsZ.Fill(z2,x1 - x2)
98 h_YvsR.Fill(sqrt(
pow(x2,2) +
pow(y2,2)),y1 - y2)
99 h_YvsZ.Fill(z2,y1 - y2)
101 h_PhivsZ.Fill(z2,atan2(y1,x1)-atan2(y2,x2))
103 h_XYvsR.Fill(sqrt(
pow(x2,2) +
pow(y2,2)),sqrt(
pow(x1 - x2,2)+
pow(y1 - y2 ,2)))
106 if not sqrt(x1*x1+y1*y1) == 0:
107 h_PhivsR.Fill(sqrt(
pow(x2,2) +
pow(y2,2)),1.0/sqrt(x1*x1+y1*y1)*((x1 - x2)*y1 - (y1 - y2)* x1))
109 h_RvsR.Fill(sqrt(
pow(x2,2) +
pow(y2,2)), (1.0/sqrt(x1*x1+y1*y1)*((x1 - x2)*x1 + (y1 - y2)* y1)))
111 h_ZvsR.Fill(sqrt(
pow(x2,2) +
pow(y2,2)),sqrt(
pow(z1 - z2,2)))
113 h_XYvsZ.Fill(z2,sqrt(
pow(x1 - x2,2)+
pow(y1 - y2 ,2)))
121 h_RvsPhi.Fill(atan2(y2,x2),sqrt(
pow(x1,2)+
pow(y1,2)) -sqrt(
pow(x2,2)+
pow(y2,2)))
◆ globalStrawLayer()
def comparisonUtils.globalStrawLayer |
( |
|
wheel, |
|
|
|
strawlayer |
|
) |
| |
Definition at line 336 of file comparisonUtils.py.
338 return wheel*16 + strawlayer
340 return 6*16 + (wheel - 6)*8 + strawlayer
◆ make1D_SubSysDiffHist()
def comparisonUtils.make1D_SubSysDiffHist |
( |
|
name, |
|
|
|
title, |
|
|
|
xName, |
|
|
|
xMins, |
|
|
|
xMaxes, |
|
|
|
yName, |
|
|
|
color |
|
) |
| |
Definition at line 166 of file comparisonUtils.py.
168 h_Ecc =
TH1F(name+
"_Ecc",title+
" (Endcap C)", nBins,xMins[0],xMaxes[0])
169 h_Ecc.SetMarkerColor(color+1)
170 h_Ecc.SetLineColor(color+1)
171 h_Ecc.GetXaxis().SetTitle(xName)
172 h_Ecc.GetYaxis().SetTitle(yName)
174 h_b =
TH1F(name,title,nBins,xMins[1],xMaxes[1])
175 h_b.SetMarkerColor(color+1)
176 h_b.SetLineColor(color+1)
177 h_b.GetXaxis().SetTitle(xName)
178 h_b.GetYaxis().SetTitle(yName)
180 h_Eca =
TH1F(name+
"_Eca",title+
" (Endcap A)", nBins,xMins[2],xMaxes[2])
181 h_Eca.SetMarkerColor(color+1)
182 h_Eca.SetLineColor(color+1)
183 h_Eca.GetXaxis().SetTitle(xName)
184 h_Eca.GetYaxis().SetTitle(yName)
186 return h_Ecc,h_b,h_Eca
◆ makeSubSysDiffHist()
def comparisonUtils.makeSubSysDiffHist |
( |
|
name, |
|
|
|
title, |
|
|
|
xName, |
|
|
|
xMins, |
|
|
|
xMaxes, |
|
|
|
yName, |
|
|
|
yRange, |
|
|
|
color, |
|
|
|
nBins = 120 |
|
) |
| |
Definition at line 146 of file comparisonUtils.py.
149 h_Ecc =
TH2F(name+
"_Ecc",title+
" (Endcap C)", nBins,xMins[0],xMaxes[0],nBins,-1*yRange,yRange)
150 h_Ecc.SetMarkerColor(color+1)
151 h_Ecc.GetXaxis().SetTitle(xName)
152 h_Ecc.GetYaxis().SetTitle(yName)
154 h_b =
TH2F(name,title,nBins,xMins[1],xMaxes[1],nBins,-1*yRange,yRange)
155 h_b.SetMarkerColor(color+1)
156 h_b.GetXaxis().SetTitle(xName)
157 h_b.GetYaxis().SetTitle(yName)
159 h_Eca =
TH2F(name+
"_Eca",title+
" (Endcap A)", nBins,xMins[2],xMaxes[2],nBins,-1*yRange,yRange)
160 h_Eca.SetMarkerColor(color+1)
161 h_Eca.GetXaxis().SetTitle(xName)
162 h_Eca.GetYaxis().SetTitle(yName)
164 return h_Ecc,h_b,h_Eca
◆ makeSubSysGeometryHist()
def comparisonUtils.makeSubSysGeometryHist |
( |
|
name, |
|
|
|
title, |
|
|
|
color |
|
) |
| |
Definition at line 126 of file comparisonUtils.py.
128 h_Ecc =
TH2F(name+
"_Ecc",title+
" (Endcap C)",2400,-2900,-500,2400,-3.14,3.14)
129 h_Ecc.SetMarkerColor(color+1)
130 h_Ecc.GetXaxis().SetTitle(
"z [mm]")
131 h_Ecc.GetYaxis().SetTitle(
"phi")
133 h_b =
TH2F(name,title,2400,-1200,1200,2400,-1200,1200)
134 h_b.SetMarkerColor(color+1)
135 h_b.GetXaxis().SetTitle(
"x [mm]")
136 h_b.GetYaxis().SetTitle(
"y [mm]")
138 h_Eca =
TH2F(name+
"_Eca",title+
" (Endcap A)",2400,400,2900,2400,-3.14,3.14)
139 h_Eca.SetMarkerColor(color+1)
140 h_Eca.GetXaxis().SetTitle(
"z [mm]")
141 h_Eca.GetYaxis().SetTitle(
"phi")
143 return h_Ecc,h_b,h_Eca,
◆ readInData()
def comparisonUtils.readInData |
( |
|
inputfile | ) |
|
Definition at line 234 of file comparisonUtils.py.
239 for line
in inputfile:
243 for i
in range(len(words)-1):
244 m_thisPosition.append(
float(words[i+1]))
248 if words[1] ==
"4" or words[1] ==
"-4":
250 m_iblElements.append(m_thisPosition)
252 elif words[1] ==
"0" and words[2] ==
"0":
253 m_iblElements.append(m_thisPosition)
256 m_pixelElements.append(m_thisPosition)
260 m_sctElements.append(m_thisPosition)
264 m_trtElements.append(m_thisPosition)
266 return m_iblElements,m_pixelElements,m_sctElements,m_trtElements
◆ WriteHist()
def comparisonUtils.WriteHist |
( |
|
title, |
|
|
|
hists, |
|
|
|
drawEndcapLines = False , |
|
|
|
drawTRTFirst = False |
|
) |
| |
Definition at line 189 of file comparisonUtils.py.
191 ,drawEndcapLines=False
192 ,drawTRTFirst=False):
194 can = TCanvas(title,title, 700, 500)
198 for i
in range(len(hists)):
200 hists[i][0].Draw(
"same")
211 for i
in range(len(hists)):
213 hists[i][1].Draw(
"same")
218 for i
in range(len(hists)):
220 hists[i][2].Draw(
"same")
def DrawTRTEndcapALines(yRange)
def fillBarrelHists(x1, y1, z1, x2, y2, z2, theHists)
def makeSubSysGeometryHist(name, title, color)
def DrawTRTEndcapCLines(yRange)
def makeSubSysDiffHist(name, title, xName, xMins, xMaxes, yName, yRange, color, nBins=120)
def make1D_SubSysDiffHist(name, title, xName, xMins, xMaxes, yName, color)
def TH2F(name, title, nxbins, bins_par2, bins_par3, bins_par4, bins_par5=None, bins_par6=None, path='', **kwargs)
def readInData(inputfile)
def fillEndcapHists(x1, y1, z1, x2, y2, z2, theHists, side)
def WriteHist(title, hists, drawEndcapLines=False, drawTRTFirst=False)
def globalStrawLayer(wheel, strawlayer)
def TH1F(name, title, nxbins, bins_par2, bins_par3=None, path='', **kwargs)
def drawStrawPlaneTransCan(bec, wheel, strawlayer, x1, y1, x2, y2)