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