store also difference in local Y
[u/mrichter/AliRoot.git] / ITS / AliITShit.h
CommitLineData
b2340bbf 1#ifndef ALIITSHIT_H
2#define ALIITSHIT_H
3da30618 3/* Copyright(c) 1998-1999, ALICE Experiment at CERN, All rights reserved. *
4 * See cxx source for full Copyright notice */
5
6/* $Id$ */
58005f18 7
58005f18 8////////////////////////////////////////////////////////////////////////
9// Version: 0
10// Written by Rene Brun, Federico Carminati, and Roberto Barbera
11//
12// Version: 1
13// Modified and documented by Bjorn S. Nilsen
14// July 11 1999
15//
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
19// detector.
20//
21// Data members:
22//
23// Int_t fTrack
24// See AliHit for a full description. The track number of the track
25// that made this hit.
26//
27// Float_t fX
28// See AliHit for a full description. The global x position of the
29// hit (in the standard units of the Monte Carlo).
30//
31// Float_t fY
32// See AliHit for a full description. The global y position of the
33// hit (in the standard units of the Monte Carlo).
34//
35// Float_t fZ
36// See AliHit for a full description. The global z position of the
37// hit (in the standard units of the Monte Carlo).
38//
39// Int_t fStatus
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.
47//
48// Int_t fLayer
49// The layer number of the detector that contains this hit. See
50// AliITSgeom and AliITSv? for a description of the geometry.
51//
52// Int_t fLadder
53// The ladder number of the detector that contains this hit. See
54// AliITSgeom and AliITSv? for a description of the geometry.
55//
56// Int_t fDet
57// The detector number of the detector that contains this hit. See
58// AliITSgeom and AliITSv? for a description of the geometry.
59//
60// Float_t fPx
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.
64//
65// Float_t fPy
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.
69//
70// Float_t fPz
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.
74//
75// Float_t fDestep
76// The energy lost by the particle during the step ending in this
77// hit. The units are those determined by the Monte Carlo.
78//
79// Float_t fTof
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.
84//
85//
58005f18 86////////////////////////////////////////////////////////////////////////
012f0f4c 87#include <TLorentzVector.h>
33da2552 88
89#include "AliHit.h"
90
33da2552 91class TParticle;
92
5e2539d9 93using std::istream;
33da2552 94class AliITShit : public AliHit {
58005f18 95
58005f18 96 public:
7e3ded1b 97 AliITShit();// Default consrtructor
98 // Old Standard Constructor
58005f18 99 AliITShit(Int_t shunt, Int_t track, Int_t *vol, Float_t *hits);
7e3ded1b 100 // New Standard Constructor
101 AliITShit(Int_t shunt,Int_t track,Int_t *vol,Float_t edep,Float_t tof,
012f0f4c 102 TLorentzVector &x,TLorentzVector &x0,TLorentzVector &p);
103 // Copy Constructor
104 AliITShit(const AliITShit &h);
105 // Equals operator
106 AliITShit& operator=(const AliITShit &h);
7e3ded1b 107 // Default destructor
012f0f4c 108 virtual ~AliITShit() {};
58005f18 109 // Get Hit information functions.
593d2ea1 110 // virtual int GetTrack() const {return fTrack;} // define in AliHit
111 // virtual void SetTrack(int track) const {fTrack=track;) // AliHit
012f0f4c 112 virtual void SetModule(Int_t mod){fModule=mod;};
113 virtual void SetShunt(Int_t shunt);
114 virtual void SetPosition(TLorentzVector &x){fX=x.X();fY=x.Y();fZ=x.Z();}
115 virtual void SetStartPosition(TLorentzVector &x){fx0=x.X();fy0=x.Y();
116 fz0=x.Z();}
117 virtual void SetTime(Float_t t){fTof = t;}
118 virtual void SetStartTime(Float_t t){ft0 = t;}
119 virtual void SetStatus(Int_t stat){fStatus = stat;}
120 virtual void SetStartStatus(Int_t stat){fStatus0 = stat;}
121 virtual void SetEdep(Float_t de){fDestep = de;}
71f80067 122 virtual void SetMomentum(TLorentzVector &p){fPx=p.Px();fPy=p.Py();
012f0f4c 123 fPz=p.Pz();}
3dbb2c95 124 virtual Int_t GetTrackStatus() const {//returns the status code
012f0f4c 125 return fStatus;}
7e3ded1b 126 virtual Int_t GetTrackStatus0() const {//returns the status code
012f0f4c 127 return fStatus0;}
128 virtual Int_t GetLayer() const{Int_t a,b,c;// returns the layer number
129 GetDetectorID(a,b,c); return a;}
130 virtual Int_t GetLadder() const{Int_t a,b,c;// returns the ladder number
131 GetDetectorID(a,b,c); return b;}
132 virtual Int_t GetDetector() const{Int_t a,b,c;//returns the detector number
133 GetDetectorID(a,b,c); return c;}
3dbb2c95 134 // returns the detector ID
012f0f4c 135 virtual void GetDetectorID(Int_t &layer,Int_t &ladder,Int_t &det)const;
136 virtual Int_t GetModule(){return fModule;};
137 virtual Float_t GetIonization() const {return fDestep;}//returns the Destep
58005f18 138 //
3dbb2c95 139 virtual void GetPositionG(Float_t &x,Float_t &y,Float_t &z)const {
012f0f4c 140 // returns the position in the Global frame
141 x=fX;y=fY;z=fZ;return;};
3dbb2c95 142 virtual void GetPositionG(Double_t &x,Double_t &y,Double_t &z)const {
012f0f4c 143 // returns the position in the Global frame
144 x=fX;y=fY;z=fZ;return;};
3dbb2c95 145 virtual Float_t GetTOF() const {// returns the time of flight
012f0f4c 146 return fTof;}
b2340bbf 147 // Returns particle 3 position at this hit in global coordinates.
3dbb2c95 148 virtual void GetPositionG(Float_t &x,Float_t &y,Float_t &z,Float_t &tof)
012f0f4c 149 const {// returns the position in the Global frame and the time of
150 // flight
151 x=fX;y=fY;z=fZ,tof=fTof;return;};
3dbb2c95 152 virtual void GetPositionG(Double_t &x,Double_t &y,Double_t &z,Double_t &t)
012f0f4c 153 const {// Returns particle 3 position and the time of flight at this
154 // hit in global coordinates.
155 x=fX;y=fY;z=fZ,t=fTof;return;};
3dbb2c95 156 virtual Float_t GetXG()const {// Returns particle X position at this hit
012f0f4c 157 // in global coordinates.
158 return fX;}
3dbb2c95 159 virtual Float_t GetYG()const {// Returns particle X position at this hit
012f0f4c 160 // in global coordinates.
161 return fY;}
3dbb2c95 162 virtual Float_t GetZG()const {// Returns particle Z position at this hit
012f0f4c 163 // in global coordinates.
164 return fZ;}
7e3ded1b 165 // Returns particle 3 position at this hit in global coordinates.
166 virtual void GetPositionG0(Float_t &x,Float_t &y,Float_t &z,Float_t &tof)
012f0f4c 167 const {// returns the initial position in the Global frame and the
168 // time of flight
169 x=fx0;y=fy0;z=fz0,tof=fTof;return;};
d2ace6e6 170 // Returns particle 3 position at this hit in global coordinates.
171 virtual void GetPositionG0(Double_t &x,Double_t &y,Double_t &z,
012f0f4c 172 Double_t &tof)const {
173 // returns the initial position in the Global frame and the
174 // time of flight
175 x=fx0;y=fy0;z=fz0,tof=fTof;return;};
176 virtual void GetPositionL(Float_t &x,Float_t &y,Float_t &z){
177 // Returns particle 3 position at this hit in local coordinates.
178 Float_t tf;GetPositionL(x,y,z,tf);}
3dbb2c95 179 virtual void GetPositionL(Float_t &x,Float_t &y,Float_t &z,Float_t &tof);
b2340bbf 180 virtual void GetPositionL(Double_t &x,Double_t &y,Double_t &z){
012f0f4c 181 // Returns particle 3 position at this hit in local coordinates.
182 Float_t xf,yf,zf,tf;GetPositionL(xf,yf,zf,tf);x=xf,y=yf;z=zf;}
3dbb2c95 183 virtual void GetPositionL(Double_t &x,Double_t &y,Double_t &z,Double_t &t){
012f0f4c 184 // Returns particle 3 position and the time of flight at this hit
185 // in local coordinates.
186 Float_t xf,yf,zf,tf;GetPositionL(xf,yf,zf,tf);x=xf,y=yf;z=zf;t=tf;}
d2ace6e6 187 // Returns particle 3 initial position and the time of flight at this hit
188 // in local coordinates.
012f0f4c 189 virtual void GetPositionL0(Double_t &x,Double_t &y,Double_t &z,
190 Double_t &t);
191 virtual Float_t GetXL(){
192 // Returns particle X position at this hit in local coordinates.
193 Float_t xf,yf,zf,tf;GetPositionL(xf,yf,zf,tf);return xf;}
194 virtual Float_t GetYL(){
195 // Returns particle Y position at this hit in local coordinates.
196 Float_t xf,yf,zf,tf;GetPositionL(xf,yf,zf,tf);return yf;}
197 virtual Float_t GetZL(){
198 // Returns particle Z position at this hit in local coordinates.
199 Float_t xf,yf,zf,tf;GetPositionL(xf,yf,zf,tf);return zf;}
6599f311 200
58005f18 201 // Get Monti Carlo information about hit.
3dbb2c95 202 virtual void GetMomentumG(Float_t &px,Float_t &py,Float_t &pz)const {
012f0f4c 203 // returns the particle momentum in the Global frame
204 px=fPx;py=fPy;pz=fPz;return;};
3dbb2c95 205 virtual void GetMomentumG(Double_t &px,Double_t &py,Double_t &pz)const {
012f0f4c 206 // returns the particle momentum in the Global frame
207 px=fPx;py=fPy;pz=fPz;return;};
3dbb2c95 208 virtual Float_t GetPXG()const {// Returns particle X momentum at this hit
012f0f4c 209 // in global coordinates.
210 return fPx;}
3dbb2c95 211 virtual Float_t GetPYG()const {// Returns particle Y momentum at
012f0f4c 212 // this hit in global coordinates.
213 return fPy;}
3dbb2c95 214 virtual Float_t GetPZG()const {// Returns particle Z momentum at
012f0f4c 215 // this hit in global coordinates.
216 return fPz;}
b2340bbf 217 // Returns particle Z momentum at this hit in local coordinates.
33da2552 218 virtual TParticle * GetParticle() const; // Returns ptr to this particle.
219 Bool_t StatusInside() const {// checks if the particle is "inside"
012f0f4c 220 if((fStatus&0x0001)==0) return kFALSE;else return kTRUE;}
33da2552 221 Bool_t StatusEntering() const {// checks if the particle is "entering"
012f0f4c 222 if((fStatus&0x0002)==0) return kFALSE;else return kTRUE;}
33da2552 223 Bool_t StatusExiting() const {// checks if the particle is "exiting"
012f0f4c 224 if((fStatus&0x0004)==0) return kFALSE;else return kTRUE;}
33da2552 225 Bool_t StatusOut() const {// checks if the particle is "out"
012f0f4c 226 if((fStatus&0x0008)==0) return kFALSE;else return kTRUE;}
33da2552 227 Bool_t StatusDisappeared() const {// checks if the part. is "disappeared"
012f0f4c 228 if((fStatus&0x00010)==0) return kFALSE;else return kTRUE;}
33da2552 229 Bool_t StatusStop() const {// checks if the particle is "stopped"
012f0f4c 230 if((fStatus&0x00020)==0) return kFALSE;else return kTRUE;}
33da2552 231 Bool_t StatusAlive() const {// checks if the particle is "alive"
012f0f4c 232 if((fStatus&0x00030)==0) return kFALSE;else return kTRUE;}
3dbb2c95 233 // Prints out the content of this class in ASCII format.
33da2552 234 void Print(ostream *os) const;
3dbb2c95 235 // Reads in the content of this class in the format of Print
236 void Read(istream *is);
d2f55a22 237 virtual void Print(Option_t *option="") const {TObject::Print(option);}
238 virtual Int_t Read(const char *name) {return TObject::Read(name);}
239
fc743205 240
241 protected:
242 Int_t fStatus; // Track Status
012f0f4c 243 Int_t fModule; // Module number
fc743205 244 Float_t fPx; // PX of particle at the point of the hit
245 Float_t fPy; // PY of particle at the point of the hit
246 Float_t fPz; // PZ of particle at the point of the hit
247 Float_t fDestep; // Energy deposited in the current step
248 Float_t fTof; // Time of flight at the point of the hit
7e3ded1b 249 Int_t fStatus0;// Track Status of Starting point
250 Float_t fx0; // Starting point of this step
251 Float_t fy0; // Starting point of this step
252 Float_t fz0; // Starting point of this step
253 Float_t ft0; // Starting point of this step
593d2ea1 254
012f0f4c 255 ClassDef(AliITShit,3) //Hits object for set:ITS
fc743205 256
3dbb2c95 257};
258// Input and output function for standard C++ input/output.
e11d9a3a 259ostream& operator<<(ostream &os,AliITShit &source);
260istream& operator>>(istream &os,AliITShit &source);
58005f18 261
262#endif