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