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