ATLAS Offline Software
makeTRTBarrelCans.py
Go to the documentation of this file.
1 BarrelTrans = TCanvas("TRT Barrel Translations","TRT Barrel Translations ",800,800)
2 trtDim = 1300
3 h1 = gPad.DrawFrame(-1*trtDim,-1*trtDim,trtDim,trtDim)
4 h1.SetTitle("translation x"+str(TRASL_FACTOR))
5 h1.GetXaxis().SetTitle("x [mm]")
6 h1.GetYaxis().SetTitle("y [mm]")
7 line = TArrow()
8 line.DrawArrow(-TRASL_FACTOR/2./10,0,TRASL_FACTOR/2/10.,0,0.01,"|-|")
9 text = TText()
10 text.DrawText(0,-100,"0.1 mm")
11 
12 for mod in x1_Aside:
13 
14  x1 = (x1_Aside[mod] + x1_Cside[mod]) / 2
15  y1 = (y1_Aside[mod] + y1_Cside[mod]) / 2
16 
17  x2 = (x2_Aside[mod] + x2_Cside[mod]) / 2
18  y2 = (y2_Aside[mod] + y2_Cside[mod]) / 2
19 
20  dx = x2 - x1
21  dy = y2 - y1
22 
23  line.SetLineColor(kGreen+1)
24  line.DrawArrow(x1,y1,x1+TRASL_FACTOR*(dx),y1+TRASL_FACTOR*(dy),0.01,"")
25 
26 
27 trtDir.cd()
28 BarrelTrans.Write()
29 rootFile.cd()
30 
31 
32 BarrelRotxy = TCanvas("TRT Barrel Ratations r-phi","TRT Barrel Rotations r-phi ",800,800)
33 trtDim = 1300
34 ROTXY_FACTOR = 100000
35 h1 = gPad.DrawFrame(-1*trtDim,-1*trtDim,trtDim,trtDim)
36 h1.SetTitle("rotation x"+str(ROTXY_FACTOR))
37 h1.GetXaxis().SetTitle("x [mm]")
38 h1.GetYaxis().SetTitle("y [mm]")
39 line = TArrow()
40 line.DrawArrow(-ROTXY_FACTOR/2./1000,0,ROTXY_FACTOR/2/1000.,0,0.01,"|-|")
41 text = TText()
42 text.DrawText(0,-100,"pi/4 mrad")
43 
44 for mod in x1_Aside:
45 
46  x1 = (x1_Aside[mod] + x1_Cside[mod]) / 2
47  y1 = (y1_Aside[mod] + y1_Cside[mod]) / 2
48 
49  x2 = (x2_Aside[mod] + x2_Cside[mod]) / 2
50  y2 = (y2_Aside[mod] + y2_Cside[mod]) / 2
51 
52 
53  # Divide by z to get an angle, divide by 2 b/c were drawing it twice
54  dxA = (x2_Aside[mod] - x2)/z1_Aside[mod]/2
55  dyA = (y2_Aside[mod] - y2)/z1_Aside[mod]/2
56 
57  dxC = (x2_Cside[mod] - x2)/z1_Aside[mod]/2
58  dyC = (y2_Cside[mod] - y2)/z1_Aside[mod]/2
59 
60 
61  line.SetLineColor(kGreen-2)
62  line.SetLineWidth(3)
63  line.DrawArrow(x1,y1,x1+ROTXY_FACTOR*(dxA),y1+ROTXY_FACTOR*(dyA),0.01,"-")
64 
65  line.SetLineColor(kGreen+2)
66  line.SetLineWidth(3)
67  line.DrawArrow(x1,y1,x1+ROTXY_FACTOR*(dxC),y1+ROTXY_FACTOR*(dyC),0.01,"-")
68 
69 
70 trtDir.cd()
71 BarrelRotxy.Write()
72 rootFile.cd()
str
Definition: BTagTrackIpAccessor.cxx:11