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