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>
19 class AliTPCParam : public AliDetectorParam {
20 //////////////////////////////////////////////////////
21 //////////////////////////////////////////////////////
22 //ALITPCParam object to be possible change
23 //geometry and some other parameters of TPC
24 //used by AliTPC and AliTPCSector
28 virtual ~AliTPCParam();
29 TGeoHMatrix * Tracking2LocalMatrix(const TGeoHMatrix * geoMatrix, Int_t sector) const;
30 virtual Bool_t Transform(Float_t *xyz, Int_t *index, Int_t* oindex);
31 //transformation from input coodination system to output coordination system
32 Int_t Transform0to1(Float_t *xyz, Int_t *index) const;
33 //trasforamtion from global to global - adjust index[0] sector
34 //return value is equal to sector corresponding to global position
35 void Transform1to2Ideal(Float_t *xyz, Int_t *index) const;
36 //transformation to rotated coordinata - ideal frame
37 void Transform1to2(Float_t *xyz, Int_t *index) const;
38 //transformation to rotated coordinata
39 void Transform2to1(Float_t *xyz, Int_t *index) const;
40 //transformation from rotated coordinata to global coordinata
41 void Transform2to2(Float_t *xyz, Int_t *index, Int_t *oindex) const;
42 //transform rotated coordinata of one sector to rotated
43 //coordinata relative to another sector
44 Float_t Transform2to2NearestWire(Float_t *xyz, Int_t *index) const;
45 //round x position to nearest wire
46 Int_t Transform2to3(Float_t *xyz, Int_t *index) const;
47 //calulate coresponding index[2] -pad row for straight rows
48 //does not change xyz[]
50 void Transform3to4(Float_t *xyz, Int_t *index) const;
51 //valid only for straight rows straight rows
52 //calculate xyz[0] position relative to given index
54 void Transform4to3(Float_t *xyz, Int_t *index) const;
55 //valid only for straight rows straight rows
56 //transform xyz[0] position relative to given index
57 void Transform2to5( Float_t *xyz, Int_t *index) const;
58 //transform [x,y,z] to [r,rphi,z]
59 void Transform5to2(Float_t *xyz, Int_t *index) const;
60 //transform [r,rphi,z] coordinata to [x,y,z]
61 void Transform4to8(Float_t *xyz, Int_t *index) const;
62 //transform xyz coordinata to 'digit' coordinata
63 void Transform8to4(Float_t *xyz, Int_t *index) const;
64 //transform 'digit' coordinata to xyz coordinata
65 void Transform6to8(Float_t *xyz, Int_t *index) const;
66 //transform dr,f coordinata to 'digit' coordinata
67 void Transform8to6(Float_t *xyz, Int_t *index) const;
68 //transform 'digit' coordinata to dr,f coordinata
70 virtual Int_t Transform2toPadRow(Float_t */*xyz*/, Int_t */*index*/) const{return 0;}
71 //transform rotated to
73 virtual Int_t GetPadRow(Float_t *xyz, Int_t *index) const ;
74 //return pad row of point xyz - xyz is given in coordinate system -(given by index)
75 //output system is 3 for straight row and 7 for cylindrical row
76 virtual void XYZtoCRXYZ(Float_t */*xyz*/,
77 Int_t &/*sector*/, Int_t &/*padrow*/, Int_t /*option*/) const {;}
78 //transform global position to the position relative to the sector padrow
79 //if option=0 X calculate absolute calculate sector
80 //if option=1 X absolute use input sector
81 //if option=2 X relative to pad row calculate sector
82 //if option=3 X relative use input sector
84 virtual void CRXYZtoXYZ(Float_t */*xyz*/,
85 const Int_t &/*sector*/, const Int_t & /*padrow*/, Int_t /*option*/) const {;}
86 //transform relative position to the gloabal position
88 virtual void CRTimePadtoYZ(Float_t &/*y*/, Float_t &/*z*/,
89 const Float_t &/*time*/, const Float_t &/*pad*/,
90 Int_t /*sector*/, Int_t /*padrow*/ ){;}
91 //transform position in digit units (time slices and pads) to "normal"
93 virtual void CRYZtoTimePad(const Float_t &/*y*/, const Float_t &/*z*/,
94 Float_t &/*time*/, Float_t &/*pad*/,
95 Int_t /*sector*/, Int_t /*padrow*/){;}
96 //transform position in cm to position in digit unit
97 virtual Int_t CalcResponse(Float_t* /*x*/, Int_t * /*index*/, Int_t /*row*/){return 0;}
98 //calculate bin response as function of the input position -x and the weight
99 //if row -pad row is equal -1 calculate response for each pad row
100 //otherwise it calculate only in given pad row
101 //return number of valid response bin
102 virtual void SetDefault(); //set defaut TPCparam
103 virtual Bool_t Update(); //recalculate and check geometric parameters
104 virtual Bool_t ReadGeoMatrices(); //read geo matrixes
105 Bool_t GetStatus() const; //get information about object consistency
106 Int_t GetIndex(Int_t sector, Int_t row) const; //give index of the given sector and pad row
107 Int_t GetNSegmentsTotal() const {return fNtRows;}
108 Double_t GetLowMaxY(Int_t irow) const {return irow*0.;}
109 Double_t GetUpMaxY(Int_t irow) const {return irow*0;}
110 //additional geometrical function - for Belikov
112 Bool_t AdjustSectorRow(Int_t index, Int_t & sector, Int_t &row) const; //return sector and padrow
115 void AdjustCosSin(Int_t isec, Float_t &cos, Float_t &sin) const;
116 //set cosinus and sinus of rotation angles for sector isec
117 Float_t GetAngle(Int_t isec) const;
118 // void GetChamberPos(Int_t isec, Float_t* xyz) const;
119 // void GetChamberRot(Int_t isec, Float_t* angles) const;
121 //set sector parameters
123 void SetInnerRadiusLow(Float_t InnerRadiusLow ) { fInnerRadiusLow=InnerRadiusLow;}
124 void SetOuterRadiusLow(Float_t OuterRadiusLow ) { fOuterRadiusLow=OuterRadiusLow;}
125 void SetInnerRadiusUp(Float_t InnerRadiusUp) { fInnerRadiusUp= InnerRadiusUp;}
126 void SetOuterRadiusUp(Float_t OuterRadiusUp) { fOuterRadiusUp= OuterRadiusUp;}
127 void SetSectorAngles(Float_t innerangle, Float_t innershift, Float_t outerangle,
129 void SetInnerFrameSpace(Float_t frspace) {fInnerFrameSpace = frspace;}
130 void SetOuterFrameSpace(Float_t frspace) {fOuterFrameSpace = frspace;}
131 void SetInnerWireMount(Float_t fmount) {fInnerWireMount = fmount;}
132 void SetOuterWireMount(Float_t fmount) {fOuterWireMount = fmount;}
133 void SetZLength(Float_t zlength) {fZLength = zlength;}
134 void SetGeometryType(Int_t type) {fGeometryType = type;}
138 void SetRowNLow( Int_t NRowLow){fNRowLow = NRowLow;}
139 void SetRowNUp1 (Int_t NRowUp1){fNRowUp1 = NRowUp1 ;} //upper sec short pads
140 void SetRowNUp2 (Int_t NRowUp2){fNRowUp2 = NRowUp2 ;} //upper sec long pads
141 void SetRowNUp (Int_t NRowUp){fNRowUp = NRowUp ;}
143 //set wire parameters
145 void SetInnerNWires(Int_t nWires){ fNInnerWiresPerPad=nWires;}
146 void SetInnerDummyWire(Int_t dummy) {fInnerDummyWire = dummy;}
147 void SetInnerOffWire(Float_t offset) {fInnerOffWire =offset;}
148 void SetOuter1NWires(Int_t nWires){ fNOuter1WiresPerPad=nWires;}
149 void SetOuter2NWire(Int_t nWires){ fNOuter2WiresPerPad=nWires;}
150 void SetOuterDummyWire(Int_t dummy) {fOuterDummyWire = dummy;}
151 void SetOuterOffWire(Float_t offset) {fOuterOffWire =offset;}
152 void SetInnerWWPitch( Float_t wwPitch) {fInnerWWPitch = wwPitch;}
153 void SetRInnerFirstWire(Float_t firstWire){fRInnerFirstWire = firstWire;}
154 void SetRInnerLastWire(Float_t lastWire){fRInnerLastWire = lastWire;}
155 void SetOuterWWPitch(Float_t wwPitch){fOuterWWPitch = wwPitch;}
156 void SetLastWireUp1(Float_t wireUp1){fLastWireUp1 = wireUp1;}
157 void SetROuterFirstWire(Float_t firstWire){fROuterFirstWire = firstWire;}
158 void SetROuterLastWire(Float_t lastWire){fROuterLastWire = lastWire;}
162 void SetInnerPadPitchLength(Float_t PadPitchLength){ fInnerPadPitchLength=PadPitchLength;}
163 void SetInnerPadPitchWidth(Float_t PadPitchWidth){ fInnerPadPitchWidth = PadPitchWidth;}
164 void SetInnerPadLength(Float_t PadLength){ fInnerPadLength=PadLength;}
165 void SetInnerPadWidth(Float_t PadWidth) { fInnerPadWidth=PadWidth;}
166 void SetOuter1PadPitchLength(Float_t PadPitchLength){ fOuter1PadPitchLength=PadPitchLength;}
167 void SetOuter2PadPitchLength(Float_t PadPitchLength){ fOuter2PadPitchLength=PadPitchLength;}
168 void SetOuterPadPitchWidth(Float_t PadPitchWidth){ fOuterPadPitchWidth = PadPitchWidth;}
169 void SetOuter1PadLength(Float_t PadLength){ fOuter1PadLength=PadLength;}
170 void SetOuter2PadLength(Float_t PadLength){ fOuter2PadLength=PadLength;}
171 void SetOuterPadWidth(Float_t PadWidth) { fOuterPadWidth=PadWidth;}
172 void SetMWPCReadout(Bool_t type) {fBMWPCReadout = type;}
173 void SetNCrossRows(Int_t rows){fNCrossRows = rows;}
177 void SetDiffT(Float_t DiffT){ fDiffT= DiffT;}
178 void SetDiffL(Float_t DiffL){ fDiffL=DiffL;}
179 void SetGasGain(Float_t GasGain){ fGasGain=GasGain;}
180 void SetDriftV(Float_t DriftV){ fDriftV= DriftV;}
181 void SetOmegaTau(Float_t OmegaTau){ fOmegaTau=OmegaTau;}
182 void SetAttCoef(Float_t AttCoef){ fAttCoef=AttCoef;}
183 void SetOxyCont(Float_t OxyCont){ fOxyCont=OxyCont;}
185 //set electronivc parameters
187 void SetPadCoupling(Float_t PadCoupling){ fPadCoupling=PadCoupling;}
188 void SetZeroSup(Int_t ZeroSup) { fZeroSup=ZeroSup;}
189 void SetNoise(Float_t Noise ) { fNoise= Noise;}
190 void SetChipGain(Float_t ChipGain){ fChipGain= ChipGain;}
191 void SetChipNorm(Float_t ChipNorm){ fChipNorm= ChipNorm;}
192 void SetTSample(Float_t TSample) { fTSample=TSample;}
193 void SetTFWHM(Float_t fwhm) { fTSigma=fwhm/2.35;}
194 void SetMaxTBin(Int_t maxtbin) { fMaxTBin = maxtbin;}
195 void SetADCSat(Int_t adcsat) { fADCSat = adcsat;}
196 void SetADCDynRange(Float_t adcdynrange) {fADCDynRange = adcdynrange;}
198 // High voltage parameters
200 void SetNominalVoltage(Float_t v, UInt_t i) {if (i<72) fNominalVoltage[i]=v;}
201 void SetMaxVoltageDeviation(Float_t voltage) { fMaxVoltageDeviation=voltage; }
202 void SetMaxDipVoltage(Float_t voltage) { fMaxDipVoltage=voltage; }
203 void SetMaxFractionHVbad(Float_t frac ) { fMaxHVfractionBad=frac; }
204 void SetVoltageDipScanPeriod(Float_t period) { fVoltageDipScanPeriod=period; }
206 //set response parameters
208 void SetNResponseMax(Int_t max) { fNResponseMax = max;}
209 void SetResponseThreshold(Int_t threshold) {fResponseThreshold = threshold;}
211 void SetGateDelay(Float_t delay) {fGateDelay = delay;}
212 void SetL1Delay(Float_t delay) {fL1Delay = delay;}
213 void SetNTBinsBeforeL1(UShort_t nbins) {fNTBinsBeforeL1 = nbins;}
215 //get sector parameters
217 Float_t GetInnerRadiusLow() const {return fInnerRadiusLow;}
218 Float_t GetInnerRadiusUp() const {return fInnerRadiusUp;}
219 Float_t GetOuterRadiusLow() const {return fOuterRadiusLow;}
220 Float_t GetOuterRadiusUp() const {return fOuterRadiusUp;}
221 Float_t GetInnerFrameSpace() const {return fInnerFrameSpace;}
222 Float_t GetOuterFrameSpace() const {return fOuterFrameSpace;}
223 Float_t GetInnerWireMount() const {return fInnerWireMount;}
224 Float_t GetOuterWireMount() const {return fOuterWireMount;}
225 Float_t GetInnerAngle() const ;
226 Float_t GetInnerAngleShift() const ;
227 Float_t GetOuterAngle() const ;
228 Float_t GetOuterAngleShift() const ;
229 Int_t GetNInnerSector() const {return fNInnerSector;}
230 Int_t GetNOuterSector() const {return fNOuterSector;}
231 Int_t GetNSector() const {return fNSector;}
232 Float_t GetZLength(Int_t sector=0) const;
233 Int_t GetGeometryType() const {return fGeometryType;}
236 //get wires parameter
238 Int_t GetInnerNWires() const {return fNInnerWiresPerPad;}
239 Float_t GetInnerWWPitch() const {return fInnerWWPitch;}
240 Int_t GetInnerDummyWire() const {return fInnerDummyWire;}
241 Float_t GetInnerOffWire() const {return fInnerOffWire;}
242 Float_t GetRInnerFirstWire() const {return fRInnerFirstWire;}
243 Float_t GetRInnerLastWire() const {return fRInnerLastWire;}
244 Int_t GetOuter1NWires() const {return fNOuter1WiresPerPad;}
245 Int_t GetOuter2NWires() const {return fNOuter2WiresPerPad;}
246 Float_t GetOuterWWPitch() const {return fOuterWWPitch;}
247 Int_t GetOuterDummyWire() const {return fOuterDummyWire;}
248 Float_t GetOuterOffWire() const {return fOuterOffWire;}
249 Float_t GetLastWireUp1() const {return fLastWireUp1;}
250 Float_t GetROuterFirstWire() const {return fROuterFirstWire;}
251 Float_t GetROuterLastWire() const {return fROuterLastWire;}
252 Float_t GetWWPitch(Int_t isector = 0) const {
253 return ( (isector < fNInnerSector) ? fInnerWWPitch :fOuterWWPitch);}
257 Float_t GetInnerPadPitchLength() const {return fInnerPadPitchLength;}
258 Float_t GetInnerPadPitchWidth() const {return fInnerPadPitchWidth;}
259 Float_t GetInnerPadLength() const {return fInnerPadLength;}
260 Float_t GetInnerPadWidth() const {return fInnerPadWidth;}
261 Float_t GetOuter1PadPitchLength() const {return fOuter1PadPitchLength;}
262 Float_t GetOuter2PadPitchLength() const {return fOuter2PadPitchLength;}
263 Float_t GetOuterPadPitchWidth() const {return fOuterPadPitchWidth;}
264 Float_t GetOuter1PadLength() const {return fOuter1PadLength;}
265 Float_t GetOuter2PadLength() const {return fOuter2PadLength;}
266 Float_t GetOuterPadWidth() const {return fOuterPadWidth;}
267 Bool_t GetMWPCReadout() const {return fBMWPCReadout;}
268 Int_t GetNCrossRows() const {return fNCrossRows;}
269 Float_t GetPadPitchWidth(Int_t isector = 0) const {
270 return ( (isector < fNInnerSector) ? fInnerPadPitchWidth :fOuterPadPitchWidth);}
271 Float_t GetPadPitchLength(Int_t isector = 0, Int_t padrow=0) const
272 { if (isector < fNInnerSector) return fInnerPadPitchLength;
273 else return ((padrow<fNRowUp1) ? fOuter1PadPitchLength:fOuter2PadPitchLength);}
274 Int_t GetNRowLow() const; //get the number of pad rows in low sector
275 Int_t GetNRowUp() const; //get the number of pad rows in up sector
276 Int_t GetNRowUp1() const; // number of short rows in up sector
277 Int_t GetNRowUp2() const; // number of long rows in up sector
278 Int_t GetNRow(Int_t isec) const {return ((isec<fNInnerSector) ? fNRowLow:fNRowUp);}
279 Int_t GetNRowsTotal() const {return fNtRows;} //get total nuber of rows
280 Float_t GetPadRowRadiiLow(Int_t irow) const; //get the pad row (irow) radii
281 Float_t GetPadRowRadiiUp(Int_t irow) const; //get the pad row (irow) radii
282 Float_t GetPadRowRadii(Int_t isec,Int_t irow) const {
283 return ( (isec < fNInnerSector) ?GetPadRowRadiiLow(irow):GetPadRowRadiiUp(irow));}
284 //retrun radii of the pad row irow in sector i
285 Int_t GetNPadsLow(Int_t irow) const; //get the number of pads in row irow
286 Int_t GetNPadsUp(Int_t irow) const; //get the number of pads in row irow
287 Int_t GetNPads(Int_t isector,Int_t irow) const{
288 return ( (isector < fNInnerSector) ?GetNPadsLow(irow) : GetNPadsUp(irow));}
290 Float_t GetYInner(Int_t irow) const; // wire length in low sec row
291 Float_t GetYOuter(Int_t irow) const; // wire length in up sec row
292 Int_t GetSectorIndex(Float_t angle, Int_t row, Float_t z) const; // get sector index
293 Float_t GetChamberCenter(Int_t isec, Float_t * center = 0) const; // get readout chamber positions
294 TGeoHMatrix *GetTrackingMatrix(Int_t isec) const {
295 return fTrackingMatrix[isec];}
296 TGeoHMatrix *GetClusterMatrix(Int_t isec) const {
297 return fClusterMatrix[isec];}
298 TGeoHMatrix *GetGlobalMatrix(Int_t isec) const {
299 return fGlobalMatrix[isec];}
300 Bool_t IsGeoRead(){ return fGlobalMatrix!=0;}
304 Float_t GetDiffT() const {return fDiffT;}
305 Float_t GetDiffL() const {return fDiffL;}
306 Float_t GetGasGain() const {return fGasGain;}
307 Float_t GetDriftV() const {return fDriftV;}
308 Float_t GetOmegaTau() const {return fOmegaTau;}
309 Float_t GetAttCoef() const {return fAttCoef;}
310 Float_t GetOxyCont() const {return fOxyCont;}
312 //get Electronic parameters
314 Float_t GetPadCoupling() const {return fPadCoupling;}
315 Int_t GetZeroSup() const {return fZeroSup;}
316 Float_t GetNoise() const {return fNoise;}
317 Float_t GetChipGain() const {return fChipGain;}
318 Float_t GetChipNorm() const {return fChipNorm;}
319 Float_t GetTSample() const {return fTSample;}
320 Float_t GetZWidth() const {return fZWidth;}
321 Float_t GetTFWHM() const {return fTSigma*2.35;}
322 Float_t GetZSigma() const {return fTSigma*fDriftV;}
323 virtual Float_t GetZOffset() const {return 3*fTSigma*fDriftV;}
324 Int_t GetMaxTBin() const {return fMaxTBin;}
325 Int_t GetADCSat() const {return fADCSat;}
326 Float_t GetADCDynRange() const {return fADCDynRange;}
327 Float_t GetTotalNormFac() const {return fTotalNormFac;}
328 Float_t GetNoiseNormFac() const {return fNoiseNormFac;}
330 // High voltage parameters
332 Float_t GetNominalVoltage(UInt_t i) const {return (i<72)?fNominalVoltage[i]:0;} //0-35:IROC, 36-71:OROC
333 Float_t GetMaxVoltageDeviation() const { return fMaxVoltageDeviation; }
334 Float_t GetMaxDipVoltage() const { return fMaxDipVoltage; }
335 Float_t GetMaxFractionHVbad() const { return fMaxHVfractionBad; }
336 Float_t GetVoltageDipScanPeriod() const { return fVoltageDipScanPeriod; }
341 Int_t * GetResBin(Int_t i);
342 //return response bin i - bin given by padrow [0] pad[1] timebin[2]
343 Float_t & GetResWeight(Int_t i);
344 //return weight of response bin i
347 Float_t GetGateDelay() const {return fGateDelay;}
348 Float_t GetL1Delay() const {return fL1Delay;}
349 UShort_t GetNTBinsBeforeL1() const {return fNTBinsBeforeL1;}
350 Float_t GetNTBinsL1() const {return fNTBinsL1;}
353 Bool_t fbStatus; //indicates consistency of the data
354 //---------------------------------------------------------------------
355 // ALICE TPC sector geometry
356 //--------------------------------------------------------------------
357 Float_t fInnerRadiusLow; // lower radius of inner sector-IP
358 Float_t fInnerRadiusUp; // upper radius of inner sector-IP
359 Float_t fOuterRadiusUp; // upper radius of outer sector-IP
360 Float_t fOuterRadiusLow; // lower radius of outer sector-IP
361 Float_t fInnerAngle; //opening angle of Inner sector
362 Float_t fInnerAngleShift; //shift of first inner sector center to the 0
363 Float_t fOuterAngle; //opening angle of outer sector
364 Float_t fOuterAngleShift; //shift of first sector center to the 0
365 Float_t fInnerFrameSpace; //space for inner frame in the phi direction
366 Float_t fOuterFrameSpace; //space for outer frame in the phi direction
367 Float_t fInnerWireMount; //space for wire mount, inner sector
368 Float_t fOuterWireMount; //space for wire mount, outer sector
369 Int_t fNInnerSector; //number of inner sectors -calculated
370 Int_t fNOuterSector; //number of outer sectors -calculated
371 Int_t fNSector; // total number of sectors -calculated
372 Float_t fZLength; //length of the drift region of the TPC
373 Float_t *fRotAngle; //[fNSector] sin and cos of rotation angles for
374 // diferent sectors -calculated
375 Int_t fGeometryType; //type of geometry -0 straight rows
376 // Float_t *fChamberPos; //[fNSector] displacements of the readout chambers
377 //with respect to the 'idead' geometry
378 //in local corrdinate system
379 // Float_t *fChamberRot; //[fNSector] rotation angles of the readout chambers
380 //with respect to the 'idead' geometry
381 //in local corrdinate system
382 TGeoHMatrix **fTrackingMatrix; //![fNSector] transformation matrices of the tracking
384 TGeoHMatrix **fClusterMatrix; //![fNSector] transformation matrices of the cluster
386 TGeoHMatrix **fGlobalMatrix; //![fNSector] fTrackingMatrix * fClusterMatrix
389 //---------------------------------------------------------------------
390 // ALICE TPC wires geometry - for GEM we can consider that it is gating
391 //--------------------------------------------------------------------
392 Int_t fNInnerWiresPerPad; //Number of wires per pad
393 Float_t fInnerWWPitch; //pitch between wires in inner sector - calculated
394 Int_t fInnerDummyWire; //number of wires without pad readout
395 Float_t fInnerOffWire; //oofset of first wire to the begining of the sector
396 Float_t fRInnerFirstWire; //position of the first wire -calculated
397 Float_t fRInnerLastWire; //position of the last wire -calculated
398 Float_t fLastWireUp1; //position of the last wire in outer1 sector
399 Int_t fNOuter1WiresPerPad; //Number of wires per pad
400 Int_t fNOuter2WiresPerPad; // Number of wires per pad
401 Float_t fOuterWWPitch; //pitch between wires in outer sector -calculated
402 Int_t fOuterDummyWire; //number of wires without pad readout
403 Float_t fOuterOffWire; //oofset of first wire to the begining of the sector
404 Float_t fROuterFirstWire; //position of the first wire -calulated
405 Float_t fROuterLastWire; //position of the last wire -calculated
406 //---------------------------------------------------------------------
407 // ALICE TPC pad parameters
408 //--------------------------------------------------------------------
409 Float_t fInnerPadPitchLength; //Inner pad pitch length
410 Float_t fInnerPadPitchWidth; //Inner pad pitch width
411 Float_t fInnerPadLength; //Inner pad length
412 Float_t fInnerPadWidth; //Inner pad width
413 Float_t fOuter1PadPitchLength; //Outer pad pitch length
414 Float_t fOuter2PadPitchLength; //Outer pad pitch length
415 Float_t fOuterPadPitchWidth; //Outer pad pitch width
416 Float_t fOuter1PadLength; //Outer pad length
417 Float_t fOuter2PadLength; //Outer pad length
418 Float_t fOuterPadWidth; //Outer pad width
419 Bool_t fBMWPCReadout; //indicate wire readout - kTRUE or GEM readout -kFALSE
420 Int_t fNCrossRows; //number of rows to crostalk calculation
422 Int_t fNRowLow; //number of pad rows per low sector -set
423 Int_t fNRowUp1; //number of short pad rows per sector up -set
424 Int_t fNRowUp2; //number of long pad rows per sector up -set
425 Int_t fNRowUp; //number of pad rows per sector up -calculated
426 Int_t fNtRows; //total number of rows in TPC -calculated
427 Float_t fPadRowLow[600]; //Lower sector, pad row radii -calculated
428 Float_t fPadRowUp[600]; //Upper sector, pad row radii -calculated
429 Int_t fNPadsLow[600]; //Lower sector, number of pads per row -calculated
430 Int_t fNPadsUp[600]; //Upper sector, number of pads per row -calculated
431 Float_t fYInner[600]; //Inner sector, wire-length
432 Float_t fYOuter[600]; //Outer sector, wire-length
433 //---------------------------------------------------------------------
434 // ALICE TPC Gas Parameters
435 //--------------------------------------------------------------------
436 Float_t fDiffT; //tangencial diffusion constant
437 Float_t fDiffL; //longutudinal diffusion constant
438 Float_t fGasGain; //gas gain constant
439 Float_t fDriftV; //drift velocity constant
440 Float_t fOmegaTau; //omega tau ExB coeficient
441 Float_t fAttCoef; //attachment coefitients
442 Float_t fOxyCont; //oxygen content
443 //---------------------------------------------------------------------
444 // ALICE TPC Electronics Parameters
445 //--------------------------------------------------------------------
446 Float_t fPadCoupling; //coupling factor ration of anode signal
447 //and total pads signal
448 Int_t fZeroSup; //zero suppresion constant
449 Float_t fNoise; //noise sigma constant
450 Float_t fChipGain; //preamp shaper constant
451 Float_t fChipNorm; //preamp shaper normalisation
452 Float_t fTSample; //sampling time
453 Float_t fZWidth; //derived value calculated using TSample and driftw -computed
454 Float_t fTSigma; //width of the Preamp/Shaper function
455 Int_t fMaxTBin; //maximum time bin number
456 Int_t fADCSat; //saturation value of ADC (10 bits)
457 Float_t fADCDynRange; //input dynamic range (mV)
458 Float_t fTotalNormFac; //full normalisation factor - calculated
459 Float_t fNoiseNormFac; //normalisation factor to transform noise in electron to ADC channel
460 //---------------------------------------------------------------------
461 // High voltage parameters
462 //---------------------------------------------------------------------
463 Float_t fNominalVoltage[72]; //nominal voltage in [V] per chamber
464 Float_t fMaxVoltageDeviation; // maximum voltage deviation from nominal voltage before a chamber is masked
465 Float_t fMaxDipVoltage; // maximum voltage deviation from median before a dip event is marked
466 Float_t fMaxHVfractionBad; // maximum fraction of bad HV entries (deviation from Median) before a chamber is marked bad
467 Float_t fVoltageDipScanPeriod; // scanning period to detect a high volrage dip: event time stamp +- fVoltageDipScanPeriod [sec]
469 //---------------------------------------------------------------------
470 // ALICE TPC response data
471 //---------------------------------------------------------------------
472 Int_t fNResponseMax; //maximal dimension of response
473 Float_t fResponseThreshold; //threshold for accepted response
474 Int_t fCurrentMax; //!current maximal dimension -calulated
475 Int_t *fResponseBin; //!array with bins -calulated
476 Float_t *fResponseWeight; //!array with response -calulated
478 //---------------------------------------------------------------------
479 // ALICE TPC L1 Parameters
480 //--------------------------------------------------------------------
481 Float_t fGateDelay; //Delay of L1 arrival for the TPC gate signal
482 Float_t fL1Delay; //Delay of L1 arrival for the TPC readout
483 UShort_t fNTBinsBeforeL1; //Number of time bins before L1 arrival which are being read out
484 Float_t fNTBinsL1; //Overall L1 delay in time bins
487 AliTPCParam(const AliTPCParam &);
488 AliTPCParam & operator=(const AliTPCParam &);
490 void CleanGeoMatrices();
492 ClassDef(AliTPCParam,5) //parameter object for set:TPC
496 inline Int_t * AliTPCParam::GetResBin(Int_t i)
498 //return response bin i - bin given by padrow [0] pad[1] timebin[2]
499 if (i<fCurrentMax) return &fResponseBin[i*3];
503 inline Float_t &AliTPCParam::GetResWeight(Int_t i)
505 //return weight of response bin i
506 if (i<fCurrentMax) return fResponseWeight[i];
507 else return fResponseWeight[i];
511 inline void AliTPCParam::AdjustCosSin(Int_t isec, Float_t &cos, Float_t &sin) const
514 //set cosinus and sinus of rotation angles for sector isec
516 cos=fRotAngle[isec*4];
517 sin=fRotAngle[isec*4+1];
520 inline Float_t AliTPCParam::GetAngle(Int_t isec) const
523 //return rotation angle of given sector
525 return fRotAngle[isec*4+2];
529 inline void AliTPCParam::Transform1to2Ideal(Float_t *xyz, Int_t *index) const
531 //transformation to rotated coordinates
532 //we must have information about sector!
533 //rotate to given sector
537 AdjustCosSin(index[1],cos,sin);
538 Float_t x1=xyz[0]*cos + xyz[1]*sin;
539 Float_t y1=-xyz[0]*sin + xyz[1]*cos;
542 xyz[2]=fZLength-TMath::Abs(xyz[2]);
547 inline void AliTPCParam::Transform1to2(Float_t *xyz, Int_t *index) const
549 //transformation to rotated coordinates
550 //we must have information about sector!
551 //rotate to given sector
552 Double_t xyzmaster[3] = {xyz[0],xyz[1],xyz[2]};
553 Double_t xyzlocal[3]={0,0,0};
554 if (index[1]>=0 && index[1]<fNSector)
555 fGlobalMatrix[index[1]]->MasterToLocal(xyzmaster,xyzlocal);
556 xyz[0] = xyzlocal[0];
557 xyz[1] = xyzlocal[1];
558 xyz[2] = xyzlocal[2];
565 inline void AliTPCParam::Transform2to1(Float_t *xyz, Int_t *index) const
568 //transformation from rotated coordinates to global coordinates
571 AdjustCosSin(index[1],cos,sin);
572 Float_t x1=xyz[0]*cos - xyz[1]*sin;
573 Float_t y1=xyz[0]*sin + xyz[1]*cos;
576 xyz[2]=fZLength-xyz[2];
577 if (index[1]<fNInnerSector)
578 {if ( index[1]>=(fNInnerSector>>1)) xyz[2]*=-1.;}
580 {if ( (index[1]-fNInnerSector) >= (fNOuterSector>>1) ) xyz[2]*=-1;}
584 inline void AliTPCParam::Transform2to2(Float_t *xyz, Int_t *index, Int_t *oindex) const
586 //transform rotated coordinats of one sector to rotated
587 //coordinates relative to another sector
588 Transform2to1(xyz,index);
589 Transform1to2(xyz,oindex);
594 inline Float_t AliTPCParam::Transform2to2NearestWire(Float_t *xyz, Int_t *index) const
597 // asigns the x-position of the closest wire to xyz[0], return the
598 // electron to closest wire distance
601 if (index[1]<fNInnerSector) {
602 xnew = fRInnerFirstWire+TMath::Nint((xyz[0]-fRInnerFirstWire)/fInnerWWPitch)*fInnerWWPitch;
605 xnew = fROuterFirstWire+TMath::Nint((xyz[0]-fROuterFirstWire)/fOuterWWPitch)*fOuterWWPitch;
612 inline Int_t AliTPCParam::Transform2to3(Float_t *xyz, Int_t *index) const
615 //calulates coresponding pad row number, sets index[2] for straight rows
616 //does not change xyz[] information
617 //valid only for straight row
619 if (index[1]<fNInnerSector)
620 index[2] =TMath::Nint((xyz[0]-fPadRowLow[0])/fInnerPadPitchLength);
622 if (xyz[0] < fLastWireUp1 )
623 index[2] = TMath::Nint((xyz[0]-fPadRowUp[0])/fOuter1PadPitchLength);
625 index[2] = TMath::Nint(fNRowUp1+(xyz[0]-fPadRowUp[64])/fOuter2PadPitchLength);
630 inline void AliTPCParam::Transform3to4(Float_t *xyz, Int_t *index) const
633 //valid only for straight rows straight rows
634 //calculate xyz[0] position relative to given index
636 if (index[1]<fNInnerSector)
637 xyz[0] -=index[2]*fInnerPadPitchLength+fPadRowLow[0];
639 if (index[2]<fNRowUp1)
640 xyz[0] -=index[2]*fOuter1PadPitchLength+fPadRowUp[0];
642 xyz[0] -=(index[2]-fNRowUp1)*fOuter2PadPitchLength+fPadRowUp[64];
646 inline void AliTPCParam::Transform4to3(Float_t *xyz, Int_t *index) const
649 //valid only for straight rows
650 //transforms relative xyz[0] to the global one within given sector
652 if (index[1]<fNInnerSector)
653 xyz[0] +=index[2]*fInnerPadPitchLength+fPadRowLow[0];
655 if(index[2]<fNRowUp1)
656 xyz[0] +=index[2]*fOuter1PadPitchLength+fPadRowUp[0];
658 xyz[0] +=index[2]*fOuter2PadPitchLength+fPadRowUp[64];
663 inline void AliTPCParam::Transform2to5( Float_t *xyz, Int_t *index) const
666 //transform [x,y,z] to [r,phi,z]
669 Float_t r = TMath::Sqrt(xyz[0]*xyz[0]+xyz[1]*xyz[1]);
670 if ((xyz[0]==0)&&(xyz[1]==0)) angle = 0;
673 angle =TMath::ASin(xyz[1]/r);
674 if (xyz[0]<0) angle=TMath::Pi()-angle;
675 if ( (xyz[0]>0) && (xyz[1]<0) ) angle=2*TMath::Pi()+angle;
682 inline void AliTPCParam::Transform5to2( Float_t *xyz, Int_t *index) const
685 //transform [r,rphi,z] to [x,y,z]
688 Float_t angle= xyz[1];
689 xyz[0]=r*TMath::Cos(angle);
690 xyz[1]=r*TMath::Sin(angle);
694 inline void AliTPCParam::Transform4to8(Float_t *xyz, Int_t *index) const
697 //transform xyz coordinates to 'digit' coordinates
700 if (index[1]<fNInnerSector) {
701 if ( index[1]>=(fNInnerSector>>1)) xyz[1]*=-1.;
704 if ( (index[1]-fNInnerSector) >= (fNOuterSector>>1) ) xyz[1]*=-1;
708 if (index[1]<fNInnerSector) {
709 xyz[0]/=fInnerPadPitchLength;
710 xyz[1]/=fInnerPadPitchWidth;
713 xyz[1]/=fOuterPadPitchWidth;
714 if (index[2]<fNRowUp1 ) xyz[0]/=fOuter1PadPitchLength;
715 else xyz[0]/=fOuter2PadPitchLength;
721 inline void AliTPCParam::Transform8to4(Float_t *xyz, Int_t *index) const
724 //transforms 'digit' coordinates to xyz coordinates
726 if (index[1]<fNInnerSector) {
727 if ( index[1]>=(fNInnerSector>>1)) xyz[1]*=-1.;
730 if ( (index[1]-fNInnerSector) >= (fNOuterSector>>1) ) xyz[1]*=-1;
734 if (index[1]<fNInnerSector) {
735 xyz[0]*=fInnerPadPitchLength;
736 xyz[1]*=fInnerPadPitchWidth;
739 xyz[1]*=fOuterPadPitchWidth;
740 if (index[2] < fNRowUp1 ) xyz[0]*=fOuter1PadPitchLength;
741 else xyz[0]*=fOuter2PadPitchLength;
746 inline void AliTPCParam::Transform6to8(Float_t *xyz, Int_t *index) const
749 //transforms cylindrical xyz coordinates to 'digit' coordinates
752 if (index[1]<fNInnerSector) {
753 xyz[0]/=fInnerPadPitchLength;
754 xyz[1]*=xyz[0]/fInnerPadPitchWidth;
757 xyz[1]*=xyz[0]/fOuterPadPitchWidth;
758 if (index[2] < fNRowUp1 ) xyz[0]/=fOuter1PadPitchLength;
759 else xyz[0]/=fOuter2PadPitchLength;
764 inline void AliTPCParam::Transform8to6(Float_t *xyz, Int_t *index) const
767 //transforms 'digit' coordinates to cylindrical xyz coordinates
770 if (index[1]<fNInnerSector) {
771 xyz[0]*=fInnerPadPitchLength;
772 xyz[1]/=xyz[0]/fInnerPadPitchWidth;
775 xyz[1]/=xyz[0]/fOuterPadPitchWidth;
776 if (index[2] < fNRowUp1 ) xyz[0]*=fOuter1PadPitchLength;
777 else xyz[0]*=fOuter2PadPitchLength;
781 inline Float_t AliTPCParam::GetZLength(Int_t sector) const
782 { if(sector <18 || (sector>35&§or<54)) return fZLength-0.275;
783 else return fZLength-0.302;