]> git.uio.no Git - u/mrichter/AliRoot.git/blame - TPC/TPCbase/AliTPCParam.h
TPC module
[u/mrichter/AliRoot.git] / TPC / TPCbase / 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>
c94bc995 16#include <TVectorD.h>
61c82c27 17class TString;
e185e9d8 18class TGraphErrors;
61c82c27 19
cc80f89e 20class AliTPCParam : public AliDetectorParam {
8c555625 21 //////////////////////////////////////////////////////
22 //////////////////////////////////////////////////////
23 //ALITPCParam object to be possible change
24 //geometry and some other parameters of TPC
cc80f89e 25 //used by AliTPC and AliTPCSector
26
8c555625 27public:
28 AliTPCParam();
cc80f89e 29 virtual ~AliTPCParam();
1ac29fc4 30 TGeoHMatrix * Tracking2LocalMatrix(const TGeoHMatrix * geoMatrix, Int_t sector) const;
cc80f89e 31 virtual Bool_t Transform(Float_t *xyz, Int_t *index, Int_t* oindex);
32 //transformation from input coodination system to output coordination system
33 Int_t Transform0to1(Float_t *xyz, Int_t *index) const;
34 //trasforamtion from global to global - adjust index[0] sector
35 //return value is equal to sector corresponding to global position
74707dd2 36 void Transform1to2Ideal(Float_t *xyz, Int_t *index) const;
37 //transformation to rotated coordinata - ideal frame
73042f01 38 void Transform1to2(Float_t *xyz, Int_t *index) const;
74707dd2 39 //transformation to rotated coordinata
73042f01 40 void Transform2to1(Float_t *xyz, Int_t *index) const;
cc80f89e 41 //transformation from rotated coordinata to global coordinata
73042f01 42 void Transform2to2(Float_t *xyz, Int_t *index, Int_t *oindex) const;
cc80f89e 43 //transform rotated coordinata of one sector to rotated
44 //coordinata relative to another sector
73042f01 45 Float_t Transform2to2NearestWire(Float_t *xyz, Int_t *index) const;
cc80f89e 46 //round x position to nearest wire
73042f01 47 Int_t Transform2to3(Float_t *xyz, Int_t *index) const;
cc80f89e 48 //calulate coresponding index[2] -pad row for straight rows
49 //does not change xyz[]
50 //return pad - row
73042f01 51 void Transform3to4(Float_t *xyz, Int_t *index) const;
cc80f89e 52 //valid only for straight rows straight rows
53 //calculate xyz[0] position relative to given index
54 //return pad - row
73042f01 55 void Transform4to3(Float_t *xyz, Int_t *index) const;
cc80f89e 56 //valid only for straight rows straight rows
57 //transform xyz[0] position relative to given index
73042f01 58 void Transform2to5( Float_t *xyz, Int_t *index) const;
cc80f89e 59 //transform [x,y,z] to [r,rphi,z]
73042f01 60 void Transform5to2(Float_t *xyz, Int_t *index) const;
cc80f89e 61 //transform [r,rphi,z] coordinata to [x,y,z]
73042f01 62 void Transform4to8(Float_t *xyz, Int_t *index) const;
cc80f89e 63 //transform xyz coordinata to 'digit' coordinata
73042f01 64 void Transform8to4(Float_t *xyz, Int_t *index) const;
cc80f89e 65 //transform 'digit' coordinata to xyz coordinata
73042f01 66 void Transform6to8(Float_t *xyz, Int_t *index) const;
cc80f89e 67 //transform dr,f coordinata to 'digit' coordinata
73042f01 68 void Transform8to6(Float_t *xyz, Int_t *index) const;
cc80f89e 69 //transform 'digit' coordinata to dr,f coordinata
70
176aff27 71 virtual Int_t Transform2toPadRow(Float_t */*xyz*/, Int_t */*index*/) const{return 0;}
cc80f89e 72 //transform rotated to
73
74 virtual Int_t GetPadRow(Float_t *xyz, Int_t *index) const ;
75 //return pad row of point xyz - xyz is given in coordinate system -(given by index)
76 //output system is 3 for straight row and 7 for cylindrical row
176aff27 77 virtual void XYZtoCRXYZ(Float_t */*xyz*/,
78 Int_t &/*sector*/, Int_t &/*padrow*/, Int_t /*option*/) const {;}
8c555625 79 //transform global position to the position relative to the sector padrow
80 //if option=0 X calculate absolute calculate sector
81 //if option=1 X absolute use input sector
82 //if option=2 X relative to pad row calculate sector
83 //if option=3 X relative use input sector
84
176aff27 85 virtual void CRXYZtoXYZ(Float_t */*xyz*/,
86 const Int_t &/*sector*/, const Int_t & /*padrow*/, Int_t /*option*/) const {;}
8c555625 87 //transform relative position to the gloabal position
88
176aff27 89 virtual void CRTimePadtoYZ(Float_t &/*y*/, Float_t &/*z*/,
90 const Float_t &/*time*/, const Float_t &/*pad*/,
91 Int_t /*sector*/, Int_t /*padrow*/ ){;}
8c555625 92 //transform position in digit units (time slices and pads) to "normal"
93 //units (cm)
176aff27 94 virtual void CRYZtoTimePad(const Float_t &/*y*/, const Float_t &/*z*/,
95 Float_t &/*time*/, Float_t &/*pad*/,
96 Int_t /*sector*/, Int_t /*padrow*/){;}
cc80f89e 97 //transform position in cm to position in digit unit
176aff27 98 virtual Int_t CalcResponse(Float_t* /*x*/, Int_t * /*index*/, Int_t /*row*/){return 0;}
cc80f89e 99 //calculate bin response as function of the input position -x and the weight
100 //if row -pad row is equal -1 calculate response for each pad row
101 //otherwise it calculate only in given pad row
102 //return number of valid response bin
103 virtual void SetDefault(); //set defaut TPCparam
104 virtual Bool_t Update(); //recalculate and check geometric parameters
01473f7b 105 virtual Bool_t ReadGeoMatrices(); //read geo matrixes
bf6adc12 106 Bool_t GetStatus() const; //get information about object consistency
8569a2b0 107 Int_t GetIndex(Int_t sector, Int_t row) const; //give index of the given sector and pad row
cc80f89e 108 Int_t GetNSegmentsTotal() const {return fNtRows;}
8c555625 109 Double_t GetLowMaxY(Int_t irow) const {return irow*0.;}
110 Double_t GetUpMaxY(Int_t irow) const {return irow*0;}
cc80f89e 111 //additional geometrical function - for Belikov
112
113 Bool_t AdjustSectorRow(Int_t index, Int_t & sector, Int_t &row) const; //return sector and padrow
8c555625 114 //for given index
8c555625 115
73042f01 116 void AdjustCosSin(Int_t isec, Float_t &cos, Float_t &sin) const;
cc80f89e 117 //set cosinus and sinus of rotation angles for sector isec
73042f01 118 Float_t GetAngle(Int_t isec) const;
01473f7b 119 // void GetChamberPos(Int_t isec, Float_t* xyz) const;
120 // void GetChamberRot(Int_t isec, Float_t* angles) const;
cc80f89e 121 //
122 //set sector parameters
123 //
124 void SetInnerRadiusLow(Float_t InnerRadiusLow ) { fInnerRadiusLow=InnerRadiusLow;}
125 void SetOuterRadiusLow(Float_t OuterRadiusLow ) { fOuterRadiusLow=OuterRadiusLow;}
126 void SetInnerRadiusUp(Float_t InnerRadiusUp) { fInnerRadiusUp= InnerRadiusUp;}
127 void SetOuterRadiusUp(Float_t OuterRadiusUp) { fOuterRadiusUp= OuterRadiusUp;}
128 void SetSectorAngles(Float_t innerangle, Float_t innershift, Float_t outerangle,
129 Float_t outershift);
130 void SetInnerFrameSpace(Float_t frspace) {fInnerFrameSpace = frspace;}
131 void SetOuterFrameSpace(Float_t frspace) {fOuterFrameSpace = frspace;}
132 void SetInnerWireMount(Float_t fmount) {fInnerWireMount = fmount;}
133 void SetOuterWireMount(Float_t fmount) {fOuterWireMount = fmount;}
134 void SetZLength(Float_t zlength) {fZLength = zlength;}
135 void SetGeometryType(Int_t type) {fGeometryType = type;}
136 //
f03e3423 137 // pad rows geometry
138 //
139 void SetRowNLow( Int_t NRowLow){fNRowLow = NRowLow;}
140 void SetRowNUp1 (Int_t NRowUp1){fNRowUp1 = NRowUp1 ;} //upper sec short pads
141 void SetRowNUp2 (Int_t NRowUp2){fNRowUp2 = NRowUp2 ;} //upper sec long pads
142 void SetRowNUp (Int_t NRowUp){fNRowUp = NRowUp ;}
143 //
cc80f89e 144 //set wire parameters
145 //
146 void SetInnerNWires(Int_t nWires){ fNInnerWiresPerPad=nWires;}
147 void SetInnerDummyWire(Int_t dummy) {fInnerDummyWire = dummy;}
148 void SetInnerOffWire(Float_t offset) {fInnerOffWire =offset;}
f03e3423 149 void SetOuter1NWires(Int_t nWires){ fNOuter1WiresPerPad=nWires;}
150 void SetOuter2NWire(Int_t nWires){ fNOuter2WiresPerPad=nWires;}
cc80f89e 151 void SetOuterDummyWire(Int_t dummy) {fOuterDummyWire = dummy;}
f03e3423 152 void SetOuterOffWire(Float_t offset) {fOuterOffWire =offset;}
153 void SetInnerWWPitch( Float_t wwPitch) {fInnerWWPitch = wwPitch;}
154 void SetRInnerFirstWire(Float_t firstWire){fRInnerFirstWire = firstWire;}
155 void SetRInnerLastWire(Float_t lastWire){fRInnerLastWire = lastWire;}
156 void SetOuterWWPitch(Float_t wwPitch){fOuterWWPitch = wwPitch;}
157 void SetLastWireUp1(Float_t wireUp1){fLastWireUp1 = wireUp1;}
158 void SetROuterFirstWire(Float_t firstWire){fROuterFirstWire = firstWire;}
159 void SetROuterLastWire(Float_t lastWire){fROuterLastWire = lastWire;}
cc80f89e 160 //
161 //set pad parameter
162 //
163 void SetInnerPadPitchLength(Float_t PadPitchLength){ fInnerPadPitchLength=PadPitchLength;}
164 void SetInnerPadPitchWidth(Float_t PadPitchWidth){ fInnerPadPitchWidth = PadPitchWidth;}
165 void SetInnerPadLength(Float_t PadLength){ fInnerPadLength=PadLength;}
f03e3423 166 void SetInnerPadWidth(Float_t PadWidth) { fInnerPadWidth=PadWidth;}
167 void SetOuter1PadPitchLength(Float_t PadPitchLength){ fOuter1PadPitchLength=PadPitchLength;}
168 void SetOuter2PadPitchLength(Float_t PadPitchLength){ fOuter2PadPitchLength=PadPitchLength;}
cc80f89e 169 void SetOuterPadPitchWidth(Float_t PadPitchWidth){ fOuterPadPitchWidth = PadPitchWidth;}
f03e3423 170 void SetOuter1PadLength(Float_t PadLength){ fOuter1PadLength=PadLength;}
171 void SetOuter2PadLength(Float_t PadLength){ fOuter2PadLength=PadLength;}
172 void SetOuterPadWidth(Float_t PadWidth) { fOuterPadWidth=PadWidth;}
cc80f89e 173 void SetMWPCReadout(Bool_t type) {fBMWPCReadout = type;}
174 void SetNCrossRows(Int_t rows){fNCrossRows = rows;}
175 //
176 //set gas paremeters
177 //
178 void SetDiffT(Float_t DiffT){ fDiffT= DiffT;}
179 void SetDiffL(Float_t DiffL){ fDiffL=DiffL;}
180 void SetGasGain(Float_t GasGain){ fGasGain=GasGain;}
181 void SetDriftV(Float_t DriftV){ fDriftV= DriftV;}
182 void SetOmegaTau(Float_t OmegaTau){ fOmegaTau=OmegaTau;}
183 void SetAttCoef(Float_t AttCoef){ fAttCoef=AttCoef;}
184 void SetOxyCont(Float_t OxyCont){ fOxyCont=OxyCont;}
e185e9d8 185 void SetGainSlopesHV(TGraphErrors * gainSlopesHV){ fGainSlopesHV=gainSlopesHV;}
186 void SetGainSlopesPT(TGraphErrors * gainSlopesPT){ fGainSlopesPT=gainSlopesPT;}
187 void SetNominalGainSlopes();
c94bc995 188 void SetComposition(Float_t c1, Float_t c2, Float_t c3, Float_t c4, Float_t c5, Float_t c6){fComposition[0]=c1;
189 fComposition[1]=c2;
190 fComposition[2]=c3;
191 fComposition[3]=c4;
192 fComposition[4]=c5;
193 fComposition[5]=c6;}
194 void SetFpot(Float_t fpot){fFpot=fpot;}
195 void SetNprim(Float_t prim){fNprim=prim;}
196 void SetNtot(Float_t ntot){fNtot=ntot;}
197 void SetWmean(Float_t wmean){fWmean=wmean;}
198 void SetExp(Float_t exp){fExp=exp;}
199 void SetEend(Float_t end){fEend=end;}
200 void SetBetheBloch(TVectorD *v){
2505f4c6 201 if (fBetheBloch) delete fBetheBloch;
202 fBetheBloch=0;
203 if (v) fBetheBloch=new TVectorD(*v);
c94bc995 204 }
2505f4c6 205 static TVectorD * GetBetheBlochParamNa49();
206 static TVectorD * GetBetheBlochParamAlice();
207 static void RegisterBBParam(TVectorD* param, Int_t position);
cc80f89e 208 //
209 //set electronivc parameters
210 //
211 void SetPadCoupling(Float_t PadCoupling){ fPadCoupling=PadCoupling;}
212 void SetZeroSup(Int_t ZeroSup) { fZeroSup=ZeroSup;}
213 void SetNoise(Float_t Noise ) { fNoise= Noise;}
214 void SetChipGain(Float_t ChipGain){ fChipGain= ChipGain;}
215 void SetChipNorm(Float_t ChipNorm){ fChipNorm= ChipNorm;}
216 void SetTSample(Float_t TSample) { fTSample=TSample;}
217 void SetTFWHM(Float_t fwhm) { fTSigma=fwhm/2.35;}
218 void SetMaxTBin(Int_t maxtbin) { fMaxTBin = maxtbin;}
219 void SetADCSat(Int_t adcsat) { fADCSat = adcsat;}
220 void SetADCDynRange(Float_t adcdynrange) {fADCDynRange = adcdynrange;}
661f340b 221 //
222 // High voltage parameters
223 //
224 void SetNominalVoltage(Float_t v, UInt_t i) {if (i<72) fNominalVoltage[i]=v;}
225 void SetMaxVoltageDeviation(Float_t voltage) { fMaxVoltageDeviation=voltage; }
226 void SetMaxDipVoltage(Float_t voltage) { fMaxDipVoltage=voltage; }
227 void SetMaxFractionHVbad(Float_t frac ) { fMaxHVfractionBad=frac; }
228 void SetVoltageDipScanPeriod(Float_t period) { fVoltageDipScanPeriod=period; }
cc80f89e 229 //
230 //set response parameters
231 //
232 void SetNResponseMax(Int_t max) { fNResponseMax = max;}
233 void SetResponseThreshold(Int_t threshold) {fResponseThreshold = threshold;}
01473f7b 234 //set L1 parameters
235 void SetGateDelay(Float_t delay) {fGateDelay = delay;}
236 void SetL1Delay(Float_t delay) {fL1Delay = delay;}
237 void SetNTBinsBeforeL1(UShort_t nbins) {fNTBinsBeforeL1 = nbins;}
cc80f89e 238 //
239 //get sector parameters
240 //
241 Float_t GetInnerRadiusLow() const {return fInnerRadiusLow;}
242 Float_t GetInnerRadiusUp() const {return fInnerRadiusUp;}
243 Float_t GetOuterRadiusLow() const {return fOuterRadiusLow;}
244 Float_t GetOuterRadiusUp() const {return fOuterRadiusUp;}
245 Float_t GetInnerFrameSpace() const {return fInnerFrameSpace;}
246 Float_t GetOuterFrameSpace() const {return fOuterFrameSpace;}
247 Float_t GetInnerWireMount() const {return fInnerWireMount;}
248 Float_t GetOuterWireMount() const {return fOuterWireMount;}
249 Float_t GetInnerAngle() const ;
250 Float_t GetInnerAngleShift() const ;
251 Float_t GetOuterAngle() const ;
252 Float_t GetOuterAngleShift() const ;
253 Int_t GetNInnerSector() const {return fNInnerSector;}
254 Int_t GetNOuterSector() const {return fNOuterSector;}
255 Int_t GetNSector() const {return fNSector;}
f0043941 256 Float_t GetZLength(Int_t sector=0) const;
cc80f89e 257 Int_t GetGeometryType() const {return fGeometryType;}
258
259 //
260 //get wires parameter
261 //
262 Int_t GetInnerNWires() const {return fNInnerWiresPerPad;}
263 Float_t GetInnerWWPitch() const {return fInnerWWPitch;}
264 Int_t GetInnerDummyWire() const {return fInnerDummyWire;}
265 Float_t GetInnerOffWire() const {return fInnerOffWire;}
266 Float_t GetRInnerFirstWire() const {return fRInnerFirstWire;}
267 Float_t GetRInnerLastWire() const {return fRInnerLastWire;}
f03e3423 268 Int_t GetOuter1NWires() const {return fNOuter1WiresPerPad;}
269 Int_t GetOuter2NWires() const {return fNOuter2WiresPerPad;}
cc80f89e 270 Float_t GetOuterWWPitch() const {return fOuterWWPitch;}
271 Int_t GetOuterDummyWire() const {return fOuterDummyWire;}
272 Float_t GetOuterOffWire() const {return fOuterOffWire;}
bf6adc12 273 Float_t GetLastWireUp1() const {return fLastWireUp1;}
cc80f89e 274 Float_t GetROuterFirstWire() const {return fROuterFirstWire;}
275 Float_t GetROuterLastWire() const {return fROuterLastWire;}
276 Float_t GetWWPitch(Int_t isector = 0) const {
277 return ( (isector < fNInnerSector) ? fInnerWWPitch :fOuterWWPitch);}
278 //
279 //get pad parameters
280 //
281 Float_t GetInnerPadPitchLength() const {return fInnerPadPitchLength;}
282 Float_t GetInnerPadPitchWidth() const {return fInnerPadPitchWidth;}
283 Float_t GetInnerPadLength() const {return fInnerPadLength;}
f03e3423 284 Float_t GetInnerPadWidth() const {return fInnerPadWidth;}
285 Float_t GetOuter1PadPitchLength() const {return fOuter1PadPitchLength;}
286 Float_t GetOuter2PadPitchLength() const {return fOuter2PadPitchLength;}
cc80f89e 287 Float_t GetOuterPadPitchWidth() const {return fOuterPadPitchWidth;}
f03e3423 288 Float_t GetOuter1PadLength() const {return fOuter1PadLength;}
289 Float_t GetOuter2PadLength() const {return fOuter2PadLength;}
cc80f89e 290 Float_t GetOuterPadWidth() const {return fOuterPadWidth;}
291 Bool_t GetMWPCReadout() const {return fBMWPCReadout;}
292 Int_t GetNCrossRows() const {return fNCrossRows;}
293 Float_t GetPadPitchWidth(Int_t isector = 0) const {
294 return ( (isector < fNInnerSector) ? fInnerPadPitchWidth :fOuterPadPitchWidth);}
f03e3423 295 Float_t GetPadPitchLength(Int_t isector = 0, Int_t padrow=0) const
bf6adc12 296 { if (isector < fNInnerSector) return fInnerPadPitchLength;
297 else return ((padrow<fNRowUp1) ? fOuter1PadPitchLength:fOuter2PadPitchLength);}
8c555625 298 Int_t GetNRowLow() const; //get the number of pad rows in low sector
299 Int_t GetNRowUp() const; //get the number of pad rows in up sector
f03e3423 300 Int_t GetNRowUp1() const; // number of short rows in up sector
301 Int_t GetNRowUp2() const; // number of long rows in up sector
cc80f89e 302 Int_t GetNRow(Int_t isec) const {return ((isec<fNInnerSector) ? fNRowLow:fNRowUp);}
bf6adc12 303 Int_t GetNRowsTotal() const {return fNtRows;} //get total nuber of rows
8c555625 304 Float_t GetPadRowRadiiLow(Int_t irow) const; //get the pad row (irow) radii
305 Float_t GetPadRowRadiiUp(Int_t irow) const; //get the pad row (irow) radii
306 Float_t GetPadRowRadii(Int_t isec,Int_t irow) const {
1283eee5 307 return ( (isec < fNInnerSector) ?GetPadRowRadiiLow(irow):GetPadRowRadiiUp(irow));}
cc80f89e 308 //retrun radii of the pad row irow in sector i
8c555625 309 Int_t GetNPadsLow(Int_t irow) const; //get the number of pads in row irow
310 Int_t GetNPadsUp(Int_t irow) const; //get the number of pads in row irow
cc80f89e 311 Int_t GetNPads(Int_t isector,Int_t irow) const{
f03e3423 312 return ( (isector < fNInnerSector) ?GetNPadsLow(irow) : GetNPadsUp(irow));}
0ad1a123 313 Int_t GetWireSegment(Int_t sector, Int_t row) const ; // get Anode wire segment index IROC --> [0,4], OROC[0,7]
314 Int_t GetNPadsPerSegment(Int_t segmentID) const; // get number of pads for a given Anode wire segment
f03e3423 315
316 Float_t GetYInner(Int_t irow) const; // wire length in low sec row
317 Float_t GetYOuter(Int_t irow) const; // wire length in up sec row
01473f7b 318 Int_t GetSectorIndex(Float_t angle, Int_t row, Float_t z) const; // get sector index
74707dd2 319 Float_t GetChamberCenter(Int_t isec, Float_t * center = 0) const; // get readout chamber positions
01473f7b 320 TGeoHMatrix *GetTrackingMatrix(Int_t isec) const {
321 return fTrackingMatrix[isec];}
322 TGeoHMatrix *GetClusterMatrix(Int_t isec) const {
323 return fClusterMatrix[isec];}
324 TGeoHMatrix *GetGlobalMatrix(Int_t isec) const {
325 return fGlobalMatrix[isec];}
326 Bool_t IsGeoRead(){ return fGlobalMatrix!=0;}
cc80f89e 327 //
328 //get GAS parameters
329 //
330 Float_t GetDiffT() const {return fDiffT;}
331 Float_t GetDiffL() const {return fDiffL;}
332 Float_t GetGasGain() const {return fGasGain;}
333 Float_t GetDriftV() const {return fDriftV;}
334 Float_t GetOmegaTau() const {return fOmegaTau;}
335 Float_t GetAttCoef() const {return fAttCoef;}
e185e9d8 336 Float_t GetOxyCont() const {return fOxyCont;}
337 TGraphErrors * GetGainSlopesHV() const { return fGainSlopesHV;}
338 TGraphErrors * GetGainSlopesPT() const { return fGainSlopesPT;}
c94bc995 339 Float_t* GetComposition() {return fComposition;}
340 Float_t GetFpot()const {return fFpot;}
341 Float_t GetNprim() const {return fNprim;}
342 Float_t GetNtot() const {return fNtot;}
343 Float_t GetWmean()const {return fWmean;}
344 Float_t GetExp()const {return fExp;}
345 Float_t GetEend()const {return fEend;}
2505f4c6 346 TVectorD* GetBetheBlochParameters(){return fBetheBloch;}
347 static Double_t BetheBlochAleph(Double_t bb, Int_t type=0);
cc80f89e 348 //
349 //get Electronic parameters
350 //
351 Float_t GetPadCoupling() const {return fPadCoupling;}
352 Int_t GetZeroSup() const {return fZeroSup;}
353 Float_t GetNoise() const {return fNoise;}
354 Float_t GetChipGain() const {return fChipGain;}
355 Float_t GetChipNorm() const {return fChipNorm;}
356 Float_t GetTSample() const {return fTSample;}
357 Float_t GetZWidth() const {return fZWidth;}
358 Float_t GetTFWHM() const {return fTSigma*2.35;}
359 Float_t GetZSigma() const {return fTSigma*fDriftV;}
bf6adc12 360 virtual Float_t GetZOffset() const {return 3*fTSigma*fDriftV;}
cc80f89e 361 Int_t GetMaxTBin() const {return fMaxTBin;}
362 Int_t GetADCSat() const {return fADCSat;}
363 Float_t GetADCDynRange() const {return fADCDynRange;}
364 Float_t GetTotalNormFac() const {return fTotalNormFac;}
365 Float_t GetNoiseNormFac() const {return fNoiseNormFac;}
661f340b 366 //
367 // High voltage parameters
368 //
61c82c27 369 Float_t GetNominalVoltage(UInt_t i) const {return (i<72)?fNominalVoltage[i]:0;} //0-35:IROC, 36-71:OROC
661f340b 370 Float_t GetMaxVoltageDeviation() const { return fMaxVoltageDeviation; }
371 Float_t GetMaxDipVoltage() const { return fMaxDipVoltage; }
372 Float_t GetMaxFractionHVbad() const { return fMaxHVfractionBad; }
373 Float_t GetVoltageDipScanPeriod() const { return fVoltageDipScanPeriod; }
374
cc80f89e 375 //
376 // get response data
377 //
73042f01 378 Int_t * GetResBin(Int_t i);
cc80f89e 379 //return response bin i - bin given by padrow [0] pad[1] timebin[2]
de61d5d5 380 Float_t & GetResWeight(Int_t i);
cc80f89e 381 //return weight of response bin i
01473f7b 382
383 // get L1 data
384 Float_t GetGateDelay() const {return fGateDelay;}
385 Float_t GetL1Delay() const {return fL1Delay;}
386 UShort_t GetNTBinsBeforeL1() const {return fNTBinsBeforeL1;}
387 Float_t GetNTBinsL1() const {return fNTBinsL1;}
cc80f89e 388protected :
8c555625 389
8c555625 390 Bool_t fbStatus; //indicates consistency of the data
391 //---------------------------------------------------------------------
392 // ALICE TPC sector geometry
cc80f89e 393 //--------------------------------------------------------------------
394 Float_t fInnerRadiusLow; // lower radius of inner sector-IP
395 Float_t fInnerRadiusUp; // upper radius of inner sector-IP
396 Float_t fOuterRadiusUp; // upper radius of outer sector-IP
397 Float_t fOuterRadiusLow; // lower radius of outer sector-IP
398 Float_t fInnerAngle; //opening angle of Inner sector
399 Float_t fInnerAngleShift; //shift of first inner sector center to the 0
400 Float_t fOuterAngle; //opening angle of outer sector
401 Float_t fOuterAngleShift; //shift of first sector center to the 0
402 Float_t fInnerFrameSpace; //space for inner frame in the phi direction
403 Float_t fOuterFrameSpace; //space for outer frame in the phi direction
404 Float_t fInnerWireMount; //space for wire mount, inner sector
405 Float_t fOuterWireMount; //space for wire mount, outer sector
0bbae0f2 406 Int_t fNInnerSector; //number of inner sectors -calculated
407 Int_t fNOuterSector; //number of outer sectors -calculated
408 Int_t fNSector; // total number of sectors -calculated
cc80f89e 409 Float_t fZLength; //length of the drift region of the TPC
0bbae0f2 410 Float_t *fRotAngle; //[fNSector] sin and cos of rotation angles for
cc80f89e 411 // diferent sectors -calculated
412 Int_t fGeometryType; //type of geometry -0 straight rows
01473f7b 413 // Float_t *fChamberPos; //[fNSector] displacements of the readout chambers
414 //with respect to the 'idead' geometry
415 //in local corrdinate system
416 // Float_t *fChamberRot; //[fNSector] rotation angles of the readout chambers
417 //with respect to the 'idead' geometry
418 //in local corrdinate system
419 TGeoHMatrix **fTrackingMatrix; //![fNSector] transformation matrices of the tracking
420 //coordinate system
421 TGeoHMatrix **fClusterMatrix; //![fNSector] transformation matrices of the cluster
422 //coordinate system
423 TGeoHMatrix **fGlobalMatrix; //![fNSector] fTrackingMatrix * fClusterMatrix
424
cc80f89e 425 //1-cylindrical
426 //---------------------------------------------------------------------
427 // ALICE TPC wires geometry - for GEM we can consider that it is gating
8c555625 428 //--------------------------------------------------------------------
0bbae0f2 429 Int_t fNInnerWiresPerPad; //Number of wires per pad
430 Float_t fInnerWWPitch; //pitch between wires in inner sector - calculated
cc80f89e 431 Int_t fInnerDummyWire; //number of wires without pad readout
432 Float_t fInnerOffWire; //oofset of first wire to the begining of the sector
433 Float_t fRInnerFirstWire; //position of the first wire -calculated
434 Float_t fRInnerLastWire; //position of the last wire -calculated
f03e3423 435 Float_t fLastWireUp1; //position of the last wire in outer1 sector
436 Int_t fNOuter1WiresPerPad; //Number of wires per pad
bf6adc12 437 Int_t fNOuter2WiresPerPad; // Number of wires per pad
0bbae0f2 438 Float_t fOuterWWPitch; //pitch between wires in outer sector -calculated
cc80f89e 439 Int_t fOuterDummyWire; //number of wires without pad readout
440 Float_t fOuterOffWire; //oofset of first wire to the begining of the sector
441 Float_t fROuterFirstWire; //position of the first wire -calulated
442 Float_t fROuterLastWire; //position of the last wire -calculated
1283eee5 443 //---------------------------------------------------------------------
444 // ALICE TPC pad parameters
445 //--------------------------------------------------------------------
cc80f89e 446 Float_t fInnerPadPitchLength; //Inner pad pitch length
447 Float_t fInnerPadPitchWidth; //Inner pad pitch width
448 Float_t fInnerPadLength; //Inner pad length
449 Float_t fInnerPadWidth; //Inner pad width
f03e3423 450 Float_t fOuter1PadPitchLength; //Outer pad pitch length
bf6adc12 451 Float_t fOuter2PadPitchLength; //Outer pad pitch length
cc80f89e 452 Float_t fOuterPadPitchWidth; //Outer pad pitch width
f03e3423 453 Float_t fOuter1PadLength; //Outer pad length
bf6adc12 454 Float_t fOuter2PadLength; //Outer pad length
cc80f89e 455 Float_t fOuterPadWidth; //Outer pad width
456 Bool_t fBMWPCReadout; //indicate wire readout - kTRUE or GEM readout -kFALSE
457 Int_t fNCrossRows; //number of rows to crostalk calculation
458
f03e3423 459 Int_t fNRowLow; //number of pad rows per low sector -set
460 Int_t fNRowUp1; //number of short pad rows per sector up -set
461 Int_t fNRowUp2; //number of long pad rows per sector up -set
cc80f89e 462 Int_t fNRowUp; //number of pad rows per sector up -calculated
463 Int_t fNtRows; //total number of rows in TPC -calculated
464 Float_t fPadRowLow[600]; //Lower sector, pad row radii -calculated
465 Float_t fPadRowUp[600]; //Upper sector, pad row radii -calculated
466 Int_t fNPadsLow[600]; //Lower sector, number of pads per row -calculated
f03e3423 467 Int_t fNPadsUp[600]; //Upper sector, number of pads per row -calculated
468 Float_t fYInner[600]; //Inner sector, wire-length
469 Float_t fYOuter[600]; //Outer sector, wire-length
8c555625 470 //---------------------------------------------------------------------
471 // ALICE TPC Gas Parameters
472 //--------------------------------------------------------------------
473 Float_t fDiffT; //tangencial diffusion constant
474 Float_t fDiffL; //longutudinal diffusion constant
475 Float_t fGasGain; //gas gain constant
cc80f89e 476 Float_t fDriftV; //drift velocity constant
8c555625 477 Float_t fOmegaTau; //omega tau ExB coeficient
478 Float_t fAttCoef; //attachment coefitients
479 Float_t fOxyCont; //oxygen content
c94bc995 480 Float_t fFpot; // first ionisation potential
481 Float_t fNprim; // number of primary electrons/cm
482 Float_t fNtot; //total number of electrons/c (MIP)
483 Float_t fWmean; // mean energy for electron/ion pair
484 Float_t fExp; // de = f(E) - energy loss parametrization
485 Float_t fEend; // upper cutoff for de generation
486 TVectorD* fBetheBloch; // Bethe-Bloch parametrization
487 // gas mixture composition
488 Float_t fComposition[6];
e185e9d8 489 TGraphErrors * fGainSlopesHV; // graph with the gain slope as function of HV - per chamber
490 TGraphErrors * fGainSlopesPT; // graph with the gain slope as function of P/T - per chamber
8c555625 491 //---------------------------------------------------------------------
492 // ALICE TPC Electronics Parameters
493 //--------------------------------------------------------------------
494 Float_t fPadCoupling; //coupling factor ration of anode signal
495 //and total pads signal
cc80f89e 496 Int_t fZeroSup; //zero suppresion constant
497 Float_t fNoise; //noise sigma constant
498 Float_t fChipGain; //preamp shaper constant
499 Float_t fChipNorm; //preamp shaper normalisation
500 Float_t fTSample; //sampling time
501 Float_t fZWidth; //derived value calculated using TSample and driftw -computed
502 Float_t fTSigma; //width of the Preamp/Shaper function
503 Int_t fMaxTBin; //maximum time bin number
504 Int_t fADCSat; //saturation value of ADC (10 bits)
505 Float_t fADCDynRange; //input dynamic range (mV)
506 Float_t fTotalNormFac; //full normalisation factor - calculated
661f340b 507 Float_t fNoiseNormFac; //normalisation factor to transform noise in electron to ADC channel
508 //---------------------------------------------------------------------
509 // High voltage parameters
510 //---------------------------------------------------------------------
61c82c27 511 Float_t fNominalVoltage[72]; //nominal voltage in [V] per chamber
661f340b 512 Float_t fMaxVoltageDeviation; // maximum voltage deviation from nominal voltage before a chamber is masked
513 Float_t fMaxDipVoltage; // maximum voltage deviation from median before a dip event is marked
514 Float_t fMaxHVfractionBad; // maximum fraction of bad HV entries (deviation from Median) before a chamber is marked bad
515 Float_t fVoltageDipScanPeriod; // scanning period to detect a high volrage dip: event time stamp +- fVoltageDipScanPeriod [sec]
cc80f89e 516
cc80f89e 517 //---------------------------------------------------------------------
518 // ALICE TPC response data
519 //---------------------------------------------------------------------
520 Int_t fNResponseMax; //maximal dimension of response
521 Float_t fResponseThreshold; //threshold for accepted response
0bbae0f2 522 Int_t fCurrentMax; //!current maximal dimension -calulated
523 Int_t *fResponseBin; //!array with bins -calulated
524 Float_t *fResponseWeight; //!array with response -calulated
cc80f89e 525
01473f7b 526 //---------------------------------------------------------------------
527 // ALICE TPC L1 Parameters
528 //--------------------------------------------------------------------
529 Float_t fGateDelay; //Delay of L1 arrival for the TPC gate signal
530 Float_t fL1Delay; //Delay of L1 arrival for the TPC readout
531 UShort_t fNTBinsBeforeL1; //Number of time bins before L1 arrival which are being read out
532 Float_t fNTBinsL1; //Overall L1 delay in time bins
2505f4c6 533 protected:
534 static TObjArray *fBBParam; // array of the Bethe-Bloch parameters.
535 private:
bf6adc12 536 AliTPCParam(const AliTPCParam &);
537 AliTPCParam & operator=(const AliTPCParam &);
c828a869 538
539 void CleanGeoMatrices();
540
aa68d009 541 ClassDef(AliTPCParam,8) //parameter object for set:TPC
8c555625 542};
543
cc80f89e 544
545inline Int_t * AliTPCParam::GetResBin(Int_t i)
546{
547 //return response bin i - bin given by padrow [0] pad[1] timebin[2]
548 if (i<fCurrentMax) return &fResponseBin[i*3];
549 else return 0;
925e6570 550}
cc80f89e 551
de61d5d5 552inline Float_t &AliTPCParam::GetResWeight(Int_t i)
cc80f89e 553{
554 //return weight of response bin i
555 if (i<fCurrentMax) return fResponseWeight[i];
de61d5d5 556 else return fResponseWeight[i];
cc80f89e 557}
8c555625 558
cc80f89e 559
73042f01 560inline void AliTPCParam::AdjustCosSin(Int_t isec, Float_t &cos, Float_t &sin) const
cc80f89e 561{
562 //
563 //set cosinus and sinus of rotation angles for sector isec
564 //
565 cos=fRotAngle[isec*4];
566 sin=fRotAngle[isec*4+1];
567}
568
73042f01 569inline Float_t AliTPCParam::GetAngle(Int_t isec) const
cc80f89e 570{
571 //
572 //return rotation angle of given sector
573 //
574 return fRotAngle[isec*4+2];
575}
576
577
74707dd2 578inline void AliTPCParam::Transform1to2Ideal(Float_t *xyz, Int_t *index) const
cc80f89e 579{
01473f7b 580 //transformation to rotated coordinates
cc80f89e 581 //we must have information about sector!
cc80f89e 582 //rotate to given sector
74707dd2 583 // ideal frame
584
cc80f89e 585 Float_t cos,sin;
01473f7b 586 AdjustCosSin(index[1],cos,sin);
cc80f89e 587 Float_t x1=xyz[0]*cos + xyz[1]*sin;
01473f7b 588 Float_t y1=-xyz[0]*sin + xyz[1]*cos;
cc80f89e 589 xyz[0]=x1;
590 xyz[1]=y1;
01473f7b 591 xyz[2]=fZLength-TMath::Abs(xyz[2]);
cc80f89e 592 index[0]=2;
593}
594
01473f7b 595
74707dd2 596inline void AliTPCParam::Transform1to2(Float_t *xyz, Int_t *index) const
597{
598 //transformation to rotated coordinates
599 //we must have information about sector!
600 //rotate to given sector
601 Double_t xyzmaster[3] = {xyz[0],xyz[1],xyz[2]};
f99d7d41 602 Double_t xyzlocal[3]={0,0,0};
34bcefc7 603 if (index[1]>=0 && index[1]<fNSector)
604 fGlobalMatrix[index[1]]->MasterToLocal(xyzmaster,xyzlocal);
74707dd2 605 xyz[0] = xyzlocal[0];
606 xyz[1] = xyzlocal[1];
607 xyz[2] = xyzlocal[2];
608 index[0]=2;
609}
610
01473f7b 611
612
613
cc80f89e 614inline void AliTPCParam::Transform2to1(Float_t *xyz, Int_t *index) const
615{
616 //
617 //transformation from rotated coordinates to global coordinates
618 //
619 Float_t cos,sin;
620 AdjustCosSin(index[1],cos,sin);
621 Float_t x1=xyz[0]*cos - xyz[1]*sin;
622 Float_t y1=xyz[0]*sin + xyz[1]*cos;
623 xyz[0]=x1;
624 xyz[1]=y1;
625 xyz[2]=fZLength-xyz[2];
626 if (index[1]<fNInnerSector)
4f57cad7 627 {if ( index[1]>=(fNInnerSector>>1)) xyz[2]*=-1.;}
cc80f89e 628 else
4f57cad7 629 {if ( (index[1]-fNInnerSector) >= (fNOuterSector>>1) ) xyz[2]*=-1;}
cc80f89e 630 index[0]=1;
631}
632
633inline void AliTPCParam::Transform2to2(Float_t *xyz, Int_t *index, Int_t *oindex) const
634{
635 //transform rotated coordinats of one sector to rotated
636 //coordinates relative to another sector
637 Transform2to1(xyz,index);
638 Transform1to2(xyz,oindex);
639 index[0]=2;
640 index[1]=oindex[1];
641}
642
643inline Float_t AliTPCParam::Transform2to2NearestWire(Float_t *xyz, Int_t *index) const
644{
645 //
646 // asigns the x-position of the closest wire to xyz[0], return the
647 // electron to closest wire distance
648 //
649 Float_t xnew,dx;
650 if (index[1]<fNInnerSector) {
651 xnew = fRInnerFirstWire+TMath::Nint((xyz[0]-fRInnerFirstWire)/fInnerWWPitch)*fInnerWWPitch;
b9d0a01d 652 }
cc80f89e 653 else {
654 xnew = fROuterFirstWire+TMath::Nint((xyz[0]-fROuterFirstWire)/fOuterWWPitch)*fOuterWWPitch;
655 }
656 dx = xnew-xyz[0];
657 xyz[0]=xnew;
658 return dx;
659}
660
661inline Int_t AliTPCParam::Transform2to3(Float_t *xyz, Int_t *index) const
662{
663 //
664 //calulates coresponding pad row number, sets index[2] for straight rows
665 //does not change xyz[] information
666 //valid only for straight row
667 //
668 if (index[1]<fNInnerSector)
669 index[2] =TMath::Nint((xyz[0]-fPadRowLow[0])/fInnerPadPitchLength);
670 else
f03e3423 671 if (xyz[0] < fLastWireUp1 )
672 index[2] = TMath::Nint((xyz[0]-fPadRowUp[0])/fOuter1PadPitchLength);
673 else
674 index[2] = TMath::Nint(fNRowUp1+(xyz[0]-fPadRowUp[64])/fOuter2PadPitchLength);
cc80f89e 675 index[0]=3;
676 return index[2];
677}
678
679inline void AliTPCParam::Transform3to4(Float_t *xyz, Int_t *index) const
680{
681 //
682 //valid only for straight rows straight rows
683 //calculate xyz[0] position relative to given index
684 //
685 if (index[1]<fNInnerSector)
686 xyz[0] -=index[2]*fInnerPadPitchLength+fPadRowLow[0];
687 else
f03e3423 688 if (index[2]<fNRowUp1)
689 xyz[0] -=index[2]*fOuter1PadPitchLength+fPadRowUp[0];
690 else
691 xyz[0] -=(index[2]-fNRowUp1)*fOuter2PadPitchLength+fPadRowUp[64];
cc80f89e 692 index[0] =4;
693}
694
695inline void AliTPCParam::Transform4to3(Float_t *xyz, Int_t *index) const
696{
697 //
698 //valid only for straight rows
699 //transforms relative xyz[0] to the global one within given sector
700 //
701 if (index[1]<fNInnerSector)
702 xyz[0] +=index[2]*fInnerPadPitchLength+fPadRowLow[0];
703 else
f03e3423 704 if(index[2]<fNRowUp1)
705 xyz[0] +=index[2]*fOuter1PadPitchLength+fPadRowUp[0];
706 else
707 xyz[0] +=index[2]*fOuter2PadPitchLength+fPadRowUp[64];
cc80f89e 708 index[0] =3;
709}
710
711
712inline void AliTPCParam::Transform2to5( Float_t *xyz, Int_t *index) const
713{
714 //
715 //transform [x,y,z] to [r,phi,z]
716 //
717 Float_t angle;
718 Float_t r = TMath::Sqrt(xyz[0]*xyz[0]+xyz[1]*xyz[1]);
719 if ((xyz[0]==0)&&(xyz[1]==0)) angle = 0;
720 else
721 {
722 angle =TMath::ASin(xyz[1]/r);
723 if (xyz[0]<0) angle=TMath::Pi()-angle;
724 if ( (xyz[0]>0) && (xyz[1]<0) ) angle=2*TMath::Pi()+angle;
725 }
726 xyz[0]=r;
727 xyz[1]=angle;
728 index[0]=5;
729}
730
731inline void AliTPCParam::Transform5to2( Float_t *xyz, Int_t *index) const
732{
733 //
734 //transform [r,rphi,z] to [x,y,z]
735 //
736 Float_t r = xyz[0];
737 Float_t angle= xyz[1];
738 xyz[0]=r*TMath::Cos(angle);
739 xyz[1]=r*TMath::Sin(angle);
740 index[0]=2;
741}
742
743inline void AliTPCParam::Transform4to8(Float_t *xyz, Int_t *index) const
744{
745 //
746 //transform xyz coordinates to 'digit' coordinates
747 //
f03e3423 748
e30e6a9c 749 if (index[1]<fNInnerSector) {
750 if ( index[1]>=(fNInnerSector>>1)) xyz[1]*=-1.;
751 }
752 else {
753 if ( (index[1]-fNInnerSector) >= (fNOuterSector>>1) ) xyz[1]*=-1;
754 }
755
f03e3423 756 xyz[2]/=fZWidth;
cc80f89e 757 if (index[1]<fNInnerSector) {
758 xyz[0]/=fInnerPadPitchLength;
759 xyz[1]/=fInnerPadPitchWidth;
cc80f89e 760 }
f03e3423 761 else{
762 xyz[1]/=fOuterPadPitchWidth;
763 if (index[2]<fNRowUp1 ) xyz[0]/=fOuter1PadPitchLength;
764 else xyz[0]/=fOuter2PadPitchLength;
765 }
01473f7b 766 xyz[1]-=0.5;
cc80f89e 767 index[0]=8;
768}
769
770inline void AliTPCParam::Transform8to4(Float_t *xyz, Int_t *index) const
771{
772 //
773 //transforms 'digit' coordinates to xyz coordinates
774 //
e30e6a9c 775 if (index[1]<fNInnerSector) {
776 if ( index[1]>=(fNInnerSector>>1)) xyz[1]*=-1.;
777 }
778 else {
779 if ( (index[1]-fNInnerSector) >= (fNOuterSector>>1) ) xyz[1]*=-1;
780 }
781
f03e3423 782 xyz[2]*=fZWidth;
cc80f89e 783 if (index[1]<fNInnerSector) {
784 xyz[0]*=fInnerPadPitchLength;
f03e3423 785 xyz[1]*=fInnerPadPitchWidth;
cc80f89e 786 }
f03e3423 787 else{
788 xyz[1]*=fOuterPadPitchWidth;
789 if (index[2] < fNRowUp1 ) xyz[0]*=fOuter1PadPitchLength;
790 else xyz[0]*=fOuter2PadPitchLength;
791 }
cc80f89e 792 index[0]=4;
793}
794
795inline void AliTPCParam::Transform6to8(Float_t *xyz, Int_t *index) const
796{
797 //
798 //transforms cylindrical xyz coordinates to 'digit' coordinates
799 //
f03e3423 800 xyz[2]/=fZWidth;
cc80f89e 801 if (index[1]<fNInnerSector) {
802 xyz[0]/=fInnerPadPitchLength;
803 xyz[1]*=xyz[0]/fInnerPadPitchWidth;
cc80f89e 804 }
f03e3423 805 else{
cc80f89e 806 xyz[1]*=xyz[0]/fOuterPadPitchWidth;
f03e3423 807 if (index[2] < fNRowUp1 ) xyz[0]/=fOuter1PadPitchLength;
808 else xyz[0]/=fOuter2PadPitchLength;
809 }
cc80f89e 810 index[0]=8;
811}
812
813inline void AliTPCParam::Transform8to6(Float_t *xyz, Int_t *index) const
814{
815 //
816 //transforms 'digit' coordinates to cylindrical xyz coordinates
817 //
f03e3423 818 xyz[2]*=fZWidth;
cc80f89e 819 if (index[1]<fNInnerSector) {
820 xyz[0]*=fInnerPadPitchLength;
821 xyz[1]/=xyz[0]/fInnerPadPitchWidth;
cc80f89e 822 }
f03e3423 823 else{
824 xyz[1]/=xyz[0]/fOuterPadPitchWidth;
825 if (index[2] < fNRowUp1 ) xyz[0]*=fOuter1PadPitchLength;
826 else xyz[0]*=fOuter2PadPitchLength;
827 }
cc80f89e 828 index[0]=6;
829}
f0043941 830inline Float_t AliTPCParam::GetZLength(Int_t sector) const
831{ if(sector <18 || (sector>35&&sector<54)) return fZLength-0.275;
832 else return fZLength-0.302;
833}
8c555625 834#endif