version 3 and all the old provision for that deleted. New default is version 1
[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
9bdd974b 69 Int_t GetNsectors() const {return fNsectors;}
88cb7938 70 virtual void MakeBranch(Option_t *opt=" ");
fe4da5cc 71 virtual void ResetDigits();
72 virtual void SetSecAL(Int_t sec);
73 virtual void SetSecAU(Int_t sec);
74 virtual void SetSecLows(Int_t s1,Int_t s2,Int_t s3,Int_t s4,Int_t s5, Int_t s6);
75 virtual void SetSecUps (Int_t s1,Int_t s2,Int_t s3,Int_t s4,Int_t s5, Int_t s6,
88cb7938 76 Int_t s7,Int_t s8,Int_t s9,Int_t s10, Int_t s11, Int_t s12);
fe4da5cc 77 virtual void SetSens(Int_t sens);
cc80f89e 78
4b0fdcad 79
80 virtual void SetSide(Float_t side);
1283eee5 81 virtual void SetGasMixt(Int_t nc,Int_t c1,Int_t c2,Int_t c3,Float_t p1,
82 Float_t p2,Float_t p3);
83
fe4da5cc 84 virtual void StepManager()=0;
8c555625 85 virtual void DrawDetector() {}
cc80f89e 86 AliTPCDigitsArray* GetDigitsArray() {return fDigitsArray;} //MI change
87 AliTPCClustersArray* GetClustersArray(){return fClustersArray;} //MI change
88 AliTPCParam *GetParam(){return fTPCParam;} // M.K, M.I changes
89 void SetParam(AliTPCParam *param){fTPCParam=param;} // M.K, M.I changes
90 void SetDigitsArray(AliTPCDigitsArray* param) {fDigitsArray=param;} //MI change
91 void SetClustersArray(AliTPCClustersArray *clusters) {fClustersArray = clusters;} //MI change
39c8eb58 92
93// additional function neccesary for the new hits
9e1a0ddb 94 virtual void MakeBranch2(Option_t *opt=" ", const char *file=0); //
39c8eb58 95 virtual void SetTreeAddress();
96 virtual void SetTreeAddress2();
97 virtual void AddHit2(Int_t a1, Int_t *a2, Float_t *a3); //
98 virtual void ResetHits();
99 virtual void ResetHits2();
100 virtual AliHit* FirstHit(Int_t track);
101 virtual AliHit* NextHit();
102 virtual AliHit* FirstHit2(Int_t track);
103 virtual AliHit* NextHit2();
39c8eb58 104 virtual void LoadPoints(Int_t dummy);
105 virtual void LoadPoints2(Int_t dummy);
106 virtual void LoadPoints3(Int_t dumy);
107 virtual void FinishPrimary();
108 virtual void RemapTrackHitIDs(Int_t *map);
109 virtual void FindTrackHitsIntersection(TClonesArray * arr);
110 //fill clones array with intersection of current point with the
111 //middle of the row
112 void SetHitType(Int_t type){fHitType =type;} //set type of hit container
f8cf550c 113 void SetDigitsSwitch(Int_t sw){fDigitsSwitch = sw;}
afc42102 114 void SetDefSwitch(Int_t def){fDefaults = def;}
407ff276 115 Float_t GetNoise(); //get Current noise
116 void GenerNoise(Int_t tablasize); // make noise table
9bdd974b 117 Bool_t IsSectorActive(Int_t sec) const; // check if the sector is active
792bb11c 118 void SetActiveSectors(Int_t * sectors, Int_t n); //set active sectors
9bdd974b 119 Int_t GetHitType() const {return fHitType;}
12d8d654 120 void SetActiveSectors(Int_t flag=0); //loop over al hits and set active only hitted sectors
42157e55 121
122// static functions
9bdd974b 123 static AliTPCParam* LoadTPCParam(TFile *file);
124protected:
125 Int_t fDefaults; // defaults switch
126 Int_t fSens; // ISENS
127 Int_t fSecAL; // Upper sector selector
128 Int_t fSecAU; // Lower sector selector
129 Int_t fSecLows[6]; // List of lower sectors selected
130 Int_t fSecUps[12]; // List of upper sectors selected
131 Int_t fNsectors; // Number of sectors in TPC
132 //MI changes
133 AliTPCDigitsArray * fDigitsArray; //!detector digit object
134 AliTPCClustersArray * fClustersArray; //!detector cluster object
135 AliTPCParam *fTPCParam; // pointer to TPC parameters
136 AliTPCTrackHitsV2 *fTrackHits; //!hits for given track M.I.
137 AliTPCTrackHits *fTrackHitsOld; //!hits for given track M.I. MIold -
138
139 Int_t fHitType; // if fNewHit = 1 old data structure if 2 new hits if 4 old MI stucture
140 // 3 both types
141 Int_t fDigitsSwitch; // digits type, 0->normal, 1->summable
142
143 //MK changes
144
145 Float_t fSide; // selects left(-1), right(+1), or both(0) sides of the TPC
146 Int_t fNoComp; // number of a drift gas components
147 Int_t fMixtComp[3]; // drift gas components
148 Float_t fMixtProp[3]; // mixture proportions
42157e55 149
150 private:
fe4da5cc 151 //
792bb11c 152 Bool_t TrackInVolume(Int_t id,Int_t track); //return true if current track is in volume
afc42102 153 void SetDefaults();
8c555625 154 void DigitizeRow(Int_t irow,Int_t isec,TObjArray **rowTriplet);
de61d5d5 155 Float_t GetSignal(TObjArray *p1, Int_t ntr, AliTPCFastMatrix *m1,
156 AliTPCFastMatrix *m2,Int_t *IndexRange);
157 void GetList (Float_t label,Int_t np,AliTPCFastMatrix *m,Int_t *IndexRange,
8c555625 158 Float_t **pList);
159 void MakeSector(Int_t isec,Int_t nrows,TTree *TH,Stat_t ntracks,TObjArray **row);
cc80f89e 160 void TransportElectron(Float_t *xyz, Int_t *index);
161 Int_t fCurrentIndex[4];// index[0] indicates coordinate system,
162 // index[1] sector number,
163 // index[2] pad row number
164 // index[3] pad row number for which signal is calculated
407ff276 165 Int_t fNoiseDepth; //!noise table
166 Float_t * fNoiseTable; //![fNoiseDepth] table with noise
167 Int_t fCurrentNoise; //!index of the noise in the noise table
792bb11c 168 Bool_t* fActiveSectors; //!bool indicating which sectors are active
407ff276 169
88cb7938 170 ClassDef(AliTPC,10) // Time Projection Chamber class
fe4da5cc 171};
172
fe4da5cc 173
174//_____________________________________________________________________________
175
176class AliTPCdigit : public AliDigit {
177public:
178 Int_t fSector; //array of volumes
179 Int_t fPadRow; //Row number
180 Int_t fPad ; //Pad number
181 Int_t fTime; //Time bucket
182 Int_t fSignal; //Signal amplitude
183
184public:
185 AliTPCdigit() {}
186 AliTPCdigit(Int_t *tracks, Int_t *digits);
187 virtual ~AliTPCdigit() {}
188
189 ClassDef(AliTPCdigit,1) // Time Projection Chamber digits
190};
191
192
193//_____________________________________________________________________________
194
195class AliTPChit : public AliHit {
196public:
197 Int_t fSector; //sector number
198 Int_t fPadRow; //Pad Row number
199 Float_t fQ ; //charge
200
201public:
202 AliTPChit() {}
203 AliTPChit(Int_t shunt, Int_t track, Int_t *vol, Float_t *hits);
204 virtual ~AliTPChit() {}
39c8eb58 205 void SetX(Float_t x){fX = x;}
206 void SetY(Float_t y){fY = y;}
207 void SetZ(Float_t z){fZ = z;}
fe4da5cc 208
209 ClassDef(AliTPChit,1) // Time Projection Chamber hits
210};
3c0f9266 211
73042f01 212#endif
fe4da5cc 213
fe4da5cc 214
3c0f9266 215
fe4da5cc 216
fe4da5cc 217
fe4da5cc 218
fe4da5cc 219
fe4da5cc 220
fe4da5cc 221