]> git.uio.no Git - u/mrichter/AliRoot.git/blob - ITS/AliITShit.h
First commit.
[u/mrichter/AliRoot.git] / ITS / AliITShit.h
1 #ifndef ALIITSHIT_H
2 #define ALIITSHIT_H
3 /* Copyright(c) 1998-1999, ALICE Experiment at CERN, All rights reserved. *
4  * See cxx source for full Copyright notice                               */
5
6 /* $Id$ */
7
8 #include "AliHit.h" 
9 #include <Riostream.h>
10 #include <TLorentzVector.h>
11
12 class TParticle;
13
14 class AliITShit : public AliHit {
15 ////////////////////////////////////////////////////////////////////////
16 // Version: 0
17 // Written by Rene Brun, Federico Carminati, and Roberto Barbera
18 //
19 // Version: 1
20 // Modified and documented by Bjorn S. Nilsen
21 // July 11 1999
22 //
23 // AliITShit is the hit class for the ITS. Hits are the information
24 // that comes from a Monte Carlo at each step as a particle mass through
25 // sensitive detector elements as particles are transported through a
26 // detector.
27 //
28 // Data members:
29 //
30 // Int_t fTrack
31 //     See AliHit for a full description. The track number of the track
32 // that made this hit.
33 //
34 // Float_t fX
35 //     See AliHit for a full description. The global x position of the
36 // hit (in the standard units of the Monte Carlo).
37 //
38 // Float_t fY
39 //     See AliHit for a full description. The global y position of the
40 // hit (in the standard units of the Monte Carlo).
41 //
42 // Float_t fZ
43 //     See AliHit for a full description. The global z position of the
44 // hit (in the standard units of the Monte Carlo).
45 //
46 // Int_t fStatus
47 //     The track status flag. This flag indicates the track status
48 // at the time of creating this hit. It is made up of the following 8
49 // status bits from highest order to lowest order bits
50 // 0           :  IsTrackAlive():    IsTrackStop():IsTrackDisappeared():
51 // IsTrackOut():IsTrackExiting():IsTrackEntering():IsTrackInside()     .
52 // See AliMC for a description of these functions. If the function is
53 // true then the bit is set to one, otherwise it is zero.
54 //
55 // Int_t fLayer
56 //     The layer number of the detector that contains this hit. See
57 // AliITSgeom and AliITSv? for a description of the geometry.
58 //
59 // Int_t fLadder
60 //     The ladder number of the detector that contains this hit. See
61 // AliITSgeom and AliITSv? for a description of the geometry.
62 //
63 // Int_t fDet
64 //     The detector number of the detector that contains this hit. See
65 // AliITSgeom and AliITSv? for a description of the geometry.
66 //
67 // Float_t fPx
68 //     The x momentum, in global coordinates, of the particle that
69 // "created" the hit at the time and position of the hit. The units
70 // are those determined by the Monte Carlo.
71 //
72 // Float_t fPy
73 //     The y momentum, in global coordinates, of the particle that
74 // "created" the hit at the time and position of the hit. The units
75 // are those determined by the Monte Carlo.
76 //
77 // Float_t fPz
78 //     The z momentum, in global coordinates, of the particle that
79 // "created" the hit at the time and position of the hit. The units
80 // are those determined by the Monte Carlo.
81 //
82 // Float_t fDestep
83 //     The energy lost by the particle during the step ending in this
84 // hit. The units are those determined by the Monte Carlo.
85 //
86 // Float_t fTof
87 //     The time of flight associated with the particle ending in this
88 // hit. The time is typically measured from the point of creation of the
89 // original particle (if this particle is a daughter).  The units
90 // are those determined by the Monte Carlo.
91 //
92 //
93 ////////////////////////////////////////////////////////////////////////
94     // public;       // defined in AliHit
95     // Int_t fTrack  // defined in AliHit
96     // Float_t fX;   // defined in AliHit
97     // Float_t fY;   // defined in AliHit
98     // Float_t fZ;   // defined in AliHit
99
100  public:
101     AliITShit();// Default consrtructor
102     // Old Standard Constructor
103     AliITShit(Int_t shunt, Int_t track, Int_t *vol, Float_t *hits);
104     // New Standard Constructor
105     AliITShit(Int_t shunt,Int_t track,Int_t *vol,Float_t edep,Float_t tof,
106               TLorentzVector &x,TLorentzVector &x0,TLorentzVector &p);
107     // Default destructor
108     virtual ~AliITShit() {}
109     // Get Hit information functions.
110     // virtual int GetTrack() const {return fTrack;} // define in AliHit
111     // virtual void SetTrack(int track) const {fTrack=track;) // AliHit
112     virtual Int_t GetTrackStatus() const {//returns the status code
113         return fStatus;}
114     virtual Int_t GetTrackStatus0() const {//returns the status code
115         return fStatus0;}
116     virtual Int_t GetLayer() const {// returns the layer number
117         return fLayer;}
118     virtual Int_t GetLadder() const {// returns the ladder number
119         return fLadder;}
120     virtual Int_t GetDetector() const {// returns the detector number
121         return fDet;}
122     virtual void  GetDetectorID(Int_t &layer,Int_t &ladder,Int_t &det)const {
123         // returns the detector ID
124         layer=fLayer;ladder=fLadder;det=fDet;return;};
125     virtual Int_t GetModule();
126     virtual Float_t GetIonization() const {// returns the Destep
127         return fDestep;}
128     //
129     virtual void GetPositionG(Float_t &x,Float_t &y,Float_t &z)const {
130         // returns the position in the Global frame
131         x=fX;y=fY;z=fZ;return;};
132     virtual void GetPositionG(Double_t &x,Double_t &y,Double_t &z)const {
133         // returns the position in the Global frame
134         x=fX;y=fY;z=fZ;return;};
135     virtual Float_t GetTOF() const {// returns the time of flight
136         return fTof;}
137     // Returns particle 3 position at this hit in global coordinates.
138     virtual void GetPositionG(Float_t &x,Float_t &y,Float_t &z,Float_t &tof)
139         const {// returns the position in the Global frame and the time of
140         // flight
141         x=fX;y=fY;z=fZ,tof=fTof;return;};
142     virtual void GetPositionG(Double_t &x,Double_t &y,Double_t &z,Double_t &t)
143         const {// Returns particle 3 position and the time of flight at this
144         // hit in global coordinates.
145         x=fX;y=fY;z=fZ,t=fTof;return;};
146     virtual Float_t GetXG()const {// Returns particle X position at this hit
147         // in global coordinates.
148         return fX;}
149     virtual Float_t GetYG()const {// Returns particle X position at this hit
150         // in global coordinates.
151         return fY;}
152     virtual Float_t GetZG()const {// Returns particle Z position at this hit
153         // in global coordinates.
154         return fZ;}
155     // Returns particle 3 position at this hit in global coordinates.
156     virtual void GetPositionG0(Float_t &x,Float_t &y,Float_t &z,Float_t &tof)
157         const {// returns the initial position in the Global frame and the
158         // time of flight
159         x=fx0;y=fy0;z=fz0,tof=fTof;return;};
160     virtual void GetPositionL(Float_t &x,Float_t &y,Float_t &z);
161     // Returns particle 3 position at this hit in local coordinates.
162     virtual void GetPositionL(Float_t &x,Float_t &y,Float_t &z,Float_t &tof);
163     virtual void GetPositionL(Double_t &x,Double_t &y,Double_t &z){
164          // Returns particle 3 position at this hit in local coordinates.
165          Float_t xf,yf,zf;GetPositionL(xf,yf,zf);x=xf,y=yf;z=zf;}
166     virtual void GetPositionL(Double_t &x,Double_t &y,Double_t &z,Double_t &t){
167     // Returns particle 3 position and the time of flight at this hit
168     // in local coordinates.
169          Float_t xf,yf,zf,tf;GetPositionL(xf,yf,zf,tf);x=xf,y=yf;z=zf;t=tf;}
170     virtual Float_t GetXL();
171     // Returns particle X position at this hit in local coordinates.
172     virtual Float_t GetYL();
173     // Returns particle Y position at this hit in local coordinates.
174     virtual Float_t GetZL();
175     // Returns particle Z position at this hit in local coordinates.
176     // Get Monti Carlo information about hit.
177     virtual void GetMomentumG(Float_t &px,Float_t &py,Float_t &pz)const {
178         // returns the particle momentum in the Global frame
179         px=fPx;py=fPy;pz=fPz;return;};
180     virtual void GetMomentumG(Double_t &px,Double_t &py,Double_t &pz)const {
181         // returns the particle momentum in the Global frame
182         px=fPx;py=fPy;pz=fPz;return;};
183     virtual Float_t GetPXG()const {// Returns particle X momentum at this hit
184         // in global coordinates.
185         return fPx;}
186     virtual Float_t GetPYG()const {// Returns particle Y momentum at
187         // this hit in global coordinates.
188         return fPy;}
189     virtual Float_t GetPZG()const {// Returns particle Z momentum at
190         // this hit in global coordinates.
191         return fPz;}
192     virtual void GetMomentumL(Float_t &px,Float_t &py,Float_t &pz);
193     virtual void GetMomentumL(Double_t &px,Double_t &py,Double_t &pz){
194        // Returns particle 3 momentum at this hit in local coordinates.  
195             Float_t x,y,z;GetMomentumL(x,y,z);px=x,py=y,pz=z;}
196     
197     virtual Float_t GetPXL();
198     // Returns particle X momentum at this hit in local coordinates.
199     virtual Float_t GetPYL();
200     // Returns particle Y momentum at this hit in local coordinates.
201     virtual Float_t GetPZL();
202     // Returns particle Z momentum at this hit in local coordinates.
203     virtual TParticle * GetParticle(); // Returns pointer to this particle.
204     Bool_t StatusInside() {// checks if the particle is "inside"
205         if((fStatus&0x0001)==0) return kFALSE;else return kTRUE;}
206     Bool_t StatusEntering() {// checks if the particle is "entering"
207         if((fStatus&0x0002)==0) return kFALSE;else return kTRUE;}
208     Bool_t StatusExiting() {// checks if the particle is "exiting"
209         if((fStatus&0x0004)==0) return kFALSE;else return kTRUE;}
210     Bool_t StatusOut() {// checks if the particle is "out"
211         if((fStatus&0x0008)==0) return kFALSE;else return kTRUE;}
212     Bool_t StatusDisappeared() {// checks if the particle is "disappeared"
213         if((fStatus&0x00010)==0) return kFALSE;else return kTRUE;}
214     Bool_t StatusStop() {// checks if the particle is "stopped"
215         if((fStatus&0x00020)==0) return kFALSE;else return kTRUE;}
216     Bool_t StatusAlive() {// checks if the particle is "alive"
217         if((fStatus&0x00030)==0) return kFALSE;else return kTRUE;}
218     // Prints out the content of this class in ASCII format.
219     void Print(ostream *os); 
220     // Reads in the content of this class in the format of Print
221     void Read(istream *is);
222
223  protected:
224     Int_t     fStatus; // Track Status
225     Int_t     fLayer;  // Layer number
226     Int_t     fLadder; // Ladder number
227     Int_t     fDet;    // Detector number  
228     Float_t   fPx;     // PX of particle at the point of the hit
229     Float_t   fPy;     // PY of particle at the point of the hit
230     Float_t   fPz;     // PZ of particle at the point of the hit
231     Float_t   fDestep; // Energy deposited in the current step
232     Float_t   fTof;    // Time of flight at the point of the hit
233     Int_t     fStatus0;// Track Status of Starting point
234     Float_t   fx0;     // Starting point of this step
235     Float_t   fy0;     // Starting point of this step
236     Float_t   fz0;     // Starting point of this step
237     Float_t   ft0;     // Starting point of this step
238
239     ClassDef(AliITShit,2)  //Hits object for set:ITS
240          
241 }; 
242 // Input and output function for standard C++ input/output.
243 ostream& operator<<(ostream &os,AliITShit &source);
244 istream& operator>>(istream &os,AliITShit &source);
245
246 #endif