1 #ifndef ALITPCTRACKHITSV2_H
2 #define ALITPCTRACKHITSV2_H
3 /* Copyright(c) 1998-1999, ALICE Experiment at CERN, All rights reserved. *
4 * See cxx source for full Copyright notice */
7 ////////////////////////////////////////////////
8 // Manager class for TPC hits //
9 ////////////////////////////////////////////////
13 #include "TClonesArray.h"
17 class AliTPCTempHitInfoV2;
18 class AliTPCCurrentHitV2;
21 class AliTrackHitsParamV2 : public TObject {
25 AliTrackHitsParamV2();
27 AliTrackHitsParamV2(const AliTrackHitsParamV2 &hit): TObject(hit),
42 AliTrackHitsParamV2& operator = (const AliTrackHitsParamV2 &hit)
43 {hit.Copy(*this); return (*this);}
44 ~AliTrackHitsParamV2();
46 Int_t GetTrackID() const {return fTrackID;}
47 Int_t GetVolumeID() const {return fVolumeID;}
48 Float_t GetR() const {return fR;}
49 Float_t GetZ() const {return fZ;}
50 Float_t GetFi() const {return fFi;}
51 Float_t GetAn() const {return fAn;}
52 Float_t GetAd() const {return fAd;}
53 Float_t GetTheta() const {return fTheta;}
54 Float_t GetThetaD() const {return fThetaD;}
55 Int_t GetNHits() const {return fNHits;}
57 Short_t HitDistance(Int_t i) const {return fHitDistance[i];}
58 Short_t Charge(Int_t i) const {return fCharge[i];}
59 Short_t Time(Int_t i) const {return fTime[i];}
61 Short_t& HitDistance(Int_t i) {return fHitDistance[i];}
62 Short_t& Charge(Int_t i) {return fCharge[i];}
63 Short_t& Time(Int_t i) {return fTime[i];}
65 void SetHitDistance(Int_t i)
66 {Short_t *s=new Short_t[i];
67 delete [] fHitDistance; fHitDistance=s;}
69 void SetCharge(Int_t i)
70 {Short_t *s=new Short_t[i];
71 delete [] fCharge; fCharge=s;}
74 {Short_t *s=new Short_t[i];
75 delete [] fTime; fTime=s;}
77 void ResizeHitDistance(Int_t i)
78 {Short_t *s=new Short_t[i];
79 memcpy(s, fHitDistance, sizeof(Short_t)*i);
80 delete [] fHitDistance; fHitDistance=s;}
82 void ResizeCharge(Int_t i)
83 {Short_t *s=new Short_t[i];
84 memcpy(s, fCharge, sizeof(Short_t)*i);
85 delete [] fCharge; fCharge=s;}
87 void ResizeTime(Int_t i)
88 {Short_t *s=new Short_t[i];
89 memcpy(s, fTime, sizeof(Short_t)*i);
90 delete [] fTime; fTime=s;}
92 void SetTrackID(Int_t id) {fTrackID=id;}
93 void SetVolumeID(Short_t id) {fVolumeID=id;}
94 void SetR(Float_t r) {fR=r;}
95 void SetZ(Float_t z) {fZ=z;}
96 void SetFi(Float_t fi) {fFi=fi;}
97 void SetAn(Float_t an) {fAn=an;}
98 void SetAd(Float_t ad) {fAd=ad;}
99 void SetTheta(Float_t t) {fTheta=t;}
100 void SetThetaD(Float_t t) {fThetaD=t;}
101 void SetNHits(Int_t n) {fNHits=n;}
106 Int_t fTrackID; // ID of the trac©k
107 Short_t fVolumeID;// volume ID
109 Float_t fZ; //z position
110 Float_t fFi; //radial angle
111 Float_t fAn; //angle with the radial vector
112 Float_t fAd; //derivation of angle
113 Float_t fTheta; //theta angle
114 Float_t fThetaD; //theta angle derivation
115 Int_t fNHits; //nuber of thits
116 Short_t * fHitDistance; //[fNHits] array of hits distances
117 Short_t * fCharge; //[fNHits] array of charges
118 Short_t * fTime; //[fNHits] array of hits time
119 static Int_t fgCounter1; //First internal counter
120 static Int_t fgCounter2; // Second internal counter
122 void Copy(TObject &) const
123 {Error("Copy","Not Implemented");}
125 ClassDef(AliTrackHitsParamV2,2)
129 class AliTPCTrackHitsV2 : public TObject {
133 ~AliTPCTrackHitsV2();
134 AliTPCTrackHitsV2(const AliTPCTrackHitsV2 &hit): TObject(hit),
137 fPrecision(hit.fPrecision),
139 fMaxDistance(hit.fMaxDistance),
140 fNVolumes(hit.fNVolumes),
142 fTempInfo(hit.fTempInfo),
143 fCurrentHit(hit.fCurrentHit),
149 (*fArray) = (*hit.fArray);
152 fVolumes = new Int_t[fNVolumes];
153 memcpy(fVolumes,hit.fVolumes,fNVolumes*sizeof(Int_t));
155 AliTPCTrackHitsV2& operator = (const AliTPCTrackHitsV2 &hit)
158 TObject::operator=(hit);
160 fPrecision=hit.fPrecision;
162 fMaxDistance=hit.fMaxDistance;
163 fNVolumes=hit.fNVolumes;
164 fTempInfo=hit.fTempInfo;
165 fCurrentHit=hit.fCurrentHit;
170 (*fArray)=(*hit.fArray);
173 fVolumes = new Int_t[fNVolumes];
174 memcpy(fVolumes,hit.fVolumes,fNVolumes*sizeof(Int_t));
182 void Clear(Option_t * /*option*/ ="");
183 void AddHitKartez(Int_t volumeID, Int_t trackID, Double_t x,
184 Double_t y, Double_t z,Int_t q,Float_t time);
185 void AddHit(Int_t volumeID, Int_t trackID, Double_t r,
186 Double_t z, Double_t fi,Int_t q,Float_t time);
188 Bool_t First(); //set current hit to first hit
189 Bool_t Next(); //set current hit to next
190 AliHit * GetHit() const;
191 AliTrackHitsParamV2 * GetParam();
193 TClonesArray * GetArray(){return fArray;}
194 Int_t GetEntriesFast() const { return fSize;}
195 void SetHitPrecision(Double_t prec) {fPrecision=prec;}
196 void SetStepPrecision(Double_t prec) {fStep=prec;}
197 void SetMaxDistance(UInt_t distance) {fMaxDistance = distance;}
198 Bool_t FlushHitStack(Bool_t force=kTRUE); //
199 Int_t * GetVolumes(){ return fVolumes;}
200 Int_t GetNVolumes() const {return fNVolumes;}
201 static Double_t GetKPrecision() {return fgkPrecision;}
202 static Double_t GetKPrecision2() {return fgkPrecision2;}
205 void AddVolume(Int_t volume); //add volumes to tthe list of volumes
206 void FlushHitStack2(Int_t index1, Int_t index2); //
209 TClonesArray * fArray; //array of compressed hits
210 Int_t fSize; //total number of hits in track
211 Double_t fPrecision; // required precision
212 Double_t fStep; //unit step size
213 UInt_t fMaxDistance; //maximal distance between two connected hits
214 Int_t fNVolumes; //number of volumes in track
215 Int_t * fVolumes; //[fNVolumes] list of volumes
216 AliTPCTempHitInfoV2 * fTempInfo; //!information about track
217 AliTPCCurrentHitV2 * fCurrentHit; //!information about current hit
218 AliHit * fHit; //! current hit information
219 static const Double_t fgkPrecision; //precision
220 static const Double_t fgkPrecision2; //precision
221 static const Double_t fgkTimePrecision; //hit time precision
222 static Int_t fgCounter1; // First internal counter
223 static Int_t fgCounter2; // Second internal counter
226 void Copy(TObject &) const
227 {Error("Copy","Not Implemented");}
230 ClassDef(AliTPCTrackHitsV2,2)
233 class AliTPCCurrentHitV2 {
235 Int_t GetStackIndex() const {return fStackIndex;}
236 void SetStackIndex(Int_t i) {fStackIndex=i;}
237 Int_t GetParamIndex() const {return fParamIndex;}
238 void SetParamIndex(Int_t i) {fParamIndex=i;}
239 Double_t GetR() const {return fR;}
240 void SetR(Double_t r) {fR=r;}
241 Bool_t GetStatus() const {return fStatus;}
242 void SetStatus(Bool_t s) {fStatus=s;}
244 Int_t fParamIndex;// - current param pointer
245 Int_t fStackIndex; // - current hit stack index
246 Double_t fR; //current Radius
247 Bool_t fStatus; //current status
252 #endif //ALITPCTRACKHITSV2_H