Defining properly momentum components in AliMUONHit constructors (thanks Artur)
[u/mrichter/AliRoot.git] / TPC / AliTPC.h
CommitLineData
73042f01 1#ifndef ALITPC_H
2#define ALITPC_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$ */
7
fe4da5cc 8////////////////////////////////////////////////
9// Manager class for TPC //
10////////////////////////////////////////////////
fe4da5cc 11#include "AliDetector.h"
12#include "AliHit.h"
13#include "AliDigit.h"
9bdd974b 14//#include "TLorentzVector.h"
da33556f 15
9bdd974b 16//#include "AliTPCLoader.h"
fe4da5cc 17
73042f01 18
2b06d5c3 19class TMatrix;
de61d5d5 20class AliTPCFastMatrix; //MI change
21class AliTPCFastVector; //MI change
22
2b06d5c3 23class TTree;
cc80f89e 24
2b06d5c3 25class TFile;
26class AliTPCParam;
cc80f89e 27class AliTPCDigitsArray;
28class AliTPCClustersArray;
792bb11c 29class AliTPCTrackHitsV2; // M.I.
30class AliTPCTrackHits; // M.I. -MI4 old hits - to be removed later
9bdd974b 31//class TLorentzVector;
32class AliTPCLoader;
792bb11c 33
fe4da5cc 34
35class AliTPC : public AliDetector {
1283eee5 36
fe4da5cc 37public:
9bdd974b 38 AliTPC();
fe4da5cc 39 AliTPC(const char *name, const char *title);
9bdd974b 40 AliTPC(const AliTPC& t);
88cb7938 41
42 virtual AliLoader* MakeLoader(const char* topfoldername);
43
fe4da5cc 44 virtual ~AliTPC();
73042f01 45 virtual void AddHit(Int_t a1, Int_t *a2, Float_t *a3);
9bdd974b 46 Int_t DistancetoPrimitive(Int_t px, Int_t py) const;
fe4da5cc 47 virtual void BuildGeometry();
48 virtual void CreateGeometry() {}
49 virtual void CreateMaterials();
c630aafd 50 virtual void Hits2Clusters(Int_t eventn=0);
cc80f89e 51 virtual void Hits2ExactClustersSector(Int_t isec); // MI change calculate "exact" cluster position
0a61bf9d 52
9bdd974b 53 virtual AliDigitizer* CreateDigitizer(AliRunDigitizer* manager) const;
0a61bf9d 54 virtual void SDigits2Digits(){;} //MI change -cycling to production
55 virtual void SDigits2Digits2(Int_t eventnumber=0);
56
57 virtual void Hits2SDigits(); // MI - cycling around
58 virtual void Hits2SDigits2(Int_t eventnumber=0);
59
a62d28a2 60 virtual void Digits2Reco(Int_t firstevent=0,Int_t lastevent=0);
85a5290f 61 virtual void Hits2Digits();
62 virtual void Hits2Digits(Int_t eventnumber); //MI change
2ab0c725 63 virtual void Hits2DigitsSector(Int_t isec); //MI change
fe4da5cc 64 virtual void Init();
65 virtual Int_t IsVersion() const =0;
9bdd974b 66 virtual void Digits2Clusters(Int_t eventnumber=0) const;
67 virtual void Clusters2Tracks() const;
cc80f89e 68
596a855f 69 virtual void Reconstruct() const;
70 virtual AliTracker* CreateTracker() const;
71 virtual void FillESD(AliESD* esd) const;
72
9bdd974b 73 Int_t GetNsectors() const {return fNsectors;}
88cb7938 74 virtual void MakeBranch(Option_t *opt=" ");
fe4da5cc 75 virtual void ResetDigits();
76 virtual void SetSecAL(Int_t sec);
77 virtual void SetSecAU(Int_t sec);
78 virtual void SetSecLows(Int_t s1,Int_t s2,Int_t s3,Int_t s4,Int_t s5, Int_t s6);
79 virtual void SetSecUps (Int_t s1,Int_t s2,Int_t s3,Int_t s4,Int_t s5, Int_t s6,
88cb7938 80 Int_t s7,Int_t s8,Int_t s9,Int_t s10, Int_t s11, Int_t s12);
fe4da5cc 81 virtual void SetSens(Int_t sens);
cc80f89e 82
4b0fdcad 83
84 virtual void SetSide(Float_t side);
1283eee5 85 virtual void SetGasMixt(Int_t nc,Int_t c1,Int_t c2,Int_t c3,Float_t p1,
86 Float_t p2,Float_t p3);
87
fe4da5cc 88 virtual void StepManager()=0;
8c555625 89 virtual void DrawDetector() {}
cc80f89e 90 AliTPCDigitsArray* GetDigitsArray() {return fDigitsArray;} //MI change
91 AliTPCClustersArray* GetClustersArray(){return fClustersArray;} //MI change
92 AliTPCParam *GetParam(){return fTPCParam;} // M.K, M.I changes
93 void SetParam(AliTPCParam *param){fTPCParam=param;} // M.K, M.I changes
94 void SetDigitsArray(AliTPCDigitsArray* param) {fDigitsArray=param;} //MI change
95 void SetClustersArray(AliTPCClustersArray *clusters) {fClustersArray = clusters;} //MI change
39c8eb58 96
97// additional function neccesary for the new hits
9e1a0ddb 98 virtual void MakeBranch2(Option_t *opt=" ", const char *file=0); //
39c8eb58 99 virtual void SetTreeAddress();
100 virtual void SetTreeAddress2();
101 virtual void AddHit2(Int_t a1, Int_t *a2, Float_t *a3); //
102 virtual void ResetHits();
103 virtual void ResetHits2();
104 virtual AliHit* FirstHit(Int_t track);
105 virtual AliHit* NextHit();
106 virtual AliHit* FirstHit2(Int_t track);
107 virtual AliHit* NextHit2();
39c8eb58 108 virtual void LoadPoints(Int_t dummy);
109 virtual void LoadPoints2(Int_t dummy);
110 virtual void LoadPoints3(Int_t dumy);
111 virtual void FinishPrimary();
112 virtual void RemapTrackHitIDs(Int_t *map);
113 virtual void FindTrackHitsIntersection(TClonesArray * arr);
114 //fill clones array with intersection of current point with the
115 //middle of the row
116 void SetHitType(Int_t type){fHitType =type;} //set type of hit container
f8cf550c 117 void SetDigitsSwitch(Int_t sw){fDigitsSwitch = sw;}
afc42102 118 void SetDefSwitch(Int_t def){fDefaults = def;}
407ff276 119 Float_t GetNoise(); //get Current noise
120 void GenerNoise(Int_t tablasize); // make noise table
9bdd974b 121 Bool_t IsSectorActive(Int_t sec) const; // check if the sector is active
792bb11c 122 void SetActiveSectors(Int_t * sectors, Int_t n); //set active sectors
9bdd974b 123 Int_t GetHitType() const {return fHitType;}
12d8d654 124 void SetActiveSectors(Int_t flag=0); //loop over al hits and set active only hitted sectors
42157e55 125
126// static functions
9bdd974b 127 static AliTPCParam* LoadTPCParam(TFile *file);
128protected:
129 Int_t fDefaults; // defaults switch
130 Int_t fSens; // ISENS
131 Int_t fSecAL; // Upper sector selector
132 Int_t fSecAU; // Lower sector selector
133 Int_t fSecLows[6]; // List of lower sectors selected
134 Int_t fSecUps[12]; // List of upper sectors selected
135 Int_t fNsectors; // Number of sectors in TPC
136 //MI changes
137 AliTPCDigitsArray * fDigitsArray; //!detector digit object
138 AliTPCClustersArray * fClustersArray; //!detector cluster object
139 AliTPCParam *fTPCParam; // pointer to TPC parameters
140 AliTPCTrackHitsV2 *fTrackHits; //!hits for given track M.I.
141 AliTPCTrackHits *fTrackHitsOld; //!hits for given track M.I. MIold -
142
143 Int_t fHitType; // if fNewHit = 1 old data structure if 2 new hits if 4 old MI stucture
144 // 3 both types
145 Int_t fDigitsSwitch; // digits type, 0->normal, 1->summable
146
147 //MK changes
148
149 Float_t fSide; // selects left(-1), right(+1), or both(0) sides of the TPC
150 Int_t fNoComp; // number of a drift gas components
151 Int_t fMixtComp[3]; // drift gas components
152 Float_t fMixtProp[3]; // mixture proportions
42157e55 153
154 private:
fe4da5cc 155 //
792bb11c 156 Bool_t TrackInVolume(Int_t id,Int_t track); //return true if current track is in volume
afc42102 157 void SetDefaults();
8c555625 158 void DigitizeRow(Int_t irow,Int_t isec,TObjArray **rowTriplet);
de61d5d5 159 Float_t GetSignal(TObjArray *p1, Int_t ntr, AliTPCFastMatrix *m1,
160 AliTPCFastMatrix *m2,Int_t *IndexRange);
161 void GetList (Float_t label,Int_t np,AliTPCFastMatrix *m,Int_t *IndexRange,
8c555625 162 Float_t **pList);
163 void MakeSector(Int_t isec,Int_t nrows,TTree *TH,Stat_t ntracks,TObjArray **row);
cc80f89e 164 void TransportElectron(Float_t *xyz, Int_t *index);
165 Int_t fCurrentIndex[4];// index[0] indicates coordinate system,
166 // index[1] sector number,
167 // index[2] pad row number
168 // index[3] pad row number for which signal is calculated
407ff276 169 Int_t fNoiseDepth; //!noise table
170 Float_t * fNoiseTable; //![fNoiseDepth] table with noise
171 Int_t fCurrentNoise; //!index of the noise in the noise table
792bb11c 172 Bool_t* fActiveSectors; //!bool indicating which sectors are active
407ff276 173
88cb7938 174 ClassDef(AliTPC,10) // Time Projection Chamber class
fe4da5cc 175};
176
fe4da5cc 177
178//_____________________________________________________________________________
179
180class AliTPCdigit : public AliDigit {
181public:
182 Int_t fSector; //array of volumes
183 Int_t fPadRow; //Row number
184 Int_t fPad ; //Pad number
185 Int_t fTime; //Time bucket
186 Int_t fSignal; //Signal amplitude
187
188public:
189 AliTPCdigit() {}
190 AliTPCdigit(Int_t *tracks, Int_t *digits);
191 virtual ~AliTPCdigit() {}
192
193 ClassDef(AliTPCdigit,1) // Time Projection Chamber digits
194};
195
196
197//_____________________________________________________________________________
198
199class AliTPChit : public AliHit {
200public:
201 Int_t fSector; //sector number
202 Int_t fPadRow; //Pad Row number
203 Float_t fQ ; //charge
204
205public:
206 AliTPChit() {}
207 AliTPChit(Int_t shunt, Int_t track, Int_t *vol, Float_t *hits);
208 virtual ~AliTPChit() {}
39c8eb58 209 void SetX(Float_t x){fX = x;}
210 void SetY(Float_t y){fY = y;}
211 void SetZ(Float_t z){fZ = z;}
fe4da5cc 212
213 ClassDef(AliTPChit,1) // Time Projection Chamber hits
214};
3c0f9266 215
73042f01 216#endif
fe4da5cc 217
fe4da5cc 218
3c0f9266 219
fe4da5cc 220
fe4da5cc 221
fe4da5cc 222
fe4da5cc 223
fe4da5cc 224
fe4da5cc 225