ATLAS Offline Software
makeTransCanvas.py
Go to the documentation of this file.
1 # Code that generates the ID trans can from CompareGeometries
2 # Author John Alison <johnda@hep.upenn.edu>IDTransCan = TCanvas("ID Translation Visualization ","ID differences ",800,800)
3 IDTransCan = TCanvas("ID Translation Visualization ","ID differences ",800,800)
4 IDDim = 1300
5 h1 = gPad.DrawFrame(-1*IDDim,-1*IDDim,IDDim,IDDim)
6 h1.SetTitle("translation x"+str(TRASL_FACTOR))
7 h1.GetXaxis().SetTitle("x [mm]")
8 h1.GetYaxis().SetTitle("y [mm]")
9 line = TArrow()
10 line.DrawArrow(500-TRASL_FACTOR/2./10,-1000,500+TRASL_FACTOR/2/10.,-1000,0.01,"|-|")
11 text = TText()
12 text.DrawText(500,-1100,"0.1 mm")
13 
14 # IBL Trans Cans
15 iblTransCan = []
16 for i in range(20):
17  iblTransCan.append(TCanvas("IBL Translation Visualization "+str(i-10),"IBL Eta module "+str(i-10),800,800) )
18  iblDim = 100
19  h1 = gPad.DrawFrame(-1*iblDim,-1*iblDim,iblDim,iblDim)
20  h1.SetTitle("Translations x"+str(TRASL_FACTOR)+" Eta Module "+str(i-10))
21  h1.GetXaxis().SetTitle("x [mm]")
22  h1.GetYaxis().SetTitle("y [mm]")
23  # gPad.SetGridx()
24  # gPad.SetGridy()
25  line = TArrow()
26  line.DrawArrow(150-TRASL_FACTOR/2./10,-200,150+TRASL_FACTOR/2/10.,-200,0.01,"|-|")
27  text = TText()
28  text.DrawText(150,-180,"0.1 mm")
29 
30 # Pixel Trans Cans
31 pixelTransCan = []
32 for i in range(13):
33  pixelTransCan.append(TCanvas("Pixel Translation Visualization "+str(i-6),"Pixel Eta module "+str(i-6),800,800) )
34  pixDim = 250
35  h1 = gPad.DrawFrame(-1*pixDim,-1*pixDim,pixDim,pixDim)
36  h1.SetTitle("Translations x"+str(TRASL_FACTOR)+" Eta Module "+str(i-6))
37  h1.GetXaxis().SetTitle("x [mm]")
38  h1.GetYaxis().SetTitle("y [mm]")
39  # gPad.SetGridx()
40  # gPad.SetGridy()
41  line = TArrow()
42  line.DrawArrow(150-TRASL_FACTOR/2./10,-200,150+TRASL_FACTOR/2/10.,-200,0.01,"|-|")
43  text = TText()
44  text.DrawText(150,-180,"0.1 mm")
45 
46 # SCT Trans Cans
47 sctTransCan = []
48 for i in range(12):
49  sctTransCan.append(TCanvas("SCT Translation Visualization "+str(i-6),"Sct Eta module "+str(i-6),800,800) )
50  sctDim = 650
51  h1 = gPad.DrawFrame(-1*sctDim,-1*sctDim,sctDim,sctDim)
52  h1.SetTitle("translation x"+str(TRASL_FACTOR)+" Eta Module "+str(i-6))
53  h1.GetXaxis().SetTitle("x [mm]")
54  h1.GetYaxis().SetTitle("y [mm]")
55  # gPad.SetGridx()
56  # gPad.SetGridy()
57  line = TArrow()
58  line.DrawArrow(-TRASL_FACTOR/2./10,0,TRASL_FACTOR/2/10.,0,0.01,"|-|")
59  text = TText()
60  text.DrawText(0,-100,"0.1 mm")
61 
62 
63 # TRT Trans Cans
64 trtTransCan = []
65 for i in range(2):
66  if i:
67  i = 1
68  else:
69  i = -1
70 
71  trtTransCan.append(TCanvas("TRT Translation Visualization Moludes "+str(i),"TRT differences Modules "+str(i),800,800) )
72  trtDim = 1300
73  h1 = gPad.DrawFrame(-1*trtDim,-1*trtDim,trtDim,trtDim)
74  h1.SetTitle("translation x"+str(TRASL_FACTOR))
75  h1.GetXaxis().SetTitle("x [mm]")
76  h1.GetYaxis().SetTitle("y [mm]")
77  line = TArrow()
78  line.DrawArrow(-TRASL_FACTOR/2./10,0,TRASL_FACTOR/2/10.,0,0.01,"|-|")
79  text = TText()
80  text.DrawText(0,-100,"0.1 mm")
81 
82 # TRT Module Trans Cans
83 
84 # A list of pairs of transCans (one for side A and one for side C)
85 trtModTransCan = {}
86 
87 # loop over the phi sectors to draw
88 for thisMod in range(len(drawTRTModules)):
89  thisLay = drawTRTModules[thisMod][0]
90  thisPhi = drawTRTModules[thisMod][1]
91 
92  # A temp. holder for the pair of transCans for this phi sector.
93  tempTransCanList = []
94  for side in range(2):
95  if side:
96  side = 1
97  else:
98  side = -1
99 
100  tempTransCanList.append(TCanvas("TRT Translation Visualization Lay: "+str(thisLay)+" Phi: "+str(thisPhi)+" Side "+str(side)
101  ,"TRT differences Straws in Lay: "+str(thisLay)+" Phi: "+str(thisPhi)+" Side "+str(side)
102  ,800,800) )
103  trtDim = 1300
104  h1 = gPad.DrawFrame(-1*trtDim,-1*trtDim,trtDim,trtDim)
105  h1.SetTitle("translation x"+str(TRASL_FACTOR))
106  h1.GetXaxis().SetTitle("x [mm]")
107  h1.GetYaxis().SetTitle("y [mm]")
108  line = TArrow()
109  line.DrawArrow(-TRASL_FACTOR/2./10,0,TRASL_FACTOR/2/10.,0,0.01,"|-|")
110  text = TText()
111  text.DrawText(0,-100,"0.1 mm")
112 
113  # Add the pair to our total list
114  trtModTransCan[(thisLay,thisPhi)] = tempTransCanList
115 
116 # Barrel Elements
117 
118 # x1 position
119 x1_Aside = {}
120 x1_Cside = {}
121 
122 # y1 position
123 y1_Aside = {}
124 y1_Cside = {}
125 
126 # z1 position
127 z1_Aside = {}
128 
129 # x2 position
130 x2_Aside = {}
131 x2_Cside = {}
132 
133 # y2 position
134 y2_Aside = {}
135 y2_Cside = {}
136 
137 
138 
139 # TRT Straw plane translations
140 # ================================
141 trtEndcapAStrawPlanes = []
142 for i in range(17):
143 
144  trtEndcapAStrawPlanes.append(TCanvas("TRT Visualization Straw Plane "+str(i)+" Endcap A","TRT Visualization Straw Plane "+str(i)+" Endcap A",800,800) )
145  trtDim = 1300
146  h1 = gPad.DrawFrame(-1*trtDim,-1*trtDim,trtDim,trtDim)
147  h1.SetTitle("translation x"+str(TRASL_FACTOR))
148  h1.GetXaxis().SetTitle("x [mm]")
149  h1.GetYaxis().SetTitle("y [mm]")
150  line = TArrow()
151  line.DrawArrow(-TRASL_FACTOR/2./10,0,TRASL_FACTOR/2/10.,0,0.01,"|-|")
152  text = TText()
153  text.DrawText(0,-100,"0.1 mm")
154 
155 
156 trtEndcapCStrawPlanes = []
157 for i in range(17):
158  trtEndcapCStrawPlanes.append(TCanvas("TRT Visualization Straw Plane "+str(i)+" Endcap C","TRT Visualization Straw Plane "+str(i)+" Endcap C",800,800) )
159  trtDim = 1300
160  h1 = gPad.DrawFrame(-1*trtDim,-1*trtDim,trtDim,trtDim)
161  h1.SetTitle("translation x"+str(TRASL_FACTOR))
162  h1.GetXaxis().SetTitle("x [mm]")
163  h1.GetYaxis().SetTitle("y [mm]")
164  line = TArrow()
165  line.DrawArrow(-TRASL_FACTOR/2./10,0,TRASL_FACTOR/2/10.,0,0.01,"|-|")
166  text = TText()
167  text.DrawText(0,-100,"0.1 mm")
168 
plotBeamSpotVxVal.range
range
Definition: plotBeamSpotVxVal.py:195
str
Definition: BTagTrackIpAccessor.cxx:11