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