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