]>
Commit | Line | Data |
---|---|---|
4c039060 | 1 | /************************************************************************** |
2 | * Copyright(c) 1998-1999, ALICE Experiment at CERN, All rights reserved. * | |
3 | * * | |
4 | * Author: The ALICE Off-line Project. * | |
5 | * Contributors are mentioned in the code where appropriate. * | |
6 | * * | |
7 | * Permission to use, copy, modify and distribute this software and its * | |
8 | * documentation strictly for non-commercial purposes is hereby granted * | |
9 | * without fee, provided that the above copyright notice appears in all * | |
10 | * copies and that both the copyright notice and this permission notice * | |
11 | * appear in the supporting documentation. The authors make no claims * | |
12 | * about the suitability of this software for any purpose. It is * | |
13 | * provided "as is" without express or implied warranty. * | |
14 | **************************************************************************/ | |
15 | ||
88cb7938 | 16 | /* $Id$ */ |
4c039060 | 17 | |
4ae5bbc4 | 18 | #include <Riostream.h> |
58005f18 | 19 | |
33da2552 | 20 | #include<TLorentzVector.h> |
58005f18 | 21 | |
b2340bbf | 22 | #include "AliRun.h" |
58005f18 | 23 | #include "AliITS.h" |
4fc5ed2d | 24 | #include "AliITSgeom.h" |
58005f18 | 25 | #include "AliITShit.h" |
5d12ce38 | 26 | #include "AliMC.h" |
58005f18 | 27 | |
28 | ||
29 | ClassImp(AliITShit) | |
30 | //////////////////////////////////////////////////////////////////////// | |
31 | // Version: 0 | |
32 | // Written by Rene Brun, Federico Carminati, and Roberto Barbera | |
33 | // | |
34 | // Version: 1 | |
35 | // Modified and documented by Bjorn S. Nilsen | |
36 | // July 11 1999 | |
37 | // | |
38 | // AliITShit is the hit class for the ITS. Hits are the information | |
39 | // that comes from a Monte Carlo at each step as a particle mass through | |
40 | // sensitive detector elements as particles are transported through a | |
41 | // detector. | |
42 | // | |
43 | //Begin_Html | |
44 | /* | |
a92b2b7d | 45 | <img src="picts/ITS/AliITShit_Class_Diagram.gif"> |
58005f18 | 46 | </pre> |
47 | <br clear=left> | |
48 | <font size=+2 color=red> | |
49 | <p>This show the relasionships between the ITS hit class and the rest of Aliroot. | |
50 | </font> | |
51 | <pre> | |
52 | */ | |
53 | //End_Html | |
b2340bbf | 54 | //////////////////////////////////////////////////////////////////////// |
55 | // Inline Member functions: | |
56 | // | |
57 | // AliITShit() | |
58 | // The default creator of the AliITShit class. | |
59 | // | |
60 | // ~AliITShit() | |
61 | // The default destructor of the AliITShit class. | |
62 | // | |
63 | // int GetTrack() | |
64 | // See AliHit for a full description. Returns the track number fTrack | |
65 | // for this hit. | |
66 | // | |
67 | // SetTrack(int track) | |
68 | // See AliHit for a full description. Sets the track number fTrack | |
69 | // for this hit. | |
70 | // | |
71 | // Int_t GetTrackStatus() | |
72 | // Returns the value of the track status flag fStatus. This flag | |
73 | // indicates the track status at the time of creating this hit. It is | |
74 | // made up of the following 8 status bits from highest order to lowest | |
75 | // order bits | |
76 | // 0 : IsTrackAlive(): IsTrackStop():IsTrackDisappeared(): | |
77 | // IsTrackOut():IsTrackExiting():IsTrackEntering():IsTrackInside() . | |
78 | // See AliMC for a description of these functions. If the function is | |
79 | // true then the bit is set to one, otherwise it is zero. | |
80 | // | |
81 | // Bool_t StatusInside() | |
82 | // Returns kTRUE if the particle producing this hit is still inside | |
83 | // the present volume. Returns kFalse if this particle will be in another | |
84 | // volume. {bit IsTrackInside is set or not} | |
85 | // | |
86 | // Bool_t StatusEntering() | |
87 | // Returns kTRUE if the particle producing this hit is has just enterd | |
88 | // the present volume. Returns kFalse otherwise. {bit IsTrackEntering is | |
89 | // set or not} | |
90 | // | |
91 | // Bool_t StatusExiting() | |
92 | // Returns kTRUE if the particle producing this hit is will exit | |
93 | // the present volume. Returns kFalse otherwise. {bit IsTrackExiting is set | |
94 | // or not} | |
95 | // | |
96 | // Bool_t StatusOut() | |
97 | // Returns kTRUE if the particle producing this hit is goint exit the | |
98 | // simulation. Returns kFalse otherwise. {bit IsTrackOut is set or not} | |
99 | // | |
100 | // Bool_t StatusDisappeared() | |
101 | // Returns kTRUE if the particle producing this hit is going to "disappear" | |
102 | // for example it has interacted producing some other particles. Returns | |
103 | // kFalse otherwise. {bit IsTrackOut is set or not} | |
104 | // | |
105 | // Bool_t StatusStop() | |
106 | // Returns kTRUE if the particle producing this hit is has dropped below | |
107 | // its energy cut off producing some other particles. Returns kFalse otherwise. | |
108 | // {bit IsTrackOut is set or not} | |
109 | // | |
110 | // Bool_t StatuAlives() | |
111 | // Returns kTRUE if the particle producing this hit is going to continue | |
112 | // to be transported. Returns kFalse otherwise. {bit IsTrackOut is set or not} | |
113 | // | |
114 | // Int_t GetLayer() | |
115 | // Returns the layer number, fLayer, for this hit. | |
116 | // | |
117 | // Int_t GetLadder() | |
118 | // Returns the ladder number, fLadder, for this hit. | |
119 | // | |
120 | // Int_t GetDetector() | |
121 | // Returns the detector number, fDet, for this hit. | |
122 | // | |
123 | // GetDetectorID(Int_t &layer, Int_t &ladder, Int_t &detector) | |
124 | // Returns the layer, ladder, and detector numbers, fLayer fLadder fDet, | |
125 | // in one call. | |
126 | // | |
127 | // Float_t GetIonization() | |
128 | // Returns the energy lost, fDestep, by the particle creating this hit, | |
129 | // in the units defined by the Monte Carlo. | |
130 | // | |
131 | // GetPositionG(Float_t &x, Float_t &y, Float_t &z) | |
132 | // Returns the global position, fX fY fZ, of this hit, in the units | |
133 | // define by the Monte Carlo. | |
134 | // | |
135 | // GetPositionG(Double_t &x, Double_t &y, Double_t &z) | |
136 | // Returns the global position, fX fY fZ, of this hit, in the units | |
137 | // define by the Monte Carlo. | |
138 | // | |
139 | // GetPositionG(Float_t &x, Float_t &y, Float_t &z, Float_t &tof) | |
140 | // Returns the global position and time of flight, fX fY fZ fTof, of | |
141 | // this hit, in the units define by the Monte Carlo. | |
142 | // | |
143 | // GetPositionG(Double_t &x,Double_t &y,Double_t &z,Double_t &tof) | |
144 | // Returns the global position and time of flight, fX fY fZ fTof, of | |
145 | // this hit, in the units define by the Monte Carlo. | |
146 | // | |
147 | // GetPositionL(Double_t &x,Double_t &y,Double_t &z) | |
148 | // Returns the local position, fX fY fZ, of this hit in the coordiante | |
149 | // of this module, in the units define by the Monte Carlo. | |
150 | // | |
151 | // GetPositionG(Double_t &x,Double_t &y,Double_t &z,Double_t &tof) | |
152 | // Returns the local position and time of flight, fX fY fZ fTof, of | |
153 | // this hit in the coordinates of this module, in the units define by the | |
154 | // Monte Carlo. | |
155 | // | |
156 | // Float_t GetXG() | |
157 | // Returns the global x position in the units defined by the Monte Carlo. | |
158 | // | |
159 | // Float_t GetYG() | |
160 | // Returns the global y position in the units defined by the Monte Carlo. | |
161 | // | |
162 | // Float_t GetYG() | |
163 | // Returns the global z position in the units defined by the Monte Carlo. | |
164 | // | |
165 | // Float_t GetTOF() | |
166 | // Returns the time of flight, fTof, of this hit, in the units defined | |
167 | // by the Monte Carlo. | |
168 | // | |
169 | // GetMomentumG(Float_t &px, Float_t &py, Float_t &pz) | |
170 | // Returns the global momentum, fPx fPy fPz, of the particle that made | |
171 | // this hit, in the units define by the Monte Carlo. | |
172 | // | |
173 | // GetMomentumG(Double_t &px,Double_t &py,Double_t &pz) | |
174 | // Returns the global momentum, fPx fPy fPz, of the particle that made | |
175 | // this hit, in the units define by the Monte Carlo. | |
176 | // | |
177 | // GetMomentumL(Double_t &px,Double_t &py,Double_t &pz) | |
178 | // Returns the momentum, fPx fPy fPz in coordinate appropreate for this | |
179 | // specific module, in the units define by the Monte Carlo. | |
180 | // | |
181 | // Float_t GetPXG() | |
182 | // Returns the global X momentum in the units defined by the Monte Carlo. | |
183 | // | |
184 | // Float_t GetPYG() | |
185 | // Returns the global Y momentum in the units defined by the Monte Carlo. | |
186 | // | |
187 | // Float_t GetPZG() | |
188 | // Returns the global Z momentum in the units defined by the Monte Carlo. | |
189 | // | |
190 | //////////////////////////////////////////////////////////////////////// | |
58005f18 | 191 | //_____________________________________________________________________________ |
7e3ded1b | 192 | AliITShit::AliITShit():AliHit(){ |
193 | // Default Constructor | |
194 | // Zero data member just to be safe. | |
195 | // Intputs: | |
196 | // none. | |
197 | // Outputs: | |
198 | // none. | |
199 | // Return: | |
200 | // A default created AliITShit class. | |
201 | ||
202 | fStatus = 0; // Track Status | |
203 | fLayer = 0; // Layer number | |
204 | fLadder = 0; // Ladder number | |
205 | fDet = 0; // Detector number | |
206 | fPx = 0.0; // PX of particle at the point of the hit | |
207 | fPy = 0.0; // PY of particle at the point of the hit | |
208 | fPz = 0.0; // PZ of particle at the point of the hit | |
209 | fDestep = 0.0; // Energy deposited in the current step | |
210 | fTof = 0.0; // Time of flight at the point of the hit | |
07265b7c | 211 | fStatus0 = 0; // zero status bit by default. |
7e3ded1b | 212 | fx0 = 0.0; // Starting point of this step |
213 | fy0 = 0.0; // Starting point of this step | |
214 | fz0 = 0.0; // Starting point of this step | |
215 | ft0 = 0.0; // Starting point of this step | |
216 | } | |
217 | AliITShit::AliITShit(Int_t shunt,Int_t track,Int_t *vol,Float_t edep, | |
218 | Float_t tof,TLorentzVector &x,TLorentzVector &x0, | |
219 | TLorentzVector &p) : AliHit(shunt, track){ | |
220 | //////////////////////////////////////////////////////////////////////// | |
221 | // Create ITS hit | |
222 | // The creator of the AliITShit class. The variables shunt and | |
223 | // track are passed to the creator of the AliHit class. See the AliHit | |
224 | // class for a full description. In the units of the Monte Carlo | |
225 | //////////////////////////////////////////////////////////////////////// | |
226 | // Intputs: | |
227 | // Int_t shunt See AliHit | |
228 | // Int_t track Track number, see AliHit | |
229 | // Int_t *vol Array of integer hit data, | |
230 | // vol[0] Layer where the hit is, 1-6 typicaly | |
231 | // vol[1] Ladder where the hit is. | |
232 | // vol[2] Detector number where the hit is | |
233 | // vol[3] Set of status bits | |
234 | // vol[4] Set of status bits at start | |
235 | // Outputs: | |
236 | // none. | |
237 | // Return: | |
238 | // A default created AliITShit class. | |
239 | ||
240 | fLayer = vol[0]; // Layer number | |
241 | fLadder = vol[2]; // Ladder number | |
242 | fDet = vol[1]; // Detector number | |
243 | fStatus = vol[3]; // Track status flags | |
244 | fStatus0 = vol[4]; // Track status flag for start position. | |
245 | fX = x.X(); // Track X global position | |
246 | fY = x.Y(); // Track Y global position | |
247 | fZ = x.Z(); // Track Z global position | |
248 | fPx = p.Px(); // Track X Momentum | |
249 | fPy = p.Py(); // Track Y Momentum | |
250 | fPz = p.Pz(); // Track Z Momentum | |
251 | fDestep = edep; // Track dE/dx for this step | |
252 | fTof = tof ; // Track Time of Flight for this step | |
253 | fx0 = x0.X(); // Track X global position | |
254 | fy0 = x0.Y(); // Track Y global position | |
255 | fz0 = x0.Z(); // Track Z global position | |
1e96b53e | 256 | ft0 = x0.T(); // Starting point of this step |
7e3ded1b | 257 | } |
258 | //______________________________________________________________________ | |
58005f18 | 259 | AliITShit::AliITShit(Int_t shunt, Int_t track, Int_t *vol, Float_t *hits): |
b2340bbf | 260 | AliHit(shunt, track){ |
261 | //////////////////////////////////////////////////////////////////////// | |
262 | // Create ITS hit | |
263 | // The creator of the AliITShit class. The variables shunt and | |
264 | // track are passed to the creator of the AliHit class. See the AliHit | |
265 | // class for a full description. the integer array *vol contains, in order, | |
266 | // fLayer = vol[0], fDet = vol[1], fLadder = vol[2], fStatus = vol[3]. | |
267 | // The array *hits contains, in order, fX = hits[0], fY = hits[1], | |
268 | // fZ = hits[2], fPx = hits[3], fPy = hits[4], fPz = hits[5], | |
269 | // fDestep = hits[6], and fTof = hits[7]. In the units of the Monte Carlo | |
270 | //////////////////////////////////////////////////////////////////////// | |
7e3ded1b | 271 | // Intputs: |
272 | // Int_t shunt See AliHit | |
273 | // Int_t track Track number, see AliHit | |
274 | // Int_t *vol Array of integer hit data, | |
275 | // vol[0] Layer where the hit is, 1-6 typicaly | |
276 | // vol[1] Ladder where the hit is. | |
277 | // vol[2] Detector number where the hit is | |
278 | // vol[3] Set of status bits | |
279 | // Float_t *hits Array of hit information | |
280 | // hits[0] X global position of this hit | |
281 | // hits[1] Y global position of this hit | |
282 | // hits[2] Z global position of this hit | |
283 | // hits[3] Px global position of this hit | |
284 | // hits[4] Py global position of this hit | |
285 | // hits[5] Pz global position of this hit | |
286 | // hits[6] Energy deposited by this step | |
287 | // hits[7] Time of flight of this particle at this step | |
288 | // Outputs: | |
289 | // none. | |
290 | // Return: | |
291 | // A standard created AliITShit class. | |
58005f18 | 292 | fLayer = vol[0]; // Layer number |
293 | fLadder = vol[2]; // Ladder number | |
294 | fDet = vol[1]; // Detector number | |
295 | fStatus = vol[3]; // Track status flags | |
7e3ded1b | 296 | fX = hits[0]; // Track X global position |
297 | fY = hits[1]; // Track Y global position | |
298 | fZ = hits[2]; // Track Z global position | |
58005f18 | 299 | fPx = hits[3]; // Track X Momentum |
300 | fPy = hits[4]; // Track Y Momentum | |
301 | fPz = hits[5]; // Track Z Momentum | |
302 | fDestep = hits[6]; // Track dE/dx for this step | |
303 | fTof = hits[7]; // Track Time of Flight for this step | |
07265b7c | 304 | fStatus0 = 0;// Track Status of Starting point |
305 | fx0 = 0.0; // Starting point of this step | |
306 | fy0 = 0.0; // Starting point of this step | |
307 | fz0 = 0.0; // Starting point of this step | |
308 | ft0 = 0.0; // Starting point of this step | |
58005f18 | 309 | } |
b2340bbf | 310 | //______________________________________________________________________ |
58005f18 | 311 | void AliITShit::GetPositionL(Float_t &x,Float_t &y,Float_t &z){ |
b2340bbf | 312 | //////////////////////////////////////////////////////////////////////// |
313 | // Returns the position of this hit in the local coordinates of this | |
314 | // module, and in the units of the Monte Carlo. | |
315 | //////////////////////////////////////////////////////////////////////// | |
58005f18 | 316 | AliITSgeom *gm = ((AliITS*)gAlice->GetDetector("ITS"))->GetITSgeom(); |
317 | Float_t g[3],l[3]; | |
318 | ||
319 | g[0] = fX; | |
320 | g[1] = fY; | |
321 | g[2] = fZ; | |
4fc5ed2d | 322 | if(gm) { |
323 | gm->GtoL(fLayer,fLadder,fDet,g,l); | |
324 | x = l[0]; | |
325 | y = l[1]; | |
326 | z = l[2]; | |
327 | } else { | |
328 | Error("AliITShit","NULL pointer to the geometry! return smth else",gm); | |
329 | // AliITSv7 - SDD case | |
330 | x=fX; | |
d2ace6e6 | 331 | y=fY; |
332 | z=fZ; | |
4fc5ed2d | 333 | } |
58005f18 | 334 | return; |
335 | } | |
b2340bbf | 336 | //______________________________________________________________________ |
58005f18 | 337 | void AliITShit::GetPositionL(Float_t &x,Float_t &y,Float_t &z,Float_t &tof){ |
b2340bbf | 338 | //////////////////////////////////////////////////////////////////////// |
339 | // Returns the position and time of flight of this hit in the local | |
340 | // coordinates of this module, and in the units of the Monte Carlo. | |
341 | //////////////////////////////////////////////////////////////////////// | |
58005f18 | 342 | AliITSgeom *gm = ((AliITS*)gAlice->GetDetector("ITS"))->GetITSgeom(); |
343 | Float_t g[3],l[3]; | |
344 | ||
345 | g[0] = fX; | |
346 | g[1] = fY; | |
347 | g[2] = fZ; | |
4fc5ed2d | 348 | if(gm) { |
349 | gm->GtoL(fLayer,fLadder,fDet,g,l); | |
350 | x = l[0]; | |
351 | y = l[1]; | |
352 | z = l[2]; | |
353 | } else { | |
354 | Error("AliITShit","NULL pointer to the geometry! return smth else",gm); | |
355 | // AliITSv7 - SDD case | |
356 | x=fX; | |
d2ace6e6 | 357 | y=fY; |
358 | z=fZ; | |
4fc5ed2d | 359 | } |
58005f18 | 360 | tof = fTof; |
361 | return; | |
362 | } | |
b2340bbf | 363 | //______________________________________________________________________ |
d2ace6e6 | 364 | void AliITShit::GetPositionL0(Double_t &x,Double_t &y,Double_t &z, |
365 | Double_t &tof){ | |
366 | //////////////////////////////////////////////////////////////////////// | |
367 | // Returns the initial position and time of flight of this hit in the local | |
368 | // coordinates of this module, and in the units of the Monte Carlo. | |
369 | //////////////////////////////////////////////////////////////////////// | |
370 | AliITSgeom *gm = ((AliITS*)gAlice->GetDetector("ITS"))->GetITSgeom(); | |
371 | Float_t g[3],l[3]; | |
372 | ||
373 | g[0] = fx0; | |
374 | g[1] = fy0; | |
375 | g[2] = fz0; | |
376 | if(gm) { | |
377 | gm->GtoL(fLayer,fLadder,fDet,g,l); | |
378 | x = l[0]; | |
379 | y = l[1]; | |
380 | z = l[2]; | |
381 | } else { | |
382 | Error("AliITShit","NULL pointer to the geometry! return smth else",gm); | |
383 | // AliITSv7 - SDD case | |
384 | x=fx0; | |
385 | y=fy0; | |
386 | z=fz0; | |
387 | } | |
388 | tof = ft0; | |
389 | return; | |
390 | } | |
391 | //______________________________________________________________________ | |
58005f18 | 392 | Float_t AliITShit::GetXL(){ |
b2340bbf | 393 | //////////////////////////////////////////////////////////////////////// |
394 | // Returns the x position of this hit in the local coordinates of this | |
395 | // module, and in the units of the Monte Carlo. | |
396 | //////////////////////////////////////////////////////////////////////// | |
58005f18 | 397 | AliITSgeom *gm = ((AliITS*)gAlice->GetDetector("ITS"))->GetITSgeom(); |
398 | Float_t g[3],l[3]; | |
399 | ||
400 | g[0] = fX; | |
401 | g[1] = fY; | |
402 | g[2] = fZ; | |
4fc5ed2d | 403 | if(gm) { |
404 | gm->GtoL(fLayer,fLadder,fDet,g,l); | |
405 | return l[0]; | |
406 | } else { | |
407 | Error("AliITShit","NULL pointer to the geometry! return smth else",gm); | |
408 | return fX; | |
409 | } | |
58005f18 | 410 | } |
b2340bbf | 411 | //______________________________________________________________________ |
58005f18 | 412 | Float_t AliITShit::GetYL(){ |
b2340bbf | 413 | //////////////////////////////////////////////////////////////////////// |
414 | // Returns the y position of this hit in the local coordinates of this | |
415 | // module, and in the units of the Monte Carlo. | |
416 | //////////////////////////////////////////////////////////////////////// | |
58005f18 | 417 | AliITSgeom *gm = ((AliITS*)gAlice->GetDetector("ITS"))->GetITSgeom(); |
418 | Float_t g[3],l[3]; | |
419 | ||
420 | g[0] = fX; | |
421 | g[1] = fY; | |
422 | g[2] = fZ; | |
4fc5ed2d | 423 | if (gm) { |
424 | gm->GtoL(fLayer,fLadder,fDet,g,l); | |
425 | return l[1]; | |
426 | } else { | |
427 | Error("AliITShit","NULL pointer to the geometry! return smth else",gm); | |
428 | return fZ; | |
429 | } | |
58005f18 | 430 | } |
b2340bbf | 431 | //______________________________________________________________________ |
58005f18 | 432 | Float_t AliITShit::GetZL(){ |
b2340bbf | 433 | //////////////////////////////////////////////////////////////////////// |
434 | // Returns the z position of this hit in the local coordinates of this | |
435 | // module, and in the units of the Monte Carlo. | |
436 | //////////////////////////////////////////////////////////////////////// | |
58005f18 | 437 | AliITSgeom *gm = ((AliITS*)gAlice->GetDetector("ITS"))->GetITSgeom(); |
438 | Float_t g[3],l[3]; | |
439 | ||
440 | g[0] = fX; | |
441 | g[1] = fY; | |
442 | g[2] = fZ; | |
4fc5ed2d | 443 | if(gm) { |
444 | gm->GtoL(fLayer,fLadder,fDet,g,l); | |
445 | return l[2]; | |
446 | } else { | |
447 | Error("AliITShit","NULL pointer to the geometry! return smth else",gm); | |
448 | return fY; | |
449 | } | |
58005f18 | 450 | } |
b2340bbf | 451 | //______________________________________________________________________ |
58005f18 | 452 | void AliITShit::GetMomentumL(Float_t &px,Float_t &py,Float_t &pz){ |
b2340bbf | 453 | //////////////////////////////////////////////////////////////////////// |
454 | // Returns the momentum of this hit in the local coordinates of this | |
455 | // module, and in the units of the Monte Carlo. | |
456 | //////////////////////////////////////////////////////////////////////// | |
58005f18 | 457 | AliITSgeom *gm = ((AliITS*)gAlice->GetDetector("ITS"))->GetITSgeom(); |
458 | Float_t g[3],l[3]; | |
459 | ||
460 | g[0] = fPx; | |
461 | g[1] = fPy; | |
462 | g[2] = fPz; | |
4fc5ed2d | 463 | if (gm) { |
464 | gm->GtoLMomentum(fLayer,fLadder,fDet,g,l); | |
465 | px = l[0]; | |
466 | py = l[1]; | |
467 | pz = l[2]; | |
468 | } else { | |
469 | Error("AliITShit","NULL pointer to the geometry! return smth else",gm); | |
470 | px=fPx; | |
471 | py=fPy; | |
472 | pz=fPz; | |
473 | } | |
58005f18 | 474 | return; |
475 | } | |
b2340bbf | 476 | //______________________________________________________________________ |
477 | Float_t AliITShit::GetPXL(){ | |
478 | //////////////////////////////////////////////////////////////////////// | |
479 | // Returns the X momentum of this hit in the local coordinates of this | |
480 | // module, and in the units of the Monte Carlo. | |
481 | //////////////////////////////////////////////////////////////////////// | |
482 | AliITSgeom *gm = ((AliITS*)gAlice->GetDetector("ITS"))->GetITSgeom(); | |
483 | Float_t g[3],l[3]; | |
484 | ||
485 | g[0] = fPx; | |
486 | g[1] = fPy; | |
487 | g[2] = fPz; | |
4fc5ed2d | 488 | if (gm) { |
489 | gm->GtoLMomentum(fLayer,fLadder,fDet,g,l); | |
490 | return l[0]; | |
491 | } else { | |
492 | Error("AliITShit","NULL pointer to the geometry! return smth else",gm); | |
493 | return fPx; | |
494 | } | |
b2340bbf | 495 | } |
496 | //______________________________________________________________________ | |
497 | Float_t AliITShit::GetPYL(){ | |
498 | //////////////////////////////////////////////////////////////////////// | |
499 | // Returns the Y momentum of this hit in the local coordinates of this | |
500 | // module, and in the units of the Monte Carlo. | |
501 | //////////////////////////////////////////////////////////////////////// | |
502 | AliITSgeom *gm = ((AliITS*)gAlice->GetDetector("ITS"))->GetITSgeom(); | |
503 | Float_t g[3],l[3]; | |
504 | ||
505 | g[0] = fPx; | |
506 | g[1] = fPy; | |
507 | g[2] = fPz; | |
4fc5ed2d | 508 | if (gm) { |
509 | gm->GtoLMomentum(fLayer,fLadder,fDet,g,l); | |
510 | return l[1]; | |
511 | } else { | |
512 | Error("AliITShit","NULL pointer to the geometry! return smth else",gm); | |
513 | return fPy; | |
514 | } | |
515 | ||
b2340bbf | 516 | } |
517 | //______________________________________________________________________ | |
518 | Float_t AliITShit::GetPZL(){ | |
519 | //////////////////////////////////////////////////////////////////////// | |
520 | // Returns the Z momentum of this hit in the local coordinates of this | |
521 | // module, and in the units of the Monte Carlo. | |
522 | //////////////////////////////////////////////////////////////////////// | |
523 | AliITSgeom *gm = ((AliITS*)gAlice->GetDetector("ITS"))->GetITSgeom(); | |
524 | Float_t g[3],l[3]; | |
525 | ||
526 | g[0] = fPx; | |
527 | g[1] = fPy; | |
528 | g[2] = fPz; | |
4fc5ed2d | 529 | if (gm) { |
530 | gm->GtoLMomentum(fLayer,fLadder,fDet,g,l); | |
531 | return l[2]; | |
532 | } else { | |
533 | Error("AliITShit","NULL pointer to the geometry! return smth else",gm); | |
534 | return fPz; | |
535 | } | |
536 | ||
b2340bbf | 537 | } |
538 | //___________________________________________________________________________; | |
539 | Int_t AliITShit::GetModule(){ | |
540 | //////////////////////////////////////////////////////////////////////// | |
541 | // Returns the module index number of the module where this hit was in. | |
542 | //////////////////////////////////////////////////////////////////////// | |
543 | AliITSgeom *gm = ((AliITS*)gAlice->GetDetector("ITS"))->GetITSgeom(); | |
544 | ||
4fc5ed2d | 545 | if (gm) return gm->GetModuleIndex(fLayer,fLadder,fDet); |
546 | else { | |
547 | Error("AliITShit","NULL pointer to the geometry! return smth else",gm); | |
548 | return 0; | |
549 | } | |
b2340bbf | 550 | } |
551 | //______________________________________________________________________ | |
33da2552 | 552 | TParticle * AliITShit::GetParticle() const { |
b2340bbf | 553 | //////////////////////////////////////////////////////////////////////// |
554 | // Returns the pointer to the TParticle for the particle that created | |
555 | // this hit. From the TParticle all kinds of information about this | |
556 | // particle can be found. See the TParticle class. | |
557 | //////////////////////////////////////////////////////////////////////// | |
5d12ce38 | 558 | return gAlice->GetMCApp()->Particle(GetTrack()); |
3dbb2c95 | 559 | } |
560 | //---------------------------------------------------------------------- | |
33da2552 | 561 | void AliITShit::Print(ostream *os) const { |
3dbb2c95 | 562 | //////////////////////////////////////////////////////////////////////// |
563 | // Standard output format for this class. | |
564 | //////////////////////////////////////////////////////////////////////// | |
565 | #if defined __GNUC__ | |
566 | #if __GNUC__ > 2 | |
567 | ios::fmtflags fmt; | |
568 | #else | |
569 | Int_t fmt; | |
570 | #endif | |
94831058 | 571 | #else |
9f69211c | 572 | #if defined __ICC || defined __ECC || defined __xlC__ |
94831058 | 573 | ios::fmtflags fmt; |
3dbb2c95 | 574 | #else |
575 | Int_t fmt; | |
94831058 | 576 | #endif |
3dbb2c95 | 577 | #endif |
578 | ||
579 | fmt = os->setf(ios::scientific); // set scientific floating point output | |
e11d9a3a | 580 | *os << fTrack << " " << fX << " " << fY << " " << fZ << " "; |
3dbb2c95 | 581 | fmt = os->setf(ios::hex); // set hex for fStatus only. |
582 | *os << fStatus << " "; | |
583 | fmt = os->setf(ios::dec); // every thing else decimel. | |
584 | *os << fLayer << " " << fLadder << " " << fDet << " ";; | |
585 | *os << fPx << " " << fPy << " " << fPz << " "; | |
586 | *os << fDestep << " " << fTof; | |
000d397e | 587 | *os << " " << fx0 << " " << fy0 << " " << fz0; |
588 | // *os << " " << endl; | |
3dbb2c95 | 589 | os->flags(fmt); // reset back to old formating. |
590 | return; | |
591 | } | |
592 | //---------------------------------------------------------------------- | |
33da2552 | 593 | void AliITShit::Read(istream *is) { |
3dbb2c95 | 594 | //////////////////////////////////////////////////////////////////////// |
595 | // Standard input format for this class. | |
596 | //////////////////////////////////////////////////////////////////////// | |
597 | ||
e11d9a3a | 598 | |
599 | *is >> fTrack >> fX >> fY >> fZ; | |
3dbb2c95 | 600 | *is >> fStatus >> fLayer >> fLadder >> fDet >> fPx >> fPy >> fPz >> |
601 | fDestep >> fTof; | |
7e3ded1b | 602 | *is >> fx0 >> fy0 >> fz0; |
3dbb2c95 | 603 | return; |
604 | } | |
605 | //---------------------------------------------------------------------- | |
606 | ostream &operator<<(ostream &os,AliITShit &p){ | |
607 | //////////////////////////////////////////////////////////////////////// | |
608 | // Standard output streaming function. | |
609 | //////////////////////////////////////////////////////////////////////// | |
610 | ||
611 | p.Print(&os); | |
612 | return os; | |
613 | } | |
614 | //---------------------------------------------------------------------- | |
615 | istream &operator>>(istream &is,AliITShit &r){ | |
616 | //////////////////////////////////////////////////////////////////////// | |
617 | // Standard input streaming function. | |
618 | //////////////////////////////////////////////////////////////////////// | |
619 | ||
620 | r.Read(&is); | |
621 | return is; | |
b2340bbf | 622 | } |
3dbb2c95 | 623 | //---------------------------------------------------------------------- |