1 /**************************************************************************
2 * Copyright(c) 1998-1999, ALICE Experiment at CERN, All rights reserved. *
4 * Author: The ALICE Off-line Project. *
5 * Contributors are mentioned in the code where appropriate. *
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 **************************************************************************/
18 ///////////////////////////////////////////////////////////////////////
19 // Manager and of geomety classes for set: TPC //
21 // !sectors are numbered from 0 //
22 // !pad rows are numbered from 0 //
24 // 12.6. changed z relative
25 // Origin: Marian Ivanov, Uni. of Bratislava, ivanov@fmph.uniba.sk //
27 ///////////////////////////////////////////////////////////////////////
31 #include <AliTPCParam.h>
33 #include <TGeoManager.h>
34 #include <TGeoPhysicalNode.h>
36 #include "AliAlignObj.h"
37 #include "AliAlignObjParams.h"
39 #include "TGraphErrors.h"
40 #include "AliTPCcalibDB.h"
41 #include "AliMathBase.h"
43 TObjArray *AliTPCParam::fBBParam = 0;
48 //___________________________________________
49 AliTPCParam::AliTPCParam()
73 fNInnerWiresPerPad(0),
80 fNOuter1WiresPerPad(0),
81 fNOuter2WiresPerPad(0),
87 fInnerPadPitchLength(0.),
88 fInnerPadPitchWidth(0.),
91 fOuter1PadPitchLength(0.),
92 fOuter2PadPitchLength(0.),
93 fOuterPadPitchWidth(0.),
97 fBMWPCReadout(kFALSE),
118 fGainSlopesHV(0), // graph with the gain slope as function of HV - per chamber
119 fGainSlopesPT(0), // graph with the gain slope as function of P/T - per chamber
134 fMaxVoltageDeviation(40.),
136 fMaxHVfractionBad(.4),
137 fVoltageDipScanPeriod(1.),
139 fResponseThreshold(0.),
149 //constructor sets the default parameters
152 SetTitle("75x40_100x60_150x60");
154 if (!fBBParam) fBBParam= new TObjArray(1000);
157 AliTPCParam::~AliTPCParam()
160 //destructor deletes some dynamicaly alocated variables
163 if (fResponseBin!=0) delete [] fResponseBin;
164 if (fResponseWeight!=0) delete [] fResponseWeight;
165 if (fRotAngle !=0) delete [] fRotAngle;
171 Int_t AliTPCParam::Transform0to1(Float_t *xyz, Int_t * index) const
174 // calculates sector number (index[1], undefined on input)
180 Float_t r = TMath::Sqrt(xyz[0]*xyz[0]+xyz[1]*xyz[1]);
181 if ((xyz[0]==0)&&(xyz[1]==0)) angle = 0.;
184 angle =TMath::ASin(xyz[1]/r);
185 if (xyz[0]<0) angle=TMath::Pi()-angle;
186 if ( (xyz[0]>0) && (xyz[1]<0) ) angle=2*TMath::Pi()+angle;
189 sector=Int_t(TMath::Nint((angle-fInnerAngleShift)/fInnerAngle));
192 AdjustCosSin(sector,cos,sin);
193 x1=xyz[0]*cos + xyz[1]*sin;
195 if (x1>fOuterRadiusLow)
197 sector=Int_t(TMath::Nint((angle-fOuterAngleShift)/fOuterAngle))+fNInnerSector;
198 if (xyz[2]<0) sector+=(fNOuterSector>>1);
201 if (xyz[2]<0) sector+=(fNInnerSector>>1);
202 if (sector<0 || sector>=fNSector) AliError(Form("Wrong sector %d",sector));
203 index[1]=sector; // calculated sector number
204 index[0]=1; // indicates system after transformation
208 Bool_t AliTPCParam::Transform(Float_t */*xyz*/, Int_t *index, Int_t* /*oindex*/)
210 //transformation from input coodination system to output coordination system
220 Int_t AliTPCParam::GetPadRow(Float_t *xyz, Int_t *index) const
223 //calculates pad row of point xyz - transformation to system 8 (digit system)
225 Int_t system = index[0];
227 Transform0to1(xyz,index);
231 Transform1to2(xyz,index);
235 if (fGeometryType==0){ //straight row
237 Transform2to3(xyz,index);
241 Transform3to4(xyz,index);
245 Transform4to8(xyz,index);
254 if (fGeometryType==1){ //cylindrical geometry
256 Transform2to5(xyz,index);
260 Transform2to3(xyz,index);
264 Transform3to4(xyz,index);
273 return -1; //if no reasonable system
276 void AliTPCParam::SetSectorAngles(Float_t innerangle, Float_t innershift, Float_t outerangle,
280 // set opening angles
281 static const Float_t kDegtoRad = 0.01745329251994;
282 fInnerAngle = innerangle; //opening angle of Inner sector
283 fInnerAngleShift = innershift; //shift of first inner sector center to the 0
284 fOuterAngle = outerangle; //opening angle of outer sector
285 fOuterAngleShift = outershift; //shift of first sector center to the 0
286 fInnerAngle *=kDegtoRad;
287 fInnerAngleShift *=kDegtoRad;
288 fOuterAngle *=kDegtoRad;
289 fOuterAngleShift *=kDegtoRad;
292 Float_t AliTPCParam::GetInnerAngle() const
299 Float_t AliTPCParam::GetInnerAngleShift() const
302 return fInnerAngleShift;
304 Float_t AliTPCParam::GetOuterAngle() const
309 Float_t AliTPCParam::GetOuterAngleShift() const
313 return fOuterAngleShift;
317 Int_t AliTPCParam::GetIndex(Int_t sector, Int_t row) const
320 //give index of the given sector and pad row
321 //no control if the sectors and rows are reasonable !!!
323 if (sector<fNInnerSector) return sector*fNRowLow+row;
324 return (fNInnerSector*fNRowLow)+(sector-fNInnerSector)*fNRowUp+row;
327 Bool_t AliTPCParam::AdjustSectorRow(Int_t index, Int_t & sector, Int_t &row) const
330 //return sector and padrow for given index
331 //if index is reasonable returns true else return false
333 if ( (index<0) || (index>fNtRows)) return kFALSE;
334 Int_t outindex = fNInnerSector*fNRowLow;
335 if (index<outindex) {
336 sector = index/fNRowLow;
337 row = index - sector*fNRowLow;
341 sector = index/fNRowUp;
342 row = index - sector*fNRowUp;
343 sector += fNInnerSector;
347 void AliTPCParam::SetDefault()
350 //set default parameters
352 //const static Int_t kMaxRows=600;
354 //sector default parameters
356 static const Float_t kInnerRadiusLow = 83.65;
357 static const Float_t kInnerRadiusUp = 133.3;
358 static const Float_t kOuterRadiusLow = 133.5;
359 static const Float_t kOuterRadiusUp = 247.7;
360 static const Float_t kInnerAngle = 20; // 20 degrees
361 static const Float_t kInnerAngleShift = 10;
362 static const Float_t kOuterAngle = 20; // 20 degrees
363 static const Float_t kOuterAngleShift = 10;
364 static const Float_t kInnerFrameSpace = 1.5;
365 static const Float_t kOuterFrameSpace = 1.5;
366 static const Float_t kInnerWireMount = 1.2;
367 static const Float_t kOuterWireMount = 1.4;
368 static const Float_t kZLength =250.;
369 static const Int_t kGeometryType = 0; //straight rows
370 static const Int_t kNRowLow = 63;
371 static const Int_t kNRowUp1 = 64;
372 static const Int_t kNRowUp2 = 32;
373 static const Int_t kNRowUp = 96;
375 //wires default parameters
377 static const Int_t kNInnerWiresPerPad = 3;
378 static const Int_t kInnerDummyWire = 2;
379 static const Float_t kInnerWWPitch = 0.25;
380 static const Float_t kRInnerFirstWire = 84.475;
381 static const Float_t kRInnerLastWire = 132.475;
382 static const Float_t kInnerOffWire = 0.5;
383 static const Int_t kNOuter1WiresPerPad = 4;
384 static const Int_t kNOuter2WiresPerPad = 6;
385 static const Float_t kOuterWWPitch = 0.25;
386 static const Float_t kROuterFirstWire = 134.225;
387 static const Float_t kROuterLastWire = 246.975;
388 static const Int_t kOuterDummyWire = 2;
389 static const Float_t kOuterOffWire = 0.5;
391 //pad default parameters
393 static const Float_t kInnerPadPitchLength = 0.75;
394 static const Float_t kInnerPadPitchWidth = 0.40;
395 static const Float_t kInnerPadLength = 0.75;
396 static const Float_t kInnerPadWidth = 0.40;
397 static const Float_t kOuter1PadPitchLength = 1.0;
398 static const Float_t kOuterPadPitchWidth = 0.6;
399 static const Float_t kOuter1PadLength = 1.0;
400 static const Float_t kOuterPadWidth = 0.6;
401 static const Float_t kOuter2PadPitchLength = 1.5;
402 static const Float_t kOuter2PadLength = 1.5;
404 static const Bool_t kBMWPCReadout = kTRUE; //MWPC readout - another possibility GEM
405 static const Int_t kNCrossRows = 1; //number of rows to cross-talk
408 //gas default parameters
410 static const Float_t kDiffT = 2.2e-2;
411 static const Float_t kDiffL = 2.2e-2;
412 static const Float_t kGasGain = 2.e4;
413 static const Float_t kDriftV =2.83e6;
414 static const Float_t kOmegaTau = 0.145;
415 static const Float_t kAttCoef = 250.;
416 static const Float_t kOxyCont = 5.e-6;
417 static const Float_t kFpot = 22.77e-9;
418 static const Float_t kNprim=14.35;
419 static const Float_t kNtot=42.66;
420 static const Float_t kWmean = 35.97e-9;
421 static const Float_t kExp = 2.2;
422 static const Float_t kEend = 10.e-6;
424 //electronic default parameters
426 static const Float_t kPadCoupling=0.5;
427 static const Int_t kZeroSup=2;
428 static const Float_t kNoise = 1000;
429 static const Float_t kChipGain = 12;
430 static const Float_t kChipNorm = 0.4;
431 static const Float_t kTSample = 2.e-7;
432 static const Float_t kTFWHM = 1.9e-7; //fwhm of charge distribution
433 static const Int_t kMaxTBin =445;
434 static const Int_t kADCSat =1024;
435 static const Float_t kADCDynRange =2000.;
439 static const Int_t kNResponseMax=100;
440 static const Float_t kResponseThreshold=0.01;
442 // static const Float_t kGateDelay=6.1e-6; //In s
443 static const Float_t kGateDelay=0.; //For the moment no gating
444 // static const Float_t kL1Delay=6.5e-6; //In s
445 static const Float_t kL1Delay=0.; //For the moment no delay
446 // static const UShort_t kNTBinsBeforeL1=14;
447 static const UShort_t kNTBinsBeforeL1=0; //For the moment no shift
450 //set sector parameters
452 SetInnerRadiusLow(kInnerRadiusLow);
453 SetOuterRadiusLow(kOuterRadiusLow);
454 SetInnerRadiusUp(kInnerRadiusUp);
455 SetOuterRadiusUp(kOuterRadiusUp);
456 SetInnerFrameSpace(kInnerFrameSpace);
457 SetOuterFrameSpace(kOuterFrameSpace);
458 SetInnerWireMount(kInnerWireMount);
459 SetOuterWireMount(kOuterWireMount);
460 SetSectorAngles(kInnerAngle,kInnerAngleShift,kOuterAngle,kOuterAngleShift);
461 SetZLength(kZLength);
462 SetGeometryType(kGeometryType);
463 SetRowNLow(kNRowLow);
464 SetRowNUp1 (kNRowUp1);
465 SetRowNUp2(kNRowUp2);
468 //set wire parameters
470 SetInnerNWires(kNInnerWiresPerPad);
471 SetInnerDummyWire(kInnerDummyWire);
472 SetInnerOffWire(kInnerOffWire);
473 SetOuter1NWires(kNOuter1WiresPerPad);
474 SetOuter2NWire(kNOuter2WiresPerPad);
475 SetOuterDummyWire(kOuterDummyWire);
476 SetOuterOffWire(kOuterOffWire);
477 SetInnerWWPitch(kInnerWWPitch);
478 SetRInnerFirstWire(kRInnerFirstWire);
479 SetRInnerLastWire(kRInnerLastWire);
480 SetOuterWWPitch(kOuterWWPitch);
481 SetROuterFirstWire(kROuterFirstWire);
482 SetROuterLastWire(kROuterLastWire);
486 SetInnerPadPitchLength(kInnerPadPitchLength);
487 SetInnerPadPitchWidth(kInnerPadPitchWidth);
488 SetInnerPadLength(kInnerPadLength);
489 SetInnerPadWidth(kInnerPadWidth);
490 SetOuter1PadPitchLength(kOuter1PadPitchLength);
491 SetOuter2PadPitchLength(kOuter2PadPitchLength);
492 SetOuterPadPitchWidth(kOuterPadPitchWidth);
493 SetOuter1PadLength(kOuter1PadLength);
494 SetOuter2PadLength(kOuter2PadLength);
495 SetOuterPadWidth(kOuterPadWidth);
496 SetMWPCReadout(kBMWPCReadout);
497 SetNCrossRows(kNCrossRows);
503 SetGasGain(kGasGain);
505 SetOmegaTau(kOmegaTau);
506 SetAttCoef(kAttCoef);
507 SetOxyCont(kOxyCont);
515 SetComposition(0.9,0.,0.1,0.,0.,0.);// Ne-CO2 90/10
517 SetBetheBloch(GetBetheBlochParamAlice());
519 //set electronivc parameters
521 SetPadCoupling(kPadCoupling);
522 SetZeroSup(kZeroSup);
524 SetChipGain(kChipGain);
525 SetChipNorm(kChipNorm);
526 SetTSample(kTSample);
528 SetMaxTBin(kMaxTBin);
530 SetADCDynRange(kADCDynRange);
531 for (UInt_t i=0; i<36; i++)
533 SetNominalVoltage(1196.0, i);
535 for (UInt_t i=36; i<72; i++)
537 SetNominalVoltage(1417.0, i);
539 // //set magnetic field
540 // SetBField(kBField);
541 // SetNPrimLoss(kNPrimLoss);
542 // SetNTotalLoss(kNTotalLoss);
544 //set response parameters
546 SetNResponseMax(kNResponseMax);
547 SetResponseThreshold(static_cast<int>(kResponseThreshold));
549 SetGateDelay(kGateDelay);
550 SetL1Delay(kL1Delay);
551 SetNTBinsBeforeL1(kNTBinsBeforeL1);
552 SetNominalGainSlopes();
556 Bool_t AliTPCParam::Update()
559 // update some calculated parameter which must be updated after changing "base"
561 // for example we can change size of pads and according this recalculate number
562 // of pad rows, number of of pads in given row ....
564 const Float_t kQel = 1.602e-19; // elementary charge
567 Int_t i,j; //loop variables because HP
568 //-----------------Sector section------------------------------------------
569 //calclulate number of sectors
570 fNInnerSector = Int_t(4*TMath::Pi()/fInnerAngle+0.2);
571 // number of inner sectors - factor 0.2 to don't be influnced by inprecision
572 if (fNInnerSector%2) return kFALSE;
573 fNOuterSector = Int_t(4*TMath::Pi()/fOuterAngle+0.2);
574 if (fNOuterSector%2) return kFALSE;
575 fNSector = fNInnerSector+fNOuterSector;
577 if (fRotAngle!=0) delete [] fRotAngle;
578 fRotAngle = new Float_t[4*fNSector];
579 //calculate sin and cosine of rotations angle
580 //sectors angles numbering from 0
583 Float_t angle = fInnerAngleShift;
584 for (i=0; j<fNInnerSector*4; i+=4, j+=4 , angle +=fInnerAngle){
585 fRotAngle[i]=TMath::Cos(angle);
586 fRotAngle[i+1]=TMath::Sin(angle);
587 fRotAngle[j] = fRotAngle[i];
588 fRotAngle[j+1] = fRotAngle[i+1];
589 fRotAngle[i+2] =angle;
590 fRotAngle[j+2] =angle;
592 angle = fOuterAngleShift;
593 j=(fNInnerSector+fNOuterSector/2)*4;
594 for (i=fNInnerSector*4; j<fNSector*4; i+=4,j+=4, angle +=fOuterAngle){
595 fRotAngle[i]=TMath::Cos(angle);
596 fRotAngle[i+1]=TMath::Sin(angle);
597 fRotAngle[j] = fRotAngle[i];
598 fRotAngle[j+1] = fRotAngle[i+1];
599 fRotAngle[i+2] =angle;
600 fRotAngle[j+2] =angle;
603 fZWidth = fTSample*fDriftV;
604 fTotalNormFac = fPadCoupling*fChipNorm*kQel*1.e15*fChipGain*fADCSat/fADCDynRange;
605 fNoiseNormFac = kQel*1.e15*fChipGain*fADCSat/fADCDynRange;
608 Float_t wspace; //available space for wire
609 Float_t dummyspace; //dummyspace for wire
611 wspace =fInnerRadiusUp-fInnerRadiusLow-2*fInnerOffWire;
612 nwire = Int_t(wspace/fInnerWWPitch);
613 wspace = Float_t(nwire)*fInnerWWPitch;
614 dummyspace =(fInnerRadiusUp-fInnerRadiusLow-wspace)/2.;
615 wspace =fOuterRadiusUp-fOuterRadiusLow-2*fOuterOffWire;
616 nwire = Int_t(wspace/fOuterWWPitch);
617 wspace = Float_t(nwire)*fOuterWWPitch;
618 dummyspace =(fOuterRadiusUp-fOuterRadiusLow-wspace)/2.;
619 fROuterFirstWire = fOuterRadiusLow+dummyspace;
620 fROuterLastWire = fROuterFirstWire+fOuterWWPitch*(Float_t)(nwire);
626 if (fResponseBin) delete [] fResponseBin;
627 if (fResponseWeight) delete [] fResponseWeight;
628 fResponseBin = new Int_t[3*fNResponseMax];
629 fResponseWeight = new Float_t[fNResponseMax];
632 fNTBinsL1 = fL1Delay/fTSample - (Float_t)fNTBinsBeforeL1;
637 void AliTPCParam::CleanGeoMatrices(){
639 // clean geo matrices
642 if (fTrackingMatrix) {
643 for(Int_t i = 0; i < fNSector; i++)
644 delete fTrackingMatrix[i];
645 delete [] fTrackingMatrix;
648 if (fClusterMatrix) {
649 for(Int_t i = 0; i < fNSector; i++)
650 delete fClusterMatrix[i];
651 delete [] fClusterMatrix;
655 for(Int_t i = 0; i < fNSector; i++)
656 delete fGlobalMatrix[i];
657 delete [] fGlobalMatrix;
663 Bool_t AliTPCParam::ReadGeoMatrices(){
668 AliFatal("Geo manager not initialized\n");
673 // clean geo matrices
676 // create new geo matrices
677 fTrackingMatrix = new TGeoHMatrix*[fNSector];
678 fClusterMatrix = new TGeoHMatrix*[fNSector];
679 fGlobalMatrix = new TGeoHMatrix*[fNSector];
680 for (Int_t isec=0; isec<fNSector; isec++) {
681 fGlobalMatrix[isec] = 0;
682 fClusterMatrix[isec]= 0;
683 fTrackingMatrix[isec]=0;
686 for (Int_t isec=0; isec<fNSector; isec++) {
687 fGlobalMatrix[isec] = 0;
688 fClusterMatrix[isec]= 0;
689 fTrackingMatrix[isec]=0;
690 AliGeomManager::ELayerID iLayer;
693 if(isec<fNInnerSector) {
694 iLayer = AliGeomManager::kTPC1;
698 iLayer = AliGeomManager::kTPC2;
699 iModule = isec - fNInnerSector;
702 UShort_t volid = AliGeomManager::LayerToVolUID(iLayer,iModule);
703 TGeoPNEntry* pne = gGeoManager->GetAlignableEntryByUID(volid);
706 AliError(Form("Alignable entry for volume ID %d not in geometry. Exiting!",volid));
709 const char *path = pne->GetTitle();
710 if (!gGeoManager->cd(path)) return kFALSE;
711 TGeoHMatrix *m = gGeoManager->GetCurrentMatrix();
712 // Since GEANT4 does not allow reflections, in this case the reflection
713 // component if the matrix is embedded by TGeo inside TGeoScaledShape
714 if (gGeoManager->GetCurrentVolume()->GetShape()->IsReflected())
715 m->ReflectZ(kFALSE, kTRUE);
717 TGeoRotation mchange;
718 mchange.RotateY(90); mchange.RotateX(90);
719 Float_t ROCcenter[3];
720 GetChamberCenter(isec,ROCcenter);
722 // Convert to global coordinate system
724 fGlobalMatrix[isec] = new TGeoHMatrix(*m);
725 fGlobalMatrix[isec]->Multiply(&(mchange.Inverse()));
726 TGeoTranslation center("center",-ROCcenter[0],-ROCcenter[1],-ROCcenter[2]);
727 fGlobalMatrix[isec]->Multiply(¢er);
729 // cluster correction matrix
731 fClusterMatrix[isec] = new TGeoHMatrix;
732 Double_t sectorAngle = 20.*(isec%18)+10;
733 TGeoHMatrix rotMatrix;
734 rotMatrix.RotateZ(sectorAngle);
735 if (GetGlobalMatrix(isec)->GetTranslation()[2]>0){
739 TGeoRotation mirrorZ;
740 mirrorZ.SetAngles(90,0,90,90,180,0);
741 fClusterMatrix[isec]->Multiply(&mirrorZ);
743 TGeoTranslation trans(0,0,GetZLength(isec));
744 fClusterMatrix[isec]->MultiplyLeft(&trans);
745 fClusterMatrix[isec]->MultiplyLeft((GetGlobalMatrix(isec)));
746 fClusterMatrix[isec]->MultiplyLeft(&(rotMatrix.Inverse()));
751 TGeoHMatrix * AliTPCParam::Tracking2LocalMatrix(const TGeoHMatrix * geoMatrix, Int_t sector) const{
753 // make local to tracking matrix
755 Double_t sectorAngle = 20.*(sector%18)+10;
756 TGeoHMatrix *newMatrix = new TGeoHMatrix();
757 newMatrix->RotateZ(sectorAngle);
758 newMatrix->MultiplyLeft(&(geoMatrix->Inverse()));
765 Bool_t AliTPCParam::GetStatus() const
767 //get information about object consistency
771 Int_t AliTPCParam::GetNRowLow() const
773 //get the number of pad rows in low sector
776 Int_t AliTPCParam::GetNRowUp() const
778 //get the number of pad rows in up sector
781 Int_t AliTPCParam::GetNRowUp1() const
783 //get the number of pad rows in up1 sector
786 Int_t AliTPCParam::GetNRowUp2() const
788 //get the number of pad rows in up2 sector
791 Float_t AliTPCParam::GetPadRowRadiiLow(Int_t irow) const
793 //get the pad row (irow) radii
794 if ( !(irow<0) && (irow<fNRowLow) )
795 return fPadRowLow[irow];
800 Float_t AliTPCParam::GetPadRowRadiiUp(Int_t irow) const
802 //get the pad row (irow) radii
803 if ( !(irow<0) && (irow<fNRowUp) )
804 return fPadRowUp[irow];
809 Int_t AliTPCParam::GetNPadsLow(Int_t irow) const
811 //get the number of pads in row irow
812 if ( !(irow<0) && (irow<fNRowLow) )
813 return fNPadsLow[irow];
819 Int_t AliTPCParam::GetNPadsUp(Int_t irow) const
821 //get the number of pads in row irow
822 if ( !(irow<0) && (irow<fNRowUp) )
823 return fNPadsUp[irow];
827 Float_t AliTPCParam::GetYInner(Int_t irow) const
829 return fYInner[irow];
833 Float_t AliTPCParam::GetYOuter(Int_t irow) const
835 return fYOuter[irow];
838 Int_t AliTPCParam::GetSectorIndex(Float_t angle, Int_t row, Float_t z) const
840 // returns the sector index
841 // takes as input the angle, index of the pad row and z position
844 if (angle > 2.*TMath::Pi()) angle -= 2.*TMath::Pi();
845 if (angle < 0. ) angle += 2.*TMath::Pi();
849 sector=Int_t(TMath::Nint((angle-fInnerAngleShift)/fInnerAngle));
850 if (z<0) sector += (fNInnerSector>>1);
853 sector=Int_t(TMath::Nint((angle-fOuterAngleShift)/fOuterAngle))+fNInnerSector;
854 if (z<0) sector += (fNOuterSector>>1);
860 Float_t AliTPCParam::GetChamberCenter(Int_t isec, Float_t * center) const
862 // returns the default radial position
863 // of the readout chambers
865 const Float_t kROCcenterIn = 110.2;
866 const Float_t kROCcenterOut = 188.45;
868 if (isec<fNInnerSector){
870 center[0] = kROCcenterIn;
872 center[2] = -5.51-0.08;
878 center[0] = kROCcenterOut;
880 center[2] = -5.61-0.08;
882 return kROCcenterOut;
886 void AliTPCParam::SetNominalGainSlopes(){
888 // Setting the nominal TPC gain slopes
889 // Nominal values were obtained as a mena values foe 2010,2011, and 2012 data
890 // Differntial values can be provided per year
892 Float_t sector[72]={0};
893 Float_t gainHV[72]={0};
894 Float_t gainPT[72]={0};
896 for (Int_t isec=0; isec<72; isec++){
898 gainHV[isec]=0.0115; // change of the Gain dG/G per 1 Volt of voltage change(1/V) - it is roughly the same for IROC and OROC
899 gainPT[isec]=2.2; // change of the Gains dG/G per P/T change ()
901 fGainSlopesHV = new TGraphErrors(72,sector,gainHV,0,0);
902 fGainSlopesPT = new TGraphErrors(72,sector,gainPT,0,0);
903 fGainSlopesHV->SetName("GainSlopesHV");
904 fGainSlopesPT->SetName("GainSlopesPT");
908 TVectorD * AliTPCParam::GetBetheBlochParamNa49(){
910 // Parameters of the BB for the Aleph parametrization AliMathBase::BetheBlochAleph
911 // Na49 parameters were used as first set of parameters for ALICE simulation
912 // (see TPC TDR for details)
919 return new TVectorD(v);
922 TVectorD * AliTPCParam::GetBetheBlochParamAlice(){
925 // Parameters of the BB for the Aleph parametrization AliMathBase::BetheBlochAleph
926 // Na49 parameters were used as first set of parameters for ALICE simulation
927 // Second set was obtained from ALICE 2009-2013 data taking
928 // (see TPC TDR for details)
936 return new TVectorD(v);
940 Double_t AliTPCParam::BetheBlochAleph(Double_t bg, Int_t type){
942 // GetBetheBloch retur values for the parametrs regieter at poition type
943 // Used for visualization and comparison purposes
944 TVectorD * paramBB =0;
946 AliTPCParam* param = AliTPCcalibDB::Instance()->GetParameters();
947 if (param) paramBB=param->GetBetheBlochParameters();
950 paramBB = (TVectorD*)fBBParam->At(type);
952 if (!paramBB) return 0;
954 return AliMathBase::BetheBlochAleph(bg,(*paramBB)(0),(*paramBB)(1),(*paramBB)(2),(*paramBB)(3),(*paramBB)(4));
958 void AliTPCParam::RegisterBBParam(TVectorD* param, Int_t position){
962 fBBParam->AddAt(param,position);