]> git.uio.no Git - u/mrichter/AliRoot.git/blame - TPC/AliTPCParam.cxx
Simple example macro to make some analyzis for the ESD tracks - see comments (Not...
[u/mrichter/AliRoot.git] / TPC / AliTPCParam.cxx
CommitLineData
4c039060 1/**************************************************************************
2 * Copyright(c) 1998-1999, ALICE Experiment at CERN, All rights reserved. *
3 * *
4 * Author: The ALICE Off-line Project. *
5 * Contributors are mentioned in the code where appropriate. *
6 * *
7 * Permission to use, copy, modify and distribute this software and its *
8 * documentation strictly for non-commercial purposes is hereby granted *
9 * without fee, provided that the above copyright notice appears in all *
10 * copies and that both the copyright notice and this permission notice *
11 * appear in the supporting documentation. The authors make no claims *
12 * about the suitability of this software for any purpose. It is *
13 * provided "as is" without express or implied warranty. *
14 **************************************************************************/
15
88cb7938 16/* $Id$ */
4c039060 17
8c555625 18///////////////////////////////////////////////////////////////////////
19// Manager and of geomety classes for set: TPC //
20// //
1283eee5 21// !sectors are numbered from 0 //
22// !pad rows are numbered from 0 //
23//
24// 12.6. changed z relative
8c555625 25// Origin: Marian Ivanov, Uni. of Bratislava, ivanov@fmph.uniba.sk //
26// //
27///////////////////////////////////////////////////////////////////////
28
73042f01 29//
8c555625 30
1283eee5 31#include <AliTPCParam.h>
8c555625 32
01473f7b 33#include <TGeoManager.h>
34#include <TGeoPhysicalNode.h>
35#include "AliAlignObj.h"
36#include "AliAlignObjAngles.h"
37#include "AliLog.h"
38
73042f01 39ClassImp(AliTPCParam)
8c555625 40
41
42//___________________________________________
43AliTPCParam::AliTPCParam()
44{
cc80f89e 45 //
46 //constructor sets the default parameters
47 //
48
49 fResponseBin = 0;
50 fResponseWeight = 0;
51 fRotAngle = 0;
01473f7b 52 fTrackingMatrix = fClusterMatrix = fGlobalMatrix = 0;
7a09f434 53 SetTitle("75x40_100x60_150x60");
8c555625 54 SetDefault();
55}
56
cc80f89e 57AliTPCParam::~AliTPCParam()
1283eee5 58{
59 //
cc80f89e 60 //destructor deletes some dynamicaly alocated variables
61 //
62
63 if (fResponseBin!=0) delete [] fResponseBin;
64 if (fResponseWeight!=0) delete [] fResponseWeight;
65 if (fRotAngle !=0) delete [] fRotAngle;
753797ce 66
67 if (fTrackingMatrix) {
68 for(Int_t i = 0; i < fNSector; i++)
69 delete fTrackingMatrix[i];
70 delete [] fTrackingMatrix;
71 }
72
73 if (fClusterMatrix) {
74 for(Int_t i = 0; i < fNSector; i++)
75 delete fClusterMatrix[i];
76 delete [] fClusterMatrix;
77 }
78
79 if (fGlobalMatrix) {
80 for(Int_t i = 0; i < fNSector; i++)
81 delete fGlobalMatrix[i];
82 delete [] fGlobalMatrix;
83 }
84
1283eee5 85}
86
87
cc80f89e 88
89
90Int_t AliTPCParam::Transform0to1(Float_t *xyz, Int_t * index) const
91{
92 //
93 // calculates sector number (index[1], undefined on input)
94 // xyz intact
95 //
96
97 Float_t angle,x1;
98 Int_t sector;
99 Float_t r = TMath::Sqrt(xyz[0]*xyz[0]+xyz[1]*xyz[1]);
100 if ((xyz[0]==0)&&(xyz[1]==0)) angle = 0.;
101 else
8c555625 102 {
cc80f89e 103 angle =TMath::ASin(xyz[1]/r);
104 if (xyz[0]<0) angle=TMath::Pi()-angle;
105 if ( (xyz[0]>0) && (xyz[1]<0) ) angle=2*TMath::Pi()+angle;
106 }
3c0f9266 107
e0a1f962 108 sector=Int_t(TMath::Nint((angle-fInnerAngleShift)/fInnerAngle));
cc80f89e 109
8c555625 110 Float_t cos,sin;
cc80f89e 111 AdjustCosSin(sector,cos,sin);
112 x1=xyz[0]*cos + xyz[1]*sin;
8c555625 113
cc80f89e 114 if (x1>fOuterRadiusLow)
115 {
e0a1f962 116 sector=Int_t(TMath::Nint((angle-fOuterAngleShift)/fOuterAngle))+fNInnerSector;
cc80f89e 117 if (xyz[2]<0) sector+=(fNOuterSector>>1);
118 }
8c555625 119 else
1283eee5 120 if (xyz[2]<0) sector+=(fNInnerSector>>1);
cc80f89e 121 index[1]=sector; // calculated sector number
122 index[0]=1; // indicates system after transformation
123 return sector;
124}
1283eee5 125
176aff27 126Bool_t AliTPCParam::Transform(Float_t */*xyz*/, Int_t *index, Int_t* /*oindex*/)
cc80f89e 127{
128 //transformation from input coodination system to output coordination system
129 switch (index[0]){
130 case 0:
131 break;
132 };
133
134 return kFALSE;
135
136}
137
138Int_t AliTPCParam::GetPadRow(Float_t *xyz, Int_t *index) const
139{
140 //
141 //calculates pad row of point xyz - transformation to system 8 (digit system)
142 //
143 Int_t system = index[0];
144 if (0==system) {
145 Transform0to1(xyz,index);
146 system=1;
147 }
148 if (1==system) {
149 Transform1to2(xyz,index);
150 system=2;
151 }
152
153 if (fGeometryType==0){ //straight row
154 if (2==system) {
155 Transform2to3(xyz,index);
156 system=3;
157 }
158 if (3==system) {
159 Transform3to4(xyz,index);
160 system=4;
8c555625 161 }
cc80f89e 162 if (4==system) {
163 Transform4to8(xyz,index);
164 system=8;
8c555625 165 }
cc80f89e 166 if (8==system) {
167 index[0]=8;
168 return index[2];
169 }
8c555625 170 }
cc80f89e 171
172 if (fGeometryType==1){ //cylindrical geometry
173 if (2==system) {
174 Transform2to5(xyz,index);
175 system=5;
176 }
177 if (5==system) {
178 Transform2to3(xyz,index);
179 system=6;
180 }
181 if (6==system) {
182 Transform3to4(xyz,index);
183 system=7;
184 }
185 if (8==system) {
186 index[0]=8;
187 return index[2];
188 }
189 }
190 index[0]=system;
191 return -1; //if no reasonable system
8c555625 192}
193
cc80f89e 194void AliTPCParam::SetSectorAngles(Float_t innerangle, Float_t innershift, Float_t outerangle,
195 Float_t outershift)
8c555625 196{
cc80f89e 197 //
198 // set opening angles
176aff27 199 static const Float_t kDegtoRad = 0.01745329251994;
cc80f89e 200 fInnerAngle = innerangle; //opening angle of Inner sector
201 fInnerAngleShift = innershift; //shift of first inner sector center to the 0
202 fOuterAngle = outerangle; //opening angle of outer sector
203 fOuterAngleShift = outershift; //shift of first sector center to the 0
204 fInnerAngle *=kDegtoRad;
205 fInnerAngleShift *=kDegtoRad;
206 fOuterAngle *=kDegtoRad;
207 fOuterAngleShift *=kDegtoRad;
8c555625 208}
cc80f89e 209
210Float_t AliTPCParam::GetInnerAngle() const
8c555625 211{
cc80f89e 212 //return angle
213 return fInnerAngle;
214
8c555625 215}
216
cc80f89e 217Float_t AliTPCParam::GetInnerAngleShift() const
218{
219 //return angle
220 return fInnerAngleShift;
8c555625 221}
cc80f89e 222Float_t AliTPCParam::GetOuterAngle() const
223{
224 //return angle
225 return fOuterAngle;
226}
227Float_t AliTPCParam::GetOuterAngleShift() const
228{
229 //return angle
230
231 return fOuterAngleShift;
232}
233
8c555625 234
8569a2b0 235Int_t AliTPCParam::GetIndex(Int_t sector, Int_t row) const
8c555625 236{
237 //
238 //give index of the given sector and pad row
239 //no control if the sectors and rows are reasonable !!!
240 //
cc80f89e 241 if (sector<fNInnerSector) return sector*fNRowLow+row;
242 return (fNInnerSector*fNRowLow)+(sector-fNInnerSector)*fNRowUp+row;
8c555625 243}
244
cc80f89e 245Bool_t AliTPCParam::AdjustSectorRow(Int_t index, Int_t & sector, Int_t &row) const
8c555625 246{
247 //
248 //return sector and padrow for given index
cc80f89e 249 //if index is reasonable returns true else return false
8c555625 250 //
251 if ( (index<0) || (index>fNtRows)) return kFALSE;
cc80f89e 252 Int_t outindex = fNInnerSector*fNRowLow;
8c555625 253 if (index<outindex) {
cc80f89e 254 sector = index/fNRowLow;
255 row = index - sector*fNRowLow;
8c555625 256 return kTRUE;
257 }
258 index-= outindex;
cc80f89e 259 sector = index/fNRowUp;
260 row = index - sector*fNRowUp;
261 sector += fNInnerSector;
8c555625 262 return kTRUE;
263}
264
cc80f89e 265void AliTPCParam::SetDefault()
8c555625 266{
267 //
cc80f89e 268 //set default parameters
8c555625 269 //
37831078 270 //const static Int_t kMaxRows=600;
73042f01 271 //
272 //sector default parameters
273 //
c254a4cb 274 static const Float_t kInnerRadiusLow = 83.65;
275 static const Float_t kInnerRadiusUp = 133.3;
276 static const Float_t kOuterRadiusLow = 133.5;
277 static const Float_t kOuterRadiusUp = 247.7;
176aff27 278 static const Float_t kInnerAngle = 20; // 20 degrees
279 static const Float_t kInnerAngleShift = 10;
280 static const Float_t kOuterAngle = 20; // 20 degrees
281 static const Float_t kOuterAngleShift = 10;
282 static const Float_t kInnerFrameSpace = 1.5;
283 static const Float_t kOuterFrameSpace = 1.5;
c254a4cb 284 static const Float_t kInnerWireMount = 1.2;
285 static const Float_t kOuterWireMount = 1.4;
176aff27 286 static const Float_t kZLength =250.;
287 static const Int_t kGeometryType = 0; //straight rows
288 static const Int_t kNRowLow = 63;
289 static const Int_t kNRowUp1 = 64;
290 static const Int_t kNRowUp2 = 32;
291 static const Int_t kNRowUp = 96;
73042f01 292 //
293 //wires default parameters
294 //
176aff27 295 static const Int_t kNInnerWiresPerPad = 3;
296 static const Int_t kInnerDummyWire = 2;
297 static const Float_t kInnerWWPitch = 0.25;
c254a4cb 298 static const Float_t kRInnerFirstWire = 84.475;
299 static const Float_t kRInnerLastWire = 132.475;
176aff27 300 static const Float_t kInnerOffWire = 0.5;
301 static const Int_t kNOuter1WiresPerPad = 4;
302 static const Int_t kNOuter2WiresPerPad = 6;
303 static const Float_t kOuterWWPitch = 0.25;
c254a4cb 304 static const Float_t kROuterFirstWire = 134.225;
305 static const Float_t kROuterLastWire = 246.975;
176aff27 306 static const Int_t kOuterDummyWire = 2;
307 static const Float_t kOuterOffWire = 0.5;
73042f01 308 //
309 //pad default parameters
310 //
176aff27 311 static const Float_t kInnerPadPitchLength = 0.75;
312 static const Float_t kInnerPadPitchWidth = 0.40;
313 static const Float_t kInnerPadLength = 0.75;
314 static const Float_t kInnerPadWidth = 0.40;
315 static const Float_t kOuter1PadPitchLength = 1.0;
316 static const Float_t kOuterPadPitchWidth = 0.6;
317 static const Float_t kOuter1PadLength = 1.0;
318 static const Float_t kOuterPadWidth = 0.6;
319 static const Float_t kOuter2PadPitchLength = 1.5;
320 static const Float_t kOuter2PadLength = 1.5;
321
322 static const Bool_t kBMWPCReadout = kTRUE; //MWPC readout - another possibility GEM
323 static const Int_t kNCrossRows = 1; //number of rows to cross-talk
73042f01 324
325 //
326 //gas default parameters
327 //
176aff27 328 static const Float_t kDiffT = 2.2e-2;
329 static const Float_t kDiffL = 2.2e-2;
330 static const Float_t kGasGain = 2.e4;
331 static const Float_t kDriftV =2.83e6;
332 static const Float_t kOmegaTau = 0.145;
333 static const Float_t kAttCoef = 250.;
334 static const Float_t kOxyCont = 5.e-6;
73042f01 335 //
336 //electronic default parameters
337 //
176aff27 338 static const Float_t kPadCoupling=0.5;
339 static const Int_t kZeroSup=2;
340 static const Float_t kNoise = 1000;
341 static const Float_t kChipGain = 12;
342 static const Float_t kChipNorm = 0.4;
343 static const Float_t kTSample = 2.e-7;
344 static const Float_t kTFWHM = 1.9e-7; //fwhm of charge distribution
345 static const Int_t kMaxTBin =445;
346 static const Int_t kADCSat =1024;
347 static const Float_t kADCDynRange =2000.;
73042f01 348 //
349 //response constants
350 //
176aff27 351 static const Int_t kNResponseMax=100;
352 static const Float_t kResponseThreshold=0.01;
01473f7b 353 //L1 constants
753797ce 354 // static const Float_t kGateDelay=6.1e-6; //In s
355 static const Float_t kGateDelay=0.; //For the moment no gating
356 // static const Float_t kL1Delay=6.5e-6; //In s
357 static const Float_t kL1Delay=0.; //For the moment no delay
358 // static const UShort_t kNTBinsBeforeL1=14;
359 static const UShort_t kNTBinsBeforeL1=0; //For the moment no shift
8c555625 360 fbStatus = kFALSE;
8c555625 361 //
cc80f89e 362 //set sector parameters
363 //
364 SetInnerRadiusLow(kInnerRadiusLow);
365 SetOuterRadiusLow(kOuterRadiusLow);
366 SetInnerRadiusUp(kInnerRadiusUp);
367 SetOuterRadiusUp(kOuterRadiusUp);
368 SetInnerFrameSpace(kInnerFrameSpace);
369 SetOuterFrameSpace(kOuterFrameSpace);
370 SetInnerWireMount(kInnerWireMount);
371 SetOuterWireMount(kOuterWireMount);
372 SetSectorAngles(kInnerAngle,kInnerAngleShift,kOuterAngle,kOuterAngleShift);
373 SetZLength(kZLength);
374 SetGeometryType(kGeometryType);
f03e3423 375 SetRowNLow(kNRowLow);
376 SetRowNUp1 (kNRowUp1);
377 SetRowNUp2(kNRowUp2);
378 SetRowNUp(kNRowUp);
cc80f89e 379 //
380 //set wire parameters
381 //
382 SetInnerNWires(kNInnerWiresPerPad);
383 SetInnerDummyWire(kInnerDummyWire);
384 SetInnerOffWire(kInnerOffWire);
f03e3423 385 SetOuter1NWires(kNOuter1WiresPerPad);
386 SetOuter2NWire(kNOuter2WiresPerPad);
cc80f89e 387 SetOuterDummyWire(kOuterDummyWire);
388 SetOuterOffWire(kOuterOffWire);
f03e3423 389 SetInnerWWPitch(kInnerWWPitch);
390 SetRInnerFirstWire(kRInnerFirstWire);
391 SetRInnerLastWire(kRInnerLastWire);
392 SetOuterWWPitch(kOuterWWPitch);
393 SetROuterFirstWire(kROuterFirstWire);
394 SetROuterLastWire(kROuterLastWire);
cc80f89e 395 //
396 //set pad parameter
1283eee5 397 //
cc80f89e 398 SetInnerPadPitchLength(kInnerPadPitchLength);
399 SetInnerPadPitchWidth(kInnerPadPitchWidth);
400 SetInnerPadLength(kInnerPadLength);
401 SetInnerPadWidth(kInnerPadWidth);
f03e3423 402 SetOuter1PadPitchLength(kOuter1PadPitchLength);
403 SetOuter2PadPitchLength(kOuter2PadPitchLength);
cc80f89e 404 SetOuterPadPitchWidth(kOuterPadPitchWidth);
f03e3423 405 SetOuter1PadLength(kOuter1PadLength);
406 SetOuter2PadLength(kOuter2PadLength);
cc80f89e 407 SetOuterPadWidth(kOuterPadWidth);
408 SetMWPCReadout(kBMWPCReadout);
409 SetNCrossRows(kNCrossRows);
1283eee5 410 //
cc80f89e 411 //set gas paremeters
412 //
413 SetDiffT(kDiffT);
414 SetDiffL(kDiffL);
415 SetGasGain(kGasGain);
416 SetDriftV(kDriftV);
417 SetOmegaTau(kOmegaTau);
418 SetAttCoef(kAttCoef);
419 SetOxyCont(kOxyCont);
420 //
421 //set electronivc parameters
422 //
423 SetPadCoupling(kPadCoupling);
424 SetZeroSup(kZeroSup);
425 SetNoise(kNoise);
426 SetChipGain(kChipGain);
427 SetChipNorm(kChipNorm);
428 SetTSample(kTSample);
429 SetTFWHM(kTFWHM);
430 SetMaxTBin(kMaxTBin);
431 SetADCSat(kADCSat);
432 SetADCDynRange(kADCDynRange);
01473f7b 433// //set magnetic field
434// SetBField(kBField);
435// SetNPrimLoss(kNPrimLoss);
436// SetNTotalLoss(kNTotalLoss);
cc80f89e 437 //
438 //set response parameters
439 //
440 SetNResponseMax(kNResponseMax);
bcc5d57d 441 SetResponseThreshold(static_cast<int>(kResponseThreshold));
01473f7b 442 //L1 data
443 SetGateDelay(kGateDelay);
444 SetL1Delay(kL1Delay);
445 SetNTBinsBeforeL1(kNTBinsBeforeL1);
8c555625 446}
cc80f89e 447
8c555625 448
449Bool_t AliTPCParam::Update()
450{
1283eee5 451 //
452 // update some calculated parameter which must be updated after changing "base"
453 // parameters
454 // for example we can change size of pads and according this recalculate number
455 // of pad rows, number of of pads in given row ....
456 //
73042f01 457 const Float_t kQel = 1.602e-19; // elementary charge
8c555625 458 fbStatus = kFALSE;
1283eee5 459
460 Int_t i,j; //loop variables because HP
461 //-----------------Sector section------------------------------------------
462 //calclulate number of sectors
cc80f89e 463 fNInnerSector = Int_t(4*TMath::Pi()/fInnerAngle+0.2);
464 // number of inner sectors - factor 0.2 to don't be influnced by inprecision
1283eee5 465 if (fNInnerSector%2) return kFALSE;
466 fNOuterSector = Int_t(4*TMath::Pi()/fOuterAngle+0.2);
467 if (fNOuterSector%2) return kFALSE;
468 fNSector = fNInnerSector+fNOuterSector;
cc80f89e 469
470 if (fRotAngle!=0) delete [] fRotAngle;
471 fRotAngle = new Float_t[4*fNSector];
1283eee5 472 //calculate sin and cosine of rotations angle
473 //sectors angles numbering from 0
cc80f89e 474
475 j=fNInnerSector*2;
1283eee5 476 Float_t angle = fInnerAngleShift;
cc80f89e 477 for (i=0; j<fNInnerSector*4; i+=4, j+=4 , angle +=fInnerAngle){
1283eee5 478 fRotAngle[i]=TMath::Cos(angle);
479 fRotAngle[i+1]=TMath::Sin(angle);
480 fRotAngle[j] = fRotAngle[i];
481 fRotAngle[j+1] = fRotAngle[i+1];
cc80f89e 482 fRotAngle[i+2] =angle;
483 fRotAngle[j+2] =angle;
1283eee5 484 }
485 angle = fOuterAngleShift;
cc80f89e 486 j=(fNInnerSector+fNOuterSector/2)*4;
487 for (i=fNInnerSector*4; j<fNSector*4; i+=4,j+=4, angle +=fOuterAngle){
1283eee5 488 fRotAngle[i]=TMath::Cos(angle);
489 fRotAngle[i+1]=TMath::Sin(angle);
490 fRotAngle[j] = fRotAngle[i];
491 fRotAngle[j+1] = fRotAngle[i+1];
cc80f89e 492 fRotAngle[i+2] =angle;
493 fRotAngle[j+2] =angle;
1283eee5 494 }
01473f7b 495
cc80f89e 496 fZWidth = fTSample*fDriftV;
73042f01 497 fTotalNormFac = fPadCoupling*fChipNorm*kQel*1.e15*fChipGain*fADCSat/fADCDynRange;
498 fNoiseNormFac = kQel*1.e15*fChipGain*fADCSat/fADCDynRange;
cc80f89e 499 //wire section
f03e3423 500 /* Int_t nwire;
cc80f89e 501 Float_t wspace; //available space for wire
502 Float_t dummyspace; //dummyspace for wire
f03e3423 503
cc80f89e 504 wspace =fInnerRadiusUp-fInnerRadiusLow-2*fInnerOffWire;
505 nwire = Int_t(wspace/fInnerWWPitch);
506 wspace = Float_t(nwire)*fInnerWWPitch;
f03e3423 507 dummyspace =(fInnerRadiusUp-fInnerRadiusLow-wspace)/2.;
cc80f89e 508 wspace =fOuterRadiusUp-fOuterRadiusLow-2*fOuterOffWire;
509 nwire = Int_t(wspace/fOuterWWPitch);
510 wspace = Float_t(nwire)*fOuterWWPitch;
511 dummyspace =(fOuterRadiusUp-fOuterRadiusLow-wspace)/2.;
512 fROuterFirstWire = fOuterRadiusLow+dummyspace;
513 fROuterLastWire = fROuterFirstWire+fOuterWWPitch*(Float_t)(nwire);
f03e3423 514 */
1283eee5 515
8c555625 516 //
cc80f89e 517 //response data
518 //
519 if (fResponseBin==0) delete [] fResponseBin;
520 if (fResponseWeight==0) delete [] fResponseBin;
521 fResponseBin = new Int_t[3*fNResponseMax];
522 fResponseWeight = new Float_t[fNResponseMax];
01473f7b 523
524 //L1 data
525 fNTBinsL1 = fL1Delay/fTSample - (Float_t)fNTBinsBeforeL1;
8c555625 526 fbStatus = kTRUE;
527 return kTRUE;
528}
529
530
531
01473f7b 532Bool_t AliTPCParam::ReadGeoMatrices(){
533 //
534 //read geo matrixes
535 //
536 if (!gGeoManager){
537 AliFatal("Geo manager not initialized\n");
538 }
539 AliAlignObjAngles o;
540 //
74707dd2 541 if (fTrackingMatrix) delete [] fTrackingMatrix;
542 fTrackingMatrix = new TGeoHMatrix*[fNSector];
543 if (fClusterMatrix) delete [] fClusterMatrix;
544 fClusterMatrix = new TGeoHMatrix*[fNSector];
01473f7b 545 if (fGlobalMatrix) delete [] fGlobalMatrix;
546 fGlobalMatrix = new TGeoHMatrix*[fNSector];
547 //
548 for (Int_t isec=0; isec<fNSector; isec++) {
549 fGlobalMatrix[isec] = 0;
74707dd2 550 fClusterMatrix[isec]= 0;
551 fTrackingMatrix[isec]=0;
01473f7b 552 AliAlignObj::ELayerID iLayer;
553 Int_t iModule;
554
555 if(isec<fNInnerSector) {
556 iLayer = AliAlignObj::kTPC1;
557 iModule = isec;
558 }
559 else {
560 iLayer = AliAlignObj::kTPC2;
561 iModule = isec - fNInnerSector;
562 }
563
564 UShort_t volid = AliAlignObj::LayerToVolUID(iLayer,iModule);
565 const char *path = AliAlignObj::GetVolPath(volid);
566 gGeoManager->cd(path);
567 TGeoHMatrix* m = gGeoManager->GetCurrentMatrix();
568 //
569 TGeoRotation mchange;
570 mchange.RotateY(90); mchange.RotateX(90);
74707dd2 571 Float_t ROCcenter[3];
572 GetChamberCenter(isec,ROCcenter);
573 //
01473f7b 574 // Convert to global coordinate system
74707dd2 575 //
01473f7b 576 fGlobalMatrix[isec] = new TGeoHMatrix(*m);
577 fGlobalMatrix[isec]->Multiply(&(mchange.Inverse()));
74707dd2 578 TGeoTranslation center("center",-ROCcenter[0],-ROCcenter[1],-ROCcenter[2]);
579 fGlobalMatrix[isec]->Multiply(&center);
580 //
581 // cluster correction matrix
582 //
583 fClusterMatrix[isec] = new TGeoHMatrix;
584 Double_t sectorAngle = 20.*(isec%18)+10;
585 TGeoHMatrix rotMatrix;
586 rotMatrix.RotateZ(sectorAngle);
587 if (GetGlobalMatrix(isec)->GetTranslation()[2]>0){
588 //
589 // mirrored system
590 //
591 TGeoRotation mirrorZ;
592 mirrorZ.SetAngles(90,0,90,90,180,0);
593 fClusterMatrix[isec]->Multiply(&mirrorZ);
594 }
595 TGeoTranslation trans(0,0,GetZLength());
596 fClusterMatrix[isec]->MultiplyLeft(&trans);
597 fClusterMatrix[isec]->MultiplyLeft((GetGlobalMatrix(isec)));
598 fClusterMatrix[isec]->MultiplyLeft(&(rotMatrix.Inverse()));
01473f7b 599 }
600 return kTRUE;
601}
602
603
bf6adc12 604Bool_t AliTPCParam::GetStatus() const
8c555625 605{
606 //get information about object consistency
607 return fbStatus;
608}
609
610Int_t AliTPCParam::GetNRowLow() const
611{
612 //get the number of pad rows in low sector
cc80f89e 613 return fNRowLow;
8c555625 614}
615Int_t AliTPCParam::GetNRowUp() const
616{
617 //get the number of pad rows in up sector
cc80f89e 618 return fNRowUp;
8c555625 619}
f03e3423 620Int_t AliTPCParam::GetNRowUp1() const
621{
622 //get the number of pad rows in up1 sector
623 return fNRowUp1;
624}
625Int_t AliTPCParam::GetNRowUp2() const
626{
627 //get the number of pad rows in up2 sector
628 return fNRowUp2;
629}
8c555625 630Float_t AliTPCParam::GetPadRowRadiiLow(Int_t irow) const
631{
632 //get the pad row (irow) radii
cc80f89e 633 if ( !(irow<0) && (irow<fNRowLow) )
8c555625 634 return fPadRowLow[irow];
635 else
636 return 0;
637}
638
639Float_t AliTPCParam::GetPadRowRadiiUp(Int_t irow) const
640{
641 //get the pad row (irow) radii
cc80f89e 642 if ( !(irow<0) && (irow<fNRowUp) )
8c555625 643 return fPadRowUp[irow];
644 else
645 return 0;
646}
647
648Int_t AliTPCParam::GetNPadsLow(Int_t irow) const
649{
650 //get the number of pads in row irow
cc80f89e 651 if ( !(irow<0) && (irow<fNRowLow) )
652 return fNPadsLow[irow];
8c555625 653 else
654 return 0;
655}
656
657
658Int_t AliTPCParam::GetNPadsUp(Int_t irow) const
659{
660 //get the number of pads in row irow
cc80f89e 661 if ( !(irow<0) && (irow<fNRowUp) )
662 return fNPadsUp[irow];
8c555625 663 else
664 return 0;
665}
f03e3423 666Float_t AliTPCParam::GetYInner(Int_t irow) const
667{
668 return fYInner[irow];
669}
670
671
672Float_t AliTPCParam::GetYOuter(Int_t irow) const
673{
674 return fYOuter[irow];
675}
676
01473f7b 677Int_t AliTPCParam::GetSectorIndex(Float_t angle, Int_t row, Float_t z) const
678{
679 // returns the sector index
680 // takes as input the angle, index of the pad row and z position
681 if(row<0) return -1;
f03e3423 682
01473f7b 683 if (angle > 2.*TMath::Pi()) angle -= 2.*TMath::Pi();
684 if (angle < 0. ) angle += 2.*TMath::Pi();
685
686 Int_t sector;
687 if(row<fNRowLow) {
688 sector=Int_t(TMath::Nint((angle-fInnerAngleShift)/fInnerAngle));
689 if (z<0) sector += (fNInnerSector>>1);
690 }
691 else {
692 sector=Int_t(TMath::Nint((angle-fOuterAngleShift)/fOuterAngle))+fNInnerSector;
693 if (z<0) sector += (fNOuterSector>>1);
694 }
695
696 return sector;
697}
f03e3423 698
74707dd2 699Float_t AliTPCParam::GetChamberCenter(Int_t isec, Float_t * center) const
01473f7b 700{
701 // returns the default radial position
702 // of the readout chambers
74707dd2 703
704 const Float_t kROCcenterIn = 110.2;
705 const Float_t kROCcenterOut = 188.45;
706
707 if (isec<fNInnerSector){
708 if (center){
709 center[0] = kROCcenterIn;
710 center[1] = 0;
711 center[2] = -5.51;
712 }
713 return kROCcenterIn;
714 }
715 else{
716 if (center){
717 center[0] = kROCcenterOut;
718 center[1] = 0;
719 center[2] = -5.61;
720 }
721 return kROCcenterOut;
722 }
01473f7b 723}
f03e3423 724
725
8c555625 726