coverity fix
[u/mrichter/AliRoot.git] / TPC / AliTPCTrackHitsV2.h
CommitLineData
f641f6bd 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 */
5
6/* $Id$ */
7////////////////////////////////////////////////
8// Manager class for TPC hits //
9////////////////////////////////////////////////
018a927a 10//
f641f6bd 11
12#include "TObject.h"
13
14class TClonesArray;
f641f6bd 15class AliTPChit;
16class AliTPCTempHitInfoV2;
17class AliTPCCurrentHitV2;
fce0283f 18class AliHit;
f641f6bd 19
20class AliTrackHitsParamV2 : public TObject {
9b1855ba 21
179c6296 22
f641f6bd 23public:
24 AliTrackHitsParamV2();
179c6296 25
26 AliTrackHitsParamV2(const AliTrackHitsParamV2 &hit): TObject(hit),
27 fTrackID(0),
28 fVolumeID(0),
29 fR(0.),
30 fZ(0.),
31 fFi(0.),
32 fAn(0.),
33 fAd(0.),
34 fTheta(0.),
35 fThetaD(0.),
36 fNHits(0),
37 fHitDistance(0),
38 fCharge(0),
39 fTime(0)
53110b9d 40 {hit.Copy(*this);}
41 AliTrackHitsParamV2& operator = (const AliTrackHitsParamV2 &hit)
42 {hit.Copy(*this); return (*this);}
f641f6bd 43 ~AliTrackHitsParamV2();
53110b9d 44
b9671574 45 Int_t GetTrackID() const {return fTrackID;}
46 Int_t GetVolumeID() const {return fVolumeID;}
47 Float_t GetR() const {return fR;}
48 Float_t GetZ() const {return fZ;}
49 Float_t GetFi() const {return fFi;}
50 Float_t GetAn() const {return fAn;}
51 Float_t GetAd() const {return fAd;}
52 Float_t GetTheta() const {return fTheta;}
53 Float_t GetThetaD() const {return fThetaD;}
54 Int_t GetNHits() const {return fNHits;}
55
56 Short_t HitDistance(Int_t i) const {return fHitDistance[i];}
57 Short_t Charge(Int_t i) const {return fCharge[i];}
58 Short_t Time(Int_t i) const {return fTime[i];}
59
60 Short_t& HitDistance(Int_t i) {return fHitDistance[i];}
61 Short_t& Charge(Int_t i) {return fCharge[i];}
62 Short_t& Time(Int_t i) {return fTime[i];}
63
64 void SetHitDistance(Int_t i)
65 {Short_t *s=new Short_t[i];
66 delete [] fHitDistance; fHitDistance=s;}
67
68 void SetCharge(Int_t i)
69 {Short_t *s=new Short_t[i];
70 delete [] fCharge; fCharge=s;}
71
72 void SetTime(Int_t i)
73 {Short_t *s=new Short_t[i];
74 delete [] fTime; fTime=s;}
75
76 void ResizeHitDistance(Int_t i)
77 {Short_t *s=new Short_t[i];
78 memcpy(s, fHitDistance, sizeof(Short_t)*i);
79 delete [] fHitDistance; fHitDistance=s;}
80
81 void ResizeCharge(Int_t i)
82 {Short_t *s=new Short_t[i];
83 memcpy(s, fCharge, sizeof(Short_t)*i);
84 delete [] fCharge; fCharge=s;}
85
86 void ResizeTime(Int_t i)
87 {Short_t *s=new Short_t[i];
88 memcpy(s, fTime, sizeof(Short_t)*i);
89 delete [] fTime; fTime=s;}
90
91 void SetTrackID(Int_t id) {fTrackID=id;}
92 void SetVolumeID(Short_t id) {fVolumeID=id;}
93 void SetR(Float_t r) {fR=r;}
94 void SetZ(Float_t z) {fZ=z;}
95 void SetFi(Float_t fi) {fFi=fi;}
96 void SetAn(Float_t an) {fAn=an;}
97 void SetAd(Float_t ad) {fAd=ad;}
98 void SetTheta(Float_t t) {fTheta=t;}
99 void SetThetaD(Float_t t) {fThetaD=t;}
100 void SetNHits(Int_t n) {fNHits=n;}
101
af05e6c8 102 Float_t Eta() const;
103
9b1855ba 104 private:
b9671574 105 Int_t fTrackID; // ID of the trac┬ęk
f641f6bd 106 Short_t fVolumeID;// volume ID
107 Float_t fR; //radius
108 Float_t fZ; //z position
109 Float_t fFi; //radial angle
110 Float_t fAn; //angle with the radial vector
111 Float_t fAd; //derivation of angle
112 Float_t fTheta; //theta angle
113 Float_t fThetaD; //theta angle derivation
114 Int_t fNHits; //nuber of thits
115 Short_t * fHitDistance; //[fNHits] array of hits distances
116 Short_t * fCharge; //[fNHits] array of charges
e61fd20d 117 Short_t * fTime; //[fNHits] array of hits time
53110b9d 118 static Int_t fgCounter1; //First internal counter
119 static Int_t fgCounter2; // Second internal counter
120
121 void Copy(TObject &) const
122 {Error("Copy","Not Implemented");}
123
e61fd20d 124 ClassDef(AliTrackHitsParamV2,2)
f641f6bd 125};
126
127
f641f6bd 128class AliTPCTrackHitsV2 : public TObject {
53110b9d 129
f641f6bd 130public:
179c6296 131 AliTPCTrackHitsV2();
f641f6bd 132 ~AliTPCTrackHitsV2();
179c6296 133 AliTPCTrackHitsV2(const AliTPCTrackHitsV2 &hit): TObject(hit),
134 fArray(0),
135 fSize(0),
136 fPrecision(0.),
137 fStep(0.),
138 fMaxDistance(0),
139 fNVolumes(0),
140 fVolumes(0),
141 fTempInfo(0),
142 fCurrentHit(0),
143 fHit(0)
53110b9d 144 {hit.Copy(*this);}
145 AliTPCTrackHitsV2& operator = (const AliTPCTrackHitsV2 &hit)
146 {hit.Copy(*this); return (*this);}
5f6e636c 147 void Clear(Option_t * /*option*/ ="");
f641f6bd 148 void AddHitKartez(Int_t volumeID, Int_t trackID, Double_t x,
e61fd20d 149 Double_t y, Double_t z,Int_t q,Float_t time);
f641f6bd 150 void AddHit(Int_t volumeID, Int_t trackID, Double_t r,
e61fd20d 151 Double_t z, Double_t fi,Int_t q,Float_t time);
f641f6bd 152
153 Bool_t First(); //set current hit to first hit
154 Bool_t Next(); //set current hit to next
53110b9d 155 AliHit * GetHit() const;
f641f6bd 156 AliTrackHitsParamV2 * GetParam();
157
158 TClonesArray * GetArray(){return fArray;}
53110b9d 159 Int_t GetEntriesFast() const { return fSize;}
f641f6bd 160 void SetHitPrecision(Double_t prec) {fPrecision=prec;}
161 void SetStepPrecision(Double_t prec) {fStep=prec;}
162 void SetMaxDistance(UInt_t distance) {fMaxDistance = distance;}
163 Bool_t FlushHitStack(Bool_t force=kTRUE); //
164 Int_t * GetVolumes(){ return fVolumes;}
53110b9d 165 Int_t GetNVolumes() const {return fNVolumes;}
b9671574 166 static Double_t GetKPrecision() {return fgkPrecision;}
167 static Double_t GetKPrecision2() {return fgkPrecision2;}
53110b9d 168
f641f6bd 169public:
170 void AddVolume(Int_t volume); //add volumes to tthe list of volumes
171 void FlushHitStack2(Int_t index1, Int_t index2); //
53110b9d 172
173protected:
f641f6bd 174 TClonesArray * fArray; //array of compressed hits
175 Int_t fSize; //total number of hits in track
176 Double_t fPrecision; // required precision
177 Double_t fStep; //unit step size
178 UInt_t fMaxDistance; //maximal distance between two connected hits
179 Int_t fNVolumes; //number of volumes in track
180 Int_t * fVolumes; //[fNVolumes] list of volumes
181 AliTPCTempHitInfoV2 * fTempInfo; //!information about track
182 AliTPCCurrentHitV2 * fCurrentHit; //!information about current hit
fce0283f 183 AliHit * fHit; //! current hit information
f641f6bd 184 static const Double_t fgkPrecision; //precision
185 static const Double_t fgkPrecision2; //precision
e61fd20d 186 static const Double_t fgkTimePrecision; //hit time precision
53110b9d 187 static Int_t fgCounter1; // First internal counter
188 static Int_t fgCounter2; // Second internal counter
189
190private:
191 void Copy(TObject &) const
192 {Error("Copy","Not Implemented");}
193
194
e61fd20d 195 ClassDef(AliTPCTrackHitsV2,2)
f641f6bd 196};
197
b9671574 198class AliTPCCurrentHitV2 {
199public:
200 Int_t GetStackIndex() const {return fStackIndex;}
201 void SetStackIndex(Int_t i) {fStackIndex=i;}
202 Int_t GetParamIndex() const {return fParamIndex;}
203 void SetParamIndex(Int_t i) {fParamIndex=i;}
204 Double_t GetR() const {return fR;}
205 void SetR(Double_t r) {fR=r;}
206 Bool_t GetStatus() const {return fStatus;}
207 void SetStatus(Bool_t s) {fStatus=s;}
208private:
45bcf167 209 Int_t fParamIndex;// - current param pointer
210 Int_t fStackIndex; // - current hit stack index
fce0283f 211 Double_t fR; //current Radius
212 Bool_t fStatus; //current status
213};
214
215
f641f6bd 216
217#endif //ALITPCTRACKHITSV2_H