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