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