3 /* Copyright(c) 1998-1999, ALICE Experiment at CERN, All rights reserved. *
4 * See cxx source for full Copyright notice */
8 ////////////////////////////////////////////////////////////////////////
10 // Written by Rene Brun, Federico Carminati, and Roberto Barbera
13 // Modified and documented by Bjorn S. Nilsen
16 // AliITShit is the hit class for the ITS. Hits are the information
17 // that comes from a Monte Carlo at each step as a particle mass through
18 // sensitive detector elements as particles are transported through a
24 // See AliHit for a full description. The track number of the track
25 // that made this hit.
28 // See AliHit for a full description. The global x position of the
29 // hit (in the standard units of the Monte Carlo).
32 // See AliHit for a full description. The global y position of the
33 // hit (in the standard units of the Monte Carlo).
36 // See AliHit for a full description. The global z position of the
37 // hit (in the standard units of the Monte Carlo).
40 // The track status flag. This flag indicates the track status
41 // at the time of creating this hit. It is made up of the following 8
42 // status bits from highest order to lowest order bits
43 // 0 : IsTrackAlive(): IsTrackStop():IsTrackDisappeared():
44 // IsTrackOut():IsTrackExiting():IsTrackEntering():IsTrackInside() .
45 // See AliMC for a description of these functions. If the function is
46 // true then the bit is set to one, otherwise it is zero.
49 // The layer number of the detector that contains this hit. See
50 // AliITSgeom and AliITSv? for a description of the geometry.
53 // The ladder number of the detector that contains this hit. See
54 // AliITSgeom and AliITSv? for a description of the geometry.
57 // The detector number of the detector that contains this hit. See
58 // AliITSgeom and AliITSv? for a description of the geometry.
61 // The x momentum, in global coordinates, of the particle that
62 // "created" the hit at the time and position of the hit. The units
63 // are those determined by the Monte Carlo.
66 // The y momentum, in global coordinates, of the particle that
67 // "created" the hit at the time and position of the hit. The units
68 // are those determined by the Monte Carlo.
71 // The z momentum, in global coordinates, of the particle that
72 // "created" the hit at the time and position of the hit. The units
73 // are those determined by the Monte Carlo.
76 // The energy lost by the particle during the step ending in this
77 // hit. The units are those determined by the Monte Carlo.
80 // The time of flight associated with the particle ending in this
81 // hit. The time is typically measured from the point of creation of the
82 // original particle (if this particle is a daughter). The units
83 // are those determined by the Monte Carlo.
86 ////////////////////////////////////////////////////////////////////////
87 #include <TLorentzVector.h>
93 class AliITShit : public AliHit {
96 AliITShit();// Default consrtructor
97 // Old Standard Constructor
98 AliITShit(Int_t shunt, Int_t track, Int_t *vol, Float_t *hits);
99 // New Standard Constructor
100 AliITShit(Int_t shunt,Int_t track,Int_t *vol,Float_t edep,Float_t tof,
101 TLorentzVector &x,TLorentzVector &x0,TLorentzVector &p);
103 AliITShit(const AliITShit &h);
105 AliITShit& operator=(const AliITShit &h);
106 // Default destructor
107 virtual ~AliITShit() {};
108 // Get Hit information functions.
109 // virtual int GetTrack() const {return fTrack;} // define in AliHit
110 // virtual void SetTrack(int track) const {fTrack=track;) // AliHit
111 virtual void SetModule(Int_t mod){fModule=mod;};
112 virtual void SetShunt(Int_t shunt);
113 virtual void SetPosition(TLorentzVector &x){fX=x.X();fY=x.Y();fZ=x.Z();}
114 virtual void SetStartPosition(TLorentzVector &x){fx0=x.X();fy0=x.Y();
116 virtual void SetTime(Float_t t){fTof = t;}
117 virtual void SetStartTime(Float_t t){ft0 = t;}
118 virtual void SetStatus(Int_t stat){fStatus = stat;}
119 virtual void SetStartStatus(Int_t stat){fStatus0 = stat;}
120 virtual void SetEdep(Float_t de){fDestep = de;}
121 virtual void SetMomentum(TLorentzVector &p){fPx=p.Px();fPy=p.Py();
123 virtual Int_t GetTrackStatus() const {//returns the status code
125 virtual Int_t GetTrackStatus0() const {//returns the status code
127 virtual Int_t GetLayer() const{Int_t a,b,c;// returns the layer number
128 GetDetectorID(a,b,c); return a;}
129 virtual Int_t GetLadder() const{Int_t a,b,c;// returns the ladder number
130 GetDetectorID(a,b,c); return b;}
131 virtual Int_t GetDetector() const{Int_t a,b,c;//returns the detector number
132 GetDetectorID(a,b,c); return c;}
133 // returns the detector ID
134 virtual void GetDetectorID(Int_t &layer,Int_t &ladder,Int_t &det)const;
135 virtual Int_t GetModule(){return fModule;};
136 virtual Float_t GetIonization() const {return fDestep;}//returns the Destep
138 virtual void GetPositionG(Float_t &x,Float_t &y,Float_t &z)const {
139 // returns the position in the Global frame
140 x=fX;y=fY;z=fZ;return;};
141 virtual void GetPositionG(Double_t &x,Double_t &y,Double_t &z)const {
142 // returns the position in the Global frame
143 x=fX;y=fY;z=fZ;return;};
144 virtual Float_t GetTOF() const {// returns the time of flight
146 // Returns particle 3 position at this hit in global coordinates.
147 virtual void GetPositionG(Float_t &x,Float_t &y,Float_t &z,Float_t &tof)
148 const {// returns the position in the Global frame and the time of
150 x=fX;y=fY;z=fZ,tof=fTof;return;};
151 virtual void GetPositionG(Double_t &x,Double_t &y,Double_t &z,Double_t &t)
152 const {// Returns particle 3 position and the time of flight at this
153 // hit in global coordinates.
154 x=fX;y=fY;z=fZ,t=fTof;return;};
155 virtual Float_t GetXG()const {// Returns particle X position at this hit
156 // in global coordinates.
158 virtual Float_t GetYG()const {// Returns particle X position at this hit
159 // in global coordinates.
161 virtual Float_t GetZG()const {// Returns particle Z position at this hit
162 // in global coordinates.
164 // Returns particle 3 position at this hit in global coordinates.
165 virtual void GetPositionG0(Float_t &x,Float_t &y,Float_t &z,Float_t &tof)
166 const {// returns the initial position in the Global frame and the
168 x=fx0;y=fy0;z=fz0,tof=fTof;return;};
169 // Returns particle 3 position at this hit in global coordinates.
170 virtual void GetPositionG0(Double_t &x,Double_t &y,Double_t &z,
171 Double_t &tof)const {
172 // returns the initial position in the Global frame and the
174 x=fx0;y=fy0;z=fz0,tof=fTof;return;};
175 virtual void GetPositionL(Float_t &x,Float_t &y,Float_t &z){
176 // Returns particle 3 position at this hit in local coordinates.
177 Float_t tf;GetPositionL(x,y,z,tf);}
178 virtual void GetPositionL(Float_t &x,Float_t &y,Float_t &z,Float_t &tof);
179 virtual void GetPositionL(Double_t &x,Double_t &y,Double_t &z){
180 // Returns particle 3 position at this hit in local coordinates.
181 Float_t xf,yf,zf,tf;GetPositionL(xf,yf,zf,tf);x=xf,y=yf;z=zf;}
182 virtual void GetPositionL(Double_t &x,Double_t &y,Double_t &z,Double_t &t){
183 // Returns particle 3 position and the time of flight at this hit
184 // in local coordinates.
185 Float_t xf,yf,zf,tf;GetPositionL(xf,yf,zf,tf);x=xf,y=yf;z=zf;t=tf;}
186 // Returns particle 3 initial position and the time of flight at this hit
187 // in local coordinates.
188 virtual void GetPositionL0(Double_t &x,Double_t &y,Double_t &z,
190 virtual Float_t GetXL(){
191 // Returns particle X position at this hit in local coordinates.
192 Float_t xf,yf,zf,tf;GetPositionL(xf,yf,zf,tf);return xf;}
193 virtual Float_t GetYL(){
194 // Returns particle Y position at this hit in local coordinates.
195 Float_t xf,yf,zf,tf;GetPositionL(xf,yf,zf,tf);return yf;}
196 virtual Float_t GetZL(){
197 // Returns particle Z position at this hit in local coordinates.
198 Float_t xf,yf,zf,tf;GetPositionL(xf,yf,zf,tf);return zf;}
200 // Get Monti Carlo information about hit.
201 virtual void GetMomentumG(Float_t &px,Float_t &py,Float_t &pz)const {
202 // returns the particle momentum in the Global frame
203 px=fPx;py=fPy;pz=fPz;return;};
204 virtual void GetMomentumG(Double_t &px,Double_t &py,Double_t &pz)const {
205 // returns the particle momentum in the Global frame
206 px=fPx;py=fPy;pz=fPz;return;};
207 virtual Float_t GetPXG()const {// Returns particle X momentum at this hit
208 // in global coordinates.
210 virtual Float_t GetPYG()const {// Returns particle Y momentum at
211 // this hit in global coordinates.
213 virtual Float_t GetPZG()const {// Returns particle Z momentum at
214 // this hit in global coordinates.
216 // Returns particle Z momentum at this hit in local coordinates.
217 virtual TParticle * GetParticle() const; // Returns ptr to this particle.
218 Bool_t StatusInside() const {// checks if the particle is "inside"
219 if((fStatus&0x0001)==0) return kFALSE;else return kTRUE;}
220 Bool_t StatusEntering() const {// checks if the particle is "entering"
221 if((fStatus&0x0002)==0) return kFALSE;else return kTRUE;}
222 Bool_t StatusExiting() const {// checks if the particle is "exiting"
223 if((fStatus&0x0004)==0) return kFALSE;else return kTRUE;}
224 Bool_t StatusOut() const {// checks if the particle is "out"
225 if((fStatus&0x0008)==0) return kFALSE;else return kTRUE;}
226 Bool_t StatusDisappeared() const {// checks if the part. is "disappeared"
227 if((fStatus&0x00010)==0) return kFALSE;else return kTRUE;}
228 Bool_t StatusStop() const {// checks if the particle is "stopped"
229 if((fStatus&0x00020)==0) return kFALSE;else return kTRUE;}
230 Bool_t StatusAlive() const {// checks if the particle is "alive"
231 if((fStatus&0x00030)==0) return kFALSE;else return kTRUE;}
232 // Prints out the content of this class in ASCII format.
233 void Print(ostream *os) const;
234 // Reads in the content of this class in the format of Print
235 void Read(istream *is);
236 virtual void Print(Option_t *option="") const {TObject::Print(option);}
237 virtual Int_t Read(const char *name) {return TObject::Read(name);}
241 Int_t fStatus; // Track Status
242 Int_t fModule; // Module number
243 Float_t fPx; // PX of particle at the point of the hit
244 Float_t fPy; // PY of particle at the point of the hit
245 Float_t fPz; // PZ of particle at the point of the hit
246 Float_t fDestep; // Energy deposited in the current step
247 Float_t fTof; // Time of flight at the point of the hit
248 Int_t fStatus0;// Track Status of Starting point
249 Float_t fx0; // Starting point of this step
250 Float_t fy0; // Starting point of this step
251 Float_t fz0; // Starting point of this step
252 Float_t ft0; // Starting point of this step
254 ClassDef(AliITShit,3) //Hits object for set:ITS
257 // Input and output function for standard C++ input/output.
258 ostream& operator<<(ostream &os,AliITShit &source);
259 istream& operator>>(istream &os,AliITShit &source);