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