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