]> git.uio.no Git - u/mrichter/AliRoot.git/blame - TPC/AliTPCParam.h
Cvetan changes (T0) + Read geo matrices +Correct pad numbers
[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
01473f7b 15#include <TGeoMatrix.h>
16
cc80f89e 17class AliTPCParam : public AliDetectorParam {
8c555625 18 //////////////////////////////////////////////////////
19 //////////////////////////////////////////////////////
20 //ALITPCParam object to be possible change
21 //geometry and some other parameters of TPC
cc80f89e 22 //used by AliTPC and AliTPCSector
23
8c555625 24public:
25 AliTPCParam();
cc80f89e 26 virtual ~AliTPCParam();
8c555625 27
cc80f89e 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
73042f01 33 void Transform1to2(Float_t *xyz, Int_t *index) const;
cc80f89e 34 //transformation to rotated coordinata
73042f01 35 void Transform2to1(Float_t *xyz, Int_t *index) const;
cc80f89e 36 //transformation from rotated coordinata to global coordinata
73042f01 37 void Transform2to2(Float_t *xyz, Int_t *index, Int_t *oindex) const;
cc80f89e 38 //transform rotated coordinata of one sector to rotated
39 //coordinata relative to another sector
73042f01 40 Float_t Transform2to2NearestWire(Float_t *xyz, Int_t *index) const;
cc80f89e 41 //round x position to nearest wire
73042f01 42 Int_t Transform2to3(Float_t *xyz, Int_t *index) const;
cc80f89e 43 //calulate coresponding index[2] -pad row for straight rows
44 //does not change xyz[]
45 //return pad - row
73042f01 46 void Transform3to4(Float_t *xyz, Int_t *index) const;
cc80f89e 47 //valid only for straight rows straight rows
48 //calculate xyz[0] position relative to given index
49 //return pad - row
73042f01 50 void Transform4to3(Float_t *xyz, Int_t *index) const;
cc80f89e 51 //valid only for straight rows straight rows
52 //transform xyz[0] position relative to given index
73042f01 53 void Transform2to5( Float_t *xyz, Int_t *index) const;
cc80f89e 54 //transform [x,y,z] to [r,rphi,z]
73042f01 55 void Transform5to2(Float_t *xyz, Int_t *index) const;
cc80f89e 56 //transform [r,rphi,z] coordinata to [x,y,z]
73042f01 57 void Transform4to8(Float_t *xyz, Int_t *index) const;
cc80f89e 58 //transform xyz coordinata to 'digit' coordinata
73042f01 59 void Transform8to4(Float_t *xyz, Int_t *index) const;
cc80f89e 60 //transform 'digit' coordinata to xyz coordinata
73042f01 61 void Transform6to8(Float_t *xyz, Int_t *index) const;
cc80f89e 62 //transform dr,f coordinata to 'digit' coordinata
73042f01 63 void Transform8to6(Float_t *xyz, Int_t *index) const;
cc80f89e 64 //transform 'digit' coordinata to dr,f coordinata
65
176aff27 66 virtual Int_t Transform2toPadRow(Float_t */*xyz*/, Int_t */*index*/) const{return 0;}
cc80f89e 67 //transform rotated to
68
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
176aff27 72 virtual void XYZtoCRXYZ(Float_t */*xyz*/,
73 Int_t &/*sector*/, Int_t &/*padrow*/, Int_t /*option*/) const {;}
8c555625 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
79
176aff27 80 virtual void CRXYZtoXYZ(Float_t */*xyz*/,
81 const Int_t &/*sector*/, const Int_t & /*padrow*/, Int_t /*option*/) const {;}
8c555625 82 //transform relative position to the gloabal position
83
176aff27 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*/ ){;}
8c555625 87 //transform position in digit units (time slices and pads) to "normal"
88 //units (cm)
176aff27 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*/){;}
cc80f89e 92 //transform position in cm to position in digit unit
176aff27 93 virtual Int_t CalcResponse(Float_t* /*x*/, Int_t * /*index*/, Int_t /*row*/){return 0;}
cc80f89e 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
01473f7b 100 virtual Bool_t ReadGeoMatrices(); //read geo matrixes
bf6adc12 101 Bool_t GetStatus() const; //get information about object consistency
8569a2b0 102 Int_t GetIndex(Int_t sector, Int_t row) const; //give index of the given sector and pad row
cc80f89e 103 Int_t GetNSegmentsTotal() const {return fNtRows;}
8c555625 104 Double_t GetLowMaxY(Int_t irow) const {return irow*0.;}
105 Double_t GetUpMaxY(Int_t irow) const {return irow*0;}
cc80f89e 106 //additional geometrical function - for Belikov
107
108 Bool_t AdjustSectorRow(Int_t index, Int_t & sector, Int_t &row) const; //return sector and padrow
8c555625 109 //for given index
8c555625 110
73042f01 111 void AdjustCosSin(Int_t isec, Float_t &cos, Float_t &sin) const;
cc80f89e 112 //set cosinus and sinus of rotation angles for sector isec
73042f01 113 Float_t GetAngle(Int_t isec) const;
01473f7b 114 // void GetChamberPos(Int_t isec, Float_t* xyz) const;
115 // void GetChamberRot(Int_t isec, Float_t* angles) const;
cc80f89e 116 //
117 //set sector parameters
118 //
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,
124 Float_t outershift);
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;}
131 //
f03e3423 132 // pad rows geometry
133 //
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 ;}
138 //
cc80f89e 139 //set wire parameters
140 //
141 void SetInnerNWires(Int_t nWires){ fNInnerWiresPerPad=nWires;}
142 void SetInnerDummyWire(Int_t dummy) {fInnerDummyWire = dummy;}
143 void SetInnerOffWire(Float_t offset) {fInnerOffWire =offset;}
f03e3423 144 void SetOuter1NWires(Int_t nWires){ fNOuter1WiresPerPad=nWires;}
145 void SetOuter2NWire(Int_t nWires){ fNOuter2WiresPerPad=nWires;}
cc80f89e 146 void SetOuterDummyWire(Int_t dummy) {fOuterDummyWire = dummy;}
f03e3423 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;}
cc80f89e 155 //
156 //set pad parameter
157 //
158 void SetInnerPadPitchLength(Float_t PadPitchLength){ fInnerPadPitchLength=PadPitchLength;}
159 void SetInnerPadPitchWidth(Float_t PadPitchWidth){ fInnerPadPitchWidth = PadPitchWidth;}
160 void SetInnerPadLength(Float_t PadLength){ fInnerPadLength=PadLength;}
f03e3423 161 void SetInnerPadWidth(Float_t PadWidth) { fInnerPadWidth=PadWidth;}
162 void SetOuter1PadPitchLength(Float_t PadPitchLength){ fOuter1PadPitchLength=PadPitchLength;}
163 void SetOuter2PadPitchLength(Float_t PadPitchLength){ fOuter2PadPitchLength=PadPitchLength;}
cc80f89e 164 void SetOuterPadPitchWidth(Float_t PadPitchWidth){ fOuterPadPitchWidth = PadPitchWidth;}
f03e3423 165 void SetOuter1PadLength(Float_t PadLength){ fOuter1PadLength=PadLength;}
166 void SetOuter2PadLength(Float_t PadLength){ fOuter2PadLength=PadLength;}
167 void SetOuterPadWidth(Float_t PadWidth) { fOuterPadWidth=PadWidth;}
cc80f89e 168 void SetMWPCReadout(Bool_t type) {fBMWPCReadout = type;}
169 void SetNCrossRows(Int_t rows){fNCrossRows = rows;}
170 //
171 //set gas paremeters
172 //
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;}
180 //
181 //set electronivc parameters
182 //
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;}
193 //
194 //set response parameters
195 //
196 void SetNResponseMax(Int_t max) { fNResponseMax = max;}
197 void SetResponseThreshold(Int_t threshold) {fResponseThreshold = threshold;}
01473f7b 198 //set L1 parameters
199 void SetGateDelay(Float_t delay) {fGateDelay = delay;}
200 void SetL1Delay(Float_t delay) {fL1Delay = delay;}
201 void SetNTBinsBeforeL1(UShort_t nbins) {fNTBinsBeforeL1 = nbins;}
cc80f89e 202 //
203 //get sector parameters
204 //
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;}
222
223 //
224 //get wires parameter
225 //
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;}
f03e3423 232 Int_t GetOuter1NWires() const {return fNOuter1WiresPerPad;}
233 Int_t GetOuter2NWires() const {return fNOuter2WiresPerPad;}
cc80f89e 234 Float_t GetOuterWWPitch() const {return fOuterWWPitch;}
235 Int_t GetOuterDummyWire() const {return fOuterDummyWire;}
236 Float_t GetOuterOffWire() const {return fOuterOffWire;}
bf6adc12 237 Float_t GetLastWireUp1() const {return fLastWireUp1;}
cc80f89e 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);}
242 //
243 //get pad parameters
244 //
245 Float_t GetInnerPadPitchLength() const {return fInnerPadPitchLength;}
246 Float_t GetInnerPadPitchWidth() const {return fInnerPadPitchWidth;}
247 Float_t GetInnerPadLength() const {return fInnerPadLength;}
f03e3423 248 Float_t GetInnerPadWidth() const {return fInnerPadWidth;}
249 Float_t GetOuter1PadPitchLength() const {return fOuter1PadPitchLength;}
250 Float_t GetOuter2PadPitchLength() const {return fOuter2PadPitchLength;}
cc80f89e 251 Float_t GetOuterPadPitchWidth() const {return fOuterPadPitchWidth;}
f03e3423 252 Float_t GetOuter1PadLength() const {return fOuter1PadLength;}
253 Float_t GetOuter2PadLength() const {return fOuter2PadLength;}
cc80f89e 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);}
f03e3423 259 Float_t GetPadPitchLength(Int_t isector = 0, Int_t padrow=0) const
bf6adc12 260 { if (isector < fNInnerSector) return fInnerPadPitchLength;
261 else return ((padrow<fNRowUp1) ? fOuter1PadPitchLength:fOuter2PadPitchLength);}
8c555625 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
f03e3423 264 Int_t GetNRowUp1() const; // number of short rows in up sector
265 Int_t GetNRowUp2() const; // number of long rows in up sector
cc80f89e 266 Int_t GetNRow(Int_t isec) const {return ((isec<fNInnerSector) ? fNRowLow:fNRowUp);}
bf6adc12 267 Int_t GetNRowsTotal() const {return fNtRows;} //get total nuber of rows
8c555625 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 {
1283eee5 271 return ( (isec < fNInnerSector) ?GetPadRowRadiiLow(irow):GetPadRowRadiiUp(irow));}
cc80f89e 272 //retrun radii of the pad row irow in sector i
8c555625 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
cc80f89e 275 Int_t GetNPads(Int_t isector,Int_t irow) const{
f03e3423 276 return ( (isector < fNInnerSector) ?GetNPadsLow(irow) : GetNPadsUp(irow));}
277
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
01473f7b 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;}
cc80f89e 289 //
290 //get GAS parameters
291 //
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;}
299 //
300 //get Electronic parameters
301 //
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;}
bf6adc12 311 virtual Float_t GetZOffset() const {return 3*fTSigma*fDriftV;}
cc80f89e 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;}
317 //
318 // get response data
319 //
73042f01 320 Int_t * GetResBin(Int_t i);
cc80f89e 321 //return response bin i - bin given by padrow [0] pad[1] timebin[2]
de61d5d5 322 Float_t & GetResWeight(Int_t i);
cc80f89e 323 //return weight of response bin i
01473f7b 324
325 // get L1 data
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;}
cc80f89e 330protected :
8c555625 331
8c555625 332 Bool_t fbStatus; //indicates consistency of the data
333 //---------------------------------------------------------------------
334 // ALICE TPC sector geometry
cc80f89e 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
0bbae0f2 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
cc80f89e 351 Float_t fZLength; //length of the drift region of the TPC
0bbae0f2 352 Float_t *fRotAngle; //[fNSector] sin and cos of rotation angles for
cc80f89e 353 // diferent sectors -calculated
354 Int_t fGeometryType; //type of geometry -0 straight rows
01473f7b 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
362 //coordinate system
363 TGeoHMatrix **fClusterMatrix; //![fNSector] transformation matrices of the cluster
364 //coordinate system
365 TGeoHMatrix **fGlobalMatrix; //![fNSector] fTrackingMatrix * fClusterMatrix
366
cc80f89e 367 //1-cylindrical
368 //---------------------------------------------------------------------
369 // ALICE TPC wires geometry - for GEM we can consider that it is gating
8c555625 370 //--------------------------------------------------------------------
0bbae0f2 371 Int_t fNInnerWiresPerPad; //Number of wires per pad
372 Float_t fInnerWWPitch; //pitch between wires in inner sector - calculated
cc80f89e 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
f03e3423 377 Float_t fLastWireUp1; //position of the last wire in outer1 sector
378 Int_t fNOuter1WiresPerPad; //Number of wires per pad
bf6adc12 379 Int_t fNOuter2WiresPerPad; // Number of wires per pad
0bbae0f2 380 Float_t fOuterWWPitch; //pitch between wires in outer sector -calculated
cc80f89e 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
1283eee5 385 //---------------------------------------------------------------------
386 // ALICE TPC pad parameters
387 //--------------------------------------------------------------------
cc80f89e 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
f03e3423 392 Float_t fOuter1PadPitchLength; //Outer pad pitch length
bf6adc12 393 Float_t fOuter2PadPitchLength; //Outer pad pitch length
cc80f89e 394 Float_t fOuterPadPitchWidth; //Outer pad pitch width
f03e3423 395 Float_t fOuter1PadLength; //Outer pad length
bf6adc12 396 Float_t fOuter2PadLength; //Outer pad length
cc80f89e 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
400
f03e3423 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
cc80f89e 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
f03e3423 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
8c555625 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
cc80f89e 418 Float_t fDriftV; //drift velocity constant
8c555625 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
cc80f89e 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
439
cc80f89e 440 //---------------------------------------------------------------------
441 // ALICE TPC response data
442 //---------------------------------------------------------------------
443 Int_t fNResponseMax; //maximal dimension of response
444 Float_t fResponseThreshold; //threshold for accepted response
0bbae0f2 445 Int_t fCurrentMax; //!current maximal dimension -calulated
446 Int_t *fResponseBin; //!array with bins -calulated
447 Float_t *fResponseWeight; //!array with response -calulated
cc80f89e 448
01473f7b 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
456
bf6adc12 457private:
458 AliTPCParam(const AliTPCParam &);
459 AliTPCParam & operator=(const AliTPCParam &);
01473f7b 460 ClassDef(AliTPCParam,4) //parameter object for set:TPC
8c555625 461};
462
cc80f89e 463
464inline Int_t * AliTPCParam::GetResBin(Int_t i)
465{
466 //return response bin i - bin given by padrow [0] pad[1] timebin[2]
467 if (i<fCurrentMax) return &fResponseBin[i*3];
468 else return 0;
925e6570 469}
cc80f89e 470
de61d5d5 471inline Float_t &AliTPCParam::GetResWeight(Int_t i)
cc80f89e 472{
473 //return weight of response bin i
474 if (i<fCurrentMax) return fResponseWeight[i];
de61d5d5 475 else return fResponseWeight[i];
cc80f89e 476}
8c555625 477
cc80f89e 478
73042f01 479inline void AliTPCParam::AdjustCosSin(Int_t isec, Float_t &cos, Float_t &sin) const
cc80f89e 480{
481 //
482 //set cosinus and sinus of rotation angles for sector isec
483 //
484 cos=fRotAngle[isec*4];
485 sin=fRotAngle[isec*4+1];
486}
487
73042f01 488inline Float_t AliTPCParam::GetAngle(Int_t isec) const
cc80f89e 489{
490 //
491 //return rotation angle of given sector
492 //
493 return fRotAngle[isec*4+2];
494}
495
01473f7b 496//inline void AliTPCParam::GetChamberPos(Int_t isec, Float_t* xyz) const
497//{
498 //
499 //return displacement and rotation of the readout chamber
500 //with respect to the ideal geometry
501// xyz[0] = fChamberPos[isec*3];
502// xyz[1] = fChamberPos[isec*3+1];
503// xyz[2] = fChamberPos[isec*3+2];
504//}
505
506//inline void AliTPCParam::GetChamberRot(Int_t isec, Float_t* angles) const
507//{
508 //
509 //return displacement and rotation of the readout chamber
510 //with respect to the ideal geometry
511// angles[0] = fChamberRot[isec*3];
512// angles[1] = fChamberRot[isec*3+1];
513// angles[2] = fChamberRot[isec*3+2];
514//}
515
516/* inline void AliTPCParam::Transform1to2(Float_t *xyz, Int_t *index) const */
517/* { */
518/* //transformation to rotated coordinates */
519/* //we must have information about sector! */
520/* //rotate to given sector */
521/* Double_t xyzmaster[3] = {xyz[0],xyz[1],xyz[2]}; */
522/* Double_t xyzlocal[3]; */
523/* fGlobalMatrix[index[1]]->MasterToLocal(xyzmaster,xyzlocal); */
524/* xyz[0] = xyzlocal[0]; */
525/* xyz[1] = xyzlocal[1]; */
526/* xyz[2] = TMath::Abs(xyzlocal[2]); */
527/* index[0]=2; */
528/* } */
cc80f89e 529
530inline void AliTPCParam::Transform1to2(Float_t *xyz, Int_t *index) const
531{
01473f7b 532 //transformation to rotated coordinates
cc80f89e 533 //we must have information about sector!
534
535 //rotate to given sector
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
547
548
549
cc80f89e 550inline void AliTPCParam::Transform2to1(Float_t *xyz, Int_t *index) const
551{
552 //
553 //transformation from rotated coordinates to global coordinates
554 //
555 Float_t cos,sin;
556 AdjustCosSin(index[1],cos,sin);
557 Float_t x1=xyz[0]*cos - xyz[1]*sin;
558 Float_t y1=xyz[0]*sin + xyz[1]*cos;
559 xyz[0]=x1;
560 xyz[1]=y1;
561 xyz[2]=fZLength-xyz[2];
562 if (index[1]<fNInnerSector)
563 if ( index[1]>=(fNInnerSector>>1)) xyz[2]*=-1.;
564 else
01473f7b 565 if ( (index[1]-fNInnerSector) >= (fNOuterSector>>1) ) xyz[2]*=-1;
cc80f89e 566 index[0]=1;
567}
568
569inline void AliTPCParam::Transform2to2(Float_t *xyz, Int_t *index, Int_t *oindex) const
570{
571 //transform rotated coordinats of one sector to rotated
572 //coordinates relative to another sector
573 Transform2to1(xyz,index);
574 Transform1to2(xyz,oindex);
575 index[0]=2;
576 index[1]=oindex[1];
577}
578
579inline Float_t AliTPCParam::Transform2to2NearestWire(Float_t *xyz, Int_t *index) const
580{
581 //
582 // asigns the x-position of the closest wire to xyz[0], return the
583 // electron to closest wire distance
584 //
585 Float_t xnew,dx;
586 if (index[1]<fNInnerSector) {
587 xnew = fRInnerFirstWire+TMath::Nint((xyz[0]-fRInnerFirstWire)/fInnerWWPitch)*fInnerWWPitch;
b9d0a01d 588 }
cc80f89e 589 else {
590 xnew = fROuterFirstWire+TMath::Nint((xyz[0]-fROuterFirstWire)/fOuterWWPitch)*fOuterWWPitch;
591 }
592 dx = xnew-xyz[0];
593 xyz[0]=xnew;
594 return dx;
595}
596
597inline Int_t AliTPCParam::Transform2to3(Float_t *xyz, Int_t *index) const
598{
599 //
600 //calulates coresponding pad row number, sets index[2] for straight rows
601 //does not change xyz[] information
602 //valid only for straight row
603 //
604 if (index[1]<fNInnerSector)
605 index[2] =TMath::Nint((xyz[0]-fPadRowLow[0])/fInnerPadPitchLength);
606 else
f03e3423 607 if (xyz[0] < fLastWireUp1 )
608 index[2] = TMath::Nint((xyz[0]-fPadRowUp[0])/fOuter1PadPitchLength);
609 else
610 index[2] = TMath::Nint(fNRowUp1+(xyz[0]-fPadRowUp[64])/fOuter2PadPitchLength);
cc80f89e 611 index[0]=3;
612 return index[2];
613}
614
615inline void AliTPCParam::Transform3to4(Float_t *xyz, Int_t *index) const
616{
617 //
618 //valid only for straight rows straight rows
619 //calculate xyz[0] position relative to given index
620 //
621 if (index[1]<fNInnerSector)
622 xyz[0] -=index[2]*fInnerPadPitchLength+fPadRowLow[0];
623 else
f03e3423 624 if (index[2]<fNRowUp1)
625 xyz[0] -=index[2]*fOuter1PadPitchLength+fPadRowUp[0];
626 else
627 xyz[0] -=(index[2]-fNRowUp1)*fOuter2PadPitchLength+fPadRowUp[64];
cc80f89e 628 index[0] =4;
629}
630
631inline void AliTPCParam::Transform4to3(Float_t *xyz, Int_t *index) const
632{
633 //
634 //valid only for straight rows
635 //transforms relative xyz[0] to the global one within given sector
636 //
637 if (index[1]<fNInnerSector)
638 xyz[0] +=index[2]*fInnerPadPitchLength+fPadRowLow[0];
639 else
f03e3423 640 if(index[2]<fNRowUp1)
641 xyz[0] +=index[2]*fOuter1PadPitchLength+fPadRowUp[0];
642 else
643 xyz[0] +=index[2]*fOuter2PadPitchLength+fPadRowUp[64];
cc80f89e 644 index[0] =3;
645}
646
647
648inline void AliTPCParam::Transform2to5( Float_t *xyz, Int_t *index) const
649{
650 //
651 //transform [x,y,z] to [r,phi,z]
652 //
653 Float_t angle;
654 Float_t r = TMath::Sqrt(xyz[0]*xyz[0]+xyz[1]*xyz[1]);
655 if ((xyz[0]==0)&&(xyz[1]==0)) angle = 0;
656 else
657 {
658 angle =TMath::ASin(xyz[1]/r);
659 if (xyz[0]<0) angle=TMath::Pi()-angle;
660 if ( (xyz[0]>0) && (xyz[1]<0) ) angle=2*TMath::Pi()+angle;
661 }
662 xyz[0]=r;
663 xyz[1]=angle;
664 index[0]=5;
665}
666
667inline void AliTPCParam::Transform5to2( Float_t *xyz, Int_t *index) const
668{
669 //
670 //transform [r,rphi,z] to [x,y,z]
671 //
672 Float_t r = xyz[0];
673 Float_t angle= xyz[1];
674 xyz[0]=r*TMath::Cos(angle);
675 xyz[1]=r*TMath::Sin(angle);
676 index[0]=2;
677}
678
679inline void AliTPCParam::Transform4to8(Float_t *xyz, Int_t *index) const
680{
681 //
682 //transform xyz coordinates to 'digit' coordinates
683 //
f03e3423 684
685 xyz[2]/=fZWidth;
cc80f89e 686 if (index[1]<fNInnerSector) {
687 xyz[0]/=fInnerPadPitchLength;
688 xyz[1]/=fInnerPadPitchWidth;
cc80f89e 689 }
f03e3423 690 else{
691 xyz[1]/=fOuterPadPitchWidth;
692 if (index[2]<fNRowUp1 ) xyz[0]/=fOuter1PadPitchLength;
693 else xyz[0]/=fOuter2PadPitchLength;
694 }
01473f7b 695 xyz[1]-=0.5;
cc80f89e 696 index[0]=8;
697}
698
699inline void AliTPCParam::Transform8to4(Float_t *xyz, Int_t *index) const
700{
701 //
702 //transforms 'digit' coordinates to xyz coordinates
703 //
f03e3423 704 xyz[2]*=fZWidth;
cc80f89e 705 if (index[1]<fNInnerSector) {
706 xyz[0]*=fInnerPadPitchLength;
f03e3423 707 xyz[1]*=fInnerPadPitchWidth;
cc80f89e 708 }
f03e3423 709 else{
710 xyz[1]*=fOuterPadPitchWidth;
711 if (index[2] < fNRowUp1 ) xyz[0]*=fOuter1PadPitchLength;
712 else xyz[0]*=fOuter2PadPitchLength;
713 }
cc80f89e 714 index[0]=4;
715}
716
717inline void AliTPCParam::Transform6to8(Float_t *xyz, Int_t *index) const
718{
719 //
720 //transforms cylindrical xyz coordinates to 'digit' coordinates
721 //
f03e3423 722 xyz[2]/=fZWidth;
cc80f89e 723 if (index[1]<fNInnerSector) {
724 xyz[0]/=fInnerPadPitchLength;
725 xyz[1]*=xyz[0]/fInnerPadPitchWidth;
cc80f89e 726 }
f03e3423 727 else{
cc80f89e 728 xyz[1]*=xyz[0]/fOuterPadPitchWidth;
f03e3423 729 if (index[2] < fNRowUp1 ) xyz[0]/=fOuter1PadPitchLength;
730 else xyz[0]/=fOuter2PadPitchLength;
731 }
cc80f89e 732 index[0]=8;
733}
734
735inline void AliTPCParam::Transform8to6(Float_t *xyz, Int_t *index) const
736{
737 //
738 //transforms 'digit' coordinates to cylindrical xyz coordinates
739 //
f03e3423 740 xyz[2]*=fZWidth;
cc80f89e 741 if (index[1]<fNInnerSector) {
742 xyz[0]*=fInnerPadPitchLength;
743 xyz[1]/=xyz[0]/fInnerPadPitchWidth;
cc80f89e 744 }
f03e3423 745 else{
746 xyz[1]/=xyz[0]/fOuterPadPitchWidth;
747 if (index[2] < fNRowUp1 ) xyz[0]*=fOuter1PadPitchLength;
748 else xyz[0]*=fOuter2PadPitchLength;
749 }
cc80f89e 750 index[0]=6;
751}
8c555625 752
8c555625 753#endif