31 #include <TGeoManager.h>
32 #include <TGeoPhysicalNode.h>
34 #include "AliAlignObj.h"
35 #include "AliAlignObjParams.h"
37 #include "TGraphErrors.h"
40 #include "AliMathBase.h"
74 fNInnerWiresPerPad(0),
81 fNOuter1WiresPerPad(0),
82 fNOuter2WiresPerPad(0),
88 fInnerPadPitchLength(0.),
89 fInnerPadPitchWidth(0.),
92 fOuter1PadPitchLength(0.),
93 fOuter2PadPitchLength(0.),
94 fOuterPadPitchWidth(0.),
98 fBMWPCReadout(kFALSE),
135 fUseGlitchFilter(kTRUE),
137 fMaxVoltageDeviation(40.),
139 fMaxHVfractionBad(.4),
140 fVoltageDipScanPeriod(1.),
142 fResponseThreshold(0.),
155 SetTitle(
"75x40_100x60_150x60");
157 if (!fBBParam) fBBParam=
new TObjArray(1000);
158 fRegionGain[0]=fRegionGain[1]=fRegionGain[2]=0.;
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;
193 x1=xyz[0]*cos + xyz[1]*sin;
202 if (sector<0 || sector>=
fNSector) AliError(Form(
"Wrong sector %d",sector));
225 Int_t system = index[0];
281 static const Float_t kDegtoRad = 0.01745329251994;
334 if ( (index<0) || (index>
fNtRows))
return kFALSE;
336 if (index<outindex) {
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;
361 static const Float_t kInnerAngleShift = 10;
362 static const Float_t kOuterAngle = 20;
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;
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;
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;
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;
405 static const Int_t kNCrossRows = 1;
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;
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;
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;
443 static const Float_t kGateDelay=0.;
445 static const Float_t kL1Delay=0.;
447 static const UShort_t kNTBinsBeforeL1=0;
460 SetSectorAngles(kInnerAngle,kInnerAngleShift,kOuterAngle,kOuterAngleShift);
532 for (UInt_t i=0; i<36; i++)
536 for (UInt_t i=36; i<72; i++)
564 const Float_t kQel = 1.602e-19;
595 j=(fNInnerSector+fNOuterSector/2)*4;
669 AliFatal(
"Geo manager not initialized\n");
681 for (Int_t isec=0; isec<
fNSector; isec++) {
687 for (Int_t isec=0; isec<
fNSector; isec++) {
691 AliGeomManager::ELayerID iLayer;
695 iLayer = AliGeomManager::kTPC1;
699 iLayer = AliGeomManager::kTPC2;
703 UShort_t volid = AliGeomManager::LayerToVolUID(iLayer,iModule);
704 TGeoPNEntry* pne = gGeoManager->GetAlignableEntryByUID(volid);
707 AliError(Form(
"Alignable entry for volume ID %d not in geometry. Exiting!",volid));
710 const char *path = pne->GetTitle();
711 if (!gGeoManager->cd(path))
return kFALSE;
712 TGeoHMatrix *m = gGeoManager->GetCurrentMatrix();
715 if (gGeoManager->GetCurrentVolume()->GetShape()->IsReflected())
716 m->ReflectZ(kFALSE, kTRUE);
718 TGeoRotation mchange;
719 mchange.RotateY(90); mchange.RotateX(90);
720 Float_t ROCcenter[3];
727 TGeoTranslation center(
"center",-ROCcenter[0],-ROCcenter[1],-ROCcenter[2]);
733 Double_t sectorAngle = 20.*(isec%18)+10;
734 TGeoHMatrix rotMatrix;
735 rotMatrix.RotateZ(sectorAngle);
740 TGeoRotation mirrorZ;
741 mirrorZ.SetAngles(90,0,90,90,180,0);
755 Double_t sectorAngle = 20.*(sector%18)+10;
756 TGeoHMatrix *newMatrix =
new TGeoHMatrix();
757 newMatrix->RotateZ(sectorAngle);
758 newMatrix->MultiplyLeft(&(geoMatrix->Inverse()));
810 if ( !(irow<0) && (irow<
fNRowUp) )
831 if ( !(irow<0) && (irow<
fNRowUp) )
843 Int_t wireIndex = -1;
845 if ( (sector<0 || sector>=72) || (row<0 || row>95) || (sector<36 && row>64) ){
846 AliError(
"No matching anode wire segment for this set of sector-row \n");
851 if (row<16) wireIndex=0;
852 else if (row>=16 && row<32) wireIndex=1;
853 else if (row>=32 && row<48) wireIndex=2;
856 if (row<16) wireIndex=4;
857 else if ( row>=16 && row<32) wireIndex=5;
858 else if ( row>=32 && row<48) wireIndex=6;
859 else if ( row>=48 && row<64) wireIndex=7;
860 else if ( row>=64 && row<75) wireIndex=8;
861 else if ( row>=75 && row<85) wireIndex=9;
874 if ( wireSegmentID<0 || wireSegmentID>10 ){
875 AliError(
"Wrong anode wire segment index. it should be [0,10] \n");
879 Int_t sector = (wireSegmentID<4) ? 0 : 36;
881 Int_t segRowDown = 0;
884 if ( wireSegmentID == 0 || wireSegmentID == 4 ) {
887 }
else if ( wireSegmentID == 1 || wireSegmentID == 5 ) {
890 }
else if ( wireSegmentID == 2 || wireSegmentID == 6 ) {
893 }
else if ( wireSegmentID == 3 || wireSegmentID == 7 ) {
896 }
else if ( wireSegmentID == 8 ) {
899 }
else if ( wireSegmentID == 9 ) {
909 for (Int_t irow = segRowDown; irow < segRowUp ; irow++){
933 if (angle > 2.*TMath::Pi()) angle -= 2.*TMath::Pi();
934 if (angle < 0. ) angle += 2.*TMath::Pi();
954 const Float_t kROCcenterIn = 110.2;
955 const Float_t kROCcenterOut = 188.45;
959 center[0] = kROCcenterIn;
961 center[2] = -5.51-0.08;
967 center[0] = kROCcenterOut;
969 center[2] = -5.61-0.08;
971 return kROCcenterOut;
980 Float_t sector[72]={0};
981 Float_t gainHV[72]={0};
982 Float_t gainPT[72]={0};
984 for (Int_t isec=0; isec<72; isec++){
1007 return new TVectorD(v);
1022 return new TVectorD(v);
1036 return new TVectorD(v);
1043 if (bg<=0)
return 0;
1044 TVectorD * paramBB =0;
1050 paramBB = (TVectorD*)
fBBParam->At(type);
1052 if (!paramBB)
return 0;
1054 return AliMathBase::BetheBlochAleph(bg,(*paramBB)(0),(*paramBB)(1),(*paramBB)(2),(*paramBB)(3),(*paramBB)(4));
Int_t * fResponseBin
! array with bins -calulated
static AliTPCcalibDB * Instance()
TGraphErrors * fGainSlopesHV
graph with the gain slope as function of HV - per chamber
Float_t fTSample
sampling time
static Double_t BetheBlochAleph(Double_t bb, Int_t type=0)
Float_t fPadCoupling
coupling factor ration of anode signal
Int_t Transform0to1(Float_t *xyz, Int_t *index) const
void SetOuterFrameSpace(Float_t frspace)
UInt_t GetNPads(UInt_t sector, UInt_t row) const
Float_t GetYInner(Int_t irow) const
void SetDiffT(Float_t DiffT)
void SetInnerRadiusLow(Float_t InnerRadiusLow)
void SetNominalVoltage(Float_t v, UInt_t i)
void SetNominalGainSlopes()
void SetNResponseMax(Int_t max)
Float_t fOuterAngleShift
shift of first sector center to the 0
void SetOuterWWPitch(Float_t wwPitch)
Int_t GetNPadsPerSegment(Int_t segmentID) const
void SetOuter1NWires(Int_t nWires)
Float_t fADCDynRange
input dynamic range (mV)
void SetPadCoupling(Float_t PadCoupling)
void SetAttCoef(Float_t AttCoef)
void SetDiffL(Float_t DiffL)
Float_t fPadRowLow[600]
Lower sector, pad row radii -calculated.
void SetInnerPadPitchWidth(Float_t PadPitchWidth)
void Transform2to5(Float_t *xyz, Int_t *index) const
Float_t fNTBinsL1
Overall L1 delay in time bins.
Manager class for detector parameters.
Bool_t fbStatus
indicates consistency of the data
void SetRInnerFirstWire(Float_t firstWire)
void SetBetheBloch(TVectorD *v)
Float_t * fRotAngle
sin and cos of rotation angles for different sectors - calculated
void SetRowNUp2(Int_t NRowUp2)
void SetGasGain(Float_t GasGain)
Manager and of geomety classes for set: TPC.
void SetChipNorm(Float_t ChipNorm)
void SetRInnerLastWire(Float_t lastWire)
void SetGateDelay(Float_t delay)
static TVectorD * GetBetheBlochParamAlice()
virtual Bool_t Transform(Float_t *xyz, Int_t *index, Int_t *oindex)
virtual Int_t GetPadRow(Float_t *xyz, Int_t *index) const
void SetOuterWireMount(Float_t fmount)
void SetMWPCReadout(Bool_t type)
void SetNoise(Float_t Noise)
static TVectorD * GetBetheBlochParamNa49()
void SetTFWHM(Float_t fwhm)
Float_t fDriftV
drift velocity constant
virtual Bool_t ReadGeoMatrices()
AliTPCParam * GetParameters() const
Int_t fGeometryType
type of geometry -0 straight rows
Float_t GetPadRowRadiiLow(Int_t irow) const
void SetL1Delay(Float_t delay)
void SetZeroSup(Int_t ZeroSup)
void SetOxyCont(Float_t OxyCont)
void SetInnerPadPitchLength(Float_t PadPitchLength)
void SetInnerFrameSpace(Float_t frspace)
static TObjArray * fBBParam
array of the Bethe-Bloch parameters.
Float_t fOuterRadiusLow
lower radius of outer sector-IP
void SetOuterOffWire(Float_t offset)
void SetOuter1PadPitchLength(Float_t PadPitchLength)
static void RegisterBBParam(TVectorD *param, Int_t position)
TGraphErrors * fGainSlopesPT
graph with the gain slope as function of P/T - per chamber
void Transform4to8(Float_t *xyz, Int_t *index) const
void SetMaxTBin(Int_t maxtbin)
Int_t Transform2to3(Float_t *xyz, Int_t *index) const
Int_t fNInnerSector
number of inner sectors -calculated
void SetInnerPadWidth(Float_t PadWidth)
TGeoHMatrix * Tracking2LocalMatrix(const TGeoHMatrix *geoMatrix, Int_t sector) const
static TVectorD * GetBetheBlochParamAliceMC()
void SetChipGain(Float_t ChipGain)
void SetSectorAngles(Float_t innerangle, Float_t innershift, Float_t outerangle, Float_t outershift)
Float_t fPadRowUp[600]
Upper sector, pad row radii -calculated.
void SetNTBinsBeforeL1(UShort_t nbins)
Int_t GetNPadsLow(Int_t irow) const
void SetOuterRadiusLow(Float_t OuterRadiusLow)
Float_t fYInner[600]
Inner sector, wire-length.
void SetInnerDummyWire(Int_t dummy)
UShort_t fNTBinsBeforeL1
Number of time bins before L1 arrival which are being read out.
Int_t fNRowUp
number of pad rows per sector up -calculated
Float_t GetOuterAngle() const
Float_t GetYOuter(Int_t irow) const
Int_t GetSectorIndex(Float_t angle, Int_t row, Float_t z) const
Float_t fNoiseNormFac
normalisation factor to transform noise in electron to ADC channel
Float_t fOuterAngle
opening angle of outer sector
Float_t fChipGain
preamp shaper constant
TGeoHMatrix ** fClusterMatrix
transformation matrices of the cluster coordinate system
Int_t fNSector
total number of sectors -calculated
void SetOuter1PadLength(Float_t PadLength)
Float_t GetInnerAngle() const
Int_t fNResponseMax
maximal dimension of response
Float_t * fResponseWeight
! array with response -calulated
Int_t fNPadsLow[600]
Lower sector, number of pads per row -calculated.
Geometry class for a single ROC.
Float_t fChipNorm
preamp shaper normalisation
void SetOuter2PadLength(Float_t PadLength)
void SetNprim(Float_t prim)
Int_t fNPadsUp[600]
Upper sector, number of pads per row -calculated.
void SetInnerWWPitch(Float_t wwPitch)
void SetOuterDummyWire(Int_t dummy)
void SetInnerPadLength(Float_t PadLength)
virtual void SetDefault()
TGeoHMatrix ** fGlobalMatrix
fTrackingMatrix * fClusterMatrix
void SetOuterRadiusUp(Float_t OuterRadiusUp)
Float_t GetOuterAngleShift() const
Float_t fInnerAngle
opening angle of Inner sector
void SetInnerNWires(Int_t nWires)
void SetRowNLow(Int_t NRowLow)
void SetTSample(Float_t TSample)
Float_t fL1Delay
Delay of L1 arrival for the TPC readout.
Int_t fADCSat
saturation value of ADC (10 bits)
void SetDriftV(Float_t DriftV)
void SetRowNUp(Int_t NRowUp)
void SetResponseThreshold(Int_t threshold)
Bool_t AdjustSectorRow(Int_t index, Int_t §or, Int_t &row) const
Float_t fInnerAngleShift
shift of first inner sector center to the 0
Int_t GetIndex(Int_t sector, Int_t row) const
TVectorD * GetBetheBlochParameters()
Float_t fTotalNormFac
full normalisation factor - calculated
void SetROuterLastWire(Float_t lastWire)
void SetZLength(Float_t zlength)
Float_t fYOuter[600]
Outer sector, wire-length.
Int_t GetWireSegment(Int_t sector, Int_t row) const
TGeoHMatrix ** fTrackingMatrix
transformation matrices of the tracking coordinate system
Float_t GetPadRowRadiiUp(Int_t irow) const
TGeoHMatrix * GetGlobalMatrix(Int_t isec) const
Float_t fZWidth
derived value calculated using TSample and driftw -computed
void SetOmegaTau(Float_t OmegaTau)
void AdjustCosSin(Int_t isec, Float_t &cos, Float_t &sin) const
void SetGeometryType(Int_t type)
Float_t GetInnerAngleShift() const
Int_t GetNPadsUp(Int_t irow) const
void SetOuterPadPitchWidth(Float_t PadPitchWidth)
void SetNCrossRows(Int_t rows)
Int_t fNOuterSector
number of outer sectors -calculated
void SetRowNUp1(Int_t NRowUp1)
void SetBetheBlochMC(TVectorD *v)
void SetADCDynRange(Float_t adcdynrange)
Int_t fNRowLow
number of pad rows per low sector -set
static AliTPCROC * Instance()
void SetInnerWireMount(Float_t fmount)
void SetOuter2NWire(Int_t nWires)
void SetOuterPadWidth(Float_t PadWidth)
Float_t GetZLength(Int_t sector=0) const
void SetADCSat(Int_t adcsat)
void SetNtot(Float_t ntot)
Int_t fNRowUp1
number of short pad rows per sector up -set
void SetROuterFirstWire(Float_t firstWire)
void Transform3to4(Float_t *xyz, Int_t *index) const
void SetEend(Float_t end)
void SetWmean(Float_t wmean)
void Transform1to2(Float_t *xyz, Int_t *index) const
void SetComposition(Float_t c1, Float_t c2, Float_t c3, Float_t c4, Float_t c5, Float_t c6)
void SetInnerOffWire(Float_t offset)
Int_t fNRowUp2
number of long pad rows per sector up -set
void SetFpot(Float_t fpot)
void SetOuter2PadPitchLength(Float_t PadPitchLength)
void SetInnerRadiusUp(Float_t InnerRadiusUp)
Int_t fNtRows
total number of rows in TPC -calculated
Float_t GetChamberCenter(Int_t isec, Float_t *center=0) const