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