3 /* Copyright(c) 1998-1999, ALICE Experiment at CERN, All rights reserved. *
4 * See cxx source for full Copyright notice */
8 ////////////////////////////////////////////////
9 // Manager class for TPC parameters //
10 ////////////////////////////////////////////////
12 #include "AliDetectorParam.h"
15 #include <TGeoMatrix.h>
17 class AliTPCParam : public AliDetectorParam {
18 //////////////////////////////////////////////////////
19 //////////////////////////////////////////////////////
20 //ALITPCParam object to be possible change
21 //geometry and some other parameters of TPC
22 //used by AliTPC and AliTPCSector
26 virtual ~AliTPCParam();
27 TGeoHMatrix * Tracking2LocalMatrix(const TGeoHMatrix * geoMatrix, Int_t sector) const;
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
33 void Transform1to2Ideal(Float_t *xyz, Int_t *index) const;
34 //transformation to rotated coordinata - ideal frame
35 void Transform1to2(Float_t *xyz, Int_t *index) const;
36 //transformation to rotated coordinata
37 void Transform2to1(Float_t *xyz, Int_t *index) const;
38 //transformation from rotated coordinata to global coordinata
39 void Transform2to2(Float_t *xyz, Int_t *index, Int_t *oindex) const;
40 //transform rotated coordinata of one sector to rotated
41 //coordinata relative to another sector
42 Float_t Transform2to2NearestWire(Float_t *xyz, Int_t *index) const;
43 //round x position to nearest wire
44 Int_t Transform2to3(Float_t *xyz, Int_t *index) const;
45 //calulate coresponding index[2] -pad row for straight rows
46 //does not change xyz[]
48 void Transform3to4(Float_t *xyz, Int_t *index) const;
49 //valid only for straight rows straight rows
50 //calculate xyz[0] position relative to given index
52 void Transform4to3(Float_t *xyz, Int_t *index) const;
53 //valid only for straight rows straight rows
54 //transform xyz[0] position relative to given index
55 void Transform2to5( Float_t *xyz, Int_t *index) const;
56 //transform [x,y,z] to [r,rphi,z]
57 void Transform5to2(Float_t *xyz, Int_t *index) const;
58 //transform [r,rphi,z] coordinata to [x,y,z]
59 void Transform4to8(Float_t *xyz, Int_t *index) const;
60 //transform xyz coordinata to 'digit' coordinata
61 void Transform8to4(Float_t *xyz, Int_t *index) const;
62 //transform 'digit' coordinata to xyz coordinata
63 void Transform6to8(Float_t *xyz, Int_t *index) const;
64 //transform dr,f coordinata to 'digit' coordinata
65 void Transform8to6(Float_t *xyz, Int_t *index) const;
66 //transform 'digit' coordinata to dr,f coordinata
68 virtual Int_t Transform2toPadRow(Float_t */*xyz*/, Int_t */*index*/) const{return 0;}
69 //transform rotated to
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
74 virtual void XYZtoCRXYZ(Float_t */*xyz*/,
75 Int_t &/*sector*/, Int_t &/*padrow*/, Int_t /*option*/) const {;}
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
82 virtual void CRXYZtoXYZ(Float_t */*xyz*/,
83 const Int_t &/*sector*/, const Int_t & /*padrow*/, Int_t /*option*/) const {;}
84 //transform relative position to the gloabal position
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*/ ){;}
89 //transform position in digit units (time slices and pads) to "normal"
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*/){;}
94 //transform position in cm to position in digit unit
95 virtual Int_t CalcResponse(Float_t* /*x*/, Int_t * /*index*/, Int_t /*row*/){return 0;}
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
102 virtual Bool_t ReadGeoMatrices(); //read geo matrixes
103 Bool_t GetStatus() const; //get information about object consistency
104 Int_t GetIndex(Int_t sector, Int_t row) const; //give index of the given sector and pad row
105 Int_t GetNSegmentsTotal() const {return fNtRows;}
106 Double_t GetLowMaxY(Int_t irow) const {return irow*0.;}
107 Double_t GetUpMaxY(Int_t irow) const {return irow*0;}
108 //additional geometrical function - for Belikov
110 Bool_t AdjustSectorRow(Int_t index, Int_t & sector, Int_t &row) const; //return sector and padrow
113 void AdjustCosSin(Int_t isec, Float_t &cos, Float_t &sin) const;
114 //set cosinus and sinus of rotation angles for sector isec
115 Float_t GetAngle(Int_t isec) const;
116 // void GetChamberPos(Int_t isec, Float_t* xyz) const;
117 // void GetChamberRot(Int_t isec, Float_t* angles) const;
119 //set sector parameters
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,
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;}
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 ;}
141 //set wire parameters
143 void SetInnerNWires(Int_t nWires){ fNInnerWiresPerPad=nWires;}
144 void SetInnerDummyWire(Int_t dummy) {fInnerDummyWire = dummy;}
145 void SetInnerOffWire(Float_t offset) {fInnerOffWire =offset;}
146 void SetOuter1NWires(Int_t nWires){ fNOuter1WiresPerPad=nWires;}
147 void SetOuter2NWire(Int_t nWires){ fNOuter2WiresPerPad=nWires;}
148 void SetOuterDummyWire(Int_t dummy) {fOuterDummyWire = dummy;}
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;}
160 void SetInnerPadPitchLength(Float_t PadPitchLength){ fInnerPadPitchLength=PadPitchLength;}
161 void SetInnerPadPitchWidth(Float_t PadPitchWidth){ fInnerPadPitchWidth = PadPitchWidth;}
162 void SetInnerPadLength(Float_t PadLength){ fInnerPadLength=PadLength;}
163 void SetInnerPadWidth(Float_t PadWidth) { fInnerPadWidth=PadWidth;}
164 void SetOuter1PadPitchLength(Float_t PadPitchLength){ fOuter1PadPitchLength=PadPitchLength;}
165 void SetOuter2PadPitchLength(Float_t PadPitchLength){ fOuter2PadPitchLength=PadPitchLength;}
166 void SetOuterPadPitchWidth(Float_t PadPitchWidth){ fOuterPadPitchWidth = PadPitchWidth;}
167 void SetOuter1PadLength(Float_t PadLength){ fOuter1PadLength=PadLength;}
168 void SetOuter2PadLength(Float_t PadLength){ fOuter2PadLength=PadLength;}
169 void SetOuterPadWidth(Float_t PadWidth) { fOuterPadWidth=PadWidth;}
170 void SetMWPCReadout(Bool_t type) {fBMWPCReadout = type;}
171 void SetNCrossRows(Int_t rows){fNCrossRows = rows;}
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;}
183 //set electronivc parameters
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;}
196 //set response parameters
198 void SetNResponseMax(Int_t max) { fNResponseMax = max;}
199 void SetResponseThreshold(Int_t threshold) {fResponseThreshold = threshold;}
201 void SetGateDelay(Float_t delay) {fGateDelay = delay;}
202 void SetL1Delay(Float_t delay) {fL1Delay = delay;}
203 void SetNTBinsBeforeL1(UShort_t nbins) {fNTBinsBeforeL1 = nbins;}
205 //get sector parameters
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;}
222 Float_t GetZLength(Int_t sector=0) const;
223 Int_t GetGeometryType() const {return fGeometryType;}
226 //get wires parameter
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;}
234 Int_t GetOuter1NWires() const {return fNOuter1WiresPerPad;}
235 Int_t GetOuter2NWires() const {return fNOuter2WiresPerPad;}
236 Float_t GetOuterWWPitch() const {return fOuterWWPitch;}
237 Int_t GetOuterDummyWire() const {return fOuterDummyWire;}
238 Float_t GetOuterOffWire() const {return fOuterOffWire;}
239 Float_t GetLastWireUp1() const {return fLastWireUp1;}
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);}
247 Float_t GetInnerPadPitchLength() const {return fInnerPadPitchLength;}
248 Float_t GetInnerPadPitchWidth() const {return fInnerPadPitchWidth;}
249 Float_t GetInnerPadLength() const {return fInnerPadLength;}
250 Float_t GetInnerPadWidth() const {return fInnerPadWidth;}
251 Float_t GetOuter1PadPitchLength() const {return fOuter1PadPitchLength;}
252 Float_t GetOuter2PadPitchLength() const {return fOuter2PadPitchLength;}
253 Float_t GetOuterPadPitchWidth() const {return fOuterPadPitchWidth;}
254 Float_t GetOuter1PadLength() const {return fOuter1PadLength;}
255 Float_t GetOuter2PadLength() const {return fOuter2PadLength;}
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);}
261 Float_t GetPadPitchLength(Int_t isector = 0, Int_t padrow=0) const
262 { if (isector < fNInnerSector) return fInnerPadPitchLength;
263 else return ((padrow<fNRowUp1) ? fOuter1PadPitchLength:fOuter2PadPitchLength);}
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
266 Int_t GetNRowUp1() const; // number of short rows in up sector
267 Int_t GetNRowUp2() const; // number of long rows in up sector
268 Int_t GetNRow(Int_t isec) const {return ((isec<fNInnerSector) ? fNRowLow:fNRowUp);}
269 Int_t GetNRowsTotal() const {return fNtRows;} //get total nuber of rows
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 {
273 return ( (isec < fNInnerSector) ?GetPadRowRadiiLow(irow):GetPadRowRadiiUp(irow));}
274 //retrun radii of the pad row irow in sector i
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
277 Int_t GetNPads(Int_t isector,Int_t irow) const{
278 return ( (isector < fNInnerSector) ?GetNPadsLow(irow) : GetNPadsUp(irow));}
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
282 Int_t GetSectorIndex(Float_t angle, Int_t row, Float_t z) const; // get sector index
283 Float_t GetChamberCenter(Int_t isec, Float_t * center = 0) const; // get readout chamber positions
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;}
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;}
302 //get Electronic parameters
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;}
313 virtual Float_t GetZOffset() const {return 3*fTSigma*fDriftV;}
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;}
322 Int_t * GetResBin(Int_t i);
323 //return response bin i - bin given by padrow [0] pad[1] timebin[2]
324 Float_t & GetResWeight(Int_t i);
325 //return weight of response bin i
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;}
334 Bool_t fbStatus; //indicates consistency of the data
335 //---------------------------------------------------------------------
336 // ALICE TPC sector geometry
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
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
353 Float_t fZLength; //length of the drift region of the TPC
354 Float_t *fRotAngle; //[fNSector] sin and cos of rotation angles for
355 // diferent sectors -calculated
356 Int_t fGeometryType; //type of geometry -0 straight rows
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
365 TGeoHMatrix **fClusterMatrix; //![fNSector] transformation matrices of the cluster
367 TGeoHMatrix **fGlobalMatrix; //![fNSector] fTrackingMatrix * fClusterMatrix
370 //---------------------------------------------------------------------
371 // ALICE TPC wires geometry - for GEM we can consider that it is gating
372 //--------------------------------------------------------------------
373 Int_t fNInnerWiresPerPad; //Number of wires per pad
374 Float_t fInnerWWPitch; //pitch between wires in inner sector - calculated
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
379 Float_t fLastWireUp1; //position of the last wire in outer1 sector
380 Int_t fNOuter1WiresPerPad; //Number of wires per pad
381 Int_t fNOuter2WiresPerPad; // Number of wires per pad
382 Float_t fOuterWWPitch; //pitch between wires in outer sector -calculated
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
387 //---------------------------------------------------------------------
388 // ALICE TPC pad parameters
389 //--------------------------------------------------------------------
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
394 Float_t fOuter1PadPitchLength; //Outer pad pitch length
395 Float_t fOuter2PadPitchLength; //Outer pad pitch length
396 Float_t fOuterPadPitchWidth; //Outer pad pitch width
397 Float_t fOuter1PadLength; //Outer pad length
398 Float_t fOuter2PadLength; //Outer pad length
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
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
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
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
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
420 Float_t fDriftV; //drift velocity constant
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
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
442 //---------------------------------------------------------------------
443 // ALICE TPC response data
444 //---------------------------------------------------------------------
445 Int_t fNResponseMax; //maximal dimension of response
446 Float_t fResponseThreshold; //threshold for accepted response
447 Int_t fCurrentMax; //!current maximal dimension -calulated
448 Int_t *fResponseBin; //!array with bins -calulated
449 Float_t *fResponseWeight; //!array with response -calulated
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
460 AliTPCParam(const AliTPCParam &);
461 AliTPCParam & operator=(const AliTPCParam &);
462 ClassDef(AliTPCParam,4) //parameter object for set:TPC
466 inline Int_t * AliTPCParam::GetResBin(Int_t i)
468 //return response bin i - bin given by padrow [0] pad[1] timebin[2]
469 if (i<fCurrentMax) return &fResponseBin[i*3];
473 inline Float_t &AliTPCParam::GetResWeight(Int_t i)
475 //return weight of response bin i
476 if (i<fCurrentMax) return fResponseWeight[i];
477 else return fResponseWeight[i];
481 inline void AliTPCParam::AdjustCosSin(Int_t isec, Float_t &cos, Float_t &sin) const
484 //set cosinus and sinus of rotation angles for sector isec
486 cos=fRotAngle[isec*4];
487 sin=fRotAngle[isec*4+1];
490 inline Float_t AliTPCParam::GetAngle(Int_t isec) const
493 //return rotation angle of given sector
495 return fRotAngle[isec*4+2];
499 inline void AliTPCParam::Transform1to2Ideal(Float_t *xyz, Int_t *index) const
501 //transformation to rotated coordinates
502 //we must have information about sector!
503 //rotate to given sector
507 AdjustCosSin(index[1],cos,sin);
508 Float_t x1=xyz[0]*cos + xyz[1]*sin;
509 Float_t y1=-xyz[0]*sin + xyz[1]*cos;
512 xyz[2]=fZLength-TMath::Abs(xyz[2]);
517 inline void AliTPCParam::Transform1to2(Float_t *xyz, Int_t *index) const
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]};
523 Double_t xyzlocal[3]={0,0,0};
524 if (index[1]>=0 && index[1]<fNSector)
525 fGlobalMatrix[index[1]]->MasterToLocal(xyzmaster,xyzlocal);
526 xyz[0] = xyzlocal[0];
527 xyz[1] = xyzlocal[1];
528 xyz[2] = xyzlocal[2];
535 inline void AliTPCParam::Transform2to1(Float_t *xyz, Int_t *index) const
538 //transformation from rotated coordinates to global coordinates
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;
546 xyz[2]=fZLength-xyz[2];
547 if (index[1]<fNInnerSector)
548 {if ( index[1]>=(fNInnerSector>>1)) xyz[2]*=-1.;}
550 {if ( (index[1]-fNInnerSector) >= (fNOuterSector>>1) ) xyz[2]*=-1;}
554 inline void AliTPCParam::Transform2to2(Float_t *xyz, Int_t *index, Int_t *oindex) const
556 //transform rotated coordinats of one sector to rotated
557 //coordinates relative to another sector
558 Transform2to1(xyz,index);
559 Transform1to2(xyz,oindex);
564 inline Float_t AliTPCParam::Transform2to2NearestWire(Float_t *xyz, Int_t *index) const
567 // asigns the x-position of the closest wire to xyz[0], return the
568 // electron to closest wire distance
571 if (index[1]<fNInnerSector) {
572 xnew = fRInnerFirstWire+TMath::Nint((xyz[0]-fRInnerFirstWire)/fInnerWWPitch)*fInnerWWPitch;
575 xnew = fROuterFirstWire+TMath::Nint((xyz[0]-fROuterFirstWire)/fOuterWWPitch)*fOuterWWPitch;
582 inline Int_t AliTPCParam::Transform2to3(Float_t *xyz, Int_t *index) const
585 //calulates coresponding pad row number, sets index[2] for straight rows
586 //does not change xyz[] information
587 //valid only for straight row
589 if (index[1]<fNInnerSector)
590 index[2] =TMath::Nint((xyz[0]-fPadRowLow[0])/fInnerPadPitchLength);
592 if (xyz[0] < fLastWireUp1 )
593 index[2] = TMath::Nint((xyz[0]-fPadRowUp[0])/fOuter1PadPitchLength);
595 index[2] = TMath::Nint(fNRowUp1+(xyz[0]-fPadRowUp[64])/fOuter2PadPitchLength);
600 inline void AliTPCParam::Transform3to4(Float_t *xyz, Int_t *index) const
603 //valid only for straight rows straight rows
604 //calculate xyz[0] position relative to given index
606 if (index[1]<fNInnerSector)
607 xyz[0] -=index[2]*fInnerPadPitchLength+fPadRowLow[0];
609 if (index[2]<fNRowUp1)
610 xyz[0] -=index[2]*fOuter1PadPitchLength+fPadRowUp[0];
612 xyz[0] -=(index[2]-fNRowUp1)*fOuter2PadPitchLength+fPadRowUp[64];
616 inline void AliTPCParam::Transform4to3(Float_t *xyz, Int_t *index) const
619 //valid only for straight rows
620 //transforms relative xyz[0] to the global one within given sector
622 if (index[1]<fNInnerSector)
623 xyz[0] +=index[2]*fInnerPadPitchLength+fPadRowLow[0];
625 if(index[2]<fNRowUp1)
626 xyz[0] +=index[2]*fOuter1PadPitchLength+fPadRowUp[0];
628 xyz[0] +=index[2]*fOuter2PadPitchLength+fPadRowUp[64];
633 inline void AliTPCParam::Transform2to5( Float_t *xyz, Int_t *index) const
636 //transform [x,y,z] to [r,phi,z]
639 Float_t r = TMath::Sqrt(xyz[0]*xyz[0]+xyz[1]*xyz[1]);
640 if ((xyz[0]==0)&&(xyz[1]==0)) angle = 0;
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;
652 inline void AliTPCParam::Transform5to2( Float_t *xyz, Int_t *index) const
655 //transform [r,rphi,z] to [x,y,z]
658 Float_t angle= xyz[1];
659 xyz[0]=r*TMath::Cos(angle);
660 xyz[1]=r*TMath::Sin(angle);
664 inline void AliTPCParam::Transform4to8(Float_t *xyz, Int_t *index) const
667 //transform xyz coordinates to 'digit' coordinates
670 if (index[1]<fNInnerSector) {
671 if ( index[1]>=(fNInnerSector>>1)) xyz[1]*=-1.;
674 if ( (index[1]-fNInnerSector) >= (fNOuterSector>>1) ) xyz[1]*=-1;
678 if (index[1]<fNInnerSector) {
679 xyz[0]/=fInnerPadPitchLength;
680 xyz[1]/=fInnerPadPitchWidth;
683 xyz[1]/=fOuterPadPitchWidth;
684 if (index[2]<fNRowUp1 ) xyz[0]/=fOuter1PadPitchLength;
685 else xyz[0]/=fOuter2PadPitchLength;
691 inline void AliTPCParam::Transform8to4(Float_t *xyz, Int_t *index) const
694 //transforms 'digit' coordinates to xyz coordinates
696 if (index[1]<fNInnerSector) {
697 if ( index[1]>=(fNInnerSector>>1)) xyz[1]*=-1.;
700 if ( (index[1]-fNInnerSector) >= (fNOuterSector>>1) ) xyz[1]*=-1;
704 if (index[1]<fNInnerSector) {
705 xyz[0]*=fInnerPadPitchLength;
706 xyz[1]*=fInnerPadPitchWidth;
709 xyz[1]*=fOuterPadPitchWidth;
710 if (index[2] < fNRowUp1 ) xyz[0]*=fOuter1PadPitchLength;
711 else xyz[0]*=fOuter2PadPitchLength;
716 inline void AliTPCParam::Transform6to8(Float_t *xyz, Int_t *index) const
719 //transforms cylindrical xyz coordinates to 'digit' coordinates
722 if (index[1]<fNInnerSector) {
723 xyz[0]/=fInnerPadPitchLength;
724 xyz[1]*=xyz[0]/fInnerPadPitchWidth;
727 xyz[1]*=xyz[0]/fOuterPadPitchWidth;
728 if (index[2] < fNRowUp1 ) xyz[0]/=fOuter1PadPitchLength;
729 else xyz[0]/=fOuter2PadPitchLength;
734 inline void AliTPCParam::Transform8to6(Float_t *xyz, Int_t *index) const
737 //transforms 'digit' coordinates to cylindrical xyz coordinates
740 if (index[1]<fNInnerSector) {
741 xyz[0]*=fInnerPadPitchLength;
742 xyz[1]/=xyz[0]/fInnerPadPitchWidth;
745 xyz[1]/=xyz[0]/fOuterPadPitchWidth;
746 if (index[2] < fNRowUp1 ) xyz[0]*=fOuter1PadPitchLength;
747 else xyz[0]*=fOuter2PadPitchLength;
751 inline Float_t AliTPCParam::GetZLength(Int_t sector) const
752 { if(sector <18 || (sector>35&§or<54)) return fZLength-0.275;
753 else return fZLength-0.302;