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