]> git.uio.no Git - u/mrichter/AliRoot.git/blame - TPC/AliTPCParam.h
Modification for gain:multiplicity calibration
[u/mrichter/AliRoot.git] / TPC / AliTPCParam.h
CommitLineData
73042f01 1#ifndef ALITPCPARAM_H
2#define ALITPCPARAM_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
8c555625 8////////////////////////////////////////////////
9// Manager class for TPC parameters //
10////////////////////////////////////////////////
8c555625 11
cc80f89e 12#include "AliDetectorParam.h"
13#include "TMath.h"
1283eee5 14
01473f7b 15#include <TGeoMatrix.h>
16
cc80f89e 17class AliTPCParam : public AliDetectorParam {
8c555625 18 //////////////////////////////////////////////////////
19 //////////////////////////////////////////////////////
20 //ALITPCParam object to be possible change
21 //geometry and some other parameters of TPC
cc80f89e 22 //used by AliTPC and AliTPCSector
23
8c555625 24public:
25 AliTPCParam();
cc80f89e 26 virtual ~AliTPCParam();
1ac29fc4 27 TGeoHMatrix * Tracking2LocalMatrix(const TGeoHMatrix * geoMatrix, Int_t sector) const;
cc80f89e 28 virtual Bool_t Transform(Float_t *xyz, Int_t *index, Int_t* oindex);
29 //transformation from input coodination system to output coordination system
30 Int_t Transform0to1(Float_t *xyz, Int_t *index) const;
31 //trasforamtion from global to global - adjust index[0] sector
32 //return value is equal to sector corresponding to global position
74707dd2 33 void Transform1to2Ideal(Float_t *xyz, Int_t *index) const;
34 //transformation to rotated coordinata - ideal frame
73042f01 35 void Transform1to2(Float_t *xyz, Int_t *index) const;
74707dd2 36 //transformation to rotated coordinata
73042f01 37 void Transform2to1(Float_t *xyz, Int_t *index) const;
cc80f89e 38 //transformation from rotated coordinata to global coordinata
73042f01 39 void Transform2to2(Float_t *xyz, Int_t *index, Int_t *oindex) const;
cc80f89e 40 //transform rotated coordinata of one sector to rotated
41 //coordinata relative to another sector
73042f01 42 Float_t Transform2to2NearestWire(Float_t *xyz, Int_t *index) const;
cc80f89e 43 //round x position to nearest wire
73042f01 44 Int_t Transform2to3(Float_t *xyz, Int_t *index) const;
cc80f89e 45 //calulate coresponding index[2] -pad row for straight rows
46 //does not change xyz[]
47 //return pad - row
73042f01 48 void Transform3to4(Float_t *xyz, Int_t *index) const;
cc80f89e 49 //valid only for straight rows straight rows
50 //calculate xyz[0] position relative to given index
51 //return pad - row
73042f01 52 void Transform4to3(Float_t *xyz, Int_t *index) const;
cc80f89e 53 //valid only for straight rows straight rows
54 //transform xyz[0] position relative to given index
73042f01 55 void Transform2to5( Float_t *xyz, Int_t *index) const;
cc80f89e 56 //transform [x,y,z] to [r,rphi,z]
73042f01 57 void Transform5to2(Float_t *xyz, Int_t *index) const;
cc80f89e 58 //transform [r,rphi,z] coordinata to [x,y,z]
73042f01 59 void Transform4to8(Float_t *xyz, Int_t *index) const;
cc80f89e 60 //transform xyz coordinata to 'digit' coordinata
73042f01 61 void Transform8to4(Float_t *xyz, Int_t *index) const;
cc80f89e 62 //transform 'digit' coordinata to xyz coordinata
73042f01 63 void Transform6to8(Float_t *xyz, Int_t *index) const;
cc80f89e 64 //transform dr,f coordinata to 'digit' coordinata
73042f01 65 void Transform8to6(Float_t *xyz, Int_t *index) const;
cc80f89e 66 //transform 'digit' coordinata to dr,f coordinata
67
176aff27 68 virtual Int_t Transform2toPadRow(Float_t */*xyz*/, Int_t */*index*/) const{return 0;}
cc80f89e 69 //transform rotated to
70
71 virtual Int_t GetPadRow(Float_t *xyz, Int_t *index) const ;
72 //return pad row of point xyz - xyz is given in coordinate system -(given by index)
73 //output system is 3 for straight row and 7 for cylindrical row
176aff27 74 virtual void XYZtoCRXYZ(Float_t */*xyz*/,
75 Int_t &/*sector*/, Int_t &/*padrow*/, Int_t /*option*/) const {;}
8c555625 76 //transform global position to the position relative to the sector padrow
77 //if option=0 X calculate absolute calculate sector
78 //if option=1 X absolute use input sector
79 //if option=2 X relative to pad row calculate sector
80 //if option=3 X relative use input sector
81
176aff27 82 virtual void CRXYZtoXYZ(Float_t */*xyz*/,
83 const Int_t &/*sector*/, const Int_t & /*padrow*/, Int_t /*option*/) const {;}
8c555625 84 //transform relative position to the gloabal position
85
176aff27 86 virtual void CRTimePadtoYZ(Float_t &/*y*/, Float_t &/*z*/,
87 const Float_t &/*time*/, const Float_t &/*pad*/,
88 Int_t /*sector*/, Int_t /*padrow*/ ){;}
8c555625 89 //transform position in digit units (time slices and pads) to "normal"
90 //units (cm)
176aff27 91 virtual void CRYZtoTimePad(const Float_t &/*y*/, const Float_t &/*z*/,
92 Float_t &/*time*/, Float_t &/*pad*/,
93 Int_t /*sector*/, Int_t /*padrow*/){;}
cc80f89e 94 //transform position in cm to position in digit unit
176aff27 95 virtual Int_t CalcResponse(Float_t* /*x*/, Int_t * /*index*/, Int_t /*row*/){return 0;}
cc80f89e 96 //calculate bin response as function of the input position -x and the weight
97 //if row -pad row is equal -1 calculate response for each pad row
98 //otherwise it calculate only in given pad row
99 //return number of valid response bin
100 virtual void SetDefault(); //set defaut TPCparam
101 virtual Bool_t Update(); //recalculate and check geometric parameters
01473f7b 102 virtual Bool_t ReadGeoMatrices(); //read geo matrixes
bf6adc12 103 Bool_t GetStatus() const; //get information about object consistency
8569a2b0 104 Int_t GetIndex(Int_t sector, Int_t row) const; //give index of the given sector and pad row
cc80f89e 105 Int_t GetNSegmentsTotal() const {return fNtRows;}
8c555625 106 Double_t GetLowMaxY(Int_t irow) const {return irow*0.;}
107 Double_t GetUpMaxY(Int_t irow) const {return irow*0;}
cc80f89e 108 //additional geometrical function - for Belikov
109
110 Bool_t AdjustSectorRow(Int_t index, Int_t & sector, Int_t &row) const; //return sector and padrow
8c555625 111 //for given index
8c555625 112
73042f01 113 void AdjustCosSin(Int_t isec, Float_t &cos, Float_t &sin) const;
cc80f89e 114 //set cosinus and sinus of rotation angles for sector isec
73042f01 115 Float_t GetAngle(Int_t isec) const;
01473f7b 116 // void GetChamberPos(Int_t isec, Float_t* xyz) const;
117 // void GetChamberRot(Int_t isec, Float_t* angles) const;
cc80f89e 118 //
119 //set sector parameters
120 //
121 void SetInnerRadiusLow(Float_t InnerRadiusLow ) { fInnerRadiusLow=InnerRadiusLow;}
122 void SetOuterRadiusLow(Float_t OuterRadiusLow ) { fOuterRadiusLow=OuterRadiusLow;}
123 void SetInnerRadiusUp(Float_t InnerRadiusUp) { fInnerRadiusUp= InnerRadiusUp;}
124 void SetOuterRadiusUp(Float_t OuterRadiusUp) { fOuterRadiusUp= OuterRadiusUp;}
125 void SetSectorAngles(Float_t innerangle, Float_t innershift, Float_t outerangle,
126 Float_t outershift);
127 void SetInnerFrameSpace(Float_t frspace) {fInnerFrameSpace = frspace;}
128 void SetOuterFrameSpace(Float_t frspace) {fOuterFrameSpace = frspace;}
129 void SetInnerWireMount(Float_t fmount) {fInnerWireMount = fmount;}
130 void SetOuterWireMount(Float_t fmount) {fOuterWireMount = fmount;}
131 void SetZLength(Float_t zlength) {fZLength = zlength;}
132 void SetGeometryType(Int_t type) {fGeometryType = type;}
133 //
f03e3423 134 // pad rows geometry
135 //
136 void SetRowNLow( Int_t NRowLow){fNRowLow = NRowLow;}
137 void SetRowNUp1 (Int_t NRowUp1){fNRowUp1 = NRowUp1 ;} //upper sec short pads
138 void SetRowNUp2 (Int_t NRowUp2){fNRowUp2 = NRowUp2 ;} //upper sec long pads
139 void SetRowNUp (Int_t NRowUp){fNRowUp = NRowUp ;}
140 //
cc80f89e 141 //set wire parameters
142 //
143 void SetInnerNWires(Int_t nWires){ fNInnerWiresPerPad=nWires;}
144 void SetInnerDummyWire(Int_t dummy) {fInnerDummyWire = dummy;}
145 void SetInnerOffWire(Float_t offset) {fInnerOffWire =offset;}
f03e3423 146 void SetOuter1NWires(Int_t nWires){ fNOuter1WiresPerPad=nWires;}
147 void SetOuter2NWire(Int_t nWires){ fNOuter2WiresPerPad=nWires;}
cc80f89e 148 void SetOuterDummyWire(Int_t dummy) {fOuterDummyWire = dummy;}
f03e3423 149 void SetOuterOffWire(Float_t offset) {fOuterOffWire =offset;}
150 void SetInnerWWPitch( Float_t wwPitch) {fInnerWWPitch = wwPitch;}
151 void SetRInnerFirstWire(Float_t firstWire){fRInnerFirstWire = firstWire;}
152 void SetRInnerLastWire(Float_t lastWire){fRInnerLastWire = lastWire;}
153 void SetOuterWWPitch(Float_t wwPitch){fOuterWWPitch = wwPitch;}
154 void SetLastWireUp1(Float_t wireUp1){fLastWireUp1 = wireUp1;}
155 void SetROuterFirstWire(Float_t firstWire){fROuterFirstWire = firstWire;}
156 void SetROuterLastWire(Float_t lastWire){fROuterLastWire = lastWire;}
cc80f89e 157 //
158 //set pad parameter
159 //
160 void SetInnerPadPitchLength(Float_t PadPitchLength){ fInnerPadPitchLength=PadPitchLength;}
161 void SetInnerPadPitchWidth(Float_t PadPitchWidth){ fInnerPadPitchWidth = PadPitchWidth;}
162 void SetInnerPadLength(Float_t PadLength){ fInnerPadLength=PadLength;}
f03e3423 163 void SetInnerPadWidth(Float_t PadWidth) { fInnerPadWidth=PadWidth;}
164 void SetOuter1PadPitchLength(Float_t PadPitchLength){ fOuter1PadPitchLength=PadPitchLength;}
165 void SetOuter2PadPitchLength(Float_t PadPitchLength){ fOuter2PadPitchLength=PadPitchLength;}
cc80f89e 166 void SetOuterPadPitchWidth(Float_t PadPitchWidth){ fOuterPadPitchWidth = PadPitchWidth;}
f03e3423 167 void SetOuter1PadLength(Float_t PadLength){ fOuter1PadLength=PadLength;}
168 void SetOuter2PadLength(Float_t PadLength){ fOuter2PadLength=PadLength;}
169 void SetOuterPadWidth(Float_t PadWidth) { fOuterPadWidth=PadWidth;}
cc80f89e 170 void SetMWPCReadout(Bool_t type) {fBMWPCReadout = type;}
171 void SetNCrossRows(Int_t rows){fNCrossRows = rows;}
172 //
173 //set gas paremeters
174 //
175 void SetDiffT(Float_t DiffT){ fDiffT= DiffT;}
176 void SetDiffL(Float_t DiffL){ fDiffL=DiffL;}
177 void SetGasGain(Float_t GasGain){ fGasGain=GasGain;}
178 void SetDriftV(Float_t DriftV){ fDriftV= DriftV;}
179 void SetOmegaTau(Float_t OmegaTau){ fOmegaTau=OmegaTau;}
180 void SetAttCoef(Float_t AttCoef){ fAttCoef=AttCoef;}
181 void SetOxyCont(Float_t OxyCont){ fOxyCont=OxyCont;}
182 //
183 //set electronivc parameters
184 //
185 void SetPadCoupling(Float_t PadCoupling){ fPadCoupling=PadCoupling;}
186 void SetZeroSup(Int_t ZeroSup) { fZeroSup=ZeroSup;}
187 void SetNoise(Float_t Noise ) { fNoise= Noise;}
188 void SetChipGain(Float_t ChipGain){ fChipGain= ChipGain;}
189 void SetChipNorm(Float_t ChipNorm){ fChipNorm= ChipNorm;}
190 void SetTSample(Float_t TSample) { fTSample=TSample;}
191 void SetTFWHM(Float_t fwhm) { fTSigma=fwhm/2.35;}
192 void SetMaxTBin(Int_t maxtbin) { fMaxTBin = maxtbin;}
193 void SetADCSat(Int_t adcsat) { fADCSat = adcsat;}
194 void SetADCDynRange(Float_t adcdynrange) {fADCDynRange = adcdynrange;}
195 //
196 //set response parameters
197 //
198 void SetNResponseMax(Int_t max) { fNResponseMax = max;}
199 void SetResponseThreshold(Int_t threshold) {fResponseThreshold = threshold;}
01473f7b 200 //set L1 parameters
201 void SetGateDelay(Float_t delay) {fGateDelay = delay;}
202 void SetL1Delay(Float_t delay) {fL1Delay = delay;}
203 void SetNTBinsBeforeL1(UShort_t nbins) {fNTBinsBeforeL1 = nbins;}
cc80f89e 204 //
205 //get sector parameters
206 //
207 Float_t GetInnerRadiusLow() const {return fInnerRadiusLow;}
208 Float_t GetInnerRadiusUp() const {return fInnerRadiusUp;}
209 Float_t GetOuterRadiusLow() const {return fOuterRadiusLow;}
210 Float_t GetOuterRadiusUp() const {return fOuterRadiusUp;}
211 Float_t GetInnerFrameSpace() const {return fInnerFrameSpace;}
212 Float_t GetOuterFrameSpace() const {return fOuterFrameSpace;}
213 Float_t GetInnerWireMount() const {return fInnerWireMount;}
214 Float_t GetOuterWireMount() const {return fOuterWireMount;}
215 Float_t GetInnerAngle() const ;
216 Float_t GetInnerAngleShift() const ;
217 Float_t GetOuterAngle() const ;
218 Float_t GetOuterAngleShift() const ;
219 Int_t GetNInnerSector() const {return fNInnerSector;}
220 Int_t GetNOuterSector() const {return fNOuterSector;}
221 Int_t GetNSector() const {return fNSector;}
f0043941 222 Float_t GetZLength(Int_t sector=0) const;
cc80f89e 223 Int_t GetGeometryType() const {return fGeometryType;}
224
225 //
226 //get wires parameter
227 //
228 Int_t GetInnerNWires() const {return fNInnerWiresPerPad;}
229 Float_t GetInnerWWPitch() const {return fInnerWWPitch;}
230 Int_t GetInnerDummyWire() const {return fInnerDummyWire;}
231 Float_t GetInnerOffWire() const {return fInnerOffWire;}
232 Float_t GetRInnerFirstWire() const {return fRInnerFirstWire;}
233 Float_t GetRInnerLastWire() const {return fRInnerLastWire;}
f03e3423 234 Int_t GetOuter1NWires() const {return fNOuter1WiresPerPad;}
235 Int_t GetOuter2NWires() const {return fNOuter2WiresPerPad;}
cc80f89e 236 Float_t GetOuterWWPitch() const {return fOuterWWPitch;}
237 Int_t GetOuterDummyWire() const {return fOuterDummyWire;}
238 Float_t GetOuterOffWire() const {return fOuterOffWire;}
bf6adc12 239 Float_t GetLastWireUp1() const {return fLastWireUp1;}
cc80f89e 240 Float_t GetROuterFirstWire() const {return fROuterFirstWire;}
241 Float_t GetROuterLastWire() const {return fROuterLastWire;}
242 Float_t GetWWPitch(Int_t isector = 0) const {
243 return ( (isector < fNInnerSector) ? fInnerWWPitch :fOuterWWPitch);}
244 //
245 //get pad parameters
246 //
247 Float_t GetInnerPadPitchLength() const {return fInnerPadPitchLength;}
248 Float_t GetInnerPadPitchWidth() const {return fInnerPadPitchWidth;}
249 Float_t GetInnerPadLength() const {return fInnerPadLength;}
f03e3423 250 Float_t GetInnerPadWidth() const {return fInnerPadWidth;}
251 Float_t GetOuter1PadPitchLength() const {return fOuter1PadPitchLength;}
252 Float_t GetOuter2PadPitchLength() const {return fOuter2PadPitchLength;}
cc80f89e 253 Float_t GetOuterPadPitchWidth() const {return fOuterPadPitchWidth;}
f03e3423 254 Float_t GetOuter1PadLength() const {return fOuter1PadLength;}
255 Float_t GetOuter2PadLength() const {return fOuter2PadLength;}
cc80f89e 256 Float_t GetOuterPadWidth() const {return fOuterPadWidth;}
257 Bool_t GetMWPCReadout() const {return fBMWPCReadout;}
258 Int_t GetNCrossRows() const {return fNCrossRows;}
259 Float_t GetPadPitchWidth(Int_t isector = 0) const {
260 return ( (isector < fNInnerSector) ? fInnerPadPitchWidth :fOuterPadPitchWidth);}
f03e3423 261 Float_t GetPadPitchLength(Int_t isector = 0, Int_t padrow=0) const
bf6adc12 262 { if (isector < fNInnerSector) return fInnerPadPitchLength;
263 else return ((padrow<fNRowUp1) ? fOuter1PadPitchLength:fOuter2PadPitchLength);}
8c555625 264 Int_t GetNRowLow() const; //get the number of pad rows in low sector
265 Int_t GetNRowUp() const; //get the number of pad rows in up sector
f03e3423 266 Int_t GetNRowUp1() const; // number of short rows in up sector
267 Int_t GetNRowUp2() const; // number of long rows in up sector
cc80f89e 268 Int_t GetNRow(Int_t isec) const {return ((isec<fNInnerSector) ? fNRowLow:fNRowUp);}
bf6adc12 269 Int_t GetNRowsTotal() const {return fNtRows;} //get total nuber of rows
8c555625 270 Float_t GetPadRowRadiiLow(Int_t irow) const; //get the pad row (irow) radii
271 Float_t GetPadRowRadiiUp(Int_t irow) const; //get the pad row (irow) radii
272 Float_t GetPadRowRadii(Int_t isec,Int_t irow) const {
1283eee5 273 return ( (isec < fNInnerSector) ?GetPadRowRadiiLow(irow):GetPadRowRadiiUp(irow));}
cc80f89e 274 //retrun radii of the pad row irow in sector i
8c555625 275 Int_t GetNPadsLow(Int_t irow) const; //get the number of pads in row irow
276 Int_t GetNPadsUp(Int_t irow) const; //get the number of pads in row irow
cc80f89e 277 Int_t GetNPads(Int_t isector,Int_t irow) const{
f03e3423 278 return ( (isector < fNInnerSector) ?GetNPadsLow(irow) : GetNPadsUp(irow));}
279
280 Float_t GetYInner(Int_t irow) const; // wire length in low sec row
281 Float_t GetYOuter(Int_t irow) const; // wire length in up sec row
01473f7b 282 Int_t GetSectorIndex(Float_t angle, Int_t row, Float_t z) const; // get sector index
74707dd2 283 Float_t GetChamberCenter(Int_t isec, Float_t * center = 0) const; // get readout chamber positions
01473f7b 284 TGeoHMatrix *GetTrackingMatrix(Int_t isec) const {
285 return fTrackingMatrix[isec];}
286 TGeoHMatrix *GetClusterMatrix(Int_t isec) const {
287 return fClusterMatrix[isec];}
288 TGeoHMatrix *GetGlobalMatrix(Int_t isec) const {
289 return fGlobalMatrix[isec];}
290 Bool_t IsGeoRead(){ return fGlobalMatrix!=0;}
cc80f89e 291 //
292 //get GAS parameters
293 //
294 Float_t GetDiffT() const {return fDiffT;}
295 Float_t GetDiffL() const {return fDiffL;}
296 Float_t GetGasGain() const {return fGasGain;}
297 Float_t GetDriftV() const {return fDriftV;}
298 Float_t GetOmegaTau() const {return fOmegaTau;}
299 Float_t GetAttCoef() const {return fAttCoef;}
300 Float_t GetOxyCont() const {return fOxyCont;}
301 //
302 //get Electronic parameters
303 //
304 Float_t GetPadCoupling() const {return fPadCoupling;}
305 Int_t GetZeroSup() const {return fZeroSup;}
306 Float_t GetNoise() const {return fNoise;}
307 Float_t GetChipGain() const {return fChipGain;}
308 Float_t GetChipNorm() const {return fChipNorm;}
309 Float_t GetTSample() const {return fTSample;}
310 Float_t GetZWidth() const {return fZWidth;}
311 Float_t GetTFWHM() const {return fTSigma*2.35;}
312 Float_t GetZSigma() const {return fTSigma*fDriftV;}
bf6adc12 313 virtual Float_t GetZOffset() const {return 3*fTSigma*fDriftV;}
cc80f89e 314 Int_t GetMaxTBin() const {return fMaxTBin;}
315 Int_t GetADCSat() const {return fADCSat;}
316 Float_t GetADCDynRange() const {return fADCDynRange;}
317 Float_t GetTotalNormFac() const {return fTotalNormFac;}
318 Float_t GetNoiseNormFac() const {return fNoiseNormFac;}
319 //
320 // get response data
321 //
73042f01 322 Int_t * GetResBin(Int_t i);
cc80f89e 323 //return response bin i - bin given by padrow [0] pad[1] timebin[2]
de61d5d5 324 Float_t & GetResWeight(Int_t i);
cc80f89e 325 //return weight of response bin i
01473f7b 326
327 // get L1 data
328 Float_t GetGateDelay() const {return fGateDelay;}
329 Float_t GetL1Delay() const {return fL1Delay;}
330 UShort_t GetNTBinsBeforeL1() const {return fNTBinsBeforeL1;}
331 Float_t GetNTBinsL1() const {return fNTBinsL1;}
cc80f89e 332protected :
8c555625 333
8c555625 334 Bool_t fbStatus; //indicates consistency of the data
335 //---------------------------------------------------------------------
336 // ALICE TPC sector geometry
cc80f89e 337 //--------------------------------------------------------------------
338 Float_t fInnerRadiusLow; // lower radius of inner sector-IP
339 Float_t fInnerRadiusUp; // upper radius of inner sector-IP
340 Float_t fOuterRadiusUp; // upper radius of outer sector-IP
341 Float_t fOuterRadiusLow; // lower radius of outer sector-IP
342 Float_t fInnerAngle; //opening angle of Inner sector
343 Float_t fInnerAngleShift; //shift of first inner sector center to the 0
344 Float_t fOuterAngle; //opening angle of outer sector
345 Float_t fOuterAngleShift; //shift of first sector center to the 0
346 Float_t fInnerFrameSpace; //space for inner frame in the phi direction
347 Float_t fOuterFrameSpace; //space for outer frame in the phi direction
348 Float_t fInnerWireMount; //space for wire mount, inner sector
349 Float_t fOuterWireMount; //space for wire mount, outer sector
0bbae0f2 350 Int_t fNInnerSector; //number of inner sectors -calculated
351 Int_t fNOuterSector; //number of outer sectors -calculated
352 Int_t fNSector; // total number of sectors -calculated
cc80f89e 353 Float_t fZLength; //length of the drift region of the TPC
0bbae0f2 354 Float_t *fRotAngle; //[fNSector] sin and cos of rotation angles for
cc80f89e 355 // diferent sectors -calculated
356 Int_t fGeometryType; //type of geometry -0 straight rows
01473f7b 357 // Float_t *fChamberPos; //[fNSector] displacements of the readout chambers
358 //with respect to the 'idead' geometry
359 //in local corrdinate system
360 // Float_t *fChamberRot; //[fNSector] rotation angles of the readout chambers
361 //with respect to the 'idead' geometry
362 //in local corrdinate system
363 TGeoHMatrix **fTrackingMatrix; //![fNSector] transformation matrices of the tracking
364 //coordinate system
365 TGeoHMatrix **fClusterMatrix; //![fNSector] transformation matrices of the cluster
366 //coordinate system
367 TGeoHMatrix **fGlobalMatrix; //![fNSector] fTrackingMatrix * fClusterMatrix
368
cc80f89e 369 //1-cylindrical
370 //---------------------------------------------------------------------
371 // ALICE TPC wires geometry - for GEM we can consider that it is gating
8c555625 372 //--------------------------------------------------------------------
0bbae0f2 373 Int_t fNInnerWiresPerPad; //Number of wires per pad
374 Float_t fInnerWWPitch; //pitch between wires in inner sector - calculated
cc80f89e 375 Int_t fInnerDummyWire; //number of wires without pad readout
376 Float_t fInnerOffWire; //oofset of first wire to the begining of the sector
377 Float_t fRInnerFirstWire; //position of the first wire -calculated
378 Float_t fRInnerLastWire; //position of the last wire -calculated
f03e3423 379 Float_t fLastWireUp1; //position of the last wire in outer1 sector
380 Int_t fNOuter1WiresPerPad; //Number of wires per pad
bf6adc12 381 Int_t fNOuter2WiresPerPad; // Number of wires per pad
0bbae0f2 382 Float_t fOuterWWPitch; //pitch between wires in outer sector -calculated
cc80f89e 383 Int_t fOuterDummyWire; //number of wires without pad readout
384 Float_t fOuterOffWire; //oofset of first wire to the begining of the sector
385 Float_t fROuterFirstWire; //position of the first wire -calulated
386 Float_t fROuterLastWire; //position of the last wire -calculated
1283eee5 387 //---------------------------------------------------------------------
388 // ALICE TPC pad parameters
389 //--------------------------------------------------------------------
cc80f89e 390 Float_t fInnerPadPitchLength; //Inner pad pitch length
391 Float_t fInnerPadPitchWidth; //Inner pad pitch width
392 Float_t fInnerPadLength; //Inner pad length
393 Float_t fInnerPadWidth; //Inner pad width
f03e3423 394 Float_t fOuter1PadPitchLength; //Outer pad pitch length
bf6adc12 395 Float_t fOuter2PadPitchLength; //Outer pad pitch length
cc80f89e 396 Float_t fOuterPadPitchWidth; //Outer pad pitch width
f03e3423 397 Float_t fOuter1PadLength; //Outer pad length
bf6adc12 398 Float_t fOuter2PadLength; //Outer pad length
cc80f89e 399 Float_t fOuterPadWidth; //Outer pad width
400 Bool_t fBMWPCReadout; //indicate wire readout - kTRUE or GEM readout -kFALSE
401 Int_t fNCrossRows; //number of rows to crostalk calculation
402
f03e3423 403 Int_t fNRowLow; //number of pad rows per low sector -set
404 Int_t fNRowUp1; //number of short pad rows per sector up -set
405 Int_t fNRowUp2; //number of long pad rows per sector up -set
cc80f89e 406 Int_t fNRowUp; //number of pad rows per sector up -calculated
407 Int_t fNtRows; //total number of rows in TPC -calculated
408 Float_t fPadRowLow[600]; //Lower sector, pad row radii -calculated
409 Float_t fPadRowUp[600]; //Upper sector, pad row radii -calculated
410 Int_t fNPadsLow[600]; //Lower sector, number of pads per row -calculated
f03e3423 411 Int_t fNPadsUp[600]; //Upper sector, number of pads per row -calculated
412 Float_t fYInner[600]; //Inner sector, wire-length
413 Float_t fYOuter[600]; //Outer sector, wire-length
8c555625 414 //---------------------------------------------------------------------
415 // ALICE TPC Gas Parameters
416 //--------------------------------------------------------------------
417 Float_t fDiffT; //tangencial diffusion constant
418 Float_t fDiffL; //longutudinal diffusion constant
419 Float_t fGasGain; //gas gain constant
cc80f89e 420 Float_t fDriftV; //drift velocity constant
8c555625 421 Float_t fOmegaTau; //omega tau ExB coeficient
422 Float_t fAttCoef; //attachment coefitients
423 Float_t fOxyCont; //oxygen content
424 //---------------------------------------------------------------------
425 // ALICE TPC Electronics Parameters
426 //--------------------------------------------------------------------
427 Float_t fPadCoupling; //coupling factor ration of anode signal
428 //and total pads signal
cc80f89e 429 Int_t fZeroSup; //zero suppresion constant
430 Float_t fNoise; //noise sigma constant
431 Float_t fChipGain; //preamp shaper constant
432 Float_t fChipNorm; //preamp shaper normalisation
433 Float_t fTSample; //sampling time
434 Float_t fZWidth; //derived value calculated using TSample and driftw -computed
435 Float_t fTSigma; //width of the Preamp/Shaper function
436 Int_t fMaxTBin; //maximum time bin number
437 Int_t fADCSat; //saturation value of ADC (10 bits)
438 Float_t fADCDynRange; //input dynamic range (mV)
439 Float_t fTotalNormFac; //full normalisation factor - calculated
440 Float_t fNoiseNormFac; //normalisation factor to transform noise in electron to ADC channel
441
cc80f89e 442 //---------------------------------------------------------------------
443 // ALICE TPC response data
444 //---------------------------------------------------------------------
445 Int_t fNResponseMax; //maximal dimension of response
446 Float_t fResponseThreshold; //threshold for accepted response
0bbae0f2 447 Int_t fCurrentMax; //!current maximal dimension -calulated
448 Int_t *fResponseBin; //!array with bins -calulated
449 Float_t *fResponseWeight; //!array with response -calulated
cc80f89e 450
01473f7b 451 //---------------------------------------------------------------------
452 // ALICE TPC L1 Parameters
453 //--------------------------------------------------------------------
454 Float_t fGateDelay; //Delay of L1 arrival for the TPC gate signal
455 Float_t fL1Delay; //Delay of L1 arrival for the TPC readout
456 UShort_t fNTBinsBeforeL1; //Number of time bins before L1 arrival which are being read out
457 Float_t fNTBinsL1; //Overall L1 delay in time bins
458
bf6adc12 459private:
460 AliTPCParam(const AliTPCParam &);
461 AliTPCParam & operator=(const AliTPCParam &);
01473f7b 462 ClassDef(AliTPCParam,4) //parameter object for set:TPC
8c555625 463};
464
cc80f89e 465
466inline Int_t * AliTPCParam::GetResBin(Int_t i)
467{
468 //return response bin i - bin given by padrow [0] pad[1] timebin[2]
469 if (i<fCurrentMax) return &fResponseBin[i*3];
470 else return 0;
925e6570 471}
cc80f89e 472
de61d5d5 473inline Float_t &AliTPCParam::GetResWeight(Int_t i)
cc80f89e 474{
475 //return weight of response bin i
476 if (i<fCurrentMax) return fResponseWeight[i];
de61d5d5 477 else return fResponseWeight[i];
cc80f89e 478}
8c555625 479
cc80f89e 480
73042f01 481inline void AliTPCParam::AdjustCosSin(Int_t isec, Float_t &cos, Float_t &sin) const
cc80f89e 482{
483 //
484 //set cosinus and sinus of rotation angles for sector isec
485 //
486 cos=fRotAngle[isec*4];
487 sin=fRotAngle[isec*4+1];
488}
489
73042f01 490inline Float_t AliTPCParam::GetAngle(Int_t isec) const
cc80f89e 491{
492 //
493 //return rotation angle of given sector
494 //
495 return fRotAngle[isec*4+2];
496}
497
498
74707dd2 499inline void AliTPCParam::Transform1to2Ideal(Float_t *xyz, Int_t *index) const
cc80f89e 500{
01473f7b 501 //transformation to rotated coordinates
cc80f89e 502 //we must have information about sector!
cc80f89e 503 //rotate to given sector
74707dd2 504 // ideal frame
505
cc80f89e 506 Float_t cos,sin;
01473f7b 507 AdjustCosSin(index[1],cos,sin);
cc80f89e 508 Float_t x1=xyz[0]*cos + xyz[1]*sin;
01473f7b 509 Float_t y1=-xyz[0]*sin + xyz[1]*cos;
cc80f89e 510 xyz[0]=x1;
511 xyz[1]=y1;
01473f7b 512 xyz[2]=fZLength-TMath::Abs(xyz[2]);
cc80f89e 513 index[0]=2;
514}
515
01473f7b 516
74707dd2 517inline void AliTPCParam::Transform1to2(Float_t *xyz, Int_t *index) const
518{
519 //transformation to rotated coordinates
520 //we must have information about sector!
521 //rotate to given sector
522 Double_t xyzmaster[3] = {xyz[0],xyz[1],xyz[2]};
f99d7d41 523 Double_t xyzlocal[3]={0,0,0};
34bcefc7 524 if (index[1]>=0 && index[1]<fNSector)
525 fGlobalMatrix[index[1]]->MasterToLocal(xyzmaster,xyzlocal);
74707dd2 526 xyz[0] = xyzlocal[0];
527 xyz[1] = xyzlocal[1];
528 xyz[2] = xyzlocal[2];
529 index[0]=2;
530}
531
01473f7b 532
533
534
cc80f89e 535inline void AliTPCParam::Transform2to1(Float_t *xyz, Int_t *index) const
536{
537 //
538 //transformation from rotated coordinates to global coordinates
539 //
540 Float_t cos,sin;
541 AdjustCosSin(index[1],cos,sin);
542 Float_t x1=xyz[0]*cos - xyz[1]*sin;
543 Float_t y1=xyz[0]*sin + xyz[1]*cos;
544 xyz[0]=x1;
545 xyz[1]=y1;
546 xyz[2]=fZLength-xyz[2];
547 if (index[1]<fNInnerSector)
4f57cad7 548 {if ( index[1]>=(fNInnerSector>>1)) xyz[2]*=-1.;}
cc80f89e 549 else
4f57cad7 550 {if ( (index[1]-fNInnerSector) >= (fNOuterSector>>1) ) xyz[2]*=-1;}
cc80f89e 551 index[0]=1;
552}
553
554inline void AliTPCParam::Transform2to2(Float_t *xyz, Int_t *index, Int_t *oindex) const
555{
556 //transform rotated coordinats of one sector to rotated
557 //coordinates relative to another sector
558 Transform2to1(xyz,index);
559 Transform1to2(xyz,oindex);
560 index[0]=2;
561 index[1]=oindex[1];
562}
563
564inline Float_t AliTPCParam::Transform2to2NearestWire(Float_t *xyz, Int_t *index) const
565{
566 //
567 // asigns the x-position of the closest wire to xyz[0], return the
568 // electron to closest wire distance
569 //
570 Float_t xnew,dx;
571 if (index[1]<fNInnerSector) {
572 xnew = fRInnerFirstWire+TMath::Nint((xyz[0]-fRInnerFirstWire)/fInnerWWPitch)*fInnerWWPitch;
b9d0a01d 573 }
cc80f89e 574 else {
575 xnew = fROuterFirstWire+TMath::Nint((xyz[0]-fROuterFirstWire)/fOuterWWPitch)*fOuterWWPitch;
576 }
577 dx = xnew-xyz[0];
578 xyz[0]=xnew;
579 return dx;
580}
581
582inline Int_t AliTPCParam::Transform2to3(Float_t *xyz, Int_t *index) const
583{
584 //
585 //calulates coresponding pad row number, sets index[2] for straight rows
586 //does not change xyz[] information
587 //valid only for straight row
588 //
589 if (index[1]<fNInnerSector)
590 index[2] =TMath::Nint((xyz[0]-fPadRowLow[0])/fInnerPadPitchLength);
591 else
f03e3423 592 if (xyz[0] < fLastWireUp1 )
593 index[2] = TMath::Nint((xyz[0]-fPadRowUp[0])/fOuter1PadPitchLength);
594 else
595 index[2] = TMath::Nint(fNRowUp1+(xyz[0]-fPadRowUp[64])/fOuter2PadPitchLength);
cc80f89e 596 index[0]=3;
597 return index[2];
598}
599
600inline void AliTPCParam::Transform3to4(Float_t *xyz, Int_t *index) const
601{
602 //
603 //valid only for straight rows straight rows
604 //calculate xyz[0] position relative to given index
605 //
606 if (index[1]<fNInnerSector)
607 xyz[0] -=index[2]*fInnerPadPitchLength+fPadRowLow[0];
608 else
f03e3423 609 if (index[2]<fNRowUp1)
610 xyz[0] -=index[2]*fOuter1PadPitchLength+fPadRowUp[0];
611 else
612 xyz[0] -=(index[2]-fNRowUp1)*fOuter2PadPitchLength+fPadRowUp[64];
cc80f89e 613 index[0] =4;
614}
615
616inline void AliTPCParam::Transform4to3(Float_t *xyz, Int_t *index) const
617{
618 //
619 //valid only for straight rows
620 //transforms relative xyz[0] to the global one within given sector
621 //
622 if (index[1]<fNInnerSector)
623 xyz[0] +=index[2]*fInnerPadPitchLength+fPadRowLow[0];
624 else
f03e3423 625 if(index[2]<fNRowUp1)
626 xyz[0] +=index[2]*fOuter1PadPitchLength+fPadRowUp[0];
627 else
628 xyz[0] +=index[2]*fOuter2PadPitchLength+fPadRowUp[64];
cc80f89e 629 index[0] =3;
630}
631
632
633inline void AliTPCParam::Transform2to5( Float_t *xyz, Int_t *index) const
634{
635 //
636 //transform [x,y,z] to [r,phi,z]
637 //
638 Float_t angle;
639 Float_t r = TMath::Sqrt(xyz[0]*xyz[0]+xyz[1]*xyz[1]);
640 if ((xyz[0]==0)&&(xyz[1]==0)) angle = 0;
641 else
642 {
643 angle =TMath::ASin(xyz[1]/r);
644 if (xyz[0]<0) angle=TMath::Pi()-angle;
645 if ( (xyz[0]>0) && (xyz[1]<0) ) angle=2*TMath::Pi()+angle;
646 }
647 xyz[0]=r;
648 xyz[1]=angle;
649 index[0]=5;
650}
651
652inline void AliTPCParam::Transform5to2( Float_t *xyz, Int_t *index) const
653{
654 //
655 //transform [r,rphi,z] to [x,y,z]
656 //
657 Float_t r = xyz[0];
658 Float_t angle= xyz[1];
659 xyz[0]=r*TMath::Cos(angle);
660 xyz[1]=r*TMath::Sin(angle);
661 index[0]=2;
662}
663
664inline void AliTPCParam::Transform4to8(Float_t *xyz, Int_t *index) const
665{
666 //
667 //transform xyz coordinates to 'digit' coordinates
668 //
f03e3423 669
e30e6a9c 670 if (index[1]<fNInnerSector) {
671 if ( index[1]>=(fNInnerSector>>1)) xyz[1]*=-1.;
672 }
673 else {
674 if ( (index[1]-fNInnerSector) >= (fNOuterSector>>1) ) xyz[1]*=-1;
675 }
676
f03e3423 677 xyz[2]/=fZWidth;
cc80f89e 678 if (index[1]<fNInnerSector) {
679 xyz[0]/=fInnerPadPitchLength;
680 xyz[1]/=fInnerPadPitchWidth;
cc80f89e 681 }
f03e3423 682 else{
683 xyz[1]/=fOuterPadPitchWidth;
684 if (index[2]<fNRowUp1 ) xyz[0]/=fOuter1PadPitchLength;
685 else xyz[0]/=fOuter2PadPitchLength;
686 }
01473f7b 687 xyz[1]-=0.5;
cc80f89e 688 index[0]=8;
689}
690
691inline void AliTPCParam::Transform8to4(Float_t *xyz, Int_t *index) const
692{
693 //
694 //transforms 'digit' coordinates to xyz coordinates
695 //
e30e6a9c 696 if (index[1]<fNInnerSector) {
697 if ( index[1]>=(fNInnerSector>>1)) xyz[1]*=-1.;
698 }
699 else {
700 if ( (index[1]-fNInnerSector) >= (fNOuterSector>>1) ) xyz[1]*=-1;
701 }
702
f03e3423 703 xyz[2]*=fZWidth;
cc80f89e 704 if (index[1]<fNInnerSector) {
705 xyz[0]*=fInnerPadPitchLength;
f03e3423 706 xyz[1]*=fInnerPadPitchWidth;
cc80f89e 707 }
f03e3423 708 else{
709 xyz[1]*=fOuterPadPitchWidth;
710 if (index[2] < fNRowUp1 ) xyz[0]*=fOuter1PadPitchLength;
711 else xyz[0]*=fOuter2PadPitchLength;
712 }
cc80f89e 713 index[0]=4;
714}
715
716inline void AliTPCParam::Transform6to8(Float_t *xyz, Int_t *index) const
717{
718 //
719 //transforms cylindrical xyz coordinates to 'digit' coordinates
720 //
f03e3423 721 xyz[2]/=fZWidth;
cc80f89e 722 if (index[1]<fNInnerSector) {
723 xyz[0]/=fInnerPadPitchLength;
724 xyz[1]*=xyz[0]/fInnerPadPitchWidth;
cc80f89e 725 }
f03e3423 726 else{
cc80f89e 727 xyz[1]*=xyz[0]/fOuterPadPitchWidth;
f03e3423 728 if (index[2] < fNRowUp1 ) xyz[0]/=fOuter1PadPitchLength;
729 else xyz[0]/=fOuter2PadPitchLength;
730 }
cc80f89e 731 index[0]=8;
732}
733
734inline void AliTPCParam::Transform8to6(Float_t *xyz, Int_t *index) const
735{
736 //
737 //transforms 'digit' coordinates to cylindrical xyz coordinates
738 //
f03e3423 739 xyz[2]*=fZWidth;
cc80f89e 740 if (index[1]<fNInnerSector) {
741 xyz[0]*=fInnerPadPitchLength;
742 xyz[1]/=xyz[0]/fInnerPadPitchWidth;
cc80f89e 743 }
f03e3423 744 else{
745 xyz[1]/=xyz[0]/fOuterPadPitchWidth;
746 if (index[2] < fNRowUp1 ) xyz[0]*=fOuter1PadPitchLength;
747 else xyz[0]*=fOuter2PadPitchLength;
748 }
cc80f89e 749 index[0]=6;
750}
f0043941 751inline Float_t AliTPCParam::GetZLength(Int_t sector) const
752{ if(sector <18 || (sector>35&&sector<54)) return fZLength-0.275;
753 else return fZLength-0.302;
754}
8c555625 755#endif