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