]>
Commit | Line | Data |
---|---|---|
58005f18 | 1 | |
2 | #include <TMath.h> | |
3 | #include <TRandom.h> | |
4 | #include <TVector.h> | |
5 | #include <TGeometry.h> | |
6 | #include <TNode.h> | |
7 | #include <TTUBE.h> | |
8 | ||
9 | #include "AliITSgeom.h" | |
10 | #include "AliITS.h" | |
11 | #include "AliITShit.h" | |
12 | #include "AliRun.h" | |
13 | ||
14 | ||
15 | ClassImp(AliITShit) | |
16 | //////////////////////////////////////////////////////////////////////// | |
17 | // Version: 0 | |
18 | // Written by Rene Brun, Federico Carminati, and Roberto Barbera | |
19 | // | |
20 | // Version: 1 | |
21 | // Modified and documented by Bjorn S. Nilsen | |
22 | // July 11 1999 | |
23 | // | |
24 | // AliITShit is the hit class for the ITS. Hits are the information | |
25 | // that comes from a Monte Carlo at each step as a particle mass through | |
26 | // sensitive detector elements as particles are transported through a | |
27 | // detector. | |
28 | // | |
29 | //Begin_Html | |
30 | /* | |
31 | <img src="figures/AliITShit_Class_Diagram.gif"> | |
32 | </pre> | |
33 | <br clear=left> | |
34 | <font size=+2 color=red> | |
35 | <p>This show the relasionships between the ITS hit class and the rest of Aliroot. | |
36 | </font> | |
37 | <pre> | |
38 | */ | |
39 | //End_Html | |
40 | //_____________________________________________________________________________ | |
41 | AliITShit::AliITShit(Int_t shunt, Int_t track, Int_t *vol, Float_t *hits): | |
42 | AliHit(shunt, track){ | |
43 | // | |
44 | // Create ITS hit | |
45 | // The creator of the AliITShit class. The variables shunt and | |
46 | // track are passed to the creator of the AliHit class. See the AliHit | |
47 | // class for a full description. the integer array *vol contains, in order, | |
48 | // fLayer = vol[0], fDet = vol[1], fLadder = vol[2], fStatus = vol[3]. | |
49 | // The array *hits contains, in order, fX = hits[0], fY = hits[1], | |
50 | // fZ = hits[2], fPx = hits[3], fPy = hits[4], fPz = hits[5], | |
51 | // fDestep = hits[6], and fTof = hits[7]. | |
52 | // | |
53 | fLayer = vol[0]; // Layer number | |
54 | fLadder = vol[2]; // Ladder number | |
55 | fDet = vol[1]; // Detector number | |
56 | fStatus = vol[3]; // Track status flags | |
57 | fX = hits[0]; // Track X position | |
58 | fY = hits[1]; // Track Y position | |
59 | fZ = hits[2]; // Track Z position | |
60 | fPx = hits[3]; // Track X Momentum | |
61 | fPy = hits[4]; // Track Y Momentum | |
62 | fPz = hits[5]; // Track Z Momentum | |
63 | fDestep = hits[6]; // Track dE/dx for this step | |
64 | fTof = hits[7]; // Track Time of Flight for this step | |
65 | } | |
66 | ||
67 | void AliITShit::GetPositionL(Float_t &x,Float_t &y,Float_t &z){ | |
68 | AliITSgeom *gm = ((AliITS*)gAlice->GetDetector("ITS"))->GetITSgeom(); | |
69 | Float_t g[3],l[3]; | |
70 | ||
71 | g[0] = fX; | |
72 | g[1] = fY; | |
73 | g[2] = fZ; | |
74 | gm->GtoL(fLayer,fLadder,fDet,g,l); | |
75 | x = l[0]; | |
76 | y = l[1]; | |
77 | z = l[2]; | |
78 | return; | |
79 | } | |
80 | ||
81 | void AliITShit::GetPositionL(Float_t &x,Float_t &y,Float_t &z,Float_t &tof){ | |
82 | AliITSgeom *gm = ((AliITS*)gAlice->GetDetector("ITS"))->GetITSgeom(); | |
83 | Float_t g[3],l[3]; | |
84 | ||
85 | g[0] = fX; | |
86 | g[1] = fY; | |
87 | g[2] = fZ; | |
88 | gm->GtoL(fLayer,fLadder,fDet,g,l); | |
89 | x = l[0]; | |
90 | y = l[1]; | |
91 | z = l[2]; | |
92 | tof = fTof; | |
93 | return; | |
94 | } | |
95 | ||
96 | Float_t AliITShit::GetXL(){ | |
97 | AliITSgeom *gm = ((AliITS*)gAlice->GetDetector("ITS"))->GetITSgeom(); | |
98 | Float_t g[3],l[3]; | |
99 | ||
100 | g[0] = fX; | |
101 | g[1] = fY; | |
102 | g[2] = fZ; | |
103 | gm->GtoL(fLayer,fLadder,fDet,g,l); | |
104 | return l[0]; | |
105 | } | |
106 | ||
107 | Float_t AliITShit::GetYL(){ | |
108 | AliITSgeom *gm = ((AliITS*)gAlice->GetDetector("ITS"))->GetITSgeom(); | |
109 | Float_t g[3],l[3]; | |
110 | ||
111 | g[0] = fX; | |
112 | g[1] = fY; | |
113 | g[2] = fZ; | |
114 | gm->GtoL(fLayer,fLadder,fDet,g,l); | |
115 | return l[1]; | |
116 | } | |
117 | ||
118 | Float_t AliITShit::GetZL(){ | |
119 | AliITSgeom *gm = ((AliITS*)gAlice->GetDetector("ITS"))->GetITSgeom(); | |
120 | Float_t g[3],l[3]; | |
121 | ||
122 | g[0] = fX; | |
123 | g[1] = fY; | |
124 | g[2] = fZ; | |
125 | gm->GtoL(fLayer,fLadder,fDet,g,l); | |
126 | return l[2]; | |
127 | } | |
128 | ||
129 | void AliITShit::GetMomentumL(Float_t &px,Float_t &py,Float_t &pz){ | |
130 | AliITSgeom *gm = ((AliITS*)gAlice->GetDetector("ITS"))->GetITSgeom(); | |
131 | Float_t g[3],l[3]; | |
132 | ||
133 | g[0] = fPx; | |
134 | g[1] = fPy; | |
135 | g[2] = fPz; | |
136 | gm->GtoLMomentum(fLayer,fLadder,fDet,g,l); | |
137 | px = l[0]; | |
138 | py = l[1]; | |
139 | pz = l[2]; | |
140 | return; | |
141 | } |