LHC related code. First commit.
[u/mrichter/AliRoot.git] / TPC / AliTPC.h
... / ...
CommitLineData
1#ifndef ALITPC_H
2#define ALITPC_H
3/* Copyright(c) 1998-1999, ALICE Experiment at CERN, All rights reserved. *
4 * See cxx source for full Copyright notice */
5
6/* $Id$ */
7
8////////////////////////////////////////////////
9// Manager class for TPC //
10////////////////////////////////////////////////
11#include "AliDetector.h"
12#include "AliHit.h"
13#include "AliDigit.h"
14
15
16class TMatrix;
17class TTree;
18
19class TFile;
20class AliTPCParam;
21class AliTPCDigitsArray;
22class AliTPCClustersArray;
23class AliTPCTrackHits; // M.I.
24
25class AliTPC : public AliDetector {
26protected:
27 Int_t fDefaults;
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
34 //MI changes
35 AliTPCDigitsArray * fDigitsArray; //!detector digit object
36 AliTPCClustersArray * fClustersArray; //!detector cluster object
37 AliTPCParam *fTPCParam; // pointer to TPC parameters
38 AliTPCTrackHits *fTrackHits; //!hits for given track M.I.
39 Int_t fHitType; // if fNewHit = 1 old data structure if 2 new hits
40 // 3 both types
41 Int_t fDigitsSwitch; // digits type, 0->normal, 1->summable
42
43 //MK changes
44
45 Float_t fSide; // selects left(-1), right(+1), or both(0) sides of the TPC
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
50public:
51 AliTPC();
52 AliTPC(const char *name, const char *title);
53 virtual ~AliTPC();
54 virtual void AddHit(Int_t a1, Int_t *a2, Float_t *a3);
55 Int_t DistancetoPrimitive(Int_t px, Int_t py);
56 virtual void BuildGeometry();
57 virtual void CreateGeometry() {}
58 virtual void CreateMaterials();
59 virtual void Hits2Clusters(TFile *of, Int_t eventn);
60 virtual void Hits2ExactClustersSector(Int_t isec); // MI change calculate "exact" cluster position
61 virtual void SDigits2Digits(Int_t eventnumber=0);
62 virtual void Hits2SDigits(Int_t eventnumber=0);
63 virtual void Digits2Reco(Int_t eventnumber=0);
64 virtual void Hits2Digits(Int_t eventnumber=0); //MI change
65 virtual void Hits2DigitsSector(Int_t isec); //MI change
66 virtual void Init();
67 virtual Int_t IsVersion() const =0;
68 virtual void Digits2Clusters(TFile *of, Int_t eventnumber=0);
69 virtual void Clusters2Tracks(TFile *of);
70
71 Int_t GetNsectors() {return fNsectors;}
72 virtual void MakeBranch(Option_t *opt=" ", const char *file=0 );
73 virtual void ResetDigits();
74 virtual void SetSecAL(Int_t sec);
75 virtual void SetSecAU(Int_t sec);
76 virtual void SetSecLows(Int_t s1,Int_t s2,Int_t s3,Int_t s4,Int_t s5, Int_t s6);
77 virtual void SetSecUps (Int_t s1,Int_t s2,Int_t s3,Int_t s4,Int_t s5, Int_t s6,
78 Int_t s7,Int_t s8,Int_t s9,Int_t s10, Int_t s11, Int_t s12);
79 virtual void SetSens(Int_t sens);
80
81
82 virtual void SetSide(Float_t side);
83 virtual void SetGasMixt(Int_t nc,Int_t c1,Int_t c2,Int_t c3,Float_t p1,
84 Float_t p2,Float_t p3);
85
86 virtual void StepManager()=0;
87 virtual void DrawDetector() {}
88 AliTPCDigitsArray* GetDigitsArray() {return fDigitsArray;} //MI change
89 AliTPCClustersArray* GetClustersArray(){return fClustersArray;} //MI change
90 AliTPCParam *GetParam(){return fTPCParam;} // M.K, M.I changes
91 void SetParam(AliTPCParam *param){fTPCParam=param;} // M.K, M.I changes
92 void SetDigitsArray(AliTPCDigitsArray* param) {fDigitsArray=param;} //MI change
93 void SetClustersArray(AliTPCClustersArray *clusters) {fClustersArray = clusters;} //MI change
94
95// additional function neccesary for the new hits
96 virtual void MakeBranch2(Option_t *opt=" ", const char *file=0); //
97 virtual void SetTreeAddress();
98 virtual void SetTreeAddress2();
99 virtual void AddHit2(Int_t a1, Int_t *a2, Float_t *a3); //
100 virtual void ResetHits();
101 virtual void ResetHits2();
102 virtual AliHit* FirstHit(Int_t track);
103 virtual AliHit* NextHit();
104 virtual AliHit* FirstHit2(Int_t track);
105 virtual AliHit* NextHit2();
106
107 virtual void LoadPoints(Int_t dummy);
108 virtual void LoadPoints2(Int_t dummy);
109 virtual void LoadPoints3(Int_t dumy);
110 virtual void FinishPrimary();
111 virtual void RemapTrackHitIDs(Int_t *map);
112 virtual void FindTrackHitsIntersection(TClonesArray * arr);
113 //fill clones array with intersection of current point with the
114 //middle of the row
115 void SetHitType(Int_t type){fHitType =type;} //set type of hit container
116 void SetDigitsSwitch(Int_t sw){fDigitsSwitch = sw;}
117 void SetDefSwitch(Int_t def){fDefaults = def;}
118
119
120private:
121 //
122 void SetDefaults();
123 void DigitizeRow(Int_t irow,Int_t isec,TObjArray **rowTriplet);
124 Float_t GetSignal(TObjArray *p1, Int_t ntr, TMatrix *m1, TMatrix *m2,
125 Int_t *IndexRange);
126 void GetList (Float_t label,Int_t np,TMatrix *m,Int_t *IndexRange,
127 Float_t **pList);
128 void MakeSector(Int_t isec,Int_t nrows,TTree *TH,Stat_t ntracks,TObjArray **row);
129 void TransportElectron(Float_t *xyz, Int_t *index);
130 Int_t fCurrentIndex[4];// index[0] indicates coordinate system,
131 // index[1] sector number,
132 // index[2] pad row number
133 // index[3] pad row number for which signal is calculated
134
135 ClassDef(AliTPC,4) // Time Projection Chamber class
136};
137
138
139//_____________________________________________________________________________
140
141class AliTPCdigit : public AliDigit {
142public:
143 Int_t fSector; //array of volumes
144 Int_t fPadRow; //Row number
145 Int_t fPad ; //Pad number
146 Int_t fTime; //Time bucket
147 Int_t fSignal; //Signal amplitude
148
149public:
150 AliTPCdigit() {}
151 AliTPCdigit(Int_t *tracks, Int_t *digits);
152 virtual ~AliTPCdigit() {}
153
154 ClassDef(AliTPCdigit,1) // Time Projection Chamber digits
155};
156
157
158//_____________________________________________________________________________
159
160class AliTPChit : public AliHit {
161public:
162 Int_t fSector; //sector number
163 Int_t fPadRow; //Pad Row number
164 Float_t fQ ; //charge
165
166public:
167 AliTPChit() {}
168 AliTPChit(Int_t shunt, Int_t track, Int_t *vol, Float_t *hits);
169 virtual ~AliTPChit() {}
170 void SetX(Float_t x){fX = x;}
171 void SetY(Float_t y){fY = y;}
172 void SetZ(Float_t z){fZ = z;}
173
174 ClassDef(AliTPChit,1) // Time Projection Chamber hits
175};
176
177#endif
178
179
180
181
182
183
184
185
186