]> git.uio.no Git - u/mrichter/AliRoot.git/blame - TPC/Base/AliTPCParam.h
- fix for TRD on-line track matching with tracks having TPCrefit but not TPCout ...
[u/mrichter/AliRoot.git] / TPC / Base / AliTPCParam.h
CommitLineData
73042f01 1#ifndef ALITPCPARAM_H
2#define ALITPCPARAM_H
3da30618 3/* Copyright(c) 1998-1999, ALICE Experiment at CERN, All rights reserved. *
4 * See cxx source for full Copyright notice */
5
6/* $Id$ */
7
8c555625 8////////////////////////////////////////////////
9// Manager class for TPC parameters //
10////////////////////////////////////////////////
8c555625 11
cc80f89e 12#include "AliDetectorParam.h"
13#include "TMath.h"
1283eee5 14
01473f7b 15#include <TGeoMatrix.h>
16
61c82c27 17class TString;
18
cc80f89e 19class AliTPCParam : public AliDetectorParam {
8c555625 20 //////////////////////////////////////////////////////
21 //////////////////////////////////////////////////////
22 //ALITPCParam object to be possible change
23 //geometry and some other parameters of TPC
cc80f89e 24 //used by AliTPC and AliTPCSector
25
8c555625 26public:
27 AliTPCParam();
cc80f89e 28 virtual ~AliTPCParam();
1ac29fc4 29 TGeoHMatrix * Tracking2LocalMatrix(const TGeoHMatrix * geoMatrix, Int_t sector) const;
cc80f89e 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
74707dd2 35 void Transform1to2Ideal(Float_t *xyz, Int_t *index) const;
36 //transformation to rotated coordinata - ideal frame
73042f01 37 void Transform1to2(Float_t *xyz, Int_t *index) const;
74707dd2 38 //transformation to rotated coordinata
73042f01 39 void Transform2to1(Float_t *xyz, Int_t *index) const;
cc80f89e 40 //transformation from rotated coordinata to global coordinata
73042f01 41 void Transform2to2(Float_t *xyz, Int_t *index, Int_t *oindex) const;
cc80f89e 42 //transform rotated coordinata of one sector to rotated
43 //coordinata relative to another sector
73042f01 44 Float_t Transform2to2NearestWire(Float_t *xyz, Int_t *index) const;
cc80f89e 45 //round x position to nearest wire
73042f01 46 Int_t Transform2to3(Float_t *xyz, Int_t *index) const;
cc80f89e 47 //calulate coresponding index[2] -pad row for straight rows
48 //does not change xyz[]
49 //return pad - row
73042f01 50 void Transform3to4(Float_t *xyz, Int_t *index) const;
cc80f89e 51 //valid only for straight rows straight rows
52 //calculate xyz[0] position relative to given index
53 //return pad - row
73042f01 54 void Transform4to3(Float_t *xyz, Int_t *index) const;
cc80f89e 55 //valid only for straight rows straight rows
56 //transform xyz[0] position relative to given index
73042f01 57 void Transform2to5( Float_t *xyz, Int_t *index) const;
cc80f89e 58 //transform [x,y,z] to [r,rphi,z]
73042f01 59 void Transform5to2(Float_t *xyz, Int_t *index) const;
cc80f89e 60 //transform [r,rphi,z] coordinata to [x,y,z]
73042f01 61 void Transform4to8(Float_t *xyz, Int_t *index) const;
cc80f89e 62 //transform xyz coordinata to 'digit' coordinata
73042f01 63 void Transform8to4(Float_t *xyz, Int_t *index) const;
cc80f89e 64 //transform 'digit' coordinata to xyz coordinata
73042f01 65 void Transform6to8(Float_t *xyz, Int_t *index) const;
cc80f89e 66 //transform dr,f coordinata to 'digit' coordinata
73042f01 67 void Transform8to6(Float_t *xyz, Int_t *index) const;
cc80f89e 68 //transform 'digit' coordinata to dr,f coordinata
69
176aff27 70 virtual Int_t Transform2toPadRow(Float_t */*xyz*/, Int_t */*index*/) const{return 0;}
cc80f89e 71 //transform rotated to
72
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
176aff27 76 virtual void XYZtoCRXYZ(Float_t */*xyz*/,
77 Int_t &/*sector*/, Int_t &/*padrow*/, Int_t /*option*/) const {;}
8c555625 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
83
176aff27 84 virtual void CRXYZtoXYZ(Float_t */*xyz*/,
85 const Int_t &/*sector*/, const Int_t & /*padrow*/, Int_t /*option*/) const {;}
8c555625 86 //transform relative position to the gloabal position
87
176aff27 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*/ ){;}
8c555625 91 //transform position in digit units (time slices and pads) to "normal"
92 //units (cm)
176aff27 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*/){;}
cc80f89e 96 //transform position in cm to position in digit unit
176aff27 97 virtual Int_t CalcResponse(Float_t* /*x*/, Int_t * /*index*/, Int_t /*row*/){return 0;}
cc80f89e 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
01473f7b 104 virtual Bool_t ReadGeoMatrices(); //read geo matrixes
bf6adc12 105 Bool_t GetStatus() const; //get information about object consistency
8569a2b0 106 Int_t GetIndex(Int_t sector, Int_t row) const; //give index of the given sector and pad row
cc80f89e 107 Int_t GetNSegmentsTotal() const {return fNtRows;}
8c555625 108 Double_t GetLowMaxY(Int_t irow) const {return irow*0.;}
109 Double_t GetUpMaxY(Int_t irow) const {return irow*0;}
cc80f89e 110 //additional geometrical function - for Belikov
111
112 Bool_t AdjustSectorRow(Int_t index, Int_t & sector, Int_t &row) const; //return sector and padrow
8c555625 113 //for given index
8c555625 114
73042f01 115 void AdjustCosSin(Int_t isec, Float_t &cos, Float_t &sin) const;
cc80f89e 116 //set cosinus and sinus of rotation angles for sector isec
73042f01 117 Float_t GetAngle(Int_t isec) const;
01473f7b 118 // void GetChamberPos(Int_t isec, Float_t* xyz) const;
119 // void GetChamberRot(Int_t isec, Float_t* angles) const;
cc80f89e 120 //
121 //set sector parameters
122 //
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,
128 Float_t outershift);
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;}
135 //
f03e3423 136 // pad rows geometry
137 //
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 ;}
142 //
cc80f89e 143 //set wire parameters
144 //
145 void SetInnerNWires(Int_t nWires){ fNInnerWiresPerPad=nWires;}
146 void SetInnerDummyWire(Int_t dummy) {fInnerDummyWire = dummy;}
147 void SetInnerOffWire(Float_t offset) {fInnerOffWire =offset;}
f03e3423 148 void SetOuter1NWires(Int_t nWires){ fNOuter1WiresPerPad=nWires;}
149 void SetOuter2NWire(Int_t nWires){ fNOuter2WiresPerPad=nWires;}
cc80f89e 150 void SetOuterDummyWire(Int_t dummy) {fOuterDummyWire = dummy;}
f03e3423 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;}
cc80f89e 159 //
160 //set pad parameter
161 //
162 void SetInnerPadPitchLength(Float_t PadPitchLength){ fInnerPadPitchLength=PadPitchLength;}
163 void SetInnerPadPitchWidth(Float_t PadPitchWidth){ fInnerPadPitchWidth = PadPitchWidth;}
164 void SetInnerPadLength(Float_t PadLength){ fInnerPadLength=PadLength;}
f03e3423 165 void SetInnerPadWidth(Float_t PadWidth) { fInnerPadWidth=PadWidth;}
166 void SetOuter1PadPitchLength(Float_t PadPitchLength){ fOuter1PadPitchLength=PadPitchLength;}
167 void SetOuter2PadPitchLength(Float_t PadPitchLength){ fOuter2PadPitchLength=PadPitchLength;}
cc80f89e 168 void SetOuterPadPitchWidth(Float_t PadPitchWidth){ fOuterPadPitchWidth = PadPitchWidth;}
f03e3423 169 void SetOuter1PadLength(Float_t PadLength){ fOuter1PadLength=PadLength;}
170 void SetOuter2PadLength(Float_t PadLength){ fOuter2PadLength=PadLength;}
171 void SetOuterPadWidth(Float_t PadWidth) { fOuterPadWidth=PadWidth;}
cc80f89e 172 void SetMWPCReadout(Bool_t type) {fBMWPCReadout = type;}
173 void SetNCrossRows(Int_t rows){fNCrossRows = rows;}
174 //
175 //set gas paremeters
176 //
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;}
184 //
185 //set electronivc parameters
186 //
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;}
661f340b 197 //
198 // High voltage parameters
199 //
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; }
cc80f89e 205 //
206 //set response parameters
207 //
208 void SetNResponseMax(Int_t max) { fNResponseMax = max;}
209 void SetResponseThreshold(Int_t threshold) {fResponseThreshold = threshold;}
01473f7b 210 //set L1 parameters
211 void SetGateDelay(Float_t delay) {fGateDelay = delay;}
212 void SetL1Delay(Float_t delay) {fL1Delay = delay;}
213 void SetNTBinsBeforeL1(UShort_t nbins) {fNTBinsBeforeL1 = nbins;}
cc80f89e 214 //
215 //get sector parameters
216 //
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;}
f0043941 232 Float_t GetZLength(Int_t sector=0) const;
cc80f89e 233 Int_t GetGeometryType() const {return fGeometryType;}
234
235 //
236 //get wires parameter
237 //
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;}
f03e3423 244 Int_t GetOuter1NWires() const {return fNOuter1WiresPerPad;}
245 Int_t GetOuter2NWires() const {return fNOuter2WiresPerPad;}
cc80f89e 246 Float_t GetOuterWWPitch() const {return fOuterWWPitch;}
247 Int_t GetOuterDummyWire() const {return fOuterDummyWire;}
248 Float_t GetOuterOffWire() const {return fOuterOffWire;}
bf6adc12 249 Float_t GetLastWireUp1() const {return fLastWireUp1;}
cc80f89e 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);}
254 //
255 //get pad parameters
256 //
257 Float_t GetInnerPadPitchLength() const {return fInnerPadPitchLength;}
258 Float_t GetInnerPadPitchWidth() const {return fInnerPadPitchWidth;}
259 Float_t GetInnerPadLength() const {return fInnerPadLength;}
f03e3423 260 Float_t GetInnerPadWidth() const {return fInnerPadWidth;}
261 Float_t GetOuter1PadPitchLength() const {return fOuter1PadPitchLength;}
262 Float_t GetOuter2PadPitchLength() const {return fOuter2PadPitchLength;}
cc80f89e 263 Float_t GetOuterPadPitchWidth() const {return fOuterPadPitchWidth;}
f03e3423 264 Float_t GetOuter1PadLength() const {return fOuter1PadLength;}
265 Float_t GetOuter2PadLength() const {return fOuter2PadLength;}
cc80f89e 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);}
f03e3423 271 Float_t GetPadPitchLength(Int_t isector = 0, Int_t padrow=0) const
bf6adc12 272 { if (isector < fNInnerSector) return fInnerPadPitchLength;
273 else return ((padrow<fNRowUp1) ? fOuter1PadPitchLength:fOuter2PadPitchLength);}
8c555625 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
f03e3423 276 Int_t GetNRowUp1() const; // number of short rows in up sector
277 Int_t GetNRowUp2() const; // number of long rows in up sector
cc80f89e 278 Int_t GetNRow(Int_t isec) const {return ((isec<fNInnerSector) ? fNRowLow:fNRowUp);}
bf6adc12 279 Int_t GetNRowsTotal() const {return fNtRows;} //get total nuber of rows
8c555625 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 {
1283eee5 283 return ( (isec < fNInnerSector) ?GetPadRowRadiiLow(irow):GetPadRowRadiiUp(irow));}
cc80f89e 284 //retrun radii of the pad row irow in sector i
8c555625 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
cc80f89e 287 Int_t GetNPads(Int_t isector,Int_t irow) const{
f03e3423 288 return ( (isector < fNInnerSector) ?GetNPadsLow(irow) : GetNPadsUp(irow));}
289
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
01473f7b 292 Int_t GetSectorIndex(Float_t angle, Int_t row, Float_t z) const; // get sector index
74707dd2 293 Float_t GetChamberCenter(Int_t isec, Float_t * center = 0) const; // get readout chamber positions
01473f7b 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;}
cc80f89e 301 //
302 //get GAS parameters
303 //
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;}
311 //
312 //get Electronic parameters
313 //
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;}
bf6adc12 323 virtual Float_t GetZOffset() const {return 3*fTSigma*fDriftV;}
cc80f89e 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;}
661f340b 329 //
330 // High voltage parameters
331 //
61c82c27 332 Float_t GetNominalVoltage(UInt_t i) const {return (i<72)?fNominalVoltage[i]:0;} //0-35:IROC, 36-71:OROC
661f340b 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; }
337
cc80f89e 338 //
339 // get response data
340 //
73042f01 341 Int_t * GetResBin(Int_t i);
cc80f89e 342 //return response bin i - bin given by padrow [0] pad[1] timebin[2]
de61d5d5 343 Float_t & GetResWeight(Int_t i);
cc80f89e 344 //return weight of response bin i
01473f7b 345
346 // get L1 data
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;}
cc80f89e 351protected :
8c555625 352
8c555625 353 Bool_t fbStatus; //indicates consistency of the data
354 //---------------------------------------------------------------------
355 // ALICE TPC sector geometry
cc80f89e 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
0bbae0f2 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
cc80f89e 372 Float_t fZLength; //length of the drift region of the TPC
0bbae0f2 373 Float_t *fRotAngle; //[fNSector] sin and cos of rotation angles for
cc80f89e 374 // diferent sectors -calculated
375 Int_t fGeometryType; //type of geometry -0 straight rows
01473f7b 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
383 //coordinate system
384 TGeoHMatrix **fClusterMatrix; //![fNSector] transformation matrices of the cluster
385 //coordinate system
386 TGeoHMatrix **fGlobalMatrix; //![fNSector] fTrackingMatrix * fClusterMatrix
387
cc80f89e 388 //1-cylindrical
389 //---------------------------------------------------------------------
390 // ALICE TPC wires geometry - for GEM we can consider that it is gating
8c555625 391 //--------------------------------------------------------------------
0bbae0f2 392 Int_t fNInnerWiresPerPad; //Number of wires per pad
393 Float_t fInnerWWPitch; //pitch between wires in inner sector - calculated
cc80f89e 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
f03e3423 398 Float_t fLastWireUp1; //position of the last wire in outer1 sector
399 Int_t fNOuter1WiresPerPad; //Number of wires per pad
bf6adc12 400 Int_t fNOuter2WiresPerPad; // Number of wires per pad
0bbae0f2 401 Float_t fOuterWWPitch; //pitch between wires in outer sector -calculated
cc80f89e 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
1283eee5 406 //---------------------------------------------------------------------
407 // ALICE TPC pad parameters
408 //--------------------------------------------------------------------
cc80f89e 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
f03e3423 413 Float_t fOuter1PadPitchLength; //Outer pad pitch length
bf6adc12 414 Float_t fOuter2PadPitchLength; //Outer pad pitch length
cc80f89e 415 Float_t fOuterPadPitchWidth; //Outer pad pitch width
f03e3423 416 Float_t fOuter1PadLength; //Outer pad length
bf6adc12 417 Float_t fOuter2PadLength; //Outer pad length
cc80f89e 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
421
f03e3423 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
cc80f89e 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
f03e3423 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
8c555625 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
cc80f89e 439 Float_t fDriftV; //drift velocity constant
8c555625 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
cc80f89e 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
661f340b 459 Float_t fNoiseNormFac; //normalisation factor to transform noise in electron to ADC channel
460 //---------------------------------------------------------------------
461 // High voltage parameters
462 //---------------------------------------------------------------------
61c82c27 463 Float_t fNominalVoltage[72]; //nominal voltage in [V] per chamber
661f340b 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]
cc80f89e 468
cc80f89e 469 //---------------------------------------------------------------------
470 // ALICE TPC response data
471 //---------------------------------------------------------------------
472 Int_t fNResponseMax; //maximal dimension of response
473 Float_t fResponseThreshold; //threshold for accepted response
0bbae0f2 474 Int_t fCurrentMax; //!current maximal dimension -calulated
475 Int_t *fResponseBin; //!array with bins -calulated
476 Float_t *fResponseWeight; //!array with response -calulated
cc80f89e 477
01473f7b 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
485
bf6adc12 486private:
487 AliTPCParam(const AliTPCParam &);
488 AliTPCParam & operator=(const AliTPCParam &);
c828a869 489
490 void CleanGeoMatrices();
491
661f340b 492 ClassDef(AliTPCParam,5) //parameter object for set:TPC
8c555625 493};
494
cc80f89e 495
496inline Int_t * AliTPCParam::GetResBin(Int_t i)
497{
498 //return response bin i - bin given by padrow [0] pad[1] timebin[2]
499 if (i<fCurrentMax) return &fResponseBin[i*3];
500 else return 0;
925e6570 501}
cc80f89e 502
de61d5d5 503inline Float_t &AliTPCParam::GetResWeight(Int_t i)
cc80f89e 504{
505 //return weight of response bin i
506 if (i<fCurrentMax) return fResponseWeight[i];
de61d5d5 507 else return fResponseWeight[i];
cc80f89e 508}
8c555625 509
cc80f89e 510
73042f01 511inline void AliTPCParam::AdjustCosSin(Int_t isec, Float_t &cos, Float_t &sin) const
cc80f89e 512{
513 //
514 //set cosinus and sinus of rotation angles for sector isec
515 //
516 cos=fRotAngle[isec*4];
517 sin=fRotAngle[isec*4+1];
518}
519
73042f01 520inline Float_t AliTPCParam::GetAngle(Int_t isec) const
cc80f89e 521{
522 //
523 //return rotation angle of given sector
524 //
525 return fRotAngle[isec*4+2];
526}
527
528
74707dd2 529inline void AliTPCParam::Transform1to2Ideal(Float_t *xyz, Int_t *index) const
cc80f89e 530{
01473f7b 531 //transformation to rotated coordinates
cc80f89e 532 //we must have information about sector!
cc80f89e 533 //rotate to given sector
74707dd2 534 // ideal frame
535
cc80f89e 536 Float_t cos,sin;
01473f7b 537 AdjustCosSin(index[1],cos,sin);
cc80f89e 538 Float_t x1=xyz[0]*cos + xyz[1]*sin;
01473f7b 539 Float_t y1=-xyz[0]*sin + xyz[1]*cos;
cc80f89e 540 xyz[0]=x1;
541 xyz[1]=y1;
01473f7b 542 xyz[2]=fZLength-TMath::Abs(xyz[2]);
cc80f89e 543 index[0]=2;
544}
545
01473f7b 546
74707dd2 547inline void AliTPCParam::Transform1to2(Float_t *xyz, Int_t *index) const
548{
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]};
f99d7d41 553 Double_t xyzlocal[3]={0,0,0};
34bcefc7 554 if (index[1]>=0 && index[1]<fNSector)
555 fGlobalMatrix[index[1]]->MasterToLocal(xyzmaster,xyzlocal);
74707dd2 556 xyz[0] = xyzlocal[0];
557 xyz[1] = xyzlocal[1];
558 xyz[2] = xyzlocal[2];
559 index[0]=2;
560}
561
01473f7b 562
563
564
cc80f89e 565inline void AliTPCParam::Transform2to1(Float_t *xyz, Int_t *index) const
566{
567 //
568 //transformation from rotated coordinates to global coordinates
569 //
570 Float_t cos,sin;
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;
574 xyz[0]=x1;
575 xyz[1]=y1;
576 xyz[2]=fZLength-xyz[2];
577 if (index[1]<fNInnerSector)
4f57cad7 578 {if ( index[1]>=(fNInnerSector>>1)) xyz[2]*=-1.;}
cc80f89e 579 else
4f57cad7 580 {if ( (index[1]-fNInnerSector) >= (fNOuterSector>>1) ) xyz[2]*=-1;}
cc80f89e 581 index[0]=1;
582}
583
584inline void AliTPCParam::Transform2to2(Float_t *xyz, Int_t *index, Int_t *oindex) const
585{
586 //transform rotated coordinats of one sector to rotated
587 //coordinates relative to another sector
588 Transform2to1(xyz,index);
589 Transform1to2(xyz,oindex);
590 index[0]=2;
591 index[1]=oindex[1];
592}
593
594inline Float_t AliTPCParam::Transform2to2NearestWire(Float_t *xyz, Int_t *index) const
595{
596 //
597 // asigns the x-position of the closest wire to xyz[0], return the
598 // electron to closest wire distance
599 //
600 Float_t xnew,dx;
601 if (index[1]<fNInnerSector) {
602 xnew = fRInnerFirstWire+TMath::Nint((xyz[0]-fRInnerFirstWire)/fInnerWWPitch)*fInnerWWPitch;
b9d0a01d 603 }
cc80f89e 604 else {
605 xnew = fROuterFirstWire+TMath::Nint((xyz[0]-fROuterFirstWire)/fOuterWWPitch)*fOuterWWPitch;
606 }
607 dx = xnew-xyz[0];
608 xyz[0]=xnew;
609 return dx;
610}
611
612inline Int_t AliTPCParam::Transform2to3(Float_t *xyz, Int_t *index) const
613{
614 //
615 //calulates coresponding pad row number, sets index[2] for straight rows
616 //does not change xyz[] information
617 //valid only for straight row
618 //
619 if (index[1]<fNInnerSector)
620 index[2] =TMath::Nint((xyz[0]-fPadRowLow[0])/fInnerPadPitchLength);
621 else
f03e3423 622 if (xyz[0] < fLastWireUp1 )
623 index[2] = TMath::Nint((xyz[0]-fPadRowUp[0])/fOuter1PadPitchLength);
624 else
625 index[2] = TMath::Nint(fNRowUp1+(xyz[0]-fPadRowUp[64])/fOuter2PadPitchLength);
cc80f89e 626 index[0]=3;
627 return index[2];
628}
629
630inline void AliTPCParam::Transform3to4(Float_t *xyz, Int_t *index) const
631{
632 //
633 //valid only for straight rows straight rows
634 //calculate xyz[0] position relative to given index
635 //
636 if (index[1]<fNInnerSector)
637 xyz[0] -=index[2]*fInnerPadPitchLength+fPadRowLow[0];
638 else
f03e3423 639 if (index[2]<fNRowUp1)
640 xyz[0] -=index[2]*fOuter1PadPitchLength+fPadRowUp[0];
641 else
642 xyz[0] -=(index[2]-fNRowUp1)*fOuter2PadPitchLength+fPadRowUp[64];
cc80f89e 643 index[0] =4;
644}
645
646inline void AliTPCParam::Transform4to3(Float_t *xyz, Int_t *index) const
647{
648 //
649 //valid only for straight rows
650 //transforms relative xyz[0] to the global one within given sector
651 //
652 if (index[1]<fNInnerSector)
653 xyz[0] +=index[2]*fInnerPadPitchLength+fPadRowLow[0];
654 else
f03e3423 655 if(index[2]<fNRowUp1)
656 xyz[0] +=index[2]*fOuter1PadPitchLength+fPadRowUp[0];
657 else
658 xyz[0] +=index[2]*fOuter2PadPitchLength+fPadRowUp[64];
cc80f89e 659 index[0] =3;
660}
661
662
663inline void AliTPCParam::Transform2to5( Float_t *xyz, Int_t *index) const
664{
665 //
666 //transform [x,y,z] to [r,phi,z]
667 //
668 Float_t angle;
669 Float_t r = TMath::Sqrt(xyz[0]*xyz[0]+xyz[1]*xyz[1]);
670 if ((xyz[0]==0)&&(xyz[1]==0)) angle = 0;
671 else
672 {
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;
676 }
677 xyz[0]=r;
678 xyz[1]=angle;
679 index[0]=5;
680}
681
682inline void AliTPCParam::Transform5to2( Float_t *xyz, Int_t *index) const
683{
684 //
685 //transform [r,rphi,z] to [x,y,z]
686 //
687 Float_t r = xyz[0];
688 Float_t angle= xyz[1];
689 xyz[0]=r*TMath::Cos(angle);
690 xyz[1]=r*TMath::Sin(angle);
691 index[0]=2;
692}
693
694inline void AliTPCParam::Transform4to8(Float_t *xyz, Int_t *index) const
695{
696 //
697 //transform xyz coordinates to 'digit' coordinates
698 //
f03e3423 699
e30e6a9c 700 if (index[1]<fNInnerSector) {
701 if ( index[1]>=(fNInnerSector>>1)) xyz[1]*=-1.;
702 }
703 else {
704 if ( (index[1]-fNInnerSector) >= (fNOuterSector>>1) ) xyz[1]*=-1;
705 }
706
f03e3423 707 xyz[2]/=fZWidth;
cc80f89e 708 if (index[1]<fNInnerSector) {
709 xyz[0]/=fInnerPadPitchLength;
710 xyz[1]/=fInnerPadPitchWidth;
cc80f89e 711 }
f03e3423 712 else{
713 xyz[1]/=fOuterPadPitchWidth;
714 if (index[2]<fNRowUp1 ) xyz[0]/=fOuter1PadPitchLength;
715 else xyz[0]/=fOuter2PadPitchLength;
716 }
01473f7b 717 xyz[1]-=0.5;
cc80f89e 718 index[0]=8;
719}
720
721inline void AliTPCParam::Transform8to4(Float_t *xyz, Int_t *index) const
722{
723 //
724 //transforms 'digit' coordinates to xyz coordinates
725 //
e30e6a9c 726 if (index[1]<fNInnerSector) {
727 if ( index[1]>=(fNInnerSector>>1)) xyz[1]*=-1.;
728 }
729 else {
730 if ( (index[1]-fNInnerSector) >= (fNOuterSector>>1) ) xyz[1]*=-1;
731 }
732
f03e3423 733 xyz[2]*=fZWidth;
cc80f89e 734 if (index[1]<fNInnerSector) {
735 xyz[0]*=fInnerPadPitchLength;
f03e3423 736 xyz[1]*=fInnerPadPitchWidth;
cc80f89e 737 }
f03e3423 738 else{
739 xyz[1]*=fOuterPadPitchWidth;
740 if (index[2] < fNRowUp1 ) xyz[0]*=fOuter1PadPitchLength;
741 else xyz[0]*=fOuter2PadPitchLength;
742 }
cc80f89e 743 index[0]=4;
744}
745
746inline void AliTPCParam::Transform6to8(Float_t *xyz, Int_t *index) const
747{
748 //
749 //transforms cylindrical xyz coordinates to 'digit' coordinates
750 //
f03e3423 751 xyz[2]/=fZWidth;
cc80f89e 752 if (index[1]<fNInnerSector) {
753 xyz[0]/=fInnerPadPitchLength;
754 xyz[1]*=xyz[0]/fInnerPadPitchWidth;
cc80f89e 755 }
f03e3423 756 else{
cc80f89e 757 xyz[1]*=xyz[0]/fOuterPadPitchWidth;
f03e3423 758 if (index[2] < fNRowUp1 ) xyz[0]/=fOuter1PadPitchLength;
759 else xyz[0]/=fOuter2PadPitchLength;
760 }
cc80f89e 761 index[0]=8;
762}
763
764inline void AliTPCParam::Transform8to6(Float_t *xyz, Int_t *index) const
765{
766 //
767 //transforms 'digit' coordinates to cylindrical xyz coordinates
768 //
f03e3423 769 xyz[2]*=fZWidth;
cc80f89e 770 if (index[1]<fNInnerSector) {
771 xyz[0]*=fInnerPadPitchLength;
772 xyz[1]/=xyz[0]/fInnerPadPitchWidth;
cc80f89e 773 }
f03e3423 774 else{
775 xyz[1]/=xyz[0]/fOuterPadPitchWidth;
776 if (index[2] < fNRowUp1 ) xyz[0]*=fOuter1PadPitchLength;
777 else xyz[0]*=fOuter2PadPitchLength;
778 }
cc80f89e 779 index[0]=6;
780}
f0043941 781inline Float_t AliTPCParam::GetZLength(Int_t sector) const
782{ if(sector <18 || (sector>35&&sector<54)) return fZLength-0.275;
783 else return fZLength-0.302;
784}
8c555625 785#endif