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();
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 Transform1to2(Float_t *xyz, Int_t *index) const;
34 //transformation to rotated coordinata
35 void Transform2to1(Float_t *xyz, Int_t *index) const;
36 //transformation from rotated coordinata to global coordinata
37 void Transform2to2(Float_t *xyz, Int_t *index, Int_t *oindex) const;
38 //transform rotated coordinata of one sector to rotated
39 //coordinata relative to another sector
40 Float_t Transform2to2NearestWire(Float_t *xyz, Int_t *index) const;
41 //round x position to nearest wire
42 Int_t Transform2to3(Float_t *xyz, Int_t *index) const;
43 //calulate coresponding index[2] -pad row for straight rows
44 //does not change xyz[]
46 void Transform3to4(Float_t *xyz, Int_t *index) const;
47 //valid only for straight rows straight rows
48 //calculate xyz[0] position relative to given index
50 void Transform4to3(Float_t *xyz, Int_t *index) const;
51 //valid only for straight rows straight rows
52 //transform xyz[0] position relative to given index
53 void Transform2to5( Float_t *xyz, Int_t *index) const;
54 //transform [x,y,z] to [r,rphi,z]
55 void Transform5to2(Float_t *xyz, Int_t *index) const;
56 //transform [r,rphi,z] coordinata to [x,y,z]
57 void Transform4to8(Float_t *xyz, Int_t *index) const;
58 //transform xyz coordinata to 'digit' coordinata
59 void Transform8to4(Float_t *xyz, Int_t *index) const;
60 //transform 'digit' coordinata to xyz coordinata
61 void Transform6to8(Float_t *xyz, Int_t *index) const;
62 //transform dr,f coordinata to 'digit' coordinata
63 void Transform8to6(Float_t *xyz, Int_t *index) const;
64 //transform 'digit' coordinata to dr,f coordinata
66 virtual Int_t Transform2toPadRow(Float_t */*xyz*/, Int_t */*index*/) const{return 0;}
67 //transform rotated to
69 virtual Int_t GetPadRow(Float_t *xyz, Int_t *index) const ;
70 //return pad row of point xyz - xyz is given in coordinate system -(given by index)
71 //output system is 3 for straight row and 7 for cylindrical row
72 virtual void XYZtoCRXYZ(Float_t */*xyz*/,
73 Int_t &/*sector*/, Int_t &/*padrow*/, Int_t /*option*/) const {;}
74 //transform global position to the position relative to the sector padrow
75 //if option=0 X calculate absolute calculate sector
76 //if option=1 X absolute use input sector
77 //if option=2 X relative to pad row calculate sector
78 //if option=3 X relative use input sector
80 virtual void CRXYZtoXYZ(Float_t */*xyz*/,
81 const Int_t &/*sector*/, const Int_t & /*padrow*/, Int_t /*option*/) const {;}
82 //transform relative position to the gloabal position
84 virtual void CRTimePadtoYZ(Float_t &/*y*/, Float_t &/*z*/,
85 const Float_t &/*time*/, const Float_t &/*pad*/,
86 Int_t /*sector*/, Int_t /*padrow*/ ){;}
87 //transform position in digit units (time slices and pads) to "normal"
89 virtual void CRYZtoTimePad(const Float_t &/*y*/, const Float_t &/*z*/,
90 Float_t &/*time*/, Float_t &/*pad*/,
91 Int_t /*sector*/, Int_t /*padrow*/){;}
92 //transform position in cm to position in digit unit
93 virtual Int_t CalcResponse(Float_t* /*x*/, Int_t * /*index*/, Int_t /*row*/){return 0;}
94 //calculate bin response as function of the input position -x and the weight
95 //if row -pad row is equal -1 calculate response for each pad row
96 //otherwise it calculate only in given pad row
97 //return number of valid response bin
98 virtual void SetDefault(); //set defaut TPCparam
99 virtual Bool_t Update(); //recalculate and check geometric parameters
100 virtual Bool_t ReadGeoMatrices(); //read geo matrixes
101 Bool_t GetStatus() const; //get information about object consistency
102 Int_t GetIndex(Int_t sector, Int_t row) const; //give index of the given sector and pad row
103 Int_t GetNSegmentsTotal() const {return fNtRows;}
104 Double_t GetLowMaxY(Int_t irow) const {return irow*0.;}
105 Double_t GetUpMaxY(Int_t irow) const {return irow*0;}
106 //additional geometrical function - for Belikov
108 Bool_t AdjustSectorRow(Int_t index, Int_t & sector, Int_t &row) const; //return sector and padrow
111 void AdjustCosSin(Int_t isec, Float_t &cos, Float_t &sin) const;
112 //set cosinus and sinus of rotation angles for sector isec
113 Float_t GetAngle(Int_t isec) const;
114 // void GetChamberPos(Int_t isec, Float_t* xyz) const;
115 // void GetChamberRot(Int_t isec, Float_t* angles) const;
117 //set sector parameters
119 void SetInnerRadiusLow(Float_t InnerRadiusLow ) { fInnerRadiusLow=InnerRadiusLow;}
120 void SetOuterRadiusLow(Float_t OuterRadiusLow ) { fOuterRadiusLow=OuterRadiusLow;}
121 void SetInnerRadiusUp(Float_t InnerRadiusUp) { fInnerRadiusUp= InnerRadiusUp;}
122 void SetOuterRadiusUp(Float_t OuterRadiusUp) { fOuterRadiusUp= OuterRadiusUp;}
123 void SetSectorAngles(Float_t innerangle, Float_t innershift, Float_t outerangle,
125 void SetInnerFrameSpace(Float_t frspace) {fInnerFrameSpace = frspace;}
126 void SetOuterFrameSpace(Float_t frspace) {fOuterFrameSpace = frspace;}
127 void SetInnerWireMount(Float_t fmount) {fInnerWireMount = fmount;}
128 void SetOuterWireMount(Float_t fmount) {fOuterWireMount = fmount;}
129 void SetZLength(Float_t zlength) {fZLength = zlength;}
130 void SetGeometryType(Int_t type) {fGeometryType = type;}
134 void SetRowNLow( Int_t NRowLow){fNRowLow = NRowLow;}
135 void SetRowNUp1 (Int_t NRowUp1){fNRowUp1 = NRowUp1 ;} //upper sec short pads
136 void SetRowNUp2 (Int_t NRowUp2){fNRowUp2 = NRowUp2 ;} //upper sec long pads
137 void SetRowNUp (Int_t NRowUp){fNRowUp = NRowUp ;}
139 //set wire parameters
141 void SetInnerNWires(Int_t nWires){ fNInnerWiresPerPad=nWires;}
142 void SetInnerDummyWire(Int_t dummy) {fInnerDummyWire = dummy;}
143 void SetInnerOffWire(Float_t offset) {fInnerOffWire =offset;}
144 void SetOuter1NWires(Int_t nWires){ fNOuter1WiresPerPad=nWires;}
145 void SetOuter2NWire(Int_t nWires){ fNOuter2WiresPerPad=nWires;}
146 void SetOuterDummyWire(Int_t dummy) {fOuterDummyWire = dummy;}
147 void SetOuterOffWire(Float_t offset) {fOuterOffWire =offset;}
148 void SetInnerWWPitch( Float_t wwPitch) {fInnerWWPitch = wwPitch;}
149 void SetRInnerFirstWire(Float_t firstWire){fRInnerFirstWire = firstWire;}
150 void SetRInnerLastWire(Float_t lastWire){fRInnerLastWire = lastWire;}
151 void SetOuterWWPitch(Float_t wwPitch){fOuterWWPitch = wwPitch;}
152 void SetLastWireUp1(Float_t wireUp1){fLastWireUp1 = wireUp1;}
153 void SetROuterFirstWire(Float_t firstWire){fROuterFirstWire = firstWire;}
154 void SetROuterLastWire(Float_t lastWire){fROuterLastWire = lastWire;}
158 void SetInnerPadPitchLength(Float_t PadPitchLength){ fInnerPadPitchLength=PadPitchLength;}
159 void SetInnerPadPitchWidth(Float_t PadPitchWidth){ fInnerPadPitchWidth = PadPitchWidth;}
160 void SetInnerPadLength(Float_t PadLength){ fInnerPadLength=PadLength;}
161 void SetInnerPadWidth(Float_t PadWidth) { fInnerPadWidth=PadWidth;}
162 void SetOuter1PadPitchLength(Float_t PadPitchLength){ fOuter1PadPitchLength=PadPitchLength;}
163 void SetOuter2PadPitchLength(Float_t PadPitchLength){ fOuter2PadPitchLength=PadPitchLength;}
164 void SetOuterPadPitchWidth(Float_t PadPitchWidth){ fOuterPadPitchWidth = PadPitchWidth;}
165 void SetOuter1PadLength(Float_t PadLength){ fOuter1PadLength=PadLength;}
166 void SetOuter2PadLength(Float_t PadLength){ fOuter2PadLength=PadLength;}
167 void SetOuterPadWidth(Float_t PadWidth) { fOuterPadWidth=PadWidth;}
168 void SetMWPCReadout(Bool_t type) {fBMWPCReadout = type;}
169 void SetNCrossRows(Int_t rows){fNCrossRows = rows;}
173 void SetDiffT(Float_t DiffT){ fDiffT= DiffT;}
174 void SetDiffL(Float_t DiffL){ fDiffL=DiffL;}
175 void SetGasGain(Float_t GasGain){ fGasGain=GasGain;}
176 void SetDriftV(Float_t DriftV){ fDriftV= DriftV;}
177 void SetOmegaTau(Float_t OmegaTau){ fOmegaTau=OmegaTau;}
178 void SetAttCoef(Float_t AttCoef){ fAttCoef=AttCoef;}
179 void SetOxyCont(Float_t OxyCont){ fOxyCont=OxyCont;}
181 //set electronivc parameters
183 void SetPadCoupling(Float_t PadCoupling){ fPadCoupling=PadCoupling;}
184 void SetZeroSup(Int_t ZeroSup) { fZeroSup=ZeroSup;}
185 void SetNoise(Float_t Noise ) { fNoise= Noise;}
186 void SetChipGain(Float_t ChipGain){ fChipGain= ChipGain;}
187 void SetChipNorm(Float_t ChipNorm){ fChipNorm= ChipNorm;}
188 void SetTSample(Float_t TSample) { fTSample=TSample;}
189 void SetTFWHM(Float_t fwhm) { fTSigma=fwhm/2.35;}
190 void SetMaxTBin(Int_t maxtbin) { fMaxTBin = maxtbin;}
191 void SetADCSat(Int_t adcsat) { fADCSat = adcsat;}
192 void SetADCDynRange(Float_t adcdynrange) {fADCDynRange = adcdynrange;}
194 //set response parameters
196 void SetNResponseMax(Int_t max) { fNResponseMax = max;}
197 void SetResponseThreshold(Int_t threshold) {fResponseThreshold = threshold;}
199 void SetGateDelay(Float_t delay) {fGateDelay = delay;}
200 void SetL1Delay(Float_t delay) {fL1Delay = delay;}
201 void SetNTBinsBeforeL1(UShort_t nbins) {fNTBinsBeforeL1 = nbins;}
203 //get sector parameters
205 Float_t GetInnerRadiusLow() const {return fInnerRadiusLow;}
206 Float_t GetInnerRadiusUp() const {return fInnerRadiusUp;}
207 Float_t GetOuterRadiusLow() const {return fOuterRadiusLow;}
208 Float_t GetOuterRadiusUp() const {return fOuterRadiusUp;}
209 Float_t GetInnerFrameSpace() const {return fInnerFrameSpace;}
210 Float_t GetOuterFrameSpace() const {return fOuterFrameSpace;}
211 Float_t GetInnerWireMount() const {return fInnerWireMount;}
212 Float_t GetOuterWireMount() const {return fOuterWireMount;}
213 Float_t GetInnerAngle() const ;
214 Float_t GetInnerAngleShift() const ;
215 Float_t GetOuterAngle() const ;
216 Float_t GetOuterAngleShift() const ;
217 Int_t GetNInnerSector() const {return fNInnerSector;}
218 Int_t GetNOuterSector() const {return fNOuterSector;}
219 Int_t GetNSector() const {return fNSector;}
220 Float_t GetZLength() const {return fZLength;}
221 Int_t GetGeometryType() const {return fGeometryType;}
224 //get wires parameter
226 Int_t GetInnerNWires() const {return fNInnerWiresPerPad;}
227 Float_t GetInnerWWPitch() const {return fInnerWWPitch;}
228 Int_t GetInnerDummyWire() const {return fInnerDummyWire;}
229 Float_t GetInnerOffWire() const {return fInnerOffWire;}
230 Float_t GetRInnerFirstWire() const {return fRInnerFirstWire;}
231 Float_t GetRInnerLastWire() const {return fRInnerLastWire;}
232 Int_t GetOuter1NWires() const {return fNOuter1WiresPerPad;}
233 Int_t GetOuter2NWires() const {return fNOuter2WiresPerPad;}
234 Float_t GetOuterWWPitch() const {return fOuterWWPitch;}
235 Int_t GetOuterDummyWire() const {return fOuterDummyWire;}
236 Float_t GetOuterOffWire() const {return fOuterOffWire;}
237 Float_t GetLastWireUp1() const {return fLastWireUp1;}
238 Float_t GetROuterFirstWire() const {return fROuterFirstWire;}
239 Float_t GetROuterLastWire() const {return fROuterLastWire;}
240 Float_t GetWWPitch(Int_t isector = 0) const {
241 return ( (isector < fNInnerSector) ? fInnerWWPitch :fOuterWWPitch);}
245 Float_t GetInnerPadPitchLength() const {return fInnerPadPitchLength;}
246 Float_t GetInnerPadPitchWidth() const {return fInnerPadPitchWidth;}
247 Float_t GetInnerPadLength() const {return fInnerPadLength;}
248 Float_t GetInnerPadWidth() const {return fInnerPadWidth;}
249 Float_t GetOuter1PadPitchLength() const {return fOuter1PadPitchLength;}
250 Float_t GetOuter2PadPitchLength() const {return fOuter2PadPitchLength;}
251 Float_t GetOuterPadPitchWidth() const {return fOuterPadPitchWidth;}
252 Float_t GetOuter1PadLength() const {return fOuter1PadLength;}
253 Float_t GetOuter2PadLength() const {return fOuter2PadLength;}
254 Float_t GetOuterPadWidth() const {return fOuterPadWidth;}
255 Bool_t GetMWPCReadout() const {return fBMWPCReadout;}
256 Int_t GetNCrossRows() const {return fNCrossRows;}
257 Float_t GetPadPitchWidth(Int_t isector = 0) const {
258 return ( (isector < fNInnerSector) ? fInnerPadPitchWidth :fOuterPadPitchWidth);}
259 Float_t GetPadPitchLength(Int_t isector = 0, Int_t padrow=0) const
260 { if (isector < fNInnerSector) return fInnerPadPitchLength;
261 else return ((padrow<fNRowUp1) ? fOuter1PadPitchLength:fOuter2PadPitchLength);}
262 Int_t GetNRowLow() const; //get the number of pad rows in low sector
263 Int_t GetNRowUp() const; //get the number of pad rows in up sector
264 Int_t GetNRowUp1() const; // number of short rows in up sector
265 Int_t GetNRowUp2() const; // number of long rows in up sector
266 Int_t GetNRow(Int_t isec) const {return ((isec<fNInnerSector) ? fNRowLow:fNRowUp);}
267 Int_t GetNRowsTotal() const {return fNtRows;} //get total nuber of rows
268 Float_t GetPadRowRadiiLow(Int_t irow) const; //get the pad row (irow) radii
269 Float_t GetPadRowRadiiUp(Int_t irow) const; //get the pad row (irow) radii
270 Float_t GetPadRowRadii(Int_t isec,Int_t irow) const {
271 return ( (isec < fNInnerSector) ?GetPadRowRadiiLow(irow):GetPadRowRadiiUp(irow));}
272 //retrun radii of the pad row irow in sector i
273 Int_t GetNPadsLow(Int_t irow) const; //get the number of pads in row irow
274 Int_t GetNPadsUp(Int_t irow) const; //get the number of pads in row irow
275 Int_t GetNPads(Int_t isector,Int_t irow) const{
276 return ( (isector < fNInnerSector) ?GetNPadsLow(irow) : GetNPadsUp(irow));}
278 Float_t GetYInner(Int_t irow) const; // wire length in low sec row
279 Float_t GetYOuter(Int_t irow) const; // wire length in up sec row
280 Int_t GetSectorIndex(Float_t angle, Int_t row, Float_t z) const; // get sector index
281 Float_t GetChamberCenter(Int_t isec) const; // get readout chamber positions
282 TGeoHMatrix *GetTrackingMatrix(Int_t isec) const {
283 return fTrackingMatrix[isec];}
284 TGeoHMatrix *GetClusterMatrix(Int_t isec) const {
285 return fClusterMatrix[isec];}
286 TGeoHMatrix *GetGlobalMatrix(Int_t isec) const {
287 return fGlobalMatrix[isec];}
288 Bool_t IsGeoRead(){ return fGlobalMatrix!=0;}
292 Float_t GetDiffT() const {return fDiffT;}
293 Float_t GetDiffL() const {return fDiffL;}
294 Float_t GetGasGain() const {return fGasGain;}
295 Float_t GetDriftV() const {return fDriftV;}
296 Float_t GetOmegaTau() const {return fOmegaTau;}
297 Float_t GetAttCoef() const {return fAttCoef;}
298 Float_t GetOxyCont() const {return fOxyCont;}
300 //get Electronic parameters
302 Float_t GetPadCoupling() const {return fPadCoupling;}
303 Int_t GetZeroSup() const {return fZeroSup;}
304 Float_t GetNoise() const {return fNoise;}
305 Float_t GetChipGain() const {return fChipGain;}
306 Float_t GetChipNorm() const {return fChipNorm;}
307 Float_t GetTSample() const {return fTSample;}
308 Float_t GetZWidth() const {return fZWidth;}
309 Float_t GetTFWHM() const {return fTSigma*2.35;}
310 Float_t GetZSigma() const {return fTSigma*fDriftV;}
311 virtual Float_t GetZOffset() const {return 3*fTSigma*fDriftV;}
312 Int_t GetMaxTBin() const {return fMaxTBin;}
313 Int_t GetADCSat() const {return fADCSat;}
314 Float_t GetADCDynRange() const {return fADCDynRange;}
315 Float_t GetTotalNormFac() const {return fTotalNormFac;}
316 Float_t GetNoiseNormFac() const {return fNoiseNormFac;}
320 Int_t * GetResBin(Int_t i);
321 //return response bin i - bin given by padrow [0] pad[1] timebin[2]
322 Float_t & GetResWeight(Int_t i);
323 //return weight of response bin i
326 Float_t GetGateDelay() const {return fGateDelay;}
327 Float_t GetL1Delay() const {return fL1Delay;}
328 UShort_t GetNTBinsBeforeL1() const {return fNTBinsBeforeL1;}
329 Float_t GetNTBinsL1() const {return fNTBinsL1;}
332 Bool_t fbStatus; //indicates consistency of the data
333 //---------------------------------------------------------------------
334 // ALICE TPC sector geometry
335 //--------------------------------------------------------------------
336 Float_t fInnerRadiusLow; // lower radius of inner sector-IP
337 Float_t fInnerRadiusUp; // upper radius of inner sector-IP
338 Float_t fOuterRadiusUp; // upper radius of outer sector-IP
339 Float_t fOuterRadiusLow; // lower radius of outer sector-IP
340 Float_t fInnerAngle; //opening angle of Inner sector
341 Float_t fInnerAngleShift; //shift of first inner sector center to the 0
342 Float_t fOuterAngle; //opening angle of outer sector
343 Float_t fOuterAngleShift; //shift of first sector center to the 0
344 Float_t fInnerFrameSpace; //space for inner frame in the phi direction
345 Float_t fOuterFrameSpace; //space for outer frame in the phi direction
346 Float_t fInnerWireMount; //space for wire mount, inner sector
347 Float_t fOuterWireMount; //space for wire mount, outer sector
348 Int_t fNInnerSector; //number of inner sectors -calculated
349 Int_t fNOuterSector; //number of outer sectors -calculated
350 Int_t fNSector; // total number of sectors -calculated
351 Float_t fZLength; //length of the drift region of the TPC
352 Float_t *fRotAngle; //[fNSector] sin and cos of rotation angles for
353 // diferent sectors -calculated
354 Int_t fGeometryType; //type of geometry -0 straight rows
355 // Float_t *fChamberPos; //[fNSector] displacements of the readout chambers
356 //with respect to the 'idead' geometry
357 //in local corrdinate system
358 // Float_t *fChamberRot; //[fNSector] rotation angles of the readout chambers
359 //with respect to the 'idead' geometry
360 //in local corrdinate system
361 TGeoHMatrix **fTrackingMatrix; //![fNSector] transformation matrices of the tracking
363 TGeoHMatrix **fClusterMatrix; //![fNSector] transformation matrices of the cluster
365 TGeoHMatrix **fGlobalMatrix; //![fNSector] fTrackingMatrix * fClusterMatrix
368 //---------------------------------------------------------------------
369 // ALICE TPC wires geometry - for GEM we can consider that it is gating
370 //--------------------------------------------------------------------
371 Int_t fNInnerWiresPerPad; //Number of wires per pad
372 Float_t fInnerWWPitch; //pitch between wires in inner sector - calculated
373 Int_t fInnerDummyWire; //number of wires without pad readout
374 Float_t fInnerOffWire; //oofset of first wire to the begining of the sector
375 Float_t fRInnerFirstWire; //position of the first wire -calculated
376 Float_t fRInnerLastWire; //position of the last wire -calculated
377 Float_t fLastWireUp1; //position of the last wire in outer1 sector
378 Int_t fNOuter1WiresPerPad; //Number of wires per pad
379 Int_t fNOuter2WiresPerPad; // Number of wires per pad
380 Float_t fOuterWWPitch; //pitch between wires in outer sector -calculated
381 Int_t fOuterDummyWire; //number of wires without pad readout
382 Float_t fOuterOffWire; //oofset of first wire to the begining of the sector
383 Float_t fROuterFirstWire; //position of the first wire -calulated
384 Float_t fROuterLastWire; //position of the last wire -calculated
385 //---------------------------------------------------------------------
386 // ALICE TPC pad parameters
387 //--------------------------------------------------------------------
388 Float_t fInnerPadPitchLength; //Inner pad pitch length
389 Float_t fInnerPadPitchWidth; //Inner pad pitch width
390 Float_t fInnerPadLength; //Inner pad length
391 Float_t fInnerPadWidth; //Inner pad width
392 Float_t fOuter1PadPitchLength; //Outer pad pitch length
393 Float_t fOuter2PadPitchLength; //Outer pad pitch length
394 Float_t fOuterPadPitchWidth; //Outer pad pitch width
395 Float_t fOuter1PadLength; //Outer pad length
396 Float_t fOuter2PadLength; //Outer pad length
397 Float_t fOuterPadWidth; //Outer pad width
398 Bool_t fBMWPCReadout; //indicate wire readout - kTRUE or GEM readout -kFALSE
399 Int_t fNCrossRows; //number of rows to crostalk calculation
401 Int_t fNRowLow; //number of pad rows per low sector -set
402 Int_t fNRowUp1; //number of short pad rows per sector up -set
403 Int_t fNRowUp2; //number of long pad rows per sector up -set
404 Int_t fNRowUp; //number of pad rows per sector up -calculated
405 Int_t fNtRows; //total number of rows in TPC -calculated
406 Float_t fPadRowLow[600]; //Lower sector, pad row radii -calculated
407 Float_t fPadRowUp[600]; //Upper sector, pad row radii -calculated
408 Int_t fNPadsLow[600]; //Lower sector, number of pads per row -calculated
409 Int_t fNPadsUp[600]; //Upper sector, number of pads per row -calculated
410 Float_t fYInner[600]; //Inner sector, wire-length
411 Float_t fYOuter[600]; //Outer sector, wire-length
412 //---------------------------------------------------------------------
413 // ALICE TPC Gas Parameters
414 //--------------------------------------------------------------------
415 Float_t fDiffT; //tangencial diffusion constant
416 Float_t fDiffL; //longutudinal diffusion constant
417 Float_t fGasGain; //gas gain constant
418 Float_t fDriftV; //drift velocity constant
419 Float_t fOmegaTau; //omega tau ExB coeficient
420 Float_t fAttCoef; //attachment coefitients
421 Float_t fOxyCont; //oxygen content
422 //---------------------------------------------------------------------
423 // ALICE TPC Electronics Parameters
424 //--------------------------------------------------------------------
425 Float_t fPadCoupling; //coupling factor ration of anode signal
426 //and total pads signal
427 Int_t fZeroSup; //zero suppresion constant
428 Float_t fNoise; //noise sigma constant
429 Float_t fChipGain; //preamp shaper constant
430 Float_t fChipNorm; //preamp shaper normalisation
431 Float_t fTSample; //sampling time
432 Float_t fZWidth; //derived value calculated using TSample and driftw -computed
433 Float_t fTSigma; //width of the Preamp/Shaper function
434 Int_t fMaxTBin; //maximum time bin number
435 Int_t fADCSat; //saturation value of ADC (10 bits)
436 Float_t fADCDynRange; //input dynamic range (mV)
437 Float_t fTotalNormFac; //full normalisation factor - calculated
438 Float_t fNoiseNormFac; //normalisation factor to transform noise in electron to ADC channel
440 //---------------------------------------------------------------------
441 // ALICE TPC response data
442 //---------------------------------------------------------------------
443 Int_t fNResponseMax; //maximal dimension of response
444 Float_t fResponseThreshold; //threshold for accepted response
445 Int_t fCurrentMax; //!current maximal dimension -calulated
446 Int_t *fResponseBin; //!array with bins -calulated
447 Float_t *fResponseWeight; //!array with response -calulated
449 //---------------------------------------------------------------------
450 // ALICE TPC L1 Parameters
451 //--------------------------------------------------------------------
452 Float_t fGateDelay; //Delay of L1 arrival for the TPC gate signal
453 Float_t fL1Delay; //Delay of L1 arrival for the TPC readout
454 UShort_t fNTBinsBeforeL1; //Number of time bins before L1 arrival which are being read out
455 Float_t fNTBinsL1; //Overall L1 delay in time bins
458 AliTPCParam(const AliTPCParam &);
459 AliTPCParam & operator=(const AliTPCParam &);
460 ClassDef(AliTPCParam,4) //parameter object for set:TPC
464 inline Int_t * AliTPCParam::GetResBin(Int_t i)
466 //return response bin i - bin given by padrow [0] pad[1] timebin[2]
467 if (i<fCurrentMax) return &fResponseBin[i*3];
471 inline Float_t &AliTPCParam::GetResWeight(Int_t i)
473 //return weight of response bin i
474 if (i<fCurrentMax) return fResponseWeight[i];
475 else return fResponseWeight[i];
479 inline void AliTPCParam::AdjustCosSin(Int_t isec, Float_t &cos, Float_t &sin) const
482 //set cosinus and sinus of rotation angles for sector isec
484 cos=fRotAngle[isec*4];
485 sin=fRotAngle[isec*4+1];
488 inline Float_t AliTPCParam::GetAngle(Int_t isec) const
491 //return rotation angle of given sector
493 return fRotAngle[isec*4+2];
497 inline void AliTPCParam::Transform1to2(Float_t *xyz, Int_t *index) const
499 //transformation to rotated coordinates
500 //we must have information about sector!
502 //rotate to given sector
504 AdjustCosSin(index[1],cos,sin);
505 Float_t x1=xyz[0]*cos + xyz[1]*sin;
506 Float_t y1=-xyz[0]*sin + xyz[1]*cos;
509 xyz[2]=fZLength-TMath::Abs(xyz[2]);
517 inline void AliTPCParam::Transform2to1(Float_t *xyz, Int_t *index) const
520 //transformation from rotated coordinates to global coordinates
523 AdjustCosSin(index[1],cos,sin);
524 Float_t x1=xyz[0]*cos - xyz[1]*sin;
525 Float_t y1=xyz[0]*sin + xyz[1]*cos;
528 xyz[2]=fZLength-xyz[2];
529 if (index[1]<fNInnerSector)
530 if ( index[1]>=(fNInnerSector>>1)) xyz[2]*=-1.;
532 if ( (index[1]-fNInnerSector) >= (fNOuterSector>>1) ) xyz[2]*=-1;
536 inline void AliTPCParam::Transform2to2(Float_t *xyz, Int_t *index, Int_t *oindex) const
538 //transform rotated coordinats of one sector to rotated
539 //coordinates relative to another sector
540 Transform2to1(xyz,index);
541 Transform1to2(xyz,oindex);
546 inline Float_t AliTPCParam::Transform2to2NearestWire(Float_t *xyz, Int_t *index) const
549 // asigns the x-position of the closest wire to xyz[0], return the
550 // electron to closest wire distance
553 if (index[1]<fNInnerSector) {
554 xnew = fRInnerFirstWire+TMath::Nint((xyz[0]-fRInnerFirstWire)/fInnerWWPitch)*fInnerWWPitch;
557 xnew = fROuterFirstWire+TMath::Nint((xyz[0]-fROuterFirstWire)/fOuterWWPitch)*fOuterWWPitch;
564 inline Int_t AliTPCParam::Transform2to3(Float_t *xyz, Int_t *index) const
567 //calulates coresponding pad row number, sets index[2] for straight rows
568 //does not change xyz[] information
569 //valid only for straight row
571 if (index[1]<fNInnerSector)
572 index[2] =TMath::Nint((xyz[0]-fPadRowLow[0])/fInnerPadPitchLength);
574 if (xyz[0] < fLastWireUp1 )
575 index[2] = TMath::Nint((xyz[0]-fPadRowUp[0])/fOuter1PadPitchLength);
577 index[2] = TMath::Nint(fNRowUp1+(xyz[0]-fPadRowUp[64])/fOuter2PadPitchLength);
582 inline void AliTPCParam::Transform3to4(Float_t *xyz, Int_t *index) const
585 //valid only for straight rows straight rows
586 //calculate xyz[0] position relative to given index
588 if (index[1]<fNInnerSector)
589 xyz[0] -=index[2]*fInnerPadPitchLength+fPadRowLow[0];
591 if (index[2]<fNRowUp1)
592 xyz[0] -=index[2]*fOuter1PadPitchLength+fPadRowUp[0];
594 xyz[0] -=(index[2]-fNRowUp1)*fOuter2PadPitchLength+fPadRowUp[64];
598 inline void AliTPCParam::Transform4to3(Float_t *xyz, Int_t *index) const
601 //valid only for straight rows
602 //transforms relative xyz[0] to the global one within given sector
604 if (index[1]<fNInnerSector)
605 xyz[0] +=index[2]*fInnerPadPitchLength+fPadRowLow[0];
607 if(index[2]<fNRowUp1)
608 xyz[0] +=index[2]*fOuter1PadPitchLength+fPadRowUp[0];
610 xyz[0] +=index[2]*fOuter2PadPitchLength+fPadRowUp[64];
615 inline void AliTPCParam::Transform2to5( Float_t *xyz, Int_t *index) const
618 //transform [x,y,z] to [r,phi,z]
621 Float_t r = TMath::Sqrt(xyz[0]*xyz[0]+xyz[1]*xyz[1]);
622 if ((xyz[0]==0)&&(xyz[1]==0)) angle = 0;
625 angle =TMath::ASin(xyz[1]/r);
626 if (xyz[0]<0) angle=TMath::Pi()-angle;
627 if ( (xyz[0]>0) && (xyz[1]<0) ) angle=2*TMath::Pi()+angle;
634 inline void AliTPCParam::Transform5to2( Float_t *xyz, Int_t *index) const
637 //transform [r,rphi,z] to [x,y,z]
640 Float_t angle= xyz[1];
641 xyz[0]=r*TMath::Cos(angle);
642 xyz[1]=r*TMath::Sin(angle);
646 inline void AliTPCParam::Transform4to8(Float_t *xyz, Int_t *index) const
649 //transform xyz coordinates to 'digit' coordinates
653 if (index[1]<fNInnerSector) {
654 xyz[0]/=fInnerPadPitchLength;
655 xyz[1]/=fInnerPadPitchWidth;
658 xyz[1]/=fOuterPadPitchWidth;
659 if (index[2]<fNRowUp1 ) xyz[0]/=fOuter1PadPitchLength;
660 else xyz[0]/=fOuter2PadPitchLength;
666 inline void AliTPCParam::Transform8to4(Float_t *xyz, Int_t *index) const
669 //transforms 'digit' coordinates to xyz coordinates
672 if (index[1]<fNInnerSector) {
673 xyz[0]*=fInnerPadPitchLength;
674 xyz[1]*=fInnerPadPitchWidth;
677 xyz[1]*=fOuterPadPitchWidth;
678 if (index[2] < fNRowUp1 ) xyz[0]*=fOuter1PadPitchLength;
679 else xyz[0]*=fOuter2PadPitchLength;
684 inline void AliTPCParam::Transform6to8(Float_t *xyz, Int_t *index) const
687 //transforms cylindrical xyz coordinates to 'digit' coordinates
690 if (index[1]<fNInnerSector) {
691 xyz[0]/=fInnerPadPitchLength;
692 xyz[1]*=xyz[0]/fInnerPadPitchWidth;
695 xyz[1]*=xyz[0]/fOuterPadPitchWidth;
696 if (index[2] < fNRowUp1 ) xyz[0]/=fOuter1PadPitchLength;
697 else xyz[0]/=fOuter2PadPitchLength;
702 inline void AliTPCParam::Transform8to6(Float_t *xyz, Int_t *index) const
705 //transforms 'digit' coordinates to cylindrical xyz coordinates
708 if (index[1]<fNInnerSector) {
709 xyz[0]*=fInnerPadPitchLength;
710 xyz[1]/=xyz[0]/fInnerPadPitchWidth;
713 xyz[1]/=xyz[0]/fOuterPadPitchWidth;
714 if (index[2] < fNRowUp1 ) xyz[0]*=fOuter1PadPitchLength;
715 else xyz[0]*=fOuter2PadPitchLength;