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