From 053767a494091eeffd93c81d4c088dde743b7fdb Mon Sep 17 00:00:00 2001 From: cblume Date: Tue, 3 Jun 2008 10:28:50 +0000 Subject: [PATCH] Replace plane by layer and chamber by stack --- TRD/AliTRD.cxx | 16 +- TRD/AliTRDCalibPadStatus.cxx | 12 +- TRD/AliTRDCalibPadStatus.h | 4 +- TRD/AliTRDCalibraFillHisto.cxx | 74 ++-- TRD/AliTRDCalibraFillHisto.h | 4 +- TRD/AliTRDCalibraFit.cxx | 138 +++---- TRD/AliTRDCalibraFit.h | 18 +- TRD/AliTRDCalibraMode.cxx | 32 +- TRD/AliTRDCalibraMode.h | 8 +- TRD/AliTRDCalibraVector.cxx | 34 +- TRD/AliTRDCalibraVector.h | 2 +- TRD/AliTRDCommonParam.h | 2 +- TRD/AliTRDSignalIndex.h | 12 +- TRD/AliTRDcalibDB.cxx | 24 +- TRD/AliTRDcalibDB.h | 10 +- TRD/AliTRDclusterizer.cxx | 55 ++- TRD/AliTRDclusterizer.h | 4 +- TRD/AliTRDdigitizer.cxx | 4 +- TRD/AliTRDdigitsManager.cxx | 4 +- TRD/AliTRDgeometry.cxx | 659 +++++++++++++++------------------ TRD/AliTRDgeometry.h | 170 ++++----- TRD/AliTRDgtuTrack.cxx | 4 +- TRD/AliTRDgtuTrack.h | 2 +- TRD/AliTRDmcmSim.cxx | 18 +- TRD/AliTRDmcmTracklet.cxx | 24 +- TRD/AliTRDmodule.cxx | 24 +- TRD/AliTRDpadPlane.cxx | 18 +- TRD/AliTRDpadPlane.h | 12 +- TRD/AliTRDpidESD.cxx | 16 +- TRD/AliTRDpropagationLayer.cxx | 14 +- TRD/AliTRDrawData.cxx | 50 +-- TRD/AliTRDrawStreamTB.cxx | 14 +- TRD/AliTRDtrack.cxx | 8 +- TRD/AliTRDtracker.cxx | 170 ++++----- TRD/AliTRDtrackerV1.cxx | 72 ++-- TRD/AliTRDtrackingAnalysis.cxx | 6 +- TRD/AliTRDtrackingChamber.cxx | 18 +- TRD/AliTRDtrackingSector.cxx | 40 +- TRD/AliTRDtransform.cxx | 6 +- TRD/AliTRDtrigger.cxx | 58 +-- TRD/AliTRDv1.cxx | 110 +++--- 41 files changed, 941 insertions(+), 1029 deletions(-) diff --git a/TRD/AliTRD.cxx b/TRD/AliTRD.cxx index a68554a505b..89728561212 100644 --- a/TRD/AliTRD.cxx +++ b/TRD/AliTRD.cxx @@ -335,7 +335,7 @@ void AliTRD::BuildGeometry() Float_t zmax1; Float_t zmax2; - Int_t iPlan; + Int_t iLayer; const Int_t kColorTRD = 46; @@ -344,7 +344,7 @@ void AliTRD::BuildGeometry() if (fDisplayType == 0) { - pgon = new TPGON("S_TRD","TRD","void",0,360,AliTRDgeometry::Nsect(),4); + pgon = new TPGON("S_TRD","TRD","void",0,360,AliTRDgeometry::Nsector(),4); rmin = kRmin; rmax = kRmax; pgon->DefineSection(0,-kZmax1,rmax,rmax); @@ -370,10 +370,10 @@ void AliTRD::BuildGeometry() zmax2 = kZmax2 + slope * thickness; zmax1 = zmax2 + slope * AliTRDgeometry::DrThick(); - for (iPlan = 0; iPlan < AliTRDgeometry::Nplan(); iPlan++) { + for (iLayer = 0; iLayer < AliTRDgeometry::Nlayer(); iLayer++) { - sprintf(name,"S_TR1%d",iPlan); - pgon = new TPGON(name,"TRD","void",0,360,AliTRDgeometry::Nsect(),4); + sprintf(name,"S_TR1%d",iLayer); + pgon = new TPGON(name,"TRD","void",0,360,AliTRDgeometry::Nsector(),4); pgon->DefineSection(0,-zmax1,rmax,rmax); pgon->DefineSection(1,-zmax2,rmin,rmax); pgon->DefineSection(2, zmax2,rmin,rmax); @@ -397,10 +397,10 @@ void AliTRD::BuildGeometry() zmax2 = kZmax2 + slope * thickness; zmax1 = zmax2 + slope * AliTRDgeometry::AmThick(); - for (iPlan = 0; iPlan < AliTRDgeometry::Nplan(); iPlan++) { + for (iLayer = 0; iLayer < AliTRDgeometry::Nlayer(); iLayer++) { - sprintf(name,"S_TR2%d",iPlan); - pgon = new TPGON(name,"TRD","void",0,360,AliTRDgeometry::Nsect(),4); + sprintf(name,"S_TR2%d",iLayer); + pgon = new TPGON(name,"TRD","void",0,360,AliTRDgeometry::Nsector(),4); pgon->DefineSection(0,-zmax1,rmax,rmax); pgon->DefineSection(1,-zmax2,rmin,rmax); pgon->DefineSection(2, zmax2,rmin,rmax); diff --git a/TRD/AliTRDCalibPadStatus.cxx b/TRD/AliTRDCalibPadStatus.cxx index 5b48c791061..3d0f2d9f27f 100644 --- a/TRD/AliTRDCalibPadStatus.cxx +++ b/TRD/AliTRDCalibPadStatus.cxx @@ -401,10 +401,10 @@ TH2F* AliTRDCalibPadStatus::GetHisto(Int_t det, TObjArray *arr, /*FOLD00*/ sprintf(title,"%s calibration histogram detector %.2d;ADC channel;Channel (pad)",type,det); - Int_t nbchannels = fGeo->GetRowMax(GetPlane(det),GetChamber(det),GetSector(det))*fGeo->GetColMax(GetPlane(det)); + Int_t nbchannels = fGeo->GetRowMax(GetLayer(det),GetStack(det),GetSector(det))*fGeo->GetColMax(GetLayer(det)); // we will add 3*8*rowMax channels at the end for the double counted - nbchannels += 3*8*(fGeo->GetRowMax(GetPlane(det),GetChamber(det),GetSector(det))); + nbchannels += 3*8*(fGeo->GetRowMax(GetLayer(det),GetStack(det),GetSector(det))); // new histogram with calib information. One value for each pad! @@ -441,7 +441,7 @@ AliTRDCalROC* AliTRDCalibPadStatus::GetCalRoc(Int_t det, TObjArray* arr, Bool_t // if we are forced and histogram doesn't yes exist create it // new AliTRDCalROC. One value for each pad! - AliTRDCalROC *croc = new AliTRDCalROC(GetPlane(det),GetChamber(det)); + AliTRDCalROC *croc = new AliTRDCalROC(GetLayer(det),GetStack(det)); arr->AddAt(croc,det); return croc; } @@ -783,10 +783,10 @@ void AliTRDCalibPadStatus::SetCalRocRMSd(AliTRDCalROC *rms, Int_t det) /*FOLD00* } //_____________________________________________________________________________ -Int_t AliTRDCalibPadStatus::GetPlane(Int_t d) const +Int_t AliTRDCalibPadStatus::GetLayer(Int_t d) const { // - // Reconstruct the plane number from the detector number + // Reconstruct the layer number from the detector number // return ((Int_t) (d % 6)); @@ -794,7 +794,7 @@ Int_t AliTRDCalibPadStatus::GetPlane(Int_t d) const } //_____________________________________________________________________________ -Int_t AliTRDCalibPadStatus::GetChamber(Int_t d) const +Int_t AliTRDCalibPadStatus::GetStack(Int_t d) const { // // Reconstruct the chamber number from the detector number diff --git a/TRD/AliTRDCalibPadStatus.h b/TRD/AliTRDCalibPadStatus.h index 3628c88ad37..5fb3025b065 100644 --- a/TRD/AliTRDCalibPadStatus.h +++ b/TRD/AliTRDCalibPadStatus.h @@ -98,8 +98,8 @@ public: Char_t *type, Bool_t force); // Some basic geometry function - virtual Int_t GetPlane(Int_t d) const; - virtual Int_t GetChamber(Int_t d) const; + virtual Int_t GetLayer(Int_t d) const; + virtual Int_t GetStack(Int_t d) const; virtual Int_t GetSector(Int_t d) const; ClassDef(AliTRDCalibPadStatus,1) diff --git a/TRD/AliTRDCalibraFillHisto.cxx b/TRD/AliTRDCalibraFillHisto.cxx index d3a872a4cb2..9a8695eab90 100644 --- a/TRD/AliTRDCalibraFillHisto.cxx +++ b/TRD/AliTRDCalibraFillHisto.cxx @@ -487,7 +487,7 @@ Bool_t AliTRDCalibraFillHisto::UpdateHistograms(AliTRDtrack *t) //If the same track, then look if the previous detector is in //the same plane, if yes: not a good track - if ((GetPlane(detector) == GetPlane(fDetectorPreviousTrack))) { + if ((GetLayer(detector) == GetLayer(fDetectorPreviousTrack))) { return kFALSE; } @@ -617,13 +617,13 @@ Bool_t AliTRDCalibraFillHisto::UpdateHistogramsV1(AliTRDtrackV1 *t) ////////////////////////////////////////// // localisation of the tracklet and dqdl ////////////////////////////////////////// - Int_t plane = tracklet->GetPlane(); + Int_t layer = tracklet->GetPlane(); Int_t ic = 0; while(!(cl = tracklet->GetClusters(ic++))) continue; Int_t detector = cl->GetDetector(); if (detector != fDetectorPreviousTrack) { // don't use the rest of this track if in the same plane - if ((plane == GetPlane(fDetectorPreviousTrack))) { + if ((layer == GetLayer(fDetectorPreviousTrack))) { break; } //Localise the detector bin @@ -709,8 +709,8 @@ Bool_t AliTRDCalibraFillHisto::FindP1TrackPHtracklet(AliTRDtrack *t, Int_t index //////////////// Int_t detector = ((AliTRDcluster *) t->GetCluster(index0))->GetDetector(); //detector // parameters of the track - Double_t snp = t->GetSnpPlane(GetPlane(detector)); // sin angle in the plan yx track - Double_t tgl = t->GetTglPlane(GetPlane(detector)); // dz/dl and not dz/dx! + Double_t snp = t->GetSnpPlane(GetLayer(detector)); // sin angle in the plan yx track + Double_t tgl = t->GetTglPlane(GetLayer(detector)); // dz/dl and not dz/dx! Double_t tnp = 0.0; // tan angle in the plan xy track if( TMath::Abs(snp) < 1.){ tnp = snp / (TMath::Sqrt(1-(snp*snp))); @@ -719,7 +719,7 @@ Bool_t AliTRDCalibraFillHisto::FindP1TrackPHtracklet(AliTRDtrack *t, Int_t index // tilting pad and cross row Int_t crossrow = 0; // if it crosses a pad row Int_t rowp = -1; // if it crosses a pad row - AliTRDpadPlane *padplane = fGeo->GetPadPlane(GetPlane(detector),GetChamber(detector)); + AliTRDpadPlane *padplane = fGeo->GetPadPlane(GetLayer(detector),GetStack(detector)); Double_t tiltingangle = padplane->GetTiltingAngle(); // tiltingangle of the pad Float_t tnt = TMath::Tan(tiltingangle/180.*TMath::Pi()); // tan tiltingangle // linear fit @@ -793,13 +793,13 @@ Bool_t AliTRDCalibraFillHisto::FindP1TrackPHtracklet(AliTRDtrack *t, Int_t index Int_t nbclusters = index1-index0; - Int_t plane = GetPlane(fDetectorPreviousTrack); + Int_t layer = GetLayer(fDetectorPreviousTrack); (* fDebugStreamer) << "FindP1TrackPHtracklet1"<< //"snpright="<GetRowMax(iPlane,iChamb,iSect); - Int_t colMax = fGeo->GetColMax(iPlane); + Int_t rowMax = fGeo->GetRowMax(iLayer,iStack,iSect); + Int_t colMax = fGeo->GetColMax(iLayer); // The fragmentation if (fNnZ[i] != 0) { @@ -308,10 +308,10 @@ void AliTRDCalibraMode::CalculXBins(Int_t idect, Int_t i) Int_t sector = GetSector(idect); fXbins[i] += sector*(6*fDetChamb2[i]+6*4*fDetChamb0[i]); - // In which chamber? - Int_t chamber = GetChamber(idect); + // In which stack? + Int_t stack = GetStack(idect); Int_t kc = 0; - while (kc < chamber) { + while (kc < stack) { if (kc == 2) { fXbins[i] += 6 * fDetChamb2[i]; } @@ -321,13 +321,13 @@ void AliTRDCalibraMode::CalculXBins(Int_t idect, Int_t i) kc ++; } - // In which plane? - Int_t plane = GetPlane(idect); - if (chamber == 2) { - fXbins[i] += plane*fDetChamb2[i]; + // In which layer? + Int_t layer = GetLayer(idect); + if (stack == 2) { + fXbins[i] += layer*fDetChamb2[i]; } else { - fXbins[i] += plane*fDetChamb0[i]; + fXbins[i] += layer*fDetChamb0[i]; } } @@ -369,7 +369,7 @@ void AliTRDCalibraMode::SetDetChamb2(Int_t i) } //_____________________________________________________________________________ -Int_t AliTRDCalibraMode::GetPlane(Int_t d) const +Int_t AliTRDCalibraMode::GetLayer(Int_t d) const { // // Reconstruct the plane number from the detector number @@ -380,15 +380,15 @@ Int_t AliTRDCalibraMode::GetPlane(Int_t d) const } //_____________________________________________________________________________ -Int_t AliTRDCalibraMode::GetChamber(Int_t d) const +Int_t AliTRDCalibraMode::GetStack(Int_t d) const { // - // Reconstruct the chamber number from the detector number + // Reconstruct the stack number from the detector number // - Int_t fgkNplan = 6; + const Int_t kNlayer = 6; - return ((Int_t) (d % 30) / fgkNplan); + return ((Int_t) (d % 30) / kNlayer); } diff --git a/TRD/AliTRDCalibraMode.h b/TRD/AliTRDCalibraMode.h index 9b087d6a45d..7e387f9e619 100644 --- a/TRD/AliTRDCalibraMode.h +++ b/TRD/AliTRDCalibraMode.h @@ -27,8 +27,8 @@ class AliTRDCalibraMode : public TObject { AliTRDCalibraMode &operator=(const AliTRDCalibraMode &) { return *this; } - Bool_t ModePadFragmentation(Int_t iPlane,Int_t iChamb, Int_t iSect, Int_t i); - void ModePadCalibration(Int_t iChamb, Int_t i); + Bool_t ModePadFragmentation(Int_t iLayer,Int_t iStack, Int_t iSector, Int_t i); + void ModePadCalibration(Int_t iStack, Int_t i); void ReconstructionRowPadGroup(Int_t idect, Int_t i); void CalculXBins(Int_t idect, Int_t i); void ResetMinMax(Int_t i); @@ -84,8 +84,8 @@ class AliTRDCalibraMode : public TObject { Short_t fDetChamb2[3]; // Number of Xbins for chamber 2 // Some basic geometry function - virtual Int_t GetPlane(Int_t d) const; - virtual Int_t GetChamber(Int_t d) const; + virtual Int_t GetLayer(Int_t d) const; + virtual Int_t GetStack(Int_t d) const; virtual Int_t GetSector(Int_t d) const; ClassDef(AliTRDCalibraMode,2) // TRD Calibration class diff --git a/TRD/AliTRDCalibraVector.cxx b/TRD/AliTRDCalibraVector.cxx index 716712c0826..5689e2d7405 100644 --- a/TRD/AliTRDCalibraVector.cxx +++ b/TRD/AliTRDCalibraVector.cxx @@ -666,9 +666,9 @@ AliTRDarrayI* AliTRDCalibraVector::GetEntriesCH(Int_t det // if we are forced and AliTRDarrayI doesn't yes exist create it AliTRDarrayI *croc = new AliTRDarrayI(); - Int_t chamber = GetChamber(det); - Int_t ngroup = 0; - if(chamber == 2) ngroup = fDetCha2[0]*fNumberBinCharge; + Int_t stack = GetStack(det); + Int_t ngroup = 0; + if(stack == 2) ngroup = fDetCha2[0]*fNumberBinCharge; else ngroup = fDetCha0[0]*fNumberBinCharge; // init croc->Expand(ngroup); @@ -692,9 +692,9 @@ AliTRDarrayI* AliTRDCalibraVector::GetEntriesPRF(Int_t det // if we are forced and AliTRDarrayI doesn't yes exist create it AliTRDarrayI *croc = new AliTRDarrayI(); - Int_t chamber = GetChamber(det); - Int_t ngroup = 0; - if(chamber == 2) ngroup = fDetCha2[2]*fNumberBinPRF; + Int_t stack = GetStack(det); + Int_t ngroup = 0; + if(stack == 2) ngroup = fDetCha2[2]*fNumberBinPRF; else ngroup = fDetCha0[2]*fNumberBinPRF; // init croc->Expand(ngroup); @@ -719,9 +719,9 @@ AliTRDarrayI* AliTRDCalibraVector::GetEntriesPH(Int_t det // if we are forced and AliTRDarrayI doesn't yes exist create it AliTRDarrayI *croc = new AliTRDarrayI(); - Int_t chamber = GetChamber(det); - Int_t ngroup = 0; - if(chamber == 2) ngroup = fDetCha2[1]*fTimeMax; + Int_t stack = GetStack(det); + Int_t ngroup = 0; + if(stack == 2) ngroup = fDetCha2[1]*fTimeMax; else ngroup = fDetCha0[1]*fTimeMax; // init croc->Expand(ngroup); @@ -746,9 +746,9 @@ AliTRDarrayF* AliTRDCalibraVector::GetMeanSquaresPH(Int_t det // if we are forced and AliTRDarrayF doesn't yes exist create it AliTRDarrayF *croc = new AliTRDarrayF(); - Int_t chamber = GetChamber(det); - Int_t ngroup = 0; - if(chamber == 2) ngroup = fDetCha2[1]*fTimeMax; + Int_t stack = GetStack(det); + Int_t ngroup = 0; + if(stack == 2) ngroup = fDetCha2[1]*fTimeMax; else ngroup = fDetCha0[1]*fTimeMax; // init croc->Expand(ngroup); @@ -772,9 +772,9 @@ AliTRDarrayF* AliTRDCalibraVector::GetMeanSquaresPRF(Int_t det // if we are forced and AliTRDarrayF doesn't yes exist create it AliTRDarrayF *croc = new AliTRDarrayF(); - Int_t chamber = GetChamber(det); - Int_t ngroup = 0; - if(chamber == 2) ngroup = fDetCha2[2]*fNumberBinPRF; + Int_t stack = GetStack(det); + Int_t ngroup = 0; + if(stack == 2) ngroup = fDetCha2[2]*fNumberBinPRF; else ngroup = fDetCha0[2]*fNumberBinPRF; // init croc->Expand(ngroup); @@ -785,10 +785,10 @@ AliTRDarrayF* AliTRDCalibraVector::GetMeanSquaresPRF(Int_t det return croc; } //_____________________________________________________________________________ -Int_t AliTRDCalibraVector::GetChamber(Int_t d) const +Int_t AliTRDCalibraVector::GetStack(Int_t d) const { // - // Reconstruct the chamber number from the detector number + // Reconstruct the stack number from the detector number // return ((Int_t) (d % 30) / 6); diff --git a/TRD/AliTRDCalibraVector.h b/TRD/AliTRDCalibraVector.h index 43459e67b32..5c925f9a6c4 100644 --- a/TRD/AliTRDCalibraVector.h +++ b/TRD/AliTRDCalibraVector.h @@ -129,7 +129,7 @@ class AliTRDCalibraVector : public TObject { AliTRDarrayI *GetEntriesCH(Int_t det, TObjArray *array, Bool_t force); // Some basic geometry function - virtual Int_t GetChamber(Int_t d) const; + virtual Int_t GetStack(Int_t d) const; ClassDef(AliTRDCalibraVector,1) // TRD Calibration class diff --git a/TRD/AliTRDCommonParam.h b/TRD/AliTRDCommonParam.h index d22a0a252da..3590982cc50 100644 --- a/TRD/AliTRDCommonParam.h +++ b/TRD/AliTRDCommonParam.h @@ -22,7 +22,7 @@ class AliTRDCommonParam : public TObject public: - enum { kNplan = 6, kNcham = 5, kNsect = 18, kNdet = 540 }; + enum { kNlayer = 6, kNstack = 5, kNsector = 18, kNdet = 540 }; AliTRDCommonParam(TRootIoCtor *); AliTRDCommonParam(const AliTRDCommonParam &p); diff --git a/TRD/AliTRDSignalIndex.h b/TRD/AliTRDSignalIndex.h index a9baf6b76bb..929c86ee193 100644 --- a/TRD/AliTRDSignalIndex.h +++ b/TRD/AliTRDSignalIndex.h @@ -62,16 +62,12 @@ class AliTRDSignalIndex : public TObject void SetSM(Int_t ix) { fSM = ix; } void SetStack(Int_t ix) { fStack = ix; } - void SetChamber(Int_t ix) { SetStack(ix); } void SetLayer(Int_t ix) { fLayer = ix; } - void SetPlane(Int_t ix) { SetLayer(ix); } void SetDetNumber(Int_t ix) { fDet = ix; } virtual Int_t GetDetNumber() const { return fDet; } // Get Det number - virtual Int_t GetLayer() const { return fLayer; } // Layer = Plane = position of the chamber in TRD - virtual Int_t GetPlane() const { return fLayer; } // Layer = Plane = position of the chamber in TRD - virtual Int_t GetStack() const { return fStack; } // Stack = Chameber = position of the chamber in TRD - virtual Int_t GetChamber() const { return fStack; } // Stack = Chameber = position of the chamber in TRD + virtual Int_t GetLayer() const { return fLayer; } // Layer position of the chamber in TRD + virtual Int_t GetStack() const { return fStack; } // Stack position of the chamber in TRD virtual Int_t GetSM() const { return fSM; } // Super module of the TRD TArrayI *GetArray() const { return fIndex; } // Get the tarrayi pointer for god knows what reason @@ -84,8 +80,8 @@ class AliTRDSignalIndex : public TObject private: Int_t fDet; // Detector number - Int_t fLayer; // Aka plane - position in the full TRD - Int_t fStack; // Aka chamber - position in the full TRD + Int_t fLayer; // Layer position in the full TRD + Int_t fStack; // Stack position in the full TRD Int_t fSM; // Super module - position in the full TRD TArrayI *fIndex; //! Monitor active pads and tbins diff --git a/TRD/AliTRDcalibDB.cxx b/TRD/AliTRDcalibDB.cxx index 5ace68fa96f..3772b0c230b 100644 --- a/TRD/AliTRDcalibDB.cxx +++ b/TRD/AliTRDcalibDB.cxx @@ -922,7 +922,7 @@ void AliTRDcalibDB::SamplePRF() const Int_t kPRFbin = 61; - Float_t prf[kNplan][kPRFbin] = { + Float_t prf[kNlayer][kPRFbin] = { {2.9037e-02, 3.3608e-02, 3.9020e-02, 4.5292e-02, 5.2694e-02, 6.1362e-02, 7.1461e-02, 8.3362e-02, 9.7063e-02, 1.1307e-01, 1.3140e-01, 1.5235e-01, @@ -1034,13 +1034,13 @@ void AliTRDcalibDB::SamplePRF() fPRFpad = ((Int_t) (1.0 / fPRFwid)); if (fPRFsmp) delete [] fPRFsmp; - fPRFsmp = new Float_t[kNplan*fPRFbin]; + fPRFsmp = new Float_t[kNlayer*fPRFbin]; Int_t ipos1; Int_t ipos2; Float_t diff; - for (Int_t iPla = 0; iPla < kNplan; iPla++) { + for (Int_t iLayer = 0; iLayer < kNlayer; iLayer++) { for (Int_t iBin = 0; iBin < fPRFbin; iBin++) { @@ -1051,18 +1051,18 @@ void AliTRDcalibDB::SamplePRF() diff = bin - pad[ipos2++]; } while ((diff > 0) && (ipos2 < kPRFbin)); if (ipos2 == kPRFbin) { - fPRFsmp[iPla*fPRFbin+iBin] = prf[iPla][ipos2-1]; + fPRFsmp[iLayer*fPRFbin+iBin] = prf[iLayer][ipos2-1]; } else if (ipos2 == 1) { - fPRFsmp[iPla*fPRFbin+iBin] = prf[iPla][ipos2-1]; + fPRFsmp[iLayer*fPRFbin+iBin] = prf[iLayer][ipos2-1]; } else { ipos2--; if (ipos2 >= kPRFbin) ipos2 = kPRFbin - 1; ipos1 = ipos2 - 1; - fPRFsmp[iPla*fPRFbin+iBin] = prf[iPla][ipos2] - + diff * (prf[iPla][ipos2] - prf[iPla][ipos1]) - / sPRFwid; + fPRFsmp[iLayer*fPRFbin+iBin] = prf[iLayer][ipos2] + + diff * (prf[iLayer][ipos2] - prf[iLayer][ipos1]) + / sPRFwid; } } @@ -1072,7 +1072,7 @@ void AliTRDcalibDB::SamplePRF() //_____________________________________________________________________________ Int_t AliTRDcalibDB::PadResponse(Double_t signal, Double_t dist - , Int_t plane, Double_t *pad) const + , Int_t layer, Double_t *pad) const { // // Applies the pad response @@ -1081,7 +1081,7 @@ Int_t AliTRDcalibDB::PadResponse(Double_t signal, Double_t dist // Int_t iBin = ((Int_t) (( - dist - fPRFlo) / fPRFwid)); - Int_t iOff = plane * fPRFbin; + Int_t iOff = layer * fPRFbin; Int_t iBin0 = iBin - fPRFpad + iOff; Int_t iBin1 = iBin + iOff; @@ -1090,13 +1090,13 @@ Int_t AliTRDcalibDB::PadResponse(Double_t signal, Double_t dist pad[0] = 0.0; pad[1] = 0.0; pad[2] = 0.0; - if ((iBin1 >= 0) && (iBin1 < (fPRFbin*kNplan))) { + if ((iBin1 >= 0) && (iBin1 < (fPRFbin*kNlayer))) { if (iBin0 >= 0) { pad[0] = signal * fPRFsmp[iBin0]; } pad[1] = signal * fPRFsmp[iBin1]; - if (iBin2 < (fPRFbin*kNplan)) { + if (iBin2 < (fPRFbin*kNlayer)) { pad[2] = signal * fPRFsmp[iBin2]; } diff --git a/TRD/AliTRDcalibDB.h b/TRD/AliTRDcalibDB.h index 8ef6345c098..7993d9b5d65 100644 --- a/TRD/AliTRDcalibDB.h +++ b/TRD/AliTRDcalibDB.h @@ -25,10 +25,10 @@ class AliTRDcalibDB : public TObject { public: - enum { kNplan = 6 - , kNcham = 5 - , kNsect = 18 - , kNdet = 540 }; + enum { kNlayer = 6 + , kNstack = 5 + , kNsector = 18 + , kNdet = 540 }; static AliTRDcalibDB *Instance(); static void Terminate(); @@ -80,7 +80,7 @@ class AliTRDcalibDB : public TObject { // Related functions, these depend on calibration data static Float_t GetOmegaTau(Float_t vdrift, Float_t bz); Int_t PadResponse(Double_t signal, Double_t dist - , Int_t plane, Double_t *pad) const; + , Int_t layer, Double_t *pad) const; protected: diff --git a/TRD/AliTRDclusterizer.cxx b/TRD/AliTRDclusterizer.cxx index 5671a572552..30386502a35 100644 --- a/TRD/AliTRDclusterizer.cxx +++ b/TRD/AliTRDclusterizer.cxx @@ -138,8 +138,6 @@ AliTRDclusterizer::~AliTRDclusterizer() // AliTRDclusterizer destructor // - printf("----> AliTRDclusterizer::dtor\n"); - if (fRecPoints) { fRecPoints->Delete(); @@ -189,6 +187,7 @@ AliTRDclusterizer &AliTRDclusterizer::operator=(const AliTRDclusterizer &c) { ((AliTRDclusterizer &) c).Copy(*this); } + return *this; } @@ -658,13 +657,13 @@ Bool_t AliTRDclusterizer::MakeClusters(Int_t det) Double_t padSignal[kNsig]; Double_t clusterSignal[kNclus]; - Int_t icham = indexesIn->GetChamber(); - Int_t iplan = indexesIn->GetPlane(); - Int_t isect = indexesIn->GetSM(); + Int_t istack = indexesIn->GetStack(); + Int_t ilayer = indexesIn->GetLayer(); + Int_t isector = indexesIn->GetSM(); // Start clustering in the chamber - Int_t idet = AliTRDgeometry::GetDetector(iplan,icham,isect); + Int_t idet = AliTRDgeometry::GetDetector(ilayer,istack,isector); if (idet != det) { AliError("Strange Detector number Missmatch!"); @@ -674,9 +673,9 @@ Bool_t AliTRDclusterizer::MakeClusters(Int_t det) // TRD space point transformation fTransform->SetDetector(det); - Int_t ilayer = AliGeomManager::kTRD1 + iplan; - Int_t imodule = icham + AliTRDgeometry::Ncham() * isect; - UShort_t volid = AliGeomManager::LayerToVolUID(ilayer,imodule); + Int_t iGeoLayer = AliGeomManager::kTRD1 + ilayer; + Int_t iGeoModule = istack + AliTRDgeometry::Nstack() * isector; + UShort_t volid = AliGeomManager::LayerToVolUID(iGeoLayer,iGeoModule); Int_t nColMax = digitsIn->GetNcol(); Int_t nRowMax = digitsIn->GetNrow(); @@ -837,7 +836,7 @@ Bool_t AliTRDclusterizer::MakeClusters(Int_t det) } // Unfold the two maxima and set the signal on // the overlapping pad to the ratio - ratioRight = Unfold(kEpsilon,iplan,padSignal); + ratioRight = Unfold(kEpsilon,ilayer,padSignal); ratioLeft = 1.0 - ratioRight; clusterSignal[2] *= ratioRight; iUnfold = 1; @@ -848,7 +847,7 @@ Bool_t AliTRDclusterizer::MakeClusters(Int_t det) if (AliTRDReconstructor::RecoParam()->LUTOn()) { // Calculate the position of the cluster by using the // lookup table method - clusterPosCol = LUTposition(iplan,clusterSignal[0] + clusterPosCol = LUTposition(ilayer,clusterSignal[0] ,clusterSignal[1] ,clusterSignal[2]); } else { @@ -1057,7 +1056,7 @@ Double_t AliTRDclusterizer::GetCOG(Double_t signal[5]) const } //_____________________________________________________________________________ -Double_t AliTRDclusterizer::Unfold(Double_t eps, Int_t plane, Double_t *padSignal) +Double_t AliTRDclusterizer::Unfold(Double_t eps, Int_t layer, Double_t *padSignal) { // // Method to unfold neighbouring maxima. @@ -1095,14 +1094,14 @@ Double_t AliTRDclusterizer::Unfold(Double_t eps, Int_t plane, Double_t *padSigna / ((1.0 - ratio)*padSignal[2] + padSignal[3] + padSignal[4]); // Set cluster charge ratio - irc = calibration->PadResponse(1.0,maxLeft ,plane,newSignal); + irc = calibration->PadResponse(1.0,maxLeft ,layer,newSignal); Double_t ampLeft = padSignal[1] / newSignal[1]; - irc = calibration->PadResponse(1.0,maxRight,plane,newSignal); + irc = calibration->PadResponse(1.0,maxRight,layer,newSignal); Double_t ampRight = padSignal[3] / newSignal[1]; // Apply pad response to parameters - irc = calibration->PadResponse(ampLeft ,maxLeft ,plane,newLeftSignal ); - irc = calibration->PadResponse(ampRight,maxRight,plane,newRightSignal); + irc = calibration->PadResponse(ampLeft ,maxLeft ,layer,newLeftSignal ); + irc = calibration->PadResponse(ampRight,maxRight,layer,newRightSignal); // Calculate new overlapping ratio ratio = TMath::Min((Double_t) 1.0 @@ -1286,10 +1285,10 @@ void AliTRDclusterizer::FillLUT() const Int_t kNlut = 128; - fLUTbin = AliTRDgeometry::kNplan * kNlut; + fLUTbin = AliTRDgeometry::kNlayer * kNlut; // The lookup table from Bogdan - Float_t lut[AliTRDgeometry::kNplan][kNlut] = { + Float_t lut[AliTRDgeometry::kNlayer][kNlut] = { { 0.0070, 0.0150, 0.0224, 0.0298, 0.0374, 0.0454, 0.0533, 0.0611, 0.0684, 0.0755, 0.0827, 0.0900, 0.0975, 0.1049, 0.1120, 0.1187, @@ -1405,16 +1404,16 @@ void AliTRDclusterizer::FillLUT() } fLUT = new Double_t[fLUTbin]; - for (Int_t iplan = 0; iplan < AliTRDgeometry::kNplan; iplan++) { + for (Int_t ilayer = 0; ilayer < AliTRDgeometry::kNlayer; ilayer++) { for (Int_t ilut = 0; ilut < kNlut; ilut++ ) { - fLUT[iplan*kNlut+ilut] = lut[iplan][ilut]; + fLUT[ilayer*kNlut+ilut] = lut[ilayer][ilut]; } } } //_____________________________________________________________________________ -Double_t AliTRDclusterizer::LUTposition(Int_t iplane, Double_t ampL +Double_t AliTRDclusterizer::LUTposition(Int_t ilayer, Double_t ampL , Double_t ampC, Double_t ampR) const { // @@ -1433,10 +1432,10 @@ Double_t AliTRDclusterizer::LUTposition(Int_t iplane, Double_t ampL Int_t side = 0; Int_t ix; - Double_t xMin[AliTRDgeometry::kNplan] = { 0.006492, 0.006377, 0.006258 - , 0.006144, 0.006030, 0.005980 }; - Double_t xMax[AliTRDgeometry::kNplan] = { 0.960351, 0.965870, 0.970445 - , 0.974352, 0.977667, 0.996101 }; + Double_t xMin[AliTRDgeometry::kNlayer] = { 0.006492, 0.006377, 0.006258 + , 0.006144, 0.006030, 0.005980 }; + Double_t xMax[AliTRDgeometry::kNlayer] = { 0.960351, 0.965870, 0.970445 + , 0.974352, 0.977667, 0.996101 }; if (ampL > ampR) { x = (ampL - ampR) / ampC; @@ -1449,8 +1448,8 @@ Double_t AliTRDclusterizer::LUTposition(Int_t iplane, Double_t ampL if (ampL != ampR) { - xmin = xMin[iplane] + 0.000005; - xmax = xMax[iplane] - 0.000005; + xmin = xMin[ilayer] + 0.000005; + xmax = xMax[ilayer] - 0.000005; xwid = (xmax - xmin) / 127.0; if (x < xmin) { @@ -1461,7 +1460,7 @@ Double_t AliTRDclusterizer::LUTposition(Int_t iplane, Double_t ampL } else { ix = (Int_t) ((x - xmin) / xwid); - pos = side * fLUT[iplane*kNlut+ix]; + pos = side * fLUT[ilayer*kNlut+ix]; } } diff --git a/TRD/AliTRDclusterizer.h b/TRD/AliTRDclusterizer.h index 995e5c8385a..0364f337c25 100644 --- a/TRD/AliTRDclusterizer.h +++ b/TRD/AliTRDclusterizer.h @@ -80,10 +80,10 @@ class AliTRDclusterizer : public TNamed { , Float_t ADCthreshold , AliTRDCalROC *calGainFactorROC , Float_t calGainFactorDetValue); - virtual Double_t Unfold(Double_t eps, Int_t plane, Double_t *padSignal); + virtual Double_t Unfold(Double_t eps, Int_t layer, Double_t *padSignal); Double_t GetCOG(Double_t signal[5]) const; void FillLUT(); - Double_t LUTposition(Int_t iplane, Double_t ampL, Double_t ampC, Double_t ampR) const; + Double_t LUTposition(Int_t ilayer, Double_t ampL, Double_t ampC, Double_t ampR) const; virtual void ResetHelperIndexes(AliTRDSignalIndex *indexesIn); diff --git a/TRD/AliTRDdigitizer.cxx b/TRD/AliTRDdigitizer.cxx index aee7d4e64bb..e3e32fdd9a7 100644 --- a/TRD/AliTRDdigitizer.cxx +++ b/TRD/AliTRDdigitizer.cxx @@ -969,7 +969,7 @@ Bool_t AliTRDdigitizer::ConvertHits(Int_t det, Float_t *hits, Int_t nhit Float_t elAttachProp = simParam->GetElAttachProp() / 100.0; AliTRDpadPlane *padPlane = fGeo->GetPadPlane(det); - Int_t plane = fGeo->GetPlane(det); + Int_t layer = fGeo->GetLayer(det); Float_t row0 = padPlane->GetRow0ROC(); Int_t nRowMax = padPlane->GetNrows(); Int_t nColMax = padPlane->GetNcols(); @@ -1149,7 +1149,7 @@ Bool_t AliTRDdigitizer::ConvertHits(Int_t det, Float_t *hits, Int_t nhit / padPlane->GetColSize(colE); // This is a fixed parametrization, i.e. not dependent on // calibration values ! - if (!(calibration->PadResponse(signal,dist,plane,padSignal))) continue; + if (!(calibration->PadResponse(signal,dist,layer,padSignal))) continue; } else { padSignal[0] = 0.0; diff --git a/TRD/AliTRDdigitsManager.cxx b/TRD/AliTRDdigitsManager.cxx index 4f193379d16..e33dd16637c 100644 --- a/TRD/AliTRDdigitsManager.cxx +++ b/TRD/AliTRDdigitsManager.cxx @@ -544,8 +544,8 @@ Bool_t AliTRDdigitsManager::BuildIndexes(Int_t det) AliTRDSignalIndex *indexes = GetIndexes(det); indexes->SetSM(geom.GetSector(det)); - indexes->SetChamber(geom.GetChamber(det)); - indexes->SetPlane(geom.GetPlane(det)); + indexes->SetStack(geom.GetStack(det)); + indexes->SetLayer(geom.GetLayer(det)); indexes->SetDetNumber(det); if (indexes->IsAllocated() == kFALSE) { diff --git a/TRD/AliTRDgeometry.cxx b/TRD/AliTRDgeometry.cxx index 056f02d9069..4ed5abb7e37 100644 --- a/TRD/AliTRDgeometry.cxx +++ b/TRD/AliTRDgeometry.cxx @@ -44,9 +44,9 @@ ClassImp(AliTRDgeometry) // // The geometry constants // - const Int_t AliTRDgeometry::fgkNsect = kNsect; - const Int_t AliTRDgeometry::fgkNplan = kNplan; - const Int_t AliTRDgeometry::fgkNcham = kNcham; + const Int_t AliTRDgeometry::fgkNsector = kNsector; + const Int_t AliTRDgeometry::fgkNlayer = kNlayer; + const Int_t AliTRDgeometry::fgkNstack = kNstack; const Int_t AliTRDgeometry::fgkNdet = kNdet; // @@ -236,9 +236,9 @@ void AliTRDgeometry::Init() // Initializes the geometry parameter // - Int_t icham; - Int_t iplan; - Int_t isect; + Int_t istack; + Int_t ilayer; + Int_t isector; // The outer width of the chambers fCwidth[0] = 90.4; @@ -250,32 +250,32 @@ void AliTRDgeometry::Init() // The outer lengths of the chambers // Includes the spacings between the chambers! - Float_t length[kNplan][kNcham] = { { 124.0, 124.0, 110.0, 124.0, 124.0 } - , { 124.0, 124.0, 110.0, 124.0, 124.0 } - , { 131.0, 131.0, 110.0, 131.0, 131.0 } - , { 138.0, 138.0, 110.0, 138.0, 138.0 } - , { 145.0, 145.0, 110.0, 145.0, 145.0 } - , { 147.0, 147.0, 110.0, 147.0, 147.0 } }; - - for (icham = 0; icham < kNcham; icham++) { - for (iplan = 0; iplan < kNplan; iplan++) { - fClength[iplan][icham] = length[iplan][icham]; + Float_t length[kNlayer][kNstack] = { { 124.0, 124.0, 110.0, 124.0, 124.0 } + , { 124.0, 124.0, 110.0, 124.0, 124.0 } + , { 131.0, 131.0, 110.0, 131.0, 131.0 } + , { 138.0, 138.0, 110.0, 138.0, 138.0 } + , { 145.0, 145.0, 110.0, 145.0, 145.0 } + , { 147.0, 147.0, 110.0, 147.0, 147.0 } }; + + for (istack = 0; istack < kNstack; istack++) { + for (ilayer = 0; ilayer < kNlayer; ilayer++) { + fClength[ilayer][istack] = length[ilayer][istack]; } } // The rotation matrix elements Float_t phi = 0.0; - for (isect = 0; isect < fgkNsect; isect++) { - phi = 2.0 * TMath::Pi() / (Float_t) fgkNsect * ((Float_t) isect + 0.5); - fRotB11[isect] = TMath::Cos(phi); - fRotB12[isect] = TMath::Sin(phi); - fRotB21[isect] = TMath::Sin(phi); - fRotB22[isect] = TMath::Cos(phi); + for (isector = 0; isector < fgkNsector; isector++) { + phi = 2.0 * TMath::Pi() / (Float_t) fgkNsector * ((Float_t) isector + 0.5); + fRotB11[isector] = TMath::Cos(phi); + fRotB12[isector] = TMath::Sin(phi); + fRotB21[isector] = TMath::Sin(phi); + fRotB22[isector] = TMath::Cos(phi); } // Initialize the SM status - for (isect = 0; isect < fgkNsect; isect++) { - SetSMstatus(isect,1); + for (isector = 0; isector < fgkNsector; isector++) { + SetSMstatus(isector,1); } } @@ -292,18 +292,18 @@ void AliTRDgeometry::CreatePadPlaneArray() delete fPadPlaneArray; } - fPadPlaneArray = new TObjArray(fgkNplan * fgkNcham); - for (Int_t iplan = 0; iplan < fgkNplan; iplan++) { - for (Int_t icham = 0; icham < fgkNcham; icham++) { - Int_t ipp = GetDetectorSec(iplan,icham); - fPadPlaneArray->AddAt(CreatePadPlane(iplan,icham),ipp); + fPadPlaneArray = new TObjArray(fgkNlayer * fgkNstack); + for (Int_t ilayer = 0; ilayer < fgkNlayer; ilayer++) { + for (Int_t istack = 0; istack < fgkNstack; istack++) { + Int_t ipp = GetDetectorSec(ilayer,istack); + fPadPlaneArray->AddAt(CreatePadPlane(ilayer,istack),ipp); } } } //_____________________________________________________________________________ -AliTRDpadPlane *AliTRDgeometry::CreatePadPlane(Int_t iplan, Int_t icham) +AliTRDpadPlane *AliTRDgeometry::CreatePadPlane(Int_t ilayer, Int_t istack) { // // Creates an AliTRDpadPlane object @@ -311,8 +311,8 @@ AliTRDpadPlane *AliTRDgeometry::CreatePadPlane(Int_t iplan, Int_t icham) AliTRDpadPlane *padPlane = new AliTRDpadPlane(); - padPlane->SetPlane(iplan); - padPlane->SetChamber(icham); + padPlane->SetLayer(ilayer); + padPlane->SetStack(istack); padPlane->SetRowSpacing(0.0); padPlane->SetColSpacing(0.0); @@ -325,9 +325,9 @@ AliTRDpadPlane *AliTRDgeometry::CreatePadPlane(Int_t iplan, Int_t icham) // // The pad plane parameter // - switch (iplan) { + switch (ilayer) { case 0: - if (icham == 2) { + if (istack == 2) { // L0C0 type padPlane->SetNrows(12); padPlane->SetLength(108.0); @@ -351,7 +351,7 @@ AliTRDpadPlane *AliTRDgeometry::CreatePadPlane(Int_t iplan, Int_t icham) } break; case 1: - if (icham == 2) { + if (istack == 2) { // L1C0 type padPlane->SetNrows(12); padPlane->SetLength(108.0); @@ -375,7 +375,7 @@ AliTRDpadPlane *AliTRDgeometry::CreatePadPlane(Int_t iplan, Int_t icham) } break; case 2: - if (icham == 2) { + if (istack == 2) { // L2C0 type padPlane->SetNrows(12); padPlane->SetLength(108.0); @@ -399,7 +399,7 @@ AliTRDpadPlane *AliTRDgeometry::CreatePadPlane(Int_t iplan, Int_t icham) } break; case 3: - if (icham == 2) { + if (istack == 2) { // L3C0 type padPlane->SetNrows(12); padPlane->SetLength(108.0); @@ -423,7 +423,7 @@ AliTRDpadPlane *AliTRDgeometry::CreatePadPlane(Int_t iplan, Int_t icham) } break; case 4: - if (icham == 2) { + if (istack == 2) { // L4C0 type padPlane->SetNrows(12); padPlane->SetLength(108.0); @@ -447,7 +447,7 @@ AliTRDpadPlane *AliTRDgeometry::CreatePadPlane(Int_t iplan, Int_t icham) } break; case 5: - if (icham == 2) { + if (istack == 2) { // L5C0 type padPlane->SetNrows(12); padPlane->SetLength(108.0); @@ -477,7 +477,7 @@ AliTRDpadPlane *AliTRDgeometry::CreatePadPlane(Int_t iplan, Int_t icham) // // Row direction // - Double_t row = fClength[iplan][icham] / 2.0 + Double_t row = fClength[ilayer][istack] / 2.0 - fgkRpadW - padPlane->GetLengthRim(); for (Int_t ir = 0; ir < padPlane->GetNrows(); ir++) { @@ -493,7 +493,7 @@ AliTRDpadPlane *AliTRDgeometry::CreatePadPlane(Int_t iplan, Int_t icham) // // Column direction // - Double_t col = fCwidth[iplan] / 2.0 + Double_t col = fCwidth[ilayer] / 2.0 + fgkCroW - padPlane->GetWidthRim(); for (Int_t ic = 0; ic < padPlane->GetNcols(); ic++) { @@ -508,13 +508,13 @@ AliTRDpadPlane *AliTRDgeometry::CreatePadPlane(Int_t iplan, Int_t icham) } // Calculate the offset to translate from the local ROC system into // the local supermodule system, which is used for clusters - Double_t rowTmp = fClength[iplan][0] - + fClength[iplan][1] - + fClength[iplan][2] / 2.0; - for (Int_t ic = 0; ic < icham; ic++) { - rowTmp -= fClength[iplan][ic]; + Double_t rowTmp = fClength[ilayer][0] + + fClength[ilayer][1] + + fClength[ilayer][2] / 2.0; + for (Int_t jstack = 0; jstack < istack; jstack++) { + rowTmp -= fClength[ilayer][jstack]; } - padPlane->SetPadRowSMOffset(rowTmp - fClength[iplan][icham]/2.0); + padPlane->SetPadRowSMOffset(rowTmp - fClength[ilayer][istack]/2.0); return padPlane; @@ -620,16 +620,16 @@ void AliTRDgeometry::CreateGeometry(Int_t *idtmed) gMC->Gsvolu("UTF1","TRD1",idtmed[1302-1],parTrd,kNparTrd); gMC->Gsvolu("UTF2","TRD1",idtmed[1302-1],parTrd,kNparTrd); - for (Int_t icham = 0; icham < kNcham; icham++) { - for (Int_t iplan = 0; iplan < kNplan; iplan++) { + for (Int_t istack = 0; istack < kNstack; istack++) { + for (Int_t ilayer = 0; ilayer < kNlayer; ilayer++) { - Int_t iDet = GetDetectorSec(iplan,icham); + Int_t iDet = GetDetectorSec(ilayer,istack); // The lower part of the readout chambers (drift volume + radiator) // The aluminum frames sprintf(cTagV,"UA%02d",iDet); - parCha[0] = fCwidth[iplan]/2.0; - parCha[1] = fClength[iplan][icham]/2.0 - fgkHspace/2.0; + parCha[0] = fCwidth[ilayer]/2.0; + parCha[1] = fClength[ilayer][istack]/2.0 - fgkHspace/2.0; parCha[2] = fgkCraH/2.0 + fgkCdrH/2.0; fChamberUAboxd[iDet][0] = parCha[0]; fChamberUAboxd[iDet][1] = parCha[1]; @@ -641,34 +641,34 @@ void AliTRDgeometry::CreateGeometry(Int_t *idtmed) // profile would not fit into the alignable volume. sprintf(cTagV,"UZ%02d",iDet); parCha[0] = fgkCroW/2.0; - parCha[1] = fClength[iplan][icham]/2.0 - fgkHspace/2.0; + parCha[1] = fClength[ilayer][istack]/2.0 - fgkHspace/2.0; parCha[2] = fgkCalW/2.0; fChamberUAboxd[iDet][0] = fChamberUAboxd[iDet][0] + fgkCroW; gMC->Gsvolu(cTagV,"BOX ",idtmed[1301-1],parCha,kNparCha); // The Wacosit frames sprintf(cTagV,"UB%02d",iDet); - parCha[0] = fCwidth[iplan]/2.0 - fgkCalT; + parCha[0] = fCwidth[ilayer]/2.0 - fgkCalT; parCha[1] = -1.0; parCha[2] = -1.0; gMC->Gsvolu(cTagV,"BOX ",idtmed[1307-1],parCha,kNparCha); // The glue around the radiator sprintf(cTagV,"UX%02d",iDet); - parCha[0] = fCwidth[iplan]/2.0 - fgkCalT - fgkCclsT; - parCha[1] = fClength[iplan][icham]/2.0 - fgkHspace/2.0 - fgkCclfT; + parCha[0] = fCwidth[ilayer]/2.0 - fgkCalT - fgkCclsT; + parCha[1] = fClength[ilayer][istack]/2.0 - fgkHspace/2.0 - fgkCclfT; parCha[2] = fgkCraH/2.0; gMC->Gsvolu(cTagV,"BOX ",idtmed[1311-1],parCha,kNparCha); // The inner part of radiator (air) sprintf(cTagV,"UC%02d",iDet); - parCha[0] = fCwidth[iplan]/2.0 - fgkCalT - fgkCclsT - fgkCglT; - parCha[1] = fClength[iplan][icham]/2.0 - fgkHspace/2.0 - fgkCclfT - fgkCglT; + parCha[0] = fCwidth[ilayer]/2.0 - fgkCalT - fgkCclsT - fgkCglT; + parCha[1] = fClength[ilayer][istack]/2.0 - fgkHspace/2.0 - fgkCclfT - fgkCglT; parCha[2] = -1.0; gMC->Gsvolu(cTagV,"BOX ",idtmed[1302-1],parCha,kNparCha); // The upper part of the readout chambers (amplification volume) // The Wacosit frames sprintf(cTagV,"UD%02d",iDet); - parCha[0] = fCwidth[iplan]/2.0 + fgkCroW; - parCha[1] = fClength[iplan][icham]/2.0 - fgkHspace/2.0; + parCha[0] = fCwidth[ilayer]/2.0 + fgkCroW; + parCha[1] = fClength[ilayer][istack]/2.0 - fgkHspace/2.0; parCha[2] = fgkCamH/2.0; fChamberUDboxd[iDet][0] = parCha[0]; fChamberUDboxd[iDet][1] = parCha[1]; @@ -676,16 +676,16 @@ void AliTRDgeometry::CreateGeometry(Int_t *idtmed) gMC->Gsvolu(cTagV,"BOX ",idtmed[1307-1],parCha,kNparCha); // The inner part of the Wacosit frame (air) sprintf(cTagV,"UE%02d",iDet); - parCha[0] = fCwidth[iplan]/2.0 + fgkCroW - fgkCcuT; - parCha[1] = fClength[iplan][icham]/2.0 - fgkHspace/2.0 - fgkCcuT; + parCha[0] = fCwidth[ilayer]/2.0 + fgkCroW - fgkCcuT; + parCha[1] = fClength[ilayer][istack]/2.0 - fgkHspace/2.0 - fgkCcuT; parCha[2] = -1.; gMC->Gsvolu(cTagV,"BOX ",idtmed[1302-1],parCha,kNparCha); // The support structure (pad plane, back panel, readout boards) // The aluminum frames sprintf(cTagV,"UF%02d",iDet); - parCha[0] = fCwidth[iplan]/2.0 + fgkCroW; - parCha[1] = fClength[iplan][icham]/2.0 - fgkHspace/2.0; + parCha[0] = fCwidth[ilayer]/2.0 + fgkCroW; + parCha[1] = fClength[ilayer][istack]/2.0 - fgkHspace/2.0; parCha[2] = fgkCroH/2.0; fChamberUFboxd[iDet][0] = parCha[0]; fChamberUFboxd[iDet][1] = parCha[1]; @@ -693,8 +693,8 @@ void AliTRDgeometry::CreateGeometry(Int_t *idtmed) gMC->Gsvolu(cTagV,"BOX ",idtmed[1301-1],parCha,kNparCha); // The inner part of the aluminum frames sprintf(cTagV,"UG%02d",iDet); - parCha[0] = fCwidth[iplan]/2.0 + fgkCroW - fgkCauT; - parCha[1] = fClength[iplan][icham]/2.0 - fgkHspace/2.0 - fgkCauT; + parCha[0] = fCwidth[ilayer]/2.0 + fgkCroW - fgkCauT; + parCha[1] = fClength[ilayer][istack]/2.0 - fgkHspace/2.0 - fgkCauT; parCha[2] = -1.0; gMC->Gsvolu(cTagV,"BOX ",idtmed[1302-1],parCha,kNparCha); @@ -706,8 +706,8 @@ void AliTRDgeometry::CreateGeometry(Int_t *idtmed) sprintf(cTagV,"UH%02d",iDet); gMC->Gsvolu(cTagV,"BOX ",idtmed[1315-1],parCha,kNparCha); // Xe/Isobutane layer (drift volume) - parCha[0] = fCwidth[iplan]/2.0 - fgkCalT - fgkCclsT; - parCha[1] = fClength[iplan][icham]/2.0 - fgkHspace/2.0 - fgkCclfT; + parCha[0] = fCwidth[ilayer]/2.0 - fgkCalT - fgkCclsT; + parCha[1] = fClength[ilayer][istack]/2.0 - fgkHspace/2.0 - fgkCclfT; parCha[2] = fgkDrThick/2.0; sprintf(cTagV,"UJ%02d",iDet); gMC->Gsvolu(cTagV,"BOX ",idtmed[1309-1],parCha,kNparCha); @@ -848,13 +848,13 @@ void AliTRDgeometry::CreateGeometry(Int_t *idtmed) // Position the frames of the chambers in the TRD mother volume xpos = 0.0; - ypos = fClength[iplan][0] + fClength[iplan][1] + fClength[iplan][2]/2.0; - for (Int_t ic = 0; ic < icham; ic++) { - ypos -= fClength[iplan][ic]; + ypos = fClength[ilayer][0] + fClength[ilayer][1] + fClength[ilayer][2]/2.0; + for (Int_t ic = 0; ic < istack; ic++) { + ypos -= fClength[ilayer][ic]; } - ypos -= fClength[iplan][icham]/2.0; + ypos -= fClength[ilayer][istack]/2.0; zpos = fgkVrocsm + fgkSMpltT + fgkCraH/2.0 + fgkCdrH/2.0 - fgkSheight/2.0 - + iplan * (fgkCH + fgkVspace); + + ilayer * (fgkCH + fgkVspace); // The lower aluminum frame, radiator + drift region sprintf(cTagV,"UA%02d",iDet); fChamberUAorig[iDet][0] = xpos; @@ -882,9 +882,9 @@ void AliTRDgeometry::CreateGeometry(Int_t *idtmed) // Create the volumes of the services CreateServices(idtmed); - for (Int_t icham = 0; icham < kNcham; icham++) { - for (Int_t iplan = 0; iplan < kNplan; iplan++) { - GroupChamber(iplan,icham,idtmed); + for (Int_t istack = 0; istack < kNstack; istack++) { + for (Int_t ilayer = 0; ilayer < kNlayer; ilayer++) { + GroupChamber(ilayer,istack,idtmed); } } @@ -907,10 +907,10 @@ void AliTRDgeometry::CreateGeometry(Int_t *idtmed) xpos = 0.0; ypos = 0.0; zpos = 0.0; - for (Int_t isect = 0; isect < kNsect; isect++) { - if (fSMstatus[isect]) { - sprintf(cTagV,"BTRD%d",isect); - switch (isect) { + for (Int_t isector = 0; isector < kNsector; isector++) { + if (fSMstatus[isector]) { + sprintf(cTagV,"BTRD%d",isector); + switch (isector) { case 13: case 14: case 15: @@ -934,9 +934,9 @@ void AliTRDgeometry::CreateGeometry(Int_t *idtmed) xpos = 0.0; ypos = 0.5*fgkSlength + 0.5*fgkFlength; zpos = 0.0; - for (Int_t isect = 0; isect < kNsect; isect++) { - if (fSMstatus[isect]) { - sprintf(cTagV,"BTRD%d",isect); + for (Int_t isector = 0; isector < kNsector; isector++) { + if (fSMstatus[isector]) { + sprintf(cTagV,"BTRD%d",isector); gMC->Gspos("UTF1",1,cTagV,xpos, ypos,zpos,0,"ONLY"); gMC->Gspos("UTF2",1,cTagV,xpos,-ypos,zpos,0,"ONLY"); } @@ -958,7 +958,7 @@ void AliTRDgeometry::CreateFrame(Int_t *idtmed) // USLx Long corner ledges (Al) // - Int_t iplan = 0; + Int_t ilayer = 0; Float_t xpos = 0.0; Float_t ypos = 0.0; @@ -1082,18 +1082,18 @@ void AliTRDgeometry::CreateFrame(Int_t *idtmed) xpos = 0.0; ypos = 0.0; zpos = 0.0; - for (iplan = 0; iplan < kNplan; iplan++) { - xpos = fCwidth[iplan]/2.0 + kSRLwid/2.0 + kSRLdst; + for (ilayer = 0; ilayer < kNlayer; ilayer++) { + xpos = fCwidth[ilayer]/2.0 + kSRLwid/2.0 + kSRLdst; ypos = 0.0; zpos = fgkVrocsm + fgkSMpltT + fgkCraH + fgkCdrH + fgkCamH - fgkSheight/2.0 - + iplan * (fgkCH + fgkVspace); - gMC->Gspos("USRL",iplan+1 ,"UTI1", xpos,ypos,zpos,0,"ONLY"); - gMC->Gspos("USRL",iplan+1+ kNplan,"UTI1",-xpos,ypos,zpos,0,"ONLY"); - gMC->Gspos("USRL",iplan+1+2*kNplan,"UTI2", xpos,ypos,zpos,0,"ONLY"); - gMC->Gspos("USRL",iplan+1+3*kNplan,"UTI2",-xpos,ypos,zpos,0,"ONLY"); - gMC->Gspos("USRL",iplan+1+4*kNplan,"UTI3", xpos,ypos,zpos,0,"ONLY"); - gMC->Gspos("USRL",iplan+1+5*kNplan,"UTI3",-xpos,ypos,zpos,0,"ONLY"); + + ilayer * (fgkCH + fgkVspace); + gMC->Gspos("USRL",ilayer+1 ,"UTI1", xpos,ypos,zpos,0,"ONLY"); + gMC->Gspos("USRL",ilayer+1+ kNlayer,"UTI1",-xpos,ypos,zpos,0,"ONLY"); + gMC->Gspos("USRL",ilayer+1+2*kNlayer,"UTI2", xpos,ypos,zpos,0,"ONLY"); + gMC->Gspos("USRL",ilayer+1+3*kNlayer,"UTI2",-xpos,ypos,zpos,0,"ONLY"); + gMC->Gspos("USRL",ilayer+1+4*kNlayer,"UTI3", xpos,ypos,zpos,0,"ONLY"); + gMC->Gspos("USRL",ilayer+1+5*kNlayer,"UTI3",-xpos,ypos,zpos,0,"ONLY"); } // @@ -1116,25 +1116,25 @@ void AliTRDgeometry::CreateFrame(Int_t *idtmed) xpos = 0.0; ypos = 0.0; zpos = 0.0; - for (iplan = 0; iplan < kNplan; iplan++) { + for (ilayer = 0; ilayer < kNlayer; ilayer++) { // The aluminum of the cross bars - parSCB[0] = fCwidth[iplan]/2.0 + kSRLdst/2.0; - sprintf(cTagV,"USF%01d",iplan); + parSCB[0] = fCwidth[ilayer]/2.0 + kSRLdst/2.0; + sprintf(cTagV,"USF%01d",ilayer); gMC->Gsvolu(cTagV,"BOX ",idtmed[1301-1],parSCB,kNparSCB); // The empty regions in the cross bars Float_t thkSCB = kSCBthk; - if (iplan < 2) { + if (ilayer < 2) { thkSCB *= 1.5; } parSCI[2] = parSCB[2] - thkSCB; parSCI[0] = parSCB[0]/4.0 - kSCBthk; - sprintf(cTagV,"USI%01d",iplan); + sprintf(cTagV,"USI%01d",ilayer); gMC->Gsvolu(cTagV,"BOX ",idtmed[1302-1],parSCI,kNparSCI); - sprintf(cTagV,"USI%01d",iplan); - sprintf(cTagM,"USF%01d",iplan); + sprintf(cTagV,"USI%01d",ilayer); + sprintf(cTagM,"USF%01d",ilayer); ypos = 0.0; zpos = 0.0; xpos = parSCI[0] + thkSCB/2.0; @@ -1146,17 +1146,17 @@ void AliTRDgeometry::CreateFrame(Int_t *idtmed) xpos = - 3.0 * parSCI[0] - 1.5 * thkSCB; gMC->Gspos(cTagV,4,cTagM,xpos,ypos,zpos,0,"ONLY"); - sprintf(cTagV,"USF%01d",iplan); + sprintf(cTagV,"USF%01d",ilayer); xpos = 0.0; zpos = fgkVrocsm + fgkSMpltT + parSCB[2] - fgkSheight/2.0 - + iplan * (fgkCH + fgkVspace); + + ilayer * (fgkCH + fgkVspace); - ypos = fClength[iplan][2]/2.0 + fClength[iplan][1]; + ypos = fClength[ilayer][2]/2.0 + fClength[ilayer][1]; gMC->Gspos(cTagV, 1,"UTI1", xpos,ypos,zpos,0,"ONLY"); gMC->Gspos(cTagV, 3,"UTI2", xpos,ypos,zpos,0,"ONLY"); gMC->Gspos(cTagV, 5,"UTI3", xpos,ypos,zpos,0,"ONLY"); - ypos = - fClength[iplan][2]/2.0 - fClength[iplan][1]; + ypos = - fClength[ilayer][2]/2.0 - fClength[ilayer][1]; gMC->Gspos(cTagV, 2,"UTI1", xpos,ypos,zpos,0,"ONLY"); gMC->Gspos(cTagV, 4,"UTI2", xpos,ypos,zpos,0,"ONLY"); gMC->Gspos(cTagV, 6,"UTI3", xpos,ypos,zpos,0,"ONLY"); @@ -1170,19 +1170,19 @@ void AliTRDgeometry::CreateFrame(Int_t *idtmed) const Int_t kNparSCH = 3; Float_t parSCH[kNparSCH]; - for (iplan = 1; iplan < kNplan-1; iplan++) { + for (ilayer = 1; ilayer < kNlayer-1; ilayer++) { - parSCH[0] = fCwidth[iplan]/2.0; - parSCH[1] = (fClength[iplan+1][2]/2.0 + fClength[iplan+1][1] - - fClength[iplan ][2]/2.0 - fClength[iplan ][1])/2.0; + parSCH[0] = fCwidth[ilayer]/2.0; + parSCH[1] = (fClength[ilayer+1][2]/2.0 + fClength[ilayer+1][1] + - fClength[ilayer ][2]/2.0 - fClength[ilayer ][1])/2.0; parSCH[2] = kSCHhgt/2.0; - sprintf(cTagV,"USH%01d",iplan); + sprintf(cTagV,"USH%01d",ilayer); gMC->Gsvolu(cTagV,"BOX ",idtmed[1301-1],parSCH,kNparSCH); xpos = 0.0; - ypos = fClength[iplan][2]/2.0 + fClength[iplan][1] + parSCH[1]; + ypos = fClength[ilayer][2]/2.0 + fClength[ilayer][1] + parSCH[1]; zpos = fgkVrocsm + fgkSMpltT - kSCHhgt/2.0 - fgkSheight/2.0 - + (iplan+1) * (fgkCH + fgkVspace); + + (ilayer+1) * (fgkCH + fgkVspace); gMC->Gspos(cTagV,1,"UTI1", xpos,ypos,zpos,0,"ONLY"); gMC->Gspos(cTagV,3,"UTI2", xpos,ypos,zpos,0,"ONLY"); gMC->Gspos(cTagV,5,"UTI3", xpos,ypos,zpos,0,"ONLY"); @@ -1645,8 +1645,8 @@ void AliTRDgeometry::CreateServices(Int_t *idtmed) // UTGD Gas distribution box (V2A) // - Int_t iplan = 0; - Int_t icham = 0; + Int_t ilayer = 0; + Int_t istack = 0; Float_t xpos = 0.0; Float_t ypos = 0.0; @@ -1714,78 +1714,78 @@ void AliTRDgeometry::CreateServices(Int_t *idtmed) gMC->Gspos("UTC2",1,"UTC1", xpos,ypos,zpos,0,"ONLY"); gMC->Gspos("UTC4",1,"UTC3", xpos,ypos,zpos,0,"ONLY"); - for (iplan = 1; iplan < kNplan; iplan++) { + for (ilayer = 1; ilayer < kNlayer; ilayer++) { // Along the chambers - xpos = fCwidth[iplan]/2.0 + kCOLwid/2.0 + kCOLposx; + xpos = fCwidth[ilayer]/2.0 + kCOLwid/2.0 + kCOLposx; ypos = 0.0; zpos = fgkVrocsm + fgkSMpltT + kCOLhgt/2.0 - fgkSheight/2.0 + kCOLposz - + iplan * (fgkCH + fgkVspace); + + ilayer * (fgkCH + fgkVspace); parCOL[0] = kCOLwid /2.0; parCOL[1] = fgkSlength/2.0; parCOL[2] = kCOLhgt /2.0; - gMC->Gsposp("UTC1",iplan ,"UTI1", xpos,ypos,zpos + gMC->Gsposp("UTC1",ilayer ,"UTI1", xpos,ypos,zpos ,matrix[0],"ONLY",parCOL,kNparCOL); - gMC->Gsposp("UTC1",iplan+ kNplan,"UTI1",-xpos,ypos,zpos + gMC->Gsposp("UTC1",ilayer+ kNlayer,"UTI1",-xpos,ypos,zpos ,matrix[1],"ONLY",parCOL,kNparCOL); - gMC->Gsposp("UTC1",iplan+6*kNplan,"UTI2", xpos,ypos,zpos + gMC->Gsposp("UTC1",ilayer+6*kNlayer,"UTI2", xpos,ypos,zpos ,matrix[0],"ONLY",parCOL,kNparCOL); - gMC->Gsposp("UTC1",iplan+7*kNplan,"UTI2",-xpos,ypos,zpos + gMC->Gsposp("UTC1",ilayer+7*kNlayer,"UTI2",-xpos,ypos,zpos ,matrix[1],"ONLY",parCOL,kNparCOL); - gMC->Gsposp("UTC1",iplan+8*kNplan ,"UTI3", xpos,ypos,zpos + gMC->Gsposp("UTC1",ilayer+8*kNlayer ,"UTI3", xpos,ypos,zpos ,matrix[0],"ONLY",parCOL,kNparCOL); - gMC->Gsposp("UTC1",iplan+9*kNplan,"UTI3",-xpos,ypos,zpos + gMC->Gsposp("UTC1",ilayer+9*kNlayer,"UTI3",-xpos,ypos,zpos ,matrix[1],"ONLY",parCOL,kNparCOL); // Front of supermodules - xpos = fCwidth[iplan]/2.0 + kCOLwid/2.0 + kCOLposx; + xpos = fCwidth[ilayer]/2.0 + kCOLwid/2.0 + kCOLposx; ypos = 0.0; zpos = fgkVrocsm + fgkSMpltT + kCOLhgt/2.0 - fgkSheight/2.0 + kCOLposz - + iplan * (fgkCH + fgkVspace); + + ilayer * (fgkCH + fgkVspace); parCOL[0] = kCOLwid /2.0; parCOL[1] = fgkFlength/2.0; parCOL[2] = kCOLhgt /2.0; - gMC->Gsposp("UTC3",iplan+2*kNplan,"UTF1", xpos,ypos,zpos + gMC->Gsposp("UTC3",ilayer+2*kNlayer,"UTF1", xpos,ypos,zpos ,matrix[0],"ONLY",parCOL,kNparCOL); - gMC->Gsposp("UTC3",iplan+3*kNplan,"UTF1",-xpos,ypos,zpos + gMC->Gsposp("UTC3",ilayer+3*kNlayer,"UTF1",-xpos,ypos,zpos ,matrix[1],"ONLY",parCOL,kNparCOL); - gMC->Gsposp("UTC3",iplan+4*kNplan,"UTF2", xpos,ypos,zpos + gMC->Gsposp("UTC3",ilayer+4*kNlayer,"UTF2", xpos,ypos,zpos ,matrix[0],"ONLY",parCOL,kNparCOL); - gMC->Gsposp("UTC3",iplan+5*kNplan,"UTF2",-xpos,ypos,zpos + gMC->Gsposp("UTC3",ilayer+5*kNlayer,"UTF2",-xpos,ypos,zpos ,matrix[1],"ONLY",parCOL,kNparCOL); } - for (iplan = 1; iplan < kNplan; iplan++) { + for (ilayer = 1; ilayer < kNlayer; ilayer++) { // In baby frame - xpos = fCwidth[iplan]/2.0 + kCOLwid/2.0; + xpos = fCwidth[ilayer]/2.0 + kCOLwid/2.0; ypos = kBBSdz/2.0 - kBBMdz/2.0; zpos = fgkVrocsm + fgkSMpltT + kCOLhgt/2.0 - fgkSheight/2.0 + kCOLposz - + iplan * (fgkCH + fgkVspace); + + ilayer * (fgkCH + fgkVspace); parCOL[0] = kCOLwid/2.0; parCOL[1] = kBBSdz /2.0; parCOL[2] = kCOLhgt/2.0; - gMC->Gsposp("UTC3",iplan+6*kNplan,"BBTRD", xpos, ypos, zpos + gMC->Gsposp("UTC3",ilayer+6*kNlayer,"BBTRD", xpos, ypos, zpos ,matrix[0],"ONLY",parCOL,kNparCOL); - gMC->Gsposp("UTC3",iplan+7*kNplan,"BBTRD",-xpos, ypos, zpos + gMC->Gsposp("UTC3",ilayer+7*kNlayer,"BBTRD",-xpos, ypos, zpos ,matrix[1],"ONLY",parCOL,kNparCOL); } - for (iplan = 1; iplan < kNplan; iplan++) { + for (ilayer = 1; ilayer < kNlayer; ilayer++) { // In back frame - xpos = fCwidth[iplan]/2.0 + kCOLwid/2.0 + kCOLposx; + xpos = fCwidth[ilayer]/2.0 + kCOLwid/2.0 + kCOLposx; ypos = -kBFSdz/2.0 + kBFMdz/2.0; zpos = fgkVrocsm + fgkSMpltT + kCOLhgt/2.0 - fgkSheight/2.0 + kCOLposz - + iplan * (fgkCH + fgkVspace); + + ilayer * (fgkCH + fgkVspace); parCOL[0] = kCOLwid/2.0; parCOL[1] = kBFSdz /2.0; parCOL[2] = kCOLhgt/2.0; - gMC->Gsposp("UTC3",iplan+6*kNplan,"BFTRD", xpos,ypos,zpos + gMC->Gsposp("UTC3",ilayer+6*kNlayer,"BFTRD", xpos,ypos,zpos ,matrix[0],"ONLY",parCOL,kNparCOL); - gMC->Gsposp("UTC3",iplan+7*kNplan,"BFTRD",-xpos,ypos,zpos + gMC->Gsposp("UTC3",ilayer+7*kNlayer,"BFTRD",-xpos,ypos,zpos ,matrix[1],"ONLY",parCOL,kNparCOL); } @@ -1798,17 +1798,17 @@ void AliTRDgeometry::CreateServices(Int_t *idtmed) parCOL[0] = kCOLwid /2.0; parCOL[1] = fgkSlength/2.0; parCOL[2] = kCOLhgt /2.0; - gMC->Gsposp("UTC1",6 ,"UTI1", xpos,ypos,zpos + gMC->Gsposp("UTC1",6 ,"UTI1", xpos,ypos,zpos ,matrix[3],"ONLY",parCOL,kNparCOL); - gMC->Gsposp("UTC1",6+ kNplan,"UTI1",-xpos,ypos,zpos + gMC->Gsposp("UTC1",6+ kNlayer,"UTI1",-xpos,ypos,zpos ,matrix[3],"ONLY",parCOL,kNparCOL); - gMC->Gsposp("UTC1",6+6*kNplan,"UTI2", xpos,ypos,zpos + gMC->Gsposp("UTC1",6+6*kNlayer,"UTI2", xpos,ypos,zpos ,matrix[3],"ONLY",parCOL,kNparCOL); - gMC->Gsposp("UTC1",6+7*kNplan,"UTI2",-xpos,ypos,zpos + gMC->Gsposp("UTC1",6+7*kNlayer,"UTI2",-xpos,ypos,zpos ,matrix[3],"ONLY",parCOL,kNparCOL); - gMC->Gsposp("UTC1",6+8*kNplan,"UTI3", xpos,ypos,zpos + gMC->Gsposp("UTC1",6+8*kNlayer,"UTI3", xpos,ypos,zpos ,matrix[3],"ONLY",parCOL,kNparCOL); - gMC->Gsposp("UTC1",6+9*kNplan,"UTI3",-xpos,ypos,zpos + gMC->Gsposp("UTC1",6+9*kNlayer,"UTI3",-xpos,ypos,zpos ,matrix[3],"ONLY",parCOL,kNparCOL); // Front of supermodules xpos = fCwidth[5]/2.0 - kCOLhgt/2.0 - 1.3; @@ -1817,13 +1817,13 @@ void AliTRDgeometry::CreateServices(Int_t *idtmed) parCOL[0] = kCOLwid /2.0; parCOL[1] = fgkFlength/2.0; parCOL[2] = kCOLhgt /2.0; - gMC->Gsposp("UTC3",6+2*kNplan,"UTF1", xpos,ypos,zpos + gMC->Gsposp("UTC3",6+2*kNlayer,"UTF1", xpos,ypos,zpos ,matrix[3],"ONLY",parCOL,kNparCOL); - gMC->Gsposp("UTC3",6+3*kNplan,"UTF1",-xpos,ypos,zpos + gMC->Gsposp("UTC3",6+3*kNlayer,"UTF1",-xpos,ypos,zpos ,matrix[3],"ONLY",parCOL,kNparCOL); - gMC->Gsposp("UTC3",6+4*kNplan,"UTF2", xpos,ypos,zpos + gMC->Gsposp("UTC3",6+4*kNlayer,"UTF2", xpos,ypos,zpos ,matrix[3],"ONLY",parCOL,kNparCOL); - gMC->Gsposp("UTC3",6+5*kNplan,"UTF2",-xpos,ypos,zpos + gMC->Gsposp("UTC3",6+5*kNlayer,"UTF2",-xpos,ypos,zpos ,matrix[3],"ONLY",parCOL,kNparCOL); // In baby frame xpos = fCwidth[5]/2.0 - kCOLhgt/2.0 - 2.3; @@ -1832,9 +1832,9 @@ void AliTRDgeometry::CreateServices(Int_t *idtmed) parCOL[0] = kCOLwid/2.0; parCOL[1] = kBBSdz /2.0; parCOL[2] = kCOLhgt/2.0; - gMC->Gsposp("UTC3",6+6*kNplan,"BBTRD", xpos, ypos, zpos + gMC->Gsposp("UTC3",6+6*kNlayer,"BBTRD", xpos, ypos, zpos ,matrix[3],"ONLY",parCOL,kNparCOL); - gMC->Gsposp("UTC3",6+7*kNplan,"BBTRD",-xpos, ypos, zpos + gMC->Gsposp("UTC3",6+7*kNlayer,"BBTRD",-xpos, ypos, zpos ,matrix[3],"ONLY",parCOL,kNparCOL); // In back frame xpos = fCwidth[5]/2.0 - kCOLhgt/2.0 - 1.3; @@ -1843,9 +1843,9 @@ void AliTRDgeometry::CreateServices(Int_t *idtmed) parCOL[0] = kCOLwid/2.0; parCOL[1] = kBFSdz /2.0; parCOL[2] = kCOLhgt/2.0; - gMC->Gsposp("UTC3",6+6*kNplan,"BFTRD", xpos,ypos,zpos + gMC->Gsposp("UTC3",6+6*kNlayer,"BFTRD", xpos,ypos,zpos ,matrix[3],"ONLY",parCOL,kNparCOL); - gMC->Gsposp("UTC3",6+7*kNplan,"BFTRD",-xpos,ypos,zpos + gMC->Gsposp("UTC3",6+7*kNlayer,"BFTRD",-xpos,ypos,zpos ,matrix[3],"ONLY",parCOL,kNparCOL); // @@ -1864,78 +1864,78 @@ void AliTRDgeometry::CreateServices(Int_t *idtmed) gMC->Gsvolu("UTP1","BOX ",idtmed[1325-1],parPWR,0); gMC->Gsvolu("UTP3","BOX ",idtmed[1325-1],parPWR,0); - for (iplan = 1; iplan < kNplan; iplan++) { + for (ilayer = 1; ilayer < kNlayer; ilayer++) { // Along the chambers - xpos = fCwidth[iplan]/2.0 + kPWRwid/2.0 + kPWRposx; + xpos = fCwidth[ilayer]/2.0 + kPWRwid/2.0 + kPWRposx; ypos = 0.0; zpos = fgkVrocsm + fgkSMpltT + kPWRhgt/2.0 - fgkSheight/2.0 + kPWRposz - + iplan * (fgkCH + fgkVspace); + + ilayer * (fgkCH + fgkVspace); parPWR[0] = kPWRwid /2.0; parPWR[1] = fgkSlength/2.0; parPWR[2] = kPWRhgt /2.0; - gMC->Gsposp("UTP1",iplan ,"UTI1", xpos,ypos,zpos + gMC->Gsposp("UTP1",ilayer ,"UTI1", xpos,ypos,zpos ,matrix[0],"ONLY",parPWR,kNparPWR); - gMC->Gsposp("UTP1",iplan+ kNplan,"UTI1",-xpos,ypos,zpos + gMC->Gsposp("UTP1",ilayer+ kNlayer,"UTI1",-xpos,ypos,zpos ,matrix[1],"ONLY",parPWR,kNparPWR); - gMC->Gsposp("UTP1",iplan+6*kNplan,"UTI2", xpos,ypos,zpos + gMC->Gsposp("UTP1",ilayer+6*kNlayer,"UTI2", xpos,ypos,zpos ,matrix[0],"ONLY",parPWR,kNparPWR); - gMC->Gsposp("UTP1",iplan+7*kNplan,"UTI2",-xpos,ypos,zpos + gMC->Gsposp("UTP1",ilayer+7*kNlayer,"UTI2",-xpos,ypos,zpos ,matrix[1],"ONLY",parPWR,kNparPWR); - gMC->Gsposp("UTP1",iplan+8*kNplan,"UTI3", xpos,ypos,zpos + gMC->Gsposp("UTP1",ilayer+8*kNlayer,"UTI3", xpos,ypos,zpos ,matrix[0],"ONLY",parPWR,kNparPWR); - gMC->Gsposp("UTP1",iplan+9*kNplan,"UTI3",-xpos,ypos,zpos + gMC->Gsposp("UTP1",ilayer+9*kNlayer,"UTI3",-xpos,ypos,zpos ,matrix[1],"ONLY",parPWR,kNparPWR); // Front of supermodule - xpos = fCwidth[iplan]/2.0 + kPWRwid/2.0 + kPWRposx; + xpos = fCwidth[ilayer]/2.0 + kPWRwid/2.0 + kPWRposx; ypos = 0.0; zpos = fgkVrocsm + fgkSMpltT + kPWRhgt/2.0 - fgkSheight/2.0 + kPWRposz - + iplan * (fgkCH + fgkVspace); + + ilayer * (fgkCH + fgkVspace); parPWR[0] = kPWRwid /2.0; parPWR[1] = fgkFlength/2.0; parPWR[2] = kPWRhgt /2.0; - gMC->Gsposp("UTP3",iplan+2*kNplan,"UTF1", xpos,ypos,zpos + gMC->Gsposp("UTP3",ilayer+2*kNlayer,"UTF1", xpos,ypos,zpos ,matrix[0],"ONLY",parPWR,kNparPWR); - gMC->Gsposp("UTP3",iplan+3*kNplan,"UTF1",-xpos,ypos,zpos + gMC->Gsposp("UTP3",ilayer+3*kNlayer,"UTF1",-xpos,ypos,zpos ,matrix[1],"ONLY",parPWR,kNparPWR); - gMC->Gsposp("UTP3",iplan+4*kNplan,"UTF2", xpos,ypos,zpos + gMC->Gsposp("UTP3",ilayer+4*kNlayer,"UTF2", xpos,ypos,zpos ,matrix[0],"ONLY",parPWR,kNparPWR); - gMC->Gsposp("UTP3",iplan+5*kNplan,"UTF2",-xpos,ypos,zpos + gMC->Gsposp("UTP3",ilayer+5*kNlayer,"UTF2",-xpos,ypos,zpos ,matrix[1],"ONLY",parPWR,kNparPWR); } - for (iplan = 1; iplan < kNplan; iplan++) { + for (ilayer = 1; ilayer < kNlayer; ilayer++) { // In baby frame - xpos = fCwidth[iplan]/2.0 + kPWRwid/2.0 + 0.93; + xpos = fCwidth[ilayer]/2.0 + kPWRwid/2.0 + 0.93; ypos = kBBSdz/2.0 - kBBMdz/2.0; zpos = fgkVrocsm + fgkSMpltT + kPWRhgt/2.0 - fgkSheight/2.0 + kPWRposz - + iplan * (fgkCH + fgkVspace); + + ilayer * (fgkCH + fgkVspace); parPWR[0] = kPWRwid/2.0; parPWR[1] = kBBSdz /2.0; parPWR[2] = kPWRhgt/2.0; - gMC->Gsposp("UTP3",iplan+6*kNplan,"BBTRD", xpos, ypos, zpos + gMC->Gsposp("UTP3",ilayer+6*kNlayer,"BBTRD", xpos, ypos, zpos ,matrix[0],"ONLY",parPWR,kNparPWR); - gMC->Gsposp("UTP3",iplan+7*kNplan,"BBTRD",-xpos, ypos, zpos + gMC->Gsposp("UTP3",ilayer+7*kNlayer,"BBTRD",-xpos, ypos, zpos ,matrix[1],"ONLY",parPWR,kNparPWR); } - for (iplan = 1; iplan < kNplan; iplan++) { + for (ilayer = 1; ilayer < kNlayer; ilayer++) { // In back frame - xpos = fCwidth[iplan]/2.0 + kPWRwid/2.0 + kPWRposx; + xpos = fCwidth[ilayer]/2.0 + kPWRwid/2.0 + kPWRposx; ypos = -kBFSdz/2.0 + kBFMdz/2.0; zpos = fgkVrocsm + fgkSMpltT + kPWRhgt/2.0 - fgkSheight/2.0 + kPWRposz - + iplan * (fgkCH + fgkVspace); + + ilayer * (fgkCH + fgkVspace); parPWR[0] = kPWRwid/2.0; parPWR[1] = kBFSdz /2.0; parPWR[2] = kPWRhgt/2.0; - gMC->Gsposp("UTP3",iplan+8*kNplan,"BFTRD", xpos,ypos,zpos + gMC->Gsposp("UTP3",ilayer+8*kNlayer,"BFTRD", xpos,ypos,zpos ,matrix[0],"ONLY",parPWR,kNparPWR); - gMC->Gsposp("UTP3",iplan+9*kNplan,"BFTRD",-xpos,ypos,zpos + gMC->Gsposp("UTP3",ilayer+9*kNlayer,"BFTRD",-xpos,ypos,zpos ,matrix[1],"ONLY",parPWR,kNparPWR); } @@ -1948,17 +1948,17 @@ void AliTRDgeometry::CreateServices(Int_t *idtmed) parPWR[0] = kPWRwid /2.0; parPWR[1] = fgkSlength/2.0; parPWR[2] = kPWRhgt /2.0; - gMC->Gsposp("UTP1",6 ,"UTI1", xpos,ypos,zpos + gMC->Gsposp("UTP1",6 ,"UTI1", xpos,ypos,zpos ,matrix[3],"ONLY",parPWR,kNparPWR); - gMC->Gsposp("UTP1",6+ kNplan,"UTI1",-xpos,ypos,zpos + gMC->Gsposp("UTP1",6+ kNlayer,"UTI1",-xpos,ypos,zpos ,matrix[3],"ONLY",parPWR,kNparPWR); - gMC->Gsposp("UTP1",6+6*kNplan,"UTI2", xpos,ypos,zpos + gMC->Gsposp("UTP1",6+6*kNlayer,"UTI2", xpos,ypos,zpos ,matrix[3],"ONLY",parPWR,kNparPWR); - gMC->Gsposp("UTP1",6+7*kNplan,"UTI2",-xpos,ypos,zpos + gMC->Gsposp("UTP1",6+7*kNlayer,"UTI2",-xpos,ypos,zpos ,matrix[3],"ONLY",parPWR,kNparPWR); - gMC->Gsposp("UTP1",6+8*kNplan,"UTI3", xpos,ypos,zpos + gMC->Gsposp("UTP1",6+8*kNlayer,"UTI3", xpos,ypos,zpos ,matrix[3],"ONLY",parPWR,kNparPWR); - gMC->Gsposp("UTP1",6+9*kNplan,"UTI3",-xpos,ypos,zpos + gMC->Gsposp("UTP1",6+9*kNlayer,"UTI3",-xpos,ypos,zpos ,matrix[3],"ONLY",parPWR,kNparPWR); // Front of supermodules xpos = fCwidth[5]/2.0 + kPWRhgt/2.0 - 1.3; @@ -1967,13 +1967,13 @@ void AliTRDgeometry::CreateServices(Int_t *idtmed) parPWR[0] = kPWRwid /2.0; parPWR[1] = fgkFlength/2.0; parPWR[2] = kPWRhgt /2.0; - gMC->Gsposp("UTP3",6+2*kNplan,"UTF1", xpos,ypos,zpos + gMC->Gsposp("UTP3",6+2*kNlayer,"UTF1", xpos,ypos,zpos ,matrix[3],"ONLY",parPWR,kNparPWR); - gMC->Gsposp("UTP3",6+3*kNplan,"UTF1",-xpos,ypos,zpos + gMC->Gsposp("UTP3",6+3*kNlayer,"UTF1",-xpos,ypos,zpos ,matrix[3],"ONLY",parPWR,kNparPWR); - gMC->Gsposp("UTP3",6+4*kNplan,"UTF2", xpos,ypos,zpos + gMC->Gsposp("UTP3",6+4*kNlayer,"UTF2", xpos,ypos,zpos ,matrix[3],"ONLY",parPWR,kNparPWR); - gMC->Gsposp("UTP3",6+5*kNplan,"UTF2",-xpos,ypos,zpos + gMC->Gsposp("UTP3",6+5*kNlayer,"UTF2",-xpos,ypos,zpos ,matrix[3],"ONLY",parPWR,kNparPWR); // In baby frame xpos = fCwidth[5]/2.0 + kPWRhgt/2.0 - 2.3; @@ -1982,9 +1982,9 @@ void AliTRDgeometry::CreateServices(Int_t *idtmed) parPWR[0] = kPWRwid/2.0; parPWR[1] = kBBSdz /2.0; parPWR[2] = kPWRhgt/2.0; - gMC->Gsposp("UTP3",6+6*kNplan,"BBTRD", xpos, ypos, zpos + gMC->Gsposp("UTP3",6+6*kNlayer,"BBTRD", xpos, ypos, zpos ,matrix[3],"ONLY",parPWR,kNparPWR); - gMC->Gsposp("UTP3",6+7*kNplan,"BBTRD",-xpos, ypos, zpos + gMC->Gsposp("UTP3",6+7*kNlayer,"BBTRD",-xpos, ypos, zpos ,matrix[3],"ONLY",parPWR,kNparPWR); // In back frame xpos = fCwidth[5]/2.0 + kPWRhgt/2.0 - 1.3; @@ -1993,9 +1993,9 @@ void AliTRDgeometry::CreateServices(Int_t *idtmed) parPWR[0] = kPWRwid/2.0; parPWR[1] = kBFSdz /2.0; parPWR[2] = kPWRhgt/2.0; - gMC->Gsposp("UTP3",6+8*kNplan,"BFTRD", xpos,ypos,zpos + gMC->Gsposp("UTP3",6+8*kNlayer,"BFTRD", xpos,ypos,zpos ,matrix[3],"ONLY",parPWR,kNparPWR); - gMC->Gsposp("UTP3",6+9*kNplan,"BFTRD",-xpos,ypos,zpos + gMC->Gsposp("UTP3",6+9*kNlayer,"BFTRD",-xpos,ypos,zpos ,matrix[3],"ONLY",parPWR,kNparPWR); // @@ -2015,13 +2015,13 @@ void AliTRDgeometry::CreateServices(Int_t *idtmed) ypos = 0.0; zpos = 0.0; gMC->Gspos("UTG2",1,"UTG1",xpos,ypos,zpos,0,"ONLY"); - for (iplan = 0; iplan < kNplan; iplan++) { - xpos = fCwidth[iplan]/2.0 + kCOLwid/2.0 - 1.5; + for (ilayer = 0; ilayer < kNlayer; ilayer++) { + xpos = fCwidth[ilayer]/2.0 + kCOLwid/2.0 - 1.5; ypos = 0.0; zpos = fgkVrocsm + fgkSMpltT + kCOLhgt/2.0 - fgkSheight/2.0 + 5.0 - + iplan * (fgkCH + fgkVspace); - gMC->Gspos("UTG1",1+iplan,"UTI3", xpos, ypos, zpos,matrix[4],"ONLY"); - gMC->Gspos("UTG1",7+iplan,"UTI3",-xpos, ypos, zpos,matrix[4],"ONLY"); + + ilayer * (fgkCH + fgkVspace); + gMC->Gspos("UTG1",1+ilayer,"UTI3", xpos, ypos, zpos,matrix[4],"ONLY"); + gMC->Gspos("UTG1",7+ilayer,"UTI3",-xpos, ypos, zpos,matrix[4],"ONLY"); } // @@ -2031,28 +2031,28 @@ void AliTRDgeometry::CreateServices(Int_t *idtmed) const Int_t kNparServ = 3; Float_t parServ[kNparServ]; - for (icham = 0; icham < kNcham; icham++) { - for (iplan = 0; iplan < kNplan; iplan++) { + for (istack = 0; istack < kNstack; istack++) { + for (ilayer = 0; ilayer < kNlayer; ilayer++) { - Int_t iDet = GetDetectorSec(iplan,icham); + Int_t iDet = GetDetectorSec(ilayer,istack); sprintf(cTagV,"UU%02d",iDet); - parServ[0] = fCwidth[iplan] /2.0; - parServ[1] = fClength[iplan][icham]/2.0 - fgkHspace/2.0; - parServ[2] = fgkVspace /2.0 - 0.742/2.0; + parServ[0] = fCwidth[ilayer] /2.0; + parServ[1] = fClength[ilayer][istack]/2.0 - fgkHspace/2.0; + parServ[2] = fgkVspace /2.0 - 0.742/2.0; fChamberUUboxd[iDet][0] = parServ[0]; fChamberUUboxd[iDet][1] = parServ[1]; fChamberUUboxd[iDet][2] = parServ[2]; gMC->Gsvolu(cTagV,"BOX",idtmed[1302-1],parServ,kNparServ); xpos = 0.0; - ypos = fClength[iplan][0] + fClength[iplan][1] + fClength[iplan][2]/2.0; - for (Int_t ic = 0; ic < icham; ic++) { - ypos -= fClength[iplan][ic]; + ypos = fClength[ilayer][0] + fClength[ilayer][1] + fClength[ilayer][2]/2.0; + for (Int_t ic = 0; ic < istack; ic++) { + ypos -= fClength[ilayer][ic]; } - ypos -= fClength[iplan][icham]/2.0; + ypos -= fClength[ilayer][istack]/2.0; zpos = fgkVrocsm + fgkSMpltT + fgkCH + fgkVspace/2.0 - fgkSheight/2.0 - + iplan * (fgkCH + fgkVspace); + + ilayer * (fgkCH + fgkVspace); zpos -= 0.742/2.0; fChamberUUorig[iDet][0] = xpos; fChamberUUorig[iDet][1] = ypos; @@ -2082,23 +2082,23 @@ void AliTRDgeometry::CreateServices(Int_t *idtmed) gMC->Gspos("UTCH",1,"UTCP",xpos,ypos,zpos,0,"ONLY"); // Position the cooling pipes in the mother volume - for (icham = 0; icham < kNcham; icham++) { - for (iplan = 0; iplan < kNplan; iplan++) { - Int_t iDet = GetDetectorSec(iplan,icham); - Int_t iCopy = GetDetector(iplan,icham,0) * 100; - Int_t nMCMrow = GetRowMax(iplan,icham,0); - Float_t ySize = (GetChamberLength(iplan,icham) - 2.0*fgkRpadW) + for (istack = 0; istack < kNstack; istack++) { + for (ilayer = 0; ilayer < kNlayer; ilayer++) { + Int_t iDet = GetDetectorSec(ilayer,istack); + Int_t iCopy = GetDetector(ilayer,istack,0) * 100; + Int_t nMCMrow = GetRowMax(ilayer,istack,0); + Float_t ySize = (GetChamberLength(ilayer,istack) - 2.0*fgkRpadW) / ((Float_t) nMCMrow); sprintf(cTagV,"UU%02d",iDet); for (Int_t iMCMrow = 0; iMCMrow < nMCMrow; iMCMrow++) { xpos = 0.0; ypos = (0.5 + iMCMrow) * ySize - 1.9 - - fClength[iplan][icham]/2.0 + fgkHspace/2.0; + - fClength[ilayer][istack]/2.0 + fgkHspace/2.0; zpos = 0.0 + 0.742/2.0; // The cooling pipes parTube[0] = 0.0; parTube[1] = 0.3/2.0; // Thickness of the cooling pipes - parTube[2] = fCwidth[iplan]/2.0; + parTube[2] = fCwidth[ilayer]/2.0; gMC->Gsposp("UTCP",iCopy+iMCMrow,cTagV,xpos,ypos,zpos ,matrix[2],"ONLY",parTube,kNparTube); } @@ -2116,22 +2116,22 @@ void AliTRDgeometry::CreateServices(Int_t *idtmed) gMC->Gsvolu("UTPL","TUBE",idtmed[1305-1],parTube,0); // Position the power lines in the mother volume - for (icham = 0; icham < kNcham; icham++) { - for (iplan = 0; iplan < kNplan; iplan++) { - Int_t iDet = GetDetectorSec(iplan,icham); - Int_t iCopy = GetDetector(iplan,icham,0) * 100; - Int_t nMCMrow = GetRowMax(iplan,icham,0); - Float_t ySize = (GetChamberLength(iplan,icham) - 2.0*fgkRpadW) + for (istack = 0; istack < kNstack; istack++) { + for (ilayer = 0; ilayer < kNlayer; ilayer++) { + Int_t iDet = GetDetectorSec(ilayer,istack); + Int_t iCopy = GetDetector(ilayer,istack,0) * 100; + Int_t nMCMrow = GetRowMax(ilayer,istack,0); + Float_t ySize = (GetChamberLength(ilayer,istack) - 2.0*fgkRpadW) / ((Float_t) nMCMrow); sprintf(cTagV,"UU%02d",iDet); for (Int_t iMCMrow = 0; iMCMrow < nMCMrow; iMCMrow++) { xpos = 0.0; ypos = (0.5 + iMCMrow) * ySize - 1.0 - - fClength[iplan][icham]/2.0 + fgkHspace/2.0; + - fClength[ilayer][istack]/2.0 + fgkHspace/2.0; zpos = -0.4 + 0.742/2.0; parTube[0] = 0.0; parTube[1] = 0.2/2.0; // Thickness of the power lines - parTube[2] = fCwidth[iplan]/2.0; + parTube[2] = fCwidth[ilayer]/2.0; gMC->Gsposp("UTPL",iCopy+iMCMrow,cTagV,xpos,ypos,zpos ,matrix[2],"ONLY",parTube,kNparTube); } @@ -2193,23 +2193,23 @@ void AliTRDgeometry::CreateServices(Int_t *idtmed) gMC->Gspos("UMC4",1,"UMCM",xpos,ypos,zpos,0,"ONLY"); // Position the MCMs in the mother volume - for (icham = 0; icham < kNcham; icham++) { - for (iplan = 0; iplan < kNplan; iplan++) { - Int_t iDet = GetDetectorSec(iplan,icham); - Int_t iCopy = GetDetector(iplan,icham,0) * 1000; - Int_t nMCMrow = GetRowMax(iplan,icham,0); - Float_t ySize = (GetChamberLength(iplan,icham) - 2.0*fgkRpadW) + for (istack = 0; istack < kNstack; istack++) { + for (ilayer = 0; ilayer < kNlayer; ilayer++) { + Int_t iDet = GetDetectorSec(ilayer,istack); + Int_t iCopy = GetDetector(ilayer,istack,0) * 1000; + Int_t nMCMrow = GetRowMax(ilayer,istack,0); + Float_t ySize = (GetChamberLength(ilayer,istack) - 2.0*fgkRpadW) / ((Float_t) nMCMrow); Int_t nMCMcol = 8; - Float_t xSize = (GetChamberWidth(iplan) - 2.0*fgkCpadW) + Float_t xSize = (GetChamberWidth(ilayer) - 2.0*fgkCpadW) / ((Float_t) nMCMcol); sprintf(cTagV,"UU%02d",iDet); for (Int_t iMCMrow = 0; iMCMrow < nMCMrow; iMCMrow++) { for (Int_t iMCMcol = 0; iMCMcol < nMCMcol; iMCMcol++) { xpos = (0.5 + iMCMcol) * xSize + 1.0 - - fCwidth[iplan]/2.0; + - fCwidth[ilayer]/2.0; ypos = (0.5 + iMCMrow) * ySize + 1.0 - - fClength[iplan][icham]/2.0 + fgkHspace/2.0; + - fClength[ilayer][istack]/2.0 + fgkHspace/2.0; zpos = -0.4 + 0.742/2.0; gMC->Gspos("UMCM",iCopy+iMCMrow*10+iMCMcol,cTagV ,xpos,ypos,zpos,0,"ONLY"); @@ -2237,27 +2237,27 @@ void AliTRDgeometry::CreateServices(Int_t *idtmed) ypos = 0.0; zpos = 0.0; gMC->Gspos("UTG4",1,"UTG3",xpos,ypos,zpos,0,"ONLY"); - for (iplan = 0; iplan < kNplan-1; iplan++) { + for (ilayer = 0; ilayer < kNlayer-1; ilayer++) { xpos = 0.0; - ypos = fClength[iplan][2]/2.0 - + fClength[iplan][1] - + fClength[iplan][0]; + ypos = fClength[ilayer][2]/2.0 + + fClength[ilayer][1] + + fClength[ilayer][0]; zpos = 9.0 - fgkSheight/2.0 - + iplan * (fgkCH + fgkVspace); + + ilayer * (fgkCH + fgkVspace); parTube[0] = 0.0; parTube[1] = 1.5/2.0; - parTube[2] = fCwidth[iplan]/2.0 - 2.5; - gMC->Gsposp("UTG3",iplan+1 ,"UTI1", xpos, ypos, zpos + parTube[2] = fCwidth[ilayer]/2.0 - 2.5; + gMC->Gsposp("UTG3",ilayer+1 ,"UTI1", xpos, ypos, zpos ,matrix[2],"ONLY",parTube,kNparTube); - gMC->Gsposp("UTG3",iplan+1+1*kNplan,"UTI1", xpos,-ypos, zpos + gMC->Gsposp("UTG3",ilayer+1+1*kNlayer,"UTI1", xpos,-ypos, zpos ,matrix[2],"ONLY",parTube,kNparTube); - gMC->Gsposp("UTG3",iplan+1+2*kNplan,"UTI2", xpos, ypos, zpos + gMC->Gsposp("UTG3",ilayer+1+2*kNlayer,"UTI2", xpos, ypos, zpos ,matrix[2],"ONLY",parTube,kNparTube); - gMC->Gsposp("UTG3",iplan+1+3*kNplan,"UTI2", xpos,-ypos, zpos + gMC->Gsposp("UTG3",ilayer+1+3*kNlayer,"UTI2", xpos,-ypos, zpos ,matrix[2],"ONLY",parTube,kNparTube); - gMC->Gsposp("UTG3",iplan+1+4*kNplan,"UTI3", xpos, ypos, zpos + gMC->Gsposp("UTG3",ilayer+1+4*kNlayer,"UTI3", xpos, ypos, zpos ,matrix[2],"ONLY",parTube,kNparTube); - gMC->Gsposp("UTG3",iplan+1+5*kNplan,"UTI3", xpos,-ypos, zpos + gMC->Gsposp("UTG3",ilayer+1+5*kNlayer,"UTI3", xpos,-ypos, zpos ,matrix[2],"ONLY",parTube,kNparTube); } @@ -2365,19 +2365,19 @@ void AliTRDgeometry::CreateServices(Int_t *idtmed) parBox[1] = 15.0/2.0; parBox[2] = 7.0/2.0; gMC->Gsvolu("UTPC","BOX ",idtmed[1325-1],parBox,kNparBox); - for (iplan = 0; iplan < kNplan-1; iplan++) { - xpos = fCwidth[iplan]/2.0 + kPWRwid/2.0; + for (ilayer = 0; ilayer < kNlayer-1; ilayer++) { + xpos = fCwidth[ilayer]/2.0 + kPWRwid/2.0; ypos = 0.0; zpos = fgkVrocsm + fgkSMpltT + kPWRhgt/2.0 - fgkSheight/2.0 + kPWRposz - + (iplan+1) * (fgkCH + fgkVspace); - gMC->Gspos("UTPC",iplan ,"UTF1", xpos,ypos,zpos,matrix[0],"ONLY"); - gMC->Gspos("UTPC",iplan+kNplan,"UTF1",-xpos,ypos,zpos,matrix[1],"ONLY"); + + (ilayer+1) * (fgkCH + fgkVspace); + gMC->Gspos("UTPC",ilayer ,"UTF1", xpos,ypos,zpos,matrix[0],"ONLY"); + gMC->Gspos("UTPC",ilayer+kNlayer,"UTF1",-xpos,ypos,zpos,matrix[1],"ONLY"); } xpos = fCwidth[5]/2.0 + kPWRhgt/2.0 - 1.3; ypos = 0.0; zpos = fgkSheight/2.0 - fgkSMpltT - 2.0; - gMC->Gspos("UTPC",5 ,"UTF1", xpos,ypos,zpos,matrix[3],"ONLY"); - gMC->Gspos("UTPC",5+kNplan,"UTF1",-xpos,ypos,zpos,matrix[3],"ONLY"); + gMC->Gspos("UTPC",5 ,"UTF1", xpos,ypos,zpos,matrix[3],"ONLY"); + gMC->Gspos("UTPC",5+kNlayer,"UTF1",-xpos,ypos,zpos,matrix[3],"ONLY"); // Power connection panel (Al) parBox[0] = 60.0/2.0; @@ -2463,7 +2463,7 @@ void AliTRDgeometry::CreateServices(Int_t *idtmed) } //_____________________________________________________________________________ -void AliTRDgeometry::GroupChamber(Int_t iplan, Int_t icham, Int_t *idtmed) +void AliTRDgeometry::GroupChamber(Int_t ilayer, Int_t istack, Int_t *idtmed) { // // Group volumes UA, UD, UF, UU in a single chamber (Air) @@ -2473,7 +2473,7 @@ void AliTRDgeometry::GroupChamber(Int_t iplan, Int_t icham, Int_t *idtmed) const Int_t kNparCha = 3; - Int_t iDet = GetDetectorSec(iplan,icham); + Int_t iDet = GetDetectorSec(ilayer,istack); Float_t xyzMin[3]; Float_t xyzMax[3]; @@ -2561,7 +2561,7 @@ void AliTRDgeometry::GroupChamber(Int_t iplan, Int_t icham, Int_t *idtmed) ,xyzOrig[1] ,xyzOrig[2] ,0,"ONLY"); - if (icham != 2) { + if (istack != 2) { // W/o middle stack gMC->Gspos(cTagV,1,"UTI3" ,xyzOrig[0] @@ -2591,69 +2591,69 @@ Bool_t AliTRDgeometry::RotateBack(Int_t det, Double_t *loc, Double_t *glb) const } //_____________________________________________________________________________ -Int_t AliTRDgeometry::GetDetectorSec(Int_t p, Int_t c) +Int_t AliTRDgeometry::GetDetectorSec(Int_t layer, Int_t stack) { // - // Convert plane / chamber into detector number for one single sector + // Convert plane / stack into detector number for one single sector // - return (p + c * fgkNplan); + return (layer + stack * fgkNlayer); } //_____________________________________________________________________________ -Int_t AliTRDgeometry::GetDetector(Int_t p, Int_t c, Int_t s) +Int_t AliTRDgeometry::GetDetector(Int_t layer, Int_t stack, Int_t sector) { // - // Convert plane / chamber / sector into detector number + // Convert layer / stack / sector into detector number // - return (p + c * fgkNplan + s * fgkNplan * fgkNcham); + return (layer + stack * fgkNlayer + sector * fgkNlayer * fgkNstack); } //_____________________________________________________________________________ -Int_t AliTRDgeometry::GetPlane(Int_t d) +Int_t AliTRDgeometry::GetLayer(Int_t det) { // - // Reconstruct the plane number from the detector number + // Reconstruct the layer number from the detector number // - return ((Int_t) (d % fgkNplan)); + return ((Int_t) (det % fgkNlayer)); } //_____________________________________________________________________________ -Int_t AliTRDgeometry::GetChamber(Int_t d) const +Int_t AliTRDgeometry::GetStack(Int_t det) const { // - // Reconstruct the chamber number from the detector number + // Reconstruct the stack number from the detector number // - return ((Int_t) (d % (fgkNplan * fgkNcham)) / fgkNplan); + return ((Int_t) (det % (fgkNlayer * fgkNstack)) / fgkNlayer); } //_____________________________________________________________________________ -Int_t AliTRDgeometry::GetChamber(Double_t z, Int_t plane) +Int_t AliTRDgeometry::GetStack(Double_t z, Int_t layer) { // - // Reconstruct the chamber number from the z position and plane number + // Reconstruct the chamber number from the z position and layer number // // The return function has to be protected for positiveness !! // - if ((plane < 0) || - (plane >= fgkNplan)) return -1; + if ((layer < 0) || + (layer >= fgkNlayer)) return -1; - Int_t ichmb = fgkNcham; + Int_t istck = fgkNstack; Double_t zmin; Double_t zmax; do { - ichmb--; - if (ichmb < 0) break; - AliTRDpadPlane *pp = GetPadPlane(plane,ichmb); + istck--; + if (istck < 0) break; + AliTRDpadPlane *pp = GetPadPlane(layer,istck); zmax = pp->GetRow0(); Int_t nrows = pp->GetNrows(); zmin = zmax - 2 * pp->GetLengthOPad() @@ -2661,156 +2661,81 @@ Int_t AliTRDgeometry::GetChamber(Double_t z, Int_t plane) - (nrows-1) * pp->GetRowSpacing(); } while((z < zmin) || (z > zmax)); - return ichmb; + return istck; } //_____________________________________________________________________________ -Int_t AliTRDgeometry::GetSector(Int_t d) const +Int_t AliTRDgeometry::GetSector(Int_t det) const { // // Reconstruct the sector number from the detector number // - return ((Int_t) (d / (fgkNplan * fgkNcham))); + return ((Int_t) (det / (fgkNlayer * fgkNstack))); } //_____________________________________________________________________________ -AliTRDpadPlane *AliTRDgeometry::GetPadPlane(Int_t p, Int_t c) +AliTRDpadPlane *AliTRDgeometry::GetPadPlane(Int_t layer, Int_t stack) { // - // Returns the pad plane for a given plane

and chamber number + // Returns the pad plane for a given plane and stack number // if (!fPadPlaneArray) { CreatePadPlaneArray(); } - Int_t ipp = GetDetectorSec(p,c); + Int_t ipp = GetDetectorSec(layer,stack); return ((AliTRDpadPlane *) fPadPlaneArray->At(ipp)); } //_____________________________________________________________________________ -Int_t AliTRDgeometry::GetRowMax(Int_t p, Int_t c, Int_t /*s*/) +Int_t AliTRDgeometry::GetRowMax(Int_t layer, Int_t stack, Int_t /*sector*/) { // // Returns the number of rows on the pad plane // - return GetPadPlane(p,c)->GetNrows(); + return GetPadPlane(layer,stack)->GetNrows(); } //_____________________________________________________________________________ -Int_t AliTRDgeometry::GetColMax(Int_t p) +Int_t AliTRDgeometry::GetColMax(Int_t layer) { // // Returns the number of rows on the pad plane // - return GetPadPlane(p,0)->GetNcols(); + return GetPadPlane(layer,0)->GetNcols(); } //_____________________________________________________________________________ -Double_t AliTRDgeometry::GetRow0(Int_t p, Int_t c, Int_t /*s*/) +Double_t AliTRDgeometry::GetRow0(Int_t layer, Int_t stack, Int_t /*sector*/) { // // Returns the position of the border of the first pad in a row // - return GetPadPlane(p,c)->GetRow0(); + return GetPadPlane(layer,stack)->GetRow0(); } //_____________________________________________________________________________ -Double_t AliTRDgeometry::GetCol0(Int_t p) +Double_t AliTRDgeometry::GetCol0(Int_t layer) { // // Returns the position of the border of the first pad in a column // - return GetPadPlane(p,0)->GetCol0(); + return GetPadPlane(layer,0)->GetCol0(); } -//_____________________________________________________________________________ -//Int_t AliTRDgeometry::GetPadRowFromMCM(Int_t irob, Int_t imcm) const -//{ - // - // Return on which row this mcm sits - // -// -// return fgkMCMrow*(irob/2) + imcm/fgkMCMrow; -// -//} - -//_____________________________________________________________________________ -//Int_t AliTRDgeometry::GetPadColFromADC(Int_t irob, Int_t imcm, Int_t iadc) const -//{ - // - // Return which pad is connected to this adc channel. return -1 if it - // is one of the not directly connected adc channels (0, 1 20) - // -// -// if (iadc < 2 || iadc > 19 ) return -1; -// -// return (iadc-2) + (imcm%fgkMCMrow)*fgkPadmax + GetRobSide(irob)*fgkColmax/2; -// -//} - -//_____________________________________________________________________________ -//Int_t AliTRDgeometry::GetMCMfromPad(Int_t irow, Int_t icol) const -//{ - // - // Return on which mcm this pad is - // -// -// if ( irow < 0 || icol < 0 || irow > fgkRowmaxC1 || icol > fgkColmax ) return -1; -// -// return (icol%(fgkColmax/2))/fgkPadmax + fgkMCMrow*(irow%fgkMCMrow); -// -//} - -//_____________________________________________________________________________ -//Int_t AliTRDgeometry::GetROBfromPad(Int_t irow, Int_t icol) const -//{ - // - // Return on which rob this pad is - // -// -// return (irow/fgkMCMrow)*2 + GetColSide(icol); -// -//} - -//_____________________________________________________________________________ -//Int_t AliTRDgeometry::GetRobSide(Int_t irob) const -//{ - // - // Return on which side this rob sits (A side = 0, B side = 1) - // -// -// if ( irob < 0 || irob >= fgkROBmaxC1 ) return -1; -// -// return irob%2; -// -//} - -//_____________________________________________________________________________ -//Int_t AliTRDgeometry::GetColSide(Int_t icol) const -//{ - // - // Return on which side this column sits (A side = 0, B side = 1) - // -// -// if ( icol < 0 || icol >= fgkColmax ) return -1; -// -// return icol/(fgkColmax/2); -// -//} - //_____________________________________________________________________________ Bool_t AliTRDgeometry::CreateClusterMatrixArray() { @@ -2829,14 +2754,14 @@ Bool_t AliTRDgeometry::CreateClusterMatrixArray() for (Int_t iLayer = AliGeomManager::kTRD1; iLayer <= AliGeomManager::kTRD6; iLayer++) { for (Int_t iModule = 0; iModule < AliGeomManager::LayerSize(iLayer); iModule++) { - Int_t isector = iModule/Ncham(); - Int_t ichamber = iModule%Ncham(); + Int_t isector = iModule/Nstack(); + Int_t istack = iModule%Nstack(); Int_t iLayerTRD = iLayer - AliGeomManager::kTRD1; - Int_t lid = GetDetector(iLayerTRD,ichamber,isector); + Int_t lid = GetDetector(iLayerTRD,istack,isector); // Taking holes into account if (((isector == 13) || (isector == 14) || (isector == 15)) && - (ichamber == 2)) continue; + (istack == 2)) continue; UShort_t volid = AliGeomManager::LayerToVolUID(iLayer,iModule); const char *symname = AliGeomManager::SymName(volid); diff --git a/TRD/AliTRDgeometry.h b/TRD/AliTRDgeometry.h index 13df0d0bfe6..927925d49fd 100644 --- a/TRD/AliTRDgeometry.h +++ b/TRD/AliTRDgeometry.h @@ -25,11 +25,11 @@ class AliTRDgeometry : public AliGeometry { public: - enum { kNplan = 6 - , kNcham = 5 - , kNsect = 18 - , kNdet = 540 - , kNdets = 30 }; + enum { kNlayer = 6 + , kNstack = 5 + , kNsector = 18 + , kNdet = 540 + , kNdets = 30 }; AliTRDgeometry(); AliTRDgeometry(const AliTRDgeometry &g); @@ -38,101 +38,93 @@ class AliTRDgeometry : public AliGeometry { virtual void Init(); virtual void CreateGeometry(Int_t *idtmed); - virtual Int_t IsVersion() { return 1; } - virtual Bool_t Impact(const TParticle* ) const { return kTRUE; } - virtual Bool_t IsHole(Int_t /*p*/, Int_t /*c*/, Int_t /*s*/) const { return kFALSE; } + virtual Int_t IsVersion() { return 1; } + virtual Bool_t Impact(const TParticle* ) const { return kTRUE; } + virtual Bool_t IsHole(Int_t /*la*/, Int_t /*st*/, Int_t /*se*/) const { return kFALSE; } virtual Bool_t RotateBack(Int_t det, Double_t *loc, Double_t *glb) const; Bool_t ChamberInGeometry(Int_t det); - void GroupChamber(Int_t iplan, Int_t icham, Int_t *idtmed); + void GroupChamber(Int_t ilayer, Int_t istack, Int_t *idtmed); void CreateFrame(Int_t *idtmed); void CreateServices(Int_t *idtmed); Bool_t CreateClusterMatrixArray(); - TGeoHMatrix *GetClusterMatrix(Int_t det) { return (TGeoHMatrix *) - fClusterMatrixArray->At(det); } + TGeoHMatrix *GetClusterMatrix(Int_t det) { return (TGeoHMatrix *) + fClusterMatrixArray->At(det); } - void SetSMstatus(Int_t sm, Char_t status) { fSMstatus[sm] = status; } + void SetSMstatus(Int_t sm, Char_t status) { fSMstatus[sm] = status; } - static Int_t GetDetectorSec(Int_t p, Int_t c); - static Int_t GetDetector(Int_t p, Int_t c, Int_t s); - static Int_t GetPlane(Int_t d); - virtual Int_t GetChamber(Int_t d) const; - virtual Int_t GetChamber(Double_t z, Int_t plane); - virtual Int_t GetSector(Int_t d) const; + static Int_t GetDetectorSec(Int_t layer, Int_t stack); + static Int_t GetDetector(Int_t layer, Int_t stack, Int_t sector); + static Int_t GetLayer(Int_t det); + virtual Int_t GetStack(Int_t det) const; + virtual Int_t GetStack(Double_t z, Int_t layer); + virtual Int_t GetSector(Int_t det) const; void CreatePadPlaneArray(); - AliTRDpadPlane *CreatePadPlane(Int_t p, Int_t c); - AliTRDpadPlane *GetPadPlane(Int_t p, Int_t c); - AliTRDpadPlane *GetPadPlane(Int_t det) { return GetPadPlane(GetPlane(det) - ,GetChamber(det)); } - Int_t GetRowMax(Int_t p, Int_t c, Int_t /*s*/); - Int_t GetColMax(Int_t p); - Double_t GetRow0(Int_t p, Int_t c, Int_t /*s*/); - Double_t GetCol0(Int_t p); - - // Translation from MCM to Pad and vice versa (these functions are now in feeParam) - //virtual Int_t GetPadRowFromMCM(Int_t irob, Int_t imcm) const; - //virtual Int_t GetPadColFromADC(Int_t irob, Int_t imcm, Int_t iadc) const; - //virtual Int_t GetMCMfromPad(Int_t irow, Int_t icol) const; - //virtual Int_t GetROBfromPad(Int_t irow, Int_t icol) const; - //virtual Int_t GetRobSide(Int_t irob) const; - //virtual Int_t GetColSide(Int_t icol) const; - - static Float_t GetTime0(Int_t p) { return fgkTime0[p]; } - - Char_t GetSMstatus(Int_t sm) const { return fSMstatus[sm]; } - Float_t GetChamberWidth(Int_t p) const { return fCwidth[p]; } - Float_t GetChamberLength(Int_t p, Int_t c) const { return fClength[p][c]; } + AliTRDpadPlane *CreatePadPlane(Int_t layer, Int_t stack); + AliTRDpadPlane *GetPadPlane(Int_t layer, Int_t stack); + AliTRDpadPlane *GetPadPlane(Int_t det) { return GetPadPlane(GetLayer(det) + ,GetStack(det)); } + Int_t GetRowMax(Int_t layer, Int_t stack, Int_t /*sector*/); + Int_t GetColMax(Int_t layer); + Double_t GetRow0(Int_t layer, Int_t stack, Int_t /*sector*/); + Double_t GetCol0(Int_t layer); + + static Float_t GetTime0(Int_t layer) { return fgkTime0[layer]; } + + Char_t GetSMstatus(Int_t sm) const { return fSMstatus[sm]; } + Float_t GetChamberWidth(Int_t layer) const { return fCwidth[layer] ; } + Float_t GetChamberLength(Int_t layer, Int_t stack) const { return fClength[layer][stack]; } virtual void GetGlobal(const AliRecPoint*, TVector3&, TMatrixF& ) const { }; virtual void GetGlobal(const AliRecPoint*, TVector3& ) const { }; - static Double_t GetAlpha() { return 2.0 - * 3.14159265358979324 - / fgkNsect; } - - static Int_t Nsect() { return fgkNsect; } - static Int_t Nplan() { return fgkNplan; } - static Int_t Ncham() { return fgkNcham; } - static Int_t Ndet() { return fgkNdet; } - - static Float_t Cheight() { return fgkCH; } - static Float_t Cspace() { return fgkVspace; } - static Float_t CraHght() { return fgkCraH; } - static Float_t CdrHght() { return fgkCdrH; } - static Float_t CamHght() { return fgkCamH; } - static Float_t CroHght() { return fgkCroH; } - static Float_t CroWid() { return fgkCroW; } - static Float_t MyThick() { return fgkMyThick; } - static Float_t DrThick() { return fgkDrThick; } - static Float_t AmThick() { return fgkAmThick; } - static Float_t DrZpos() { return fgkDrZpos; } - static Float_t RpadW() { return fgkRpadW; } - static Float_t CpadW() { return fgkCpadW; } - - static Float_t Cwidcha() { return (fgkSwidth2 - fgkSwidth1) - / fgkSheight - * (fgkCH + fgkVspace); } - - static Int_t MCMmax() { return fgkMCMmax; } - static Int_t MCMrow() { return fgkMCMrow; } - static Int_t ROBmaxC0() { return fgkROBmaxC0; } - static Int_t ROBmaxC1() { return fgkROBmaxC1; } - static Int_t ADCmax() { return fgkADCmax; } - static Int_t TBmax() { return fgkTBmax; } - static Int_t Padmax() { return fgkPadmax; } - static Int_t Colmax() { return fgkColmax; } - static Int_t RowmaxC0() { return fgkRowmaxC0; } - static Int_t RowmaxC1() { return fgkRowmaxC1; } + static Double_t GetAlpha() { return 2.0 + * 3.14159265358979324 + / fgkNsector; } + + static Int_t Nsector() { return fgkNsector; } + static Int_t Nlayer() { return fgkNlayer; } + static Int_t Nstack() { return fgkNstack; } + static Int_t Ndet() { return fgkNdet; } + + static Float_t Cheight() { return fgkCH; } + static Float_t Cspace() { return fgkVspace; } + static Float_t CraHght() { return fgkCraH; } + static Float_t CdrHght() { return fgkCdrH; } + static Float_t CamHght() { return fgkCamH; } + static Float_t CroHght() { return fgkCroH; } + static Float_t CroWid() { return fgkCroW; } + static Float_t MyThick() { return fgkMyThick; } + static Float_t DrThick() { return fgkDrThick; } + static Float_t AmThick() { return fgkAmThick; } + static Float_t DrZpos() { return fgkDrZpos; } + static Float_t RpadW() { return fgkRpadW; } + static Float_t CpadW() { return fgkCpadW; } + + static Float_t Cwidcha() { return (fgkSwidth2 - fgkSwidth1) + / fgkSheight + * (fgkCH + fgkVspace); } + + static Int_t MCMmax() { return fgkMCMmax; } + static Int_t MCMrow() { return fgkMCMrow; } + static Int_t ROBmaxC0() { return fgkROBmaxC0; } + static Int_t ROBmaxC1() { return fgkROBmaxC1; } + static Int_t ADCmax() { return fgkADCmax; } + static Int_t TBmax() { return fgkTBmax; } + static Int_t Padmax() { return fgkPadmax; } + static Int_t Colmax() { return fgkColmax; } + static Int_t RowmaxC0() { return fgkRowmaxC0; } + static Int_t RowmaxC1() { return fgkRowmaxC1; } protected: - static const Int_t fgkNsect; // Number of sectors in the full detector (18) - static const Int_t fgkNplan; // Number of planes of the TRD (6) - static const Int_t fgkNcham; // Number of chambers in z-direction (5) + static const Int_t fgkNsector; // Number of sectors in the full detector (18) + static const Int_t fgkNlayer; // Number of layers of the TRD (6) + static const Int_t fgkNstack; // Number of stacks in z-direction (5) static const Int_t fgkNdet; // Total number of detectors (18 * 6 * 5 = 540) static const Float_t fgkTlength; // Length of the TRD-volume in spaceframe (BTRD) @@ -203,18 +195,18 @@ class AliTRDgeometry : public AliGeometry { static const Int_t fgkRowmaxC0; // Maximum number of Rows per C0 chamber static const Int_t fgkRowmaxC1; // Maximum number of Rows per C1 chamber - Char_t fSMstatus[kNsect]; // Super module status byte + Char_t fSMstatus[kNsector]; // Super module status byte - Float_t fCwidth[kNplan]; // Outer widths of the chambers - Float_t fClength[kNplan][kNcham]; // Outer lengths of the chambers + Float_t fCwidth[kNlayer]; // Outer widths of the chambers + Float_t fClength[kNlayer][kNstack]; // Outer lengths of the chambers - Float_t fRotB11[kNsect]; // Matrix elements for the backward rotation - Float_t fRotB12[kNsect]; // Matrix elements for the backward rotation - Float_t fRotB21[kNsect]; // Matrix elements for the backward rotation - Float_t fRotB22[kNsect]; // Matrix elements for the backward rotation + Float_t fRotB11[kNsector]; // Matrix elements for the backward rotation + Float_t fRotB12[kNsector]; // Matrix elements for the backward rotation + Float_t fRotB21[kNsector]; // Matrix elements for the backward rotation + Float_t fRotB22[kNsector]; // Matrix elements for the backward rotation static const Double_t fgkTime0Base; // Base value for calculation of Time-position of pad 0 - static const Float_t fgkTime0[kNplan]; // Time-position of pad 0 + static const Float_t fgkTime0[kNlayer]; // Time-position of pad 0 Float_t fChamberUAorig[3*kNdets][3]; // Volumes origin in Float_t fChamberUDorig[3*kNdets][3]; // the chamber @@ -229,7 +221,7 @@ class AliTRDgeometry : public AliGeometry { TObjArray *fClusterMatrixArray; //! Transformation matrices loc. cluster to tracking cs TObjArray *fPadPlaneArray; //! Array of pad plane objects - ClassDef(AliTRDgeometry,16) // TRD geometry class + ClassDef(AliTRDgeometry,17) // TRD geometry class }; diff --git a/TRD/AliTRDgtuTrack.cxx b/TRD/AliTRDgtuTrack.cxx index 3b7335bfdcc..99fcdcd64ce 100644 --- a/TRD/AliTRDgtuTrack.cxx +++ b/TRD/AliTRDgtuTrack.cxx @@ -233,8 +233,8 @@ void AliTRDgtuTrack::Track(Float_t xpl, Float_t field) fNclusters = 0; fNplanes = 0; fNtracklets = GetNtracklets(); - Int_t inDetector[kNplan]; - for (i = 0; i < kNplan; i++) { + Int_t inDetector[kNlayer]; + for (i = 0; i < kNlayer; i++) { inDetector[i] = -1; } diff --git a/TRD/AliTRDgtuTrack.h b/TRD/AliTRDgtuTrack.h index 551e7e466e3..115e6a34909 100644 --- a/TRD/AliTRDgtuTrack.h +++ b/TRD/AliTRDgtuTrack.h @@ -19,7 +19,7 @@ class AliTRDgtuTrack : public TObject { public: - enum { kNmaxTrk = 12, kNplan = 6 }; + enum { kNmaxTrk = 12, kNlayer = 6 }; AliTRDgtuTrack(); AliTRDgtuTrack(const AliTRDgtuTrack &t); diff --git a/TRD/AliTRDmcmSim.cxx b/TRD/AliTRDmcmSim.cxx index 163a1c17f38..71d265c5b00 100644 --- a/TRD/AliTRDmcmSim.cxx +++ b/TRD/AliTRDmcmSim.cxx @@ -272,8 +272,8 @@ void AliTRDmcmSim::Init( Int_t chaId, Int_t robPos, Int_t mcmPos ) fGeo = new AliTRDgeometry(); fChaId = chaId; fSector = fGeo->GetSector( fChaId ); - fStack = fGeo->GetChamber( fChaId ); - fLayer = fGeo->GetPlane( fChaId ); + fStack = fGeo->GetStack( fChaId ); + fLayer = fGeo->GetLayer( fChaId ); fRobPos = robPos; fMcmPos = mcmPos; fNADC = fFeeParam->GetNadcMcm(); @@ -349,17 +349,17 @@ Bool_t AliTRDmcmSim::CheckInitialized() void AliTRDmcmSim::SetPosLUT() { - Double_t iHi = (Double_t)fCal->GetPRFhi(); - Double_t iLo = (Double_t)fCal->GetPRFlo(); - Int_t nBin = fCal->GetPRFbin(); - Int_t iOff = fLayer * nBin; - Int_t kNplan = fGeo->Nplan(); + Double_t iHi = (Double_t)fCal->GetPRFhi(); + Double_t iLo = (Double_t)fCal->GetPRFlo(); + Int_t nBin = fCal->GetPRFbin(); + Int_t iOff = fLayer * nBin; + Int_t kNlayer = fGeo->Nlayer(); - Float_t *sPRFsmp = new Float_t[nBin*kNplan]; + Float_t *sPRFsmp = new Float_t[nBin*kNlayer]; Double_t *sPRFlayer = new Double_t[nBin]; - for(Int_t i = 0; iGetSampledPRF()[i]); sPRFsmp[i] = fCal->GetSampledPRF()[i]; diff --git a/TRD/AliTRDmcmTracklet.cxx b/TRD/AliTRDmcmTracklet.cxx index e895ebcfe0c..90f7648a10b 100644 --- a/TRD/AliTRDmcmTracklet.cxx +++ b/TRD/AliTRDmcmTracklet.cxx @@ -297,12 +297,12 @@ void AliTRDmcmTracklet::MakeTrackletGraph(AliTRDgeometry *geo, Float_t field) return; } - Int_t iplan, icham; + Int_t ilayer, istack; - iplan = geo->GetPlane(fDetector); - icham = geo->GetChamber(fDetector); + ilayer = geo->GetLayer(fDetector); + istack = geo->GetStack(fDetector); - AliTRDpadPlane *padPlane = fGeo->GetPadPlane(iplan,icham); + AliTRDpadPlane *padPlane = fGeo->GetPadPlane(ilayer,istack); Float_t samplFreq = AliTRDCommonParam::Instance()->GetSamplingFrequency(); @@ -325,7 +325,7 @@ void AliTRDmcmTracklet::MakeTrackletGraph(AliTRDgeometry *geo, Float_t field) if (amp[0] < 0.0 || amp[1] < 0.0 || amp[2] < 0.0) continue; - ypos = GetClusY(amp,iplan); + ypos = GetClusY(amp,ilayer); colSize = padPlane->GetColSize(col); vDrift = calibration->GetVdrift(fDetector,col,fRow); @@ -337,16 +337,16 @@ void AliTRDmcmTracklet::MakeTrackletGraph(AliTRDgeometry *geo, Float_t field) lorentzAngle = TMath::ATan(omegaTau)*180.0/TMath::Pi(); xpos = (time+0.5) * timeBinSize; - xpos = geo->GetTime0(iplan) - xpos; + xpos = geo->GetTime0(ilayer) - xpos; ypos = padPlane->GetColPos(col) - (ypos + 0.5) * colSize; // ExB correction - xzero = geo->GetTime0(iplan); + xzero = geo->GetTime0(ilayer); ypos = ypos + (xpos-xzero) * omegaTau; // tilted pads correction - thetaSlope = - padPlane->GetRowPos(fRow)/geo->GetTime0(iplan); + thetaSlope = - padPlane->GetRowPos(fRow)/geo->GetTime0(ilayer); tiltingAngle = padPlane->GetTiltingAngle()/180.0*TMath::Pi(); ypos = ypos - (xpos-xzero) * thetaSlope * TMath::Sin(tiltingAngle); @@ -357,7 +357,7 @@ void AliTRDmcmTracklet::MakeTrackletGraph(AliTRDgeometry *geo, Float_t field) fGPos->Set(npg); - fTime0 = geo->GetTime0(iplan) - AliTRDgeometry::CdrHght() - 0.5*AliTRDgeometry::CamHght(); + fTime0 = geo->GetTime0(ilayer) - AliTRDgeometry::CdrHght() - 0.5*AliTRDgeometry::CamHght(); fRowz = padPlane->GetRowPos(fRow) - padPlane->GetRowSize(fRow)/2.0; Double_t xMin = 0; @@ -425,7 +425,7 @@ void AliTRDmcmTracklet::MakeClusAmpGraph() } //_____________________________________________________________________________ -Float_t AliTRDmcmTracklet::GetClusY(Float_t *adc, Int_t pla) const +Float_t AliTRDmcmTracklet::GetClusY(Float_t *adc, Int_t layer) const { // // Cluster position in the phi direction in pad units (relative to the pad border) @@ -443,7 +443,7 @@ Float_t AliTRDmcmTracklet::GetClusY(Float_t *adc, Int_t pla) const Float_t sigma = 0.0; - switch(pla) { + switch(layer) { case 0: sigma = 0.515; break; case 1: @@ -457,7 +457,7 @@ Float_t AliTRDmcmTracklet::GetClusY(Float_t *adc, Int_t pla) const case 5: sigma = 0.463; break; default: - AliError("Wrong plane number."); + AliError("Wrong layer number."); return 0.0; } diff --git a/TRD/AliTRDmodule.cxx b/TRD/AliTRDmodule.cxx index b2ed6c0b896..8989c7866b3 100644 --- a/TRD/AliTRDmodule.cxx +++ b/TRD/AliTRDmodule.cxx @@ -61,11 +61,11 @@ AliTRDmodule::AliTRDmodule() gAlice->Field(x,b); // b[] is in kilo Gauss fField = b[2] * 0.1; // Tesla - for (Int_t iPlan = 0; iPlan < AliTRDgeometry::Nplan(); iPlan++) { + for (Int_t iLayer = 0; iLayer < AliTRDgeometry::Nlayer(); iLayer++) { for (Int_t i = 0; i < kNsubZchan; i++) { - fZnchan[iPlan][i] = 0; + fZnchan[iLayer][i] = 0; for (Int_t j = 0; j < kNmaxZchan; j++) { - fZtrkid[iPlan][j][i] = -1; + fZtrkid[iLayer][j][i] = -1; } } } @@ -88,11 +88,11 @@ AliTRDmodule::AliTRDmodule(const AliTRDmodule &m) // AliTRDmodule copy constructor // - for (Int_t iPlan = 0; iPlan < AliTRDgeometry::Nplan(); iPlan++) { + for (Int_t iLayer = 0; iLayer < AliTRDgeometry::Nlayer(); iLayer++) { for (Int_t i = 0; i < kNsubZchan; i++) { - ((AliTRDmodule &) m).fZnchan[iPlan][i] = 0; + ((AliTRDmodule &) m).fZnchan[iLayer][i] = 0; for (Int_t j = 0; j < kNmaxZchan; j++) { - ((AliTRDmodule &) m).fZtrkid[iPlan][j][i] = -1; + ((AliTRDmodule &) m).fZtrkid[iLayer][j][i] = -1; } } } @@ -136,11 +136,11 @@ void AliTRDmodule::Copy(TObject &m) const ((AliTRDmodule &) m).fLTUtrk = NULL; ((AliTRDmodule &) m).fGTUtrk = NULL; - for (Int_t iPlan = 0; iPlan < AliTRDgeometry::Nplan(); iPlan++) { + for (Int_t iLayer = 0; iLayer < AliTRDgeometry::Nlayer(); iLayer++) { for (Int_t i = 0; i < kNsubZchan; i++) { - ((AliTRDmodule &) m).fZnchan[iPlan][i] = 0; + ((AliTRDmodule &) m).fZnchan[iLayer][i] = 0; for (Int_t j = 0; j < kNmaxZchan; j++) { - ((AliTRDmodule &) m).fZtrkid[iPlan][j][i] = -1; + ((AliTRDmodule &) m).fZtrkid[iLayer][j][i] = -1; } } } @@ -356,11 +356,11 @@ void AliTRDmodule::InitZLUT() // Initialize the pad row sorting look-up-table // - for (Int_t iPlan = 0; iPlan < AliTRDgeometry::Nplan(); iPlan++) { + for (Int_t iLayer = 0; iLayer < AliTRDgeometry::Nlayer(); iLayer++) { for (Int_t i = 0; i < kNsubZchan; i++) { - fZnchan[iPlan][i] = 0; + fZnchan[iLayer][i] = 0; for (Int_t j = 0; j < kNmaxZchan; j++) { - fZtrkid[iPlan][j][i] = -1; + fZtrkid[iLayer][j][i] = -1; } } } diff --git a/TRD/AliTRDpadPlane.cxx b/TRD/AliTRDpadPlane.cxx index 2851dd3a817..a34d0aac9ac 100644 --- a/TRD/AliTRDpadPlane.cxx +++ b/TRD/AliTRDpadPlane.cxx @@ -38,8 +38,8 @@ ClassImp(AliTRDpadPlane) //_____________________________________________________________________________ AliTRDpadPlane::AliTRDpadPlane() :TObject() - ,fPla(0) - ,fCha(0) + ,fLayer(0) + ,fStack(0) ,fLength(0) ,fWidth(0) ,fLengthRim(0) @@ -65,10 +65,10 @@ AliTRDpadPlane::AliTRDpadPlane() } //_____________________________________________________________________________ -AliTRDpadPlane::AliTRDpadPlane(Int_t plane, Int_t chamber) +AliTRDpadPlane::AliTRDpadPlane(Int_t layer, Int_t stack) :TObject() - ,fPla(plane) - ,fCha(chamber) + ,fLayer(layer) + ,fStack(stack) ,fLength(0) ,fWidth(0) ,fLengthRim(0) @@ -96,8 +96,8 @@ AliTRDpadPlane::AliTRDpadPlane(Int_t plane, Int_t chamber) //_____________________________________________________________________________ AliTRDpadPlane::AliTRDpadPlane(const AliTRDpadPlane &p) :TObject(p) - ,fPla(p.fPla) - ,fCha(p.fCha) + ,fLayer(p.fLayer) + ,fStack(p.fStack) ,fLength(p.fLength) ,fWidth(p.fWidth) ,fLengthRim(p.fLengthRim) @@ -183,8 +183,8 @@ void AliTRDpadPlane::Copy(TObject &p) const Int_t iBin = 0; - ((AliTRDpadPlane &) p).fPla = fPla; - ((AliTRDpadPlane &) p).fCha = fCha; + ((AliTRDpadPlane &) p).fLayer = fLayer; + ((AliTRDpadPlane &) p).fStack = fStack; ((AliTRDpadPlane &) p).fLength = fLength; ((AliTRDpadPlane &) p).fWidth = fWidth; diff --git a/TRD/AliTRDpadPlane.h b/TRD/AliTRDpadPlane.h index fa7ee75e1a3..302d2ba94fb 100644 --- a/TRD/AliTRDpadPlane.h +++ b/TRD/AliTRDpadPlane.h @@ -25,14 +25,14 @@ class AliTRDpadPlane : public TObject { public: AliTRDpadPlane(); - AliTRDpadPlane(Int_t plane, Int_t chamber); + AliTRDpadPlane(Int_t layer, Int_t stack); AliTRDpadPlane(const AliTRDpadPlane &p); virtual ~AliTRDpadPlane(); AliTRDpadPlane &operator=(const AliTRDpadPlane &p); virtual void Copy(TObject &p) const; - void SetPlane(Int_t p) { fPla = p; }; - void SetChamber(Int_t c) { fCha = c; }; + void SetLayer(Int_t l) { fLayer = l; }; + void SetStack(Int_t s) { fStack = s; }; void SetRowSpacing(Double_t s) { fRowSpacing = s; }; void SetColSpacing(Double_t s) { fColSpacing = s; }; void SetLengthRim(Double_t l) { fLengthRim = l; }; @@ -118,8 +118,8 @@ class AliTRDpadPlane : public TObject { protected: - Int_t fPla; // Plane number - Int_t fCha; // Chamber number + Int_t fLayer; // Layer number + Int_t fStack; // Stack number Double_t fLength; // Length of pad plane in z-direction (row) Double_t fWidth; // Width of pad plane in rphi-direction (col) @@ -147,7 +147,7 @@ class AliTRDpadPlane : public TObject { Double_t fPadRowSMOffset; // To be added to translate local ROC system to local SM system - ClassDef(AliTRDpadPlane,4) // TRD ROC pad plane + ClassDef(AliTRDpadPlane,5) // TRD ROC pad plane }; diff --git a/TRD/AliTRDpidESD.cxx b/TRD/AliTRDpidESD.cxx index cef2adcdf62..dcb38c5f87c 100644 --- a/TRD/AliTRDpidESD.cxx +++ b/TRD/AliTRDpidESD.cxx @@ -165,18 +165,18 @@ Int_t AliTRDpidESD::MakePID(AliESDEvent *event) for (Int_t iSpecies = 0; iSpecies < AliPID::kSPECIES; iSpecies++) p[iSpecies] = 1./AliPID::kSPECIES; - for (Int_t iPlan = 0; iPlan < AliTRDgeometry::kNplan; iPlan++) { + for (Int_t iLayer = 0; iLayer < AliTRDgeometry::kNlayer; iLayer++) { // read data for track segment for(int iSlice=0; iSliceGetTRDslice(iPlan, iSlice); - dEdx = t->GetTRDslice(iPlan, -1); - timebin = t->GetTRDTimBin(iPlan); + dedx[iSlice] = t->GetTRDslice(iLayer, iSlice); + dEdx = t->GetTRDslice(iLayer, -1); + timebin = t->GetTRDTimBin(iLayer); // check data if ((dEdx <= 0.) || (timebin <= -1.)) continue; // retrive kinematic info for this track segment - if(!RecalculateTrackSegmentKine(t, iPlan, mom, length)){ + if(!RecalculateTrackSegmentKine(t, iLayer, mom, length)){ // information is not fully reliable especialy for length // estimation. To be used in the future. } @@ -186,7 +186,7 @@ Int_t AliTRDpidESD::MakePID(AliESDEvent *event) // Get the probabilities for the different particle species for (Int_t iSpecies = 0; iSpecies < AliPID::kSPECIES; iSpecies++) { - p[iSpecies] *= pd->GetProbability(iSpecies, mom, dedx, length, iPlan); + p[iSpecies] *= pd->GetProbability(iSpecies, mom, dedx, length, iLayer); //p[iSpecies] *= pd->GetProbabilityT(iSpecies, mom, timebin); } } @@ -235,7 +235,7 @@ Bool_t AliTRDpidESD::CheckTrack(AliESDtrack *t) //_____________________________________________________________________________ Bool_t AliTRDpidESD::RecalculateTrackSegmentKine(AliESDtrack *esd - , Int_t plan + , Int_t layer , Float_t &mom , Float_t &length) { @@ -249,7 +249,7 @@ Bool_t AliTRDpidESD::RecalculateTrackSegmentKine(AliESDtrack *esd const Float_t kAmHalfWidth = AliTRDgeometry::AmThick() / 2.; const Float_t kDrWidth = AliTRDgeometry::DrThick(); - const Float_t kTime0 = AliTRDgeometry::GetTime0(plan); + const Float_t kTime0 = AliTRDgeometry::GetTime0(layer); // set initial length value to chamber height length = 2 * kAmHalfWidth + kDrWidth; diff --git a/TRD/AliTRDpropagationLayer.cxx b/TRD/AliTRDpropagationLayer.cxx index 93d088f2599..cd229cfd2fd 100644 --- a/TRD/AliTRDpropagationLayer.cxx +++ b/TRD/AliTRDpropagationLayer.cxx @@ -226,10 +226,10 @@ void AliTRDpropagationLayer::SetZ(Double_t *center, Double_t *w, Double_t *wsens // Set centers and the width of sectors // - for (Int_t icham = 0; icham < AliTRDgeometry::kNcham; icham++) { - fZc[icham] = center[icham]; - fZmax[icham] = w[icham]; - fZmaxSensitive[icham] = wsensitive[icham]; + for (Int_t istack = 0; istack < AliTRDgeometry::kNstack; istack++) { + fZc[istack] = center[istack]; + fZmax[istack] = w[istack]; + fZmaxSensitive[istack] = wsensitive[istack]; } } @@ -243,9 +243,9 @@ void AliTRDpropagationLayer::SetHoles(Bool_t *holes) fHole = kFALSE; - for (Int_t icham = 0; icham < AliTRDgeometry::kNcham; icham++) { - fIsHole[icham] = holes[icham]; - if (holes[icham]) { + for (Int_t istack = 0; istack < AliTRDgeometry::kNstack; istack++) { + fIsHole[istack] = holes[istack]; + if (holes[istack]) { fHole = kTRUE; } } diff --git a/TRD/AliTRDrawData.cxx b/TRD/AliTRDrawData.cxx index b2294ede15f..d8d57f49259 100644 --- a/TRD/AliTRDrawData.cxx +++ b/TRD/AliTRDrawData.cxx @@ -157,7 +157,7 @@ Bool_t AliTRDrawData::Digits2Raw(AliTRDdigitsManager *digitsManager) Bool_t newEvent = kFALSE; // only for correct readout tree // sect is same as iDDL, so I use only sect here. - for (Int_t sect = 0; sect < fGeo->Nsect(); sect++) { + for (Int_t sect = 0; sect < fGeo->Nsector(); sect++) { char name[1024]; sprintf(name,"TRD_%d.ddl",sect + AliTRDRawStream::kDDLOffset); @@ -175,25 +175,25 @@ Bool_t AliTRDrawData::Digits2Raw(AliTRDdigitsManager *digitsManager) // GTU common data header (5x4 bytes per super module, shows link mask) - for( Int_t cham = 0; cham < fGeo->Ncham(); cham++ ) { + for( Int_t stack = 0; stack < fGeo->Nstack(); stack++ ) { UInt_t gtuCdh = (UInt_t)(0xe << 28); - for( Int_t plan = 0; plan < fGeo->Nplan(); plan++) { - Int_t iDet = fGeo->GetDetector(plan, cham, sect); + for( Int_t layer = 0; layer < fGeo->Nlayer(); layer++) { + Int_t iDet = fGeo->GetDetector(layer, stack, sect); // If chamber status is ok, we assume that the optical link is also OK. // This is shown in the GTU link mask. if ( AliTRDcalibDB::Instance()->GetChamberStatus(iDet) ) - gtuCdh = gtuCdh | (3 << (2*plan)); + gtuCdh = gtuCdh | (3 << (2*layer)); } of->WriteBuffer((char *) (& gtuCdh), sizeof(gtuCdh)); npayloadbyte += 4; } // Prepare chamber data - for( Int_t cham = 0; cham < fGeo->Ncham(); cham++) { - for( Int_t plan = 0; plan < fGeo->Nplan(); plan++) { + for( Int_t stack = 0; stack < fGeo->Nstack(); stack++) { + for( Int_t layer = 0; layer < fGeo->Nlayer(); layer++) { - Int_t iDet = fGeo->GetDetector(plan,cham,sect); + Int_t iDet = fGeo->GetDetector(layer,stack,sect); if (iDet == 0) newEvent = kTRUE; // it is expected that each event has at least one tracklet; this is only needed for correct readout tree // Get the digits array AliTRDdataArrayS *digits = (AliTRDdataArrayS *) digitsManager->GetDigits(iDet); @@ -275,11 +275,11 @@ Int_t AliTRDrawData::ProduceHcDataV1andV2(AliTRDdataArrayS *digits, Int_t side Int_t nw = 0; // Number of written words Int_t of = 0; // Number of overflowed words - Int_t plan = fGeo->GetPlane( det ); // Plane - Int_t cham = fGeo->GetChamber( det ); // Chamber + Int_t layer = fGeo->GetLayer( det ); // Layer + Int_t stack = fGeo->GetStack( det ); // Stack Int_t sect = fGeo->GetSector( det ); // Sector (=iDDL) - Int_t nRow = fGeo->GetRowMax( plan, cham, sect ); - Int_t nCol = fGeo->GetColMax( plan ); + Int_t nRow = fGeo->GetRowMax( layer, stack, sect ); + Int_t nCol = fGeo->GetColMax( layer ); const Int_t kNTBin = AliTRDcalibDB::Instance()->GetNumberOfTimeBins(); Int_t kCtype = 0; // Chamber type (0:C0, 1:C1) Int_t iEv = 0xA; // Event ID. Now fixed to 10, how do I get event id? @@ -297,8 +297,8 @@ Int_t AliTRDrawData::ProduceHcDataV1andV2(AliTRDdataArrayS *digits, Int_t side return 0; } - AliDebug(1,Form("Producing raw data for sect=%d plan=%d cham=%d side=%d" - ,sect,plan,cham,side)); + AliDebug(1,Form("Producing raw data for sect=%d layer=%d stack=%d side=%d" + ,sect,layer,stack,side)); // Tracklet should be processed here but not implemented yet @@ -314,7 +314,7 @@ Int_t AliTRDrawData::ProduceHcDataV1andV2(AliTRDdataArrayS *digits, Int_t side if ( rv == 1 ) { // Now it is the same version as used in SM-I commissioning. Int_t dcs = det+100; // DCS Serial (in simulation, it is meaningless - x = (dcs<<20) | (sect<<15) | (plan<<12) | (cham<<9) | (side<<8) | 1; + x = (dcs<<20) | (sect<<15) | (layer<<12) | (stack<<9) | (side<<8) | 1; if (nw < maxSize) { buf[nw++] = x; } @@ -326,7 +326,7 @@ Int_t AliTRDrawData::ProduceHcDataV1andV2(AliTRDdataArrayS *digits, Int_t side // h[0] (there are 3 HC header) Int_t minorv = 0; // The minor version number Int_t add = 2; // The number of additional header words to follow - x = (1<<31) | (rv<<24) | (minorv<<17) | (add<<14) | (sect<<9) | (plan<<6) | (cham<<3) | (side<<2) | 1; + x = (1<<31) | (rv<<24) | (minorv<<17) | (add<<14) | (sect<<9) | (layer<<6) | (stack<<3) | (side<<2) | 1; if (nw < maxSize) { buf[nw++] = x; } @@ -446,11 +446,11 @@ Int_t AliTRDrawData::ProduceHcDataV3(AliTRDdataArrayS *digits, Int_t side , Int_ Int_t nw = 0; // Number of written words Int_t of = 0; // Number of overflowed words - Int_t plan = fGeo->GetPlane( det ); // Plane - Int_t cham = fGeo->GetChamber( det ); // Chamber + Int_t layer = fGeo->GetLayer( det ); // Layer + Int_t stack = fGeo->GetStack( det ); // Stack Int_t sect = fGeo->GetSector( det ); // Sector (=iDDL) - Int_t nRow = fGeo->GetRowMax( plan, cham, sect ); - Int_t nCol = fGeo->GetColMax( plan ); + Int_t nRow = fGeo->GetRowMax( layer, stack, sect ); + Int_t nCol = fGeo->GetColMax( layer ); const Int_t kNTBin = AliTRDcalibDB::Instance()->GetNumberOfTimeBins(); Int_t kCtype = 0; // Chamber type (0:C0, 1:C1) //Int_t iEv = 0xA; // Event ID. Now fixed to 10, how do I get event id? @@ -470,8 +470,8 @@ Int_t AliTRDrawData::ProduceHcDataV3(AliTRDdataArrayS *digits, Int_t side , Int_ return 0; } - AliDebug(1,Form("Producing raw data for sect=%d plan=%d cham=%d side=%d" - ,sect,plan,cham,side)); + AliDebug(1,Form("Producing raw data for sect=%d layer=%d stack=%d side=%d" + ,sect,layer,stack,side)); AliTRDmcmSim** mcm = new AliTRDmcmSim*[(kCtype + 3)*(fGeo->MCMmax())]; @@ -656,8 +656,8 @@ AliTRDdigitsManager *AliTRDrawData::Raw2Digits(AliRawReader *rawReader) //_____________________________________________________________________________ void AliTRDrawData::WriteIntermediateWords(UInt_t* buf, Int_t& nw, Int_t& of, const Int_t& maxSize, const Int_t& det, const Int_t& side) { - Int_t plan = fGeo->GetPlane( det ); // Plane - Int_t cham = fGeo->GetChamber( det ); // Chamber + Int_t layer = fGeo->GetLayer( det ); // Layer + Int_t stack = fGeo->GetStack( det ); // Stack Int_t sect = fGeo->GetSector( det ); // Sector (=iDDL) Int_t rv = fFee->GetRAWversion(); const Int_t kNTBin = AliTRDcalibDB::Instance()->GetNumberOfTimeBins(); @@ -675,7 +675,7 @@ void AliTRDrawData::WriteIntermediateWords(UInt_t* buf, Int_t& nw, Int_t& of, co // h[0] (there are 3 HC header) Int_t minorv = 0; // The minor version number Int_t add = 2; // The number of additional header words to follow - x = (1<<31) | (rv<<24) | (minorv<<17) | (add<<14) | (sect<<9) | (plan<<6) | (cham<<3) | (side<<2) | 1; + x = (1<<31) | (rv<<24) | (minorv<<17) | (add<<14) | (sect<<9) | (layer<<6) | (stack<<3) | (side<<2) | 1; if (nw < maxSize) { buf[nw++] = x; } diff --git a/TRD/AliTRDrawStreamTB.cxx b/TRD/AliTRDrawStreamTB.cxx index cb373ec85de..7c45198cc1d 100644 --- a/TRD/AliTRDrawStreamTB.cxx +++ b/TRD/AliTRDrawStreamTB.cxx @@ -1511,10 +1511,10 @@ AliTRDrawStreamTB::IsHCheaderOK() } } - if (fHC->fLayer < 0 || fHC->fLayer >= AliTRDgeometry::kNplan) + if (fHC->fLayer < 0 || fHC->fLayer >= AliTRDgeometry::kNlayer) { - if (fgWarnError) AliWarning(Form("Wrong plane(layer) %d", fHC->fLayer)); - if (fRawReader) fRawReader->AddMajorErrorLog(kHCHeaderWrongLayer, "Wrong Plane"); + if (fgWarnError) AliWarning(Form("Wrong layer %d", fHC->fLayer)); + if (fRawReader) fRawReader->AddMajorErrorLog(kHCHeaderWrongLayer, "Wrong layer"); return kFALSE; } @@ -1523,9 +1523,9 @@ AliTRDrawStreamTB::IsHCheaderOK() if ((fHC->fLayer * 2 != fStackLinkNumber) && (fHC->fLayer * 2 != fStackLinkNumber - 1)) { - if (fgWarnError) AliWarning(Form("Missmatch: plane(layer) in HCheader %d HW-Link %d | %s", + if (fgWarnError) AliWarning(Form("Missmatch: layer in HCheader %d HW-Link %d | %s", fHC->fLayer, fStackLinkNumber, DumpStackInfo(fStack))); - if (fRawReader) fRawReader->AddMajorErrorLog(kHCHeaderWrongLayer, "Plane-Link missmatch"); + if (fRawReader) fRawReader->AddMajorErrorLog(kHCHeaderWrongLayer, "Layer-Link missmatch"); fStackLinkNumber = -1; return kFALSE; } @@ -1550,7 +1550,7 @@ AliTRDrawStreamTB::IsHCheaderOK() // SLOW GEOM // this check fails - raw data inconsistent with geometry? if (fHC->fSM != fGeometry->GetSector(fHC->fDET) - || fHC->fSM <0 || fHC->fSM >= AliTRDgeometry::kNsect) + || fHC->fSM <0 || fHC->fSM >= AliTRDgeometry::kNsector) { if (fgWarnError) AliWarning(Form("Wrong SM(sector) %d (Geometry says: %d) Stack=%d Layer=%d Det=%d", fHC->fSM, fGeometry->GetSector(fHC->fDET), @@ -1582,7 +1582,7 @@ AliTRDrawStreamTB::IsHCheaderOK() return kFALSE; } // extra - not needed - // if (fHC->fSM <0 || fHC->fSM >= AliTRDgeometry::kNsect) + // if (fHC->fSM <0 || fHC->fSM >= AliTRDgeometry::kNsector) // { // if (fgWarnError) AliWarning(Form("Wrong SM(sector) %d (Geometry says: %d) Stack=%d Layer=%d", // fHC->fSM, fGeometry->GetDetectorSec(fHC->fLayer, fHC->fStack), diff --git a/TRD/AliTRDtrack.cxx b/TRD/AliTRDtrack.cxx index 3730a26a453..9556d9bc6bf 100644 --- a/TRD/AliTRDtrack.cxx +++ b/TRD/AliTRDtrack.cxx @@ -517,7 +517,7 @@ void AliTRDtrack::CookdEdxTimBin(const Int_t/* tid*/) if (!cluster) continue; // Read info from current cluster - plane = AliTRDgeometry::GetPlane(cluster->GetDetector()); + plane = AliTRDgeometry::GetLayer(cluster->GetDetector()); if (plane < 0 || plane >= kNplane) { AliError(Form("Wrong plane %d", plane)); continue; @@ -586,7 +586,7 @@ void AliTRDtrack::CookdEdxNN(Float_t *dedx) } // Read info from current cluster - plane = AliTRDgeometry::GetPlane(cluster->GetDetector()); + plane = AliTRDgeometry::GetLayer(cluster->GetDetector()); if (plane < 0 || plane >= kNplane) { AliError(Form("Wrong plane %d",plane)); continue; @@ -697,7 +697,7 @@ Bool_t AliTRDtrack::CookPID(Int_t &pidQuality) // Skip tracks which have no TRD signal at all if (fdEdx == 0.) return kFALSE; - for (Int_t iPlane = 0; iPlane < AliTRDgeometry::kNplan; iPlane++) { + for (Int_t iPlane = 0; iPlane < AliTRDgeometry::kNlayer; iPlane++) { length = (AliTRDgeometry::AmThick() + AliTRDgeometry::DrThick()) / TMath::Sqrt((1.0 - fSnp[iPlane]*fSnp[iPlane]) @@ -1132,7 +1132,7 @@ Int_t AliTRDtrack::GetSector() const // return Int_t(TVector2::Phi_0_2pi(GetAlpha()) / AliTRDgeometry::GetAlpha()) - % AliTRDgeometry::kNsect; + % AliTRDgeometry::kNsector; } diff --git a/TRD/AliTRDtracker.cxx b/TRD/AliTRDtracker.cxx index e0d182b2947..c96f59b2eeb 100644 --- a/TRD/AliTRDtracker.cxx +++ b/TRD/AliTRDtracker.cxx @@ -235,12 +235,12 @@ Int_t AliTRDtracker::LocalToGlobalID(Int_t lid) // Transform internal TRD ID to global detector ID // - Int_t isector = fGeom->GetSector(lid); - Int_t ichamber = fGeom->GetChamber(lid); - Int_t iplan = fGeom->GetPlane(lid); + Int_t isector = fGeom->GetSector(lid); + Int_t istack = fGeom->GetStack(lid); + Int_t ilayer = fGeom->GetLayer(lid); AliGeomManager::ELayerID iLayer = AliGeomManager::kTRD1; - switch (iplan) { + switch (ilayer) { case 0: iLayer = AliGeomManager::kTRD1; break; @@ -261,7 +261,7 @@ Int_t AliTRDtracker::LocalToGlobalID(Int_t lid) break; }; - Int_t modId = isector * fGeom->Ncham() + ichamber; + Int_t modId = isector * fGeom->Nstack() + istack; UShort_t volid = AliGeomManager::LayerToVolUID(iLayer,modId); return volid; @@ -278,9 +278,9 @@ Int_t AliTRDtracker::GlobalToLocalID(Int_t gid) Int_t modId = 0; AliGeomManager::ELayerID layerId = AliGeomManager::VolUIDToLayer(gid,modId); - Int_t isector = modId / fGeom->Ncham(); - Int_t ichamber = modId % fGeom->Ncham(); - Int_t iLayer = -1; + Int_t isector = modId / fGeom->Nstack(); + Int_t istack = modId % fGeom->Nstack(); + Int_t iLayer = -1; switch (layerId) { case AliGeomManager::kTRD1: @@ -309,7 +309,7 @@ Int_t AliTRDtracker::GlobalToLocalID(Int_t gid) return -1; } - Int_t lid = fGeom->GetDetector(iLayer,ichamber,isector); + Int_t lid = fGeom->GetDetector(iLayer,istack,isector); return lid; @@ -363,8 +363,8 @@ AliTRDcluster *AliTRDtracker::GetCluster(AliTRDtrack *track, Int_t plane if (cli->GetLocalTimeBin() != timebin) { continue; } - Int_t iplane = fGeom->GetPlane(cli->GetDetector()); - if (iplane == plane) { + Int_t ilayer = fGeom->GetLayer(cli->GetDetector()); + if (ilayer == plane) { cl = cli; index = indexes[i]; break; @@ -390,9 +390,9 @@ Int_t AliTRDtracker::GetLastPlane(AliTRDtrack *track) if (!cli) { break; } - Int_t iplane = fGeom->GetPlane(cli->GetDetector()); - if (iplane > lastplane) { - lastplane = iplane; + Int_t ilayer = fGeom->GetLayer(cli->GetDetector()); + if (ilayer > lastplane) { + lastplane = ilayer; } } @@ -892,13 +892,13 @@ Int_t AliTRDtracker::FollowProlongation(AliTRDtrack &t) continue; } - Int_t plane = fGeom->GetPlane(cl0->GetDetector()); - if (plane > lastplane) { + Int_t layer = fGeom->GetLayer(cl0->GetDetector()); + if (layer > lastplane) { continue; } Int_t timebin = cl0->GetLocalTimeBin(); - AliTRDcluster *cl2 = GetCluster(&t,plane,timebin,index); + AliTRDcluster *cl2 = GetCluster(&t,layer,timebin,index); if (cl2) { cl = cl2; @@ -913,7 +913,7 @@ Int_t AliTRDtracker::FollowProlongation(AliTRDtrack &t) t.SetSampledEdx(TMath::Abs(cl->GetQ()/dxsample)); Double_t h01 = GetTiltFactor(cl); Int_t det = cl->GetDetector(); - Int_t pplane = fGeom->GetPlane(det); + Int_t llayer = fGeom->GetLayer(det); if (t.GetX() > 345.0) { t.SetNLast(t.GetNLast() + 1); @@ -928,7 +928,7 @@ Int_t AliTRDtracker::FollowProlongation(AliTRDtrack &t) maxChi2 = t.GetPredictedChi2(cl,h01); if (maxChi2 < 1e+10) { - if (!t.UpdateMI(cl,maxChi2,index,h01,pplane)) { + if (!t.UpdateMI(cl,maxChi2,index,h01,llayer)) { // ???? } else { @@ -1094,7 +1094,7 @@ Int_t AliTRDtracker::FollowBackProlongation(AliTRDtrack &t) t.SetSampledEdx(TMath::Abs(cl->GetQ()/dxsample)); Double_t h01 = GetTiltFactor(cl); Int_t det = cl->GetDetector(); - Int_t plane = fGeom->GetPlane(det); + Int_t layer = fGeom->GetLayer(det); if (t.GetX() > 345.0) { t.SetNLast(t.GetNLast() + 1); t.SetChi2Last(t.GetChi2Last() + maxChi2); @@ -1104,7 +1104,7 @@ Int_t AliTRDtracker::FollowBackProlongation(AliTRDtrack &t) maxChi2 = t.GetPredictedChi2(cl,h01); if (maxChi2<1e+10) - if (!t.UpdateMI(cl,maxChi2,index,h01,plane)) { + if (!t.UpdateMI(cl,maxChi2,index,h01,layer)) { if (!t.Update(cl,maxChi2,index,h01)) { // ???? } @@ -1116,8 +1116,8 @@ Int_t AliTRDtracker::FollowBackProlongation(AliTRDtrack &t) // } // Reset material budget if 2 consecutive gold - if (plane > 0) { - if ((t.GetTracklets(plane).GetN() + t.GetTracklets(plane-1).GetN()) > 20) { + if (layer > 0) { + if ((t.GetTracklets(layer).GetN() + t.GetTracklets(layer-1).GetN()) > 20) { t.SetBudget(2,0.0); } } @@ -1238,25 +1238,25 @@ Int_t AliTRDtracker::LoadClusters(TTree *cTree) Int_t detector = c->GetDetector(); Int_t localTimeBin = c->GetLocalTimeBin(); Int_t sector = fGeom->GetSector(detector); - Int_t plane = fGeom->GetPlane(detector); + Int_t layer = fGeom->GetLayer(detector); Int_t trackingSector = sector; //if (c->GetQ() > 10) { - // Int_t chamber = fGeom->GetChamber(detector); + // Int_t stack = fGeom->GetStack(detector); //} - Int_t gtb = fTrSec[trackingSector]->CookTimeBinIndex(plane,localTimeBin); + Int_t gtb = fTrSec[trackingSector]->CookTimeBinIndex(layer,localTimeBin); if (gtb < 0) { continue; } - Int_t layer = fTrSec[trackingSector]->GetLayerNumber(gtb); + Int_t trLayer = fTrSec[trackingSector]->GetLayerNumber(gtb); index = ncl; fHXCl->Fill(c->GetX()); - fTrSec[trackingSector]->GetLayer(layer)->SetX(c->GetX()); - fTrSec[trackingSector]->GetLayer(layer)->InsertCluster(c,index); + fTrSec[trackingSector]->GetLayer(trLayer)->SetX(c->GetX()); + fTrSec[trackingSector]->GetLayer(trLayer)->InsertCluster(c,index); } @@ -1290,7 +1290,7 @@ void AliTRDtracker::UnloadClusters() delete fTracks->RemoveAt(i); } - Int_t nsec = AliTRDgeometry::kNsect; + Int_t nsec = AliTRDgeometry::kNsector; for (i = 0; i < nsec; i++) { for(Int_t pl = 0; pl < fTrSec[i]->GetNumberOfLayers(); pl++) { fTrSec[i]->GetLayer(pl)->Clear(); @@ -1319,7 +1319,7 @@ Int_t AliTRDtracker::Clusters2Tracks(AliESDEvent *esd) const Double_t kRoad2z = 20.0; // Road in z for extrapolated cluster const Int_t kMaxSeed = 3000; - Int_t maxSec = AliTRDgeometry::kNsect; + Int_t maxSec = AliTRDgeometry::kNsector; // Linear fitters in planes TLinearFitter fitterTC(2,"hyp2"); // Fitting with tilting pads - kz fixed - kz= Z/x, + vertex const @@ -1338,17 +1338,17 @@ Int_t AliTRDtracker::Clusters2Tracks(AliESDEvent *esd) } for (Int_t ns = 0; ns < maxSec; ns++) { for (Int_t ilayer = 0; ilayer < fTrSec[ns]->GetNumberOfLayers(); ilayer++) { - AliTRDpropagationLayer &layer = *(fTrSec[ns]->GetLayer(ilayer)); - if (layer == 0) { + AliTRDpropagationLayer &propLayer = *(fTrSec[ns]->GetLayer(ilayer)); + if (propLayer == 0) { continue; } - Int_t det = layer[0]->GetDetector(); - Int_t plane = fGeom->GetPlane(det); - if (ilayer < layers[plane][0]) { - layers[plane][0] = ilayer; + Int_t det = propLayer[0]->GetDetector(); + Int_t layer = fGeom->GetLayer(det); + if (ilayer < layers[layer][0]) { + layers[layer][0] = ilayer; } - if (ilayer > layers[plane][1]) { - layers[plane][1] = ilayer; + if (ilayer > layers[layer][1]) { + layers[layer][1] = ilayer; } } } @@ -2520,40 +2520,40 @@ Bool_t AliTRDtracker::GetTrackPoint(Int_t index, AliTrackPoint &p) const // AliTRDcluster *cl = (AliTRDcluster *) fClusters->UncheckedAt(index); - Int_t idet = cl->GetDetector(); - Int_t isector = fGeom->GetSector(idet); - Int_t ichamber = fGeom->GetChamber(idet); - Int_t iplan = fGeom->GetPlane(idet); + Int_t idet = cl->GetDetector(); + Int_t isector = fGeom->GetSector(idet); + Int_t istack = fGeom->GetStack(idet); + Int_t ilayer = fGeom->GetLayer(idet); Double_t local[3]; - local[0] = GetX(isector,iplan,cl->GetLocalTimeBin()); + local[0] = GetX(isector,ilayer,cl->GetLocalTimeBin()); local[1] = cl->GetY(); local[2] = cl->GetZ(); Double_t global[3]; fGeom->RotateBack(idet,local,global); p.SetXYZ(global[0],global[1],global[2]); - AliGeomManager::ELayerID iLayer = AliGeomManager::kTRD1; - switch (iplan) { + AliGeomManager::ELayerID iGeoLayer = AliGeomManager::kTRD1; + switch (ilayer) { case 0: - iLayer = AliGeomManager::kTRD1; + iGeoLayer = AliGeomManager::kTRD1; break; case 1: - iLayer = AliGeomManager::kTRD2; + iGeoLayer = AliGeomManager::kTRD2; break; case 2: - iLayer = AliGeomManager::kTRD3; + iGeoLayer = AliGeomManager::kTRD3; break; case 3: - iLayer = AliGeomManager::kTRD4; + iGeoLayer = AliGeomManager::kTRD4; break; case 4: - iLayer = AliGeomManager::kTRD5; + iGeoLayer = AliGeomManager::kTRD5; break; case 5: - iLayer = AliGeomManager::kTRD6; + iGeoLayer = AliGeomManager::kTRD6; break; }; - Int_t modId = isector * fGeom->Ncham() + ichamber; - UShort_t volid = AliGeomManager::LayerToVolUID(iLayer,modId); + Int_t modId = isector * fGeom->Nstack() + istack; + UShort_t volid = AliGeomManager::LayerToVolUID(iGeoLayer,modId); p.SetVolumeID(volid); return kTRUE; @@ -2659,11 +2659,11 @@ void AliTRDtracker::UseClusters(const AliKalmanTrack *t, Int_t from) const for (Int_t i = from; i < ncl; i++) { Int_t index = t->GetClusterIndex(i); AliTRDcluster *c = (AliTRDcluster *) fClusters->UncheckedAt(index); - Int_t iplane = fGeom->GetPlane(c->GetDetector()); - if (track->GetTracklets(iplane).GetChi2() > kmaxchi2) { + Int_t ilayer = fGeom->GetLayer(c->GetDetector()); + if (track->GetTracklets(ilayer).GetChi2() > kmaxchi2) { continue; } - if (track->GetTracklets(iplane).GetN() < kmincl) { + if (track->GetTracklets(ilayer).GetN() < kmincl) { continue; } if (!(c->IsUsed())) { @@ -2728,9 +2728,9 @@ AliTRDtracker::AliTRDtrackingSector AliTRDpropagationLayer *ppl = 0; // Get holes description from geometry - Bool_t holes[AliTRDgeometry::kNcham]; - for (Int_t icham = 0; icham < AliTRDgeometry::kNcham; icham++) { - holes[icham] = fGeom->IsHole(0,icham,gs); + Bool_t holes[AliTRDgeometry::kNstack]; + for (Int_t istack = 0; istack < AliTRDgeometry::kNstack; istack++) { + holes[istack] = fGeom->IsHole(0,istack,gs); } for (UInt_t i = 0; i < kMaxTimeBinIndex; i++) { @@ -2746,27 +2746,27 @@ AliTRDtracker::AliTRDtrackingSector Double_t dxAmp = (Double_t) fGeom->CamHght(); // Amplification region //Double_t dxDrift = (Double_t) fGeom->CdrHght(); // Drift region - const Int_t kNchambers = AliTRDgeometry::Ncham(); + const Int_t kNstacks = AliTRDgeometry::Nstack(); Int_t tbIndex; Double_t ymax = 0; Double_t ymaxsensitive = 0; - Double_t *zc = new Double_t[kNchambers]; - Double_t *zmax = new Double_t[kNchambers]; - Double_t *zmaxsensitive = new Double_t[kNchambers]; + Double_t *zc = new Double_t[kNstacks]; + Double_t *zmax = new Double_t[kNstacks]; + Double_t *zmaxsensitive = new Double_t[kNstacks]; - for (Int_t plane = 0; plane < AliTRDgeometry::Nplan(); plane++) { + for (Int_t layer = 0; layer < AliTRDgeometry::Nlayer(); layer++) { - ymax = fGeom->GetChamberWidth(plane) / 2.0; - padPlane = fGeom->GetPadPlane(plane,0); + ymax = fGeom->GetChamberWidth(layer) / 2.0; + padPlane = fGeom->GetPadPlane(layer,0); ymaxsensitive = (padPlane->GetColSize(1) * padPlane->GetNcols() - 4.0) / 2.0; - for (Int_t ch = 0; ch < kNchambers; ch++) { - zmax[ch] = fGeom->GetChamberLength(plane,ch) / 2.0; + for (Int_t st = 0; st < kNstacks; st++) { + zmax[st] = fGeom->GetChamberLength(layer,st) / 2.0; Float_t pad = padPlane->GetRowSize(1); - Float_t row0 = fGeom->GetRow0(plane,ch,0); - Int_t nPads = fGeom->GetRowMax(plane,ch,0); - zmaxsensitive[ch] = Float_t(nPads) * pad / 2.0; - zc[ch] = -(pad * nPads) / 2.0 + row0; + Float_t row0 = fGeom->GetRow0(layer,st,0); + Int_t nPads = fGeom->GetRowMax(layer,st,0); + zmaxsensitive[st] = Float_t(nPads) * pad / 2.0; + zc[st] = -(pad * nPads) / 2.0 + row0; } AliTRDcalibDB *fCalibration = AliTRDcalibDB::Instance(); @@ -2775,12 +2775,12 @@ AliTRDtracker::AliTRDtrackingSector rho = 0.00295 * 0.85; //???? radLength = 11.0; - Double_t x0 = (Double_t) AliTRDgeometry::GetTime0(plane); + Double_t x0 = (Double_t) AliTRDgeometry::GetTime0(layer); //Double_t xbottom = x0 - dxDrift; //Double_t xtop = x0 + dxAmp; //temporary !! (A.Bercuci) - Int_t T0 = (Int_t)fCalibration->GetT0Average(AliTRDgeometry::GetDetector(plane, 2, gs)); + Int_t T0 = (Int_t)fCalibration->GetT0Average(AliTRDgeometry::GetDetector(layer, 2, gs)); Int_t nTimeBins = AliTRDcalibDB::Instance()->GetNumberOfTimeBins(); for (Int_t iTime = 0; iTime < nTimeBins; iTime++) { @@ -2789,8 +2789,8 @@ AliTRDtracker::AliTRDtrackingSector //if (xlayer<0) xlayer = dxAmp / 2.0; x = x0 - xlayer; - tbIndex = CookTimeBinIndex(plane,iTime); - ppl = new AliTRDpropagationLayer(x,dx,rho,radLength,tbIndex,plane); + tbIndex = CookTimeBinIndex(layer,iTime); + ppl = new AliTRDpropagationLayer(x,dx,rho,radLength,tbIndex,layer); ppl->SetYmax(ymax,ymaxsensitive); ppl->SetZ(zc,zmax,zmaxsensitive); ppl->SetHoles(holes); @@ -3042,8 +3042,8 @@ Double_t AliTRDtracker::GetTiltFactor(const AliTRDcluster *c) // Int_t det = c->GetDetector(); - Int_t plane = fGeom->GetPlane(det); - AliTRDpadPlane *padPlane = fGeom->GetPadPlane(plane,0); + Int_t layer = fGeom->GetLayer(det); + AliTRDpadPlane *padPlane = fGeom->GetPadPlane(layer,0); Double_t h01 = TMath::Tan(-TMath::Pi() / 180.0 * padPlane->GetTiltingAngle()); if (fNoTilt) { @@ -3110,7 +3110,7 @@ Int_t AliTRDtracker::FindClusters(Int_t sector, Int_t t0, Int_t t1 Int_t nall = 0; Int_t nfound = 0; Double_t h01 = 0.0; - Int_t plane = -1; + Int_t layer = -1; Int_t detector = -1; Float_t padlength = 0.0; @@ -3158,9 +3158,9 @@ Int_t AliTRDtracker::FindClusters(Int_t sector, Int_t t0, Int_t t1 AliTRDcluster *c = (AliTRDcluster *) (timeBin[i]); h01 = GetTiltFactor(c); - if (plane < 0) { + if (layer < 0) { Int_t det = c->GetDetector(); - plane = fGeom->GetPlane(det); + layer = fGeom->GetLayer(det); padlength = TMath::Sqrt(c->GetSigmaZ2() * 12.0); } @@ -3621,11 +3621,11 @@ Int_t AliTRDtracker::FindClusters(Int_t sector, Int_t t0, Int_t t1 tracklet.SetP1(angle[bestiter]); tracklet.SetN(nfound); tracklet.SetNCross(changes[bestiter]); - tracklet.SetPlane(plane); + tracklet.SetPlane(layer); tracklet.SetSigma2(expectederr); tracklet.SetChi2(tchi2s[bestiter]); tracklet.SetMaxPos(maxpos,maxpos4,maxpos5); - track->SetTracklets(plane,tracklet); + track->SetTracklets(layer,tracklet); track->SetNWrong(track->GetNWrong() + nbad[0]); // @@ -3672,7 +3672,7 @@ Int_t AliTRDtracker::FindClusters(Int_t sector, Int_t t0, Int_t t1 << "nfound=" << nfound // Number of found clusters << "clfound=" << clfound // Total number of found clusters in road << "mpads=" << mpads // Mean number of pads per cluster - << "plane=" << plane // Plane number + << "layer=" << layer // Layer number << "detector=" << detector // Detector number << "road=" << road // The width of the used road << "graph0.=" << &graph0 // x - y = dy for closest cluster diff --git a/TRD/AliTRDtrackerV1.cxx b/TRD/AliTRDtrackerV1.cxx index 632aaec98d6..c30d66e53c9 100644 --- a/TRD/AliTRDtrackerV1.cxx +++ b/TRD/AliTRDtrackerV1.cxx @@ -96,7 +96,7 @@ AliTRDtrackerV1::AliTRDtrackerV1() } if(!fgNTimeBins) fgNTimeBins = AliTRDcalibDB::Instance()->GetNumberOfTimeBins(); - for (Int_t isector = 0; isector < AliTRDgeometry::kNsect; isector++) new(&fTrSec[isector]) AliTRDtrackingSector(fGeom, isector); + for (Int_t isector = 0; isector < AliTRDgeometry::kNsector; isector++) new(&fTrSec[isector]) AliTRDtrackingSector(fGeom, isector); if (!AliTRDReconstructor::RecoParam()){ AliWarning("RecoParams not set in AliTRDReconstructor. Setting to default LowFluxParam."); @@ -153,7 +153,7 @@ Int_t AliTRDtrackerV1::Clusters2Tracks(AliESDEvent *esd) //AliInfo("Start Track Finder ..."); Int_t ntracks = 0; - for(int ism=0; ismGetPlane(idet)) { + switch (fGeom->GetLayer(idet)) { case 0: iLayer = AliGeomManager::kTRD1; break; @@ -208,7 +208,7 @@ Bool_t AliTRDtrackerV1::GetTrackPoint(Int_t index, AliTrackPoint &p) const iLayer = AliGeomManager::kTRD6; break; }; - Int_t modId = fGeom->GetSector(idet) * fGeom->Ncham() + fGeom->GetChamber(idet); + Int_t modId = fGeom->GetSector(idet) * fGeom->Nstack() + fGeom->GetStack(idet); UShort_t volid = AliGeomManager::LayerToVolUID(iLayer, modId); p.SetVolumeID(volid); @@ -232,7 +232,7 @@ TLinearFitter* AliTRDtrackerV1::GetTiltedRiemanFitterConstraint() //____________________________________________________________________ AliRieman* AliTRDtrackerV1::GetRiemanFitter() { - if(!fgRieman) fgRieman = new AliRieman(AliTRDtrackingChamber::kNTimeBins * AliTRDgeometry::kNplan); + if(!fgRieman) fgRieman = new AliRieman(AliTRDtrackingChamber::kNTimeBins * AliTRDgeometry::kNlayer); return fgRieman; } @@ -616,38 +616,38 @@ Int_t AliTRDtrackerV1::FollowBackProlongation(AliTRDtrackV1 &t) AliTRDseedV1 tracklet, *ptrTracklet = 0x0; - // Loop through the TRD planes - for (Int_t iplane = 0; iplane < AliTRDgeometry::Nplan(); iplane++) { + // Loop through the TRD layers + for (Int_t ilayer = 0; ilayer < AliTRDgeometry::Nlayer(); ilayer++) { // BUILD TRACKLET IF NOT ALREADY BUILT Double_t x = 0., y, z, alpha; - ptrTracklet = t.GetTracklet(iplane); + ptrTracklet = t.GetTracklet(ilayer); if(!ptrTracklet){ - ptrTracklet = new(&tracklet) AliTRDseedV1(iplane); + ptrTracklet = new(&tracklet) AliTRDseedV1(ilayer); alpha = t.GetAlpha(); - Int_t sector = Int_t(alpha/AliTRDgeometry::GetAlpha() + (alpha>0. ? 0 : AliTRDgeometry::kNsect)); + Int_t sector = Int_t(alpha/AliTRDgeometry::GetAlpha() + (alpha>0. ? 0 : AliTRDgeometry::kNsector)); if(!fTrSec[sector].GetNChambers()) continue; - if((x = fTrSec[sector].GetX(iplane)) < 1.) continue; + if((x = fTrSec[sector].GetX(ilayer)) < 1.) continue; if (!t.GetProlongation(x, y, z)) break; - Int_t stack = fGeom->GetChamber(z, iplane); + Int_t stack = fGeom->GetStack(z, ilayer); Int_t nCandidates = stack >= 0 ? 1 : 2; z -= stack >= 0 ? 0. : 4.; for(int icham=0; ichamGetChamber(z, iplane)) < 0) continue; + if((stack = fGeom->GetStack(z, ilayer)) < 0) continue; - if(!(chamber = fTrSec[sector].GetChamber(stack, iplane))) continue; + if(!(chamber = fTrSec[sector].GetChamber(stack, ilayer))) continue; if(chamber->GetNClusters() < fgNTimeBins*AliTRDReconstructor::RecoParam()->GetFindableClusters()) continue; x = chamber->GetX(); - AliTRDpadPlane *pp = fGeom->GetPadPlane(iplane, stack); + AliTRDpadPlane *pp = fGeom->GetPadPlane(ilayer, stack); tracklet.SetTilt(TMath::Tan(-TMath::DegToRad()*pp->GetTiltingAngle())); tracklet.SetPadLength(pp->GetLengthIPad()); - tracklet.SetPlane(iplane); + tracklet.SetPlane(ilayer); tracklet.SetX0(x); if(!tracklet.Init(&t)){ t.SetStopped(kTRUE); @@ -706,7 +706,7 @@ Int_t AliTRDtrackerV1::FollowBackProlongation(AliTRDtrackV1 &t) //t.SetTracklet(&tracklet, index); } // Reset material budget if 2 consecutive gold - if(iplane>0 && t.GetTracklet(iplane-1) && ptrTracklet->GetN() + t.GetTracklet(iplane-1)->GetN() > 20) t.SetBudget(2, 0.); + if(ilayer>0 && t.GetTracklet(ilayer-1) && ptrTracklet->GetN() + t.GetTracklet(ilayer-1)->GetN() > 20) t.SetBudget(2, 0.); // Make backup of the track until is gold // TO DO update quality check of the track. @@ -729,7 +729,7 @@ Int_t AliTRDtrackerV1::FollowBackProlongation(AliTRDtrackV1 &t) (TMath::Abs(t.GetSnp()) < 0.85) && (t.GetNumberOfClusters() > 20)) t.MakeBackupTrack(); - } // end planes loop + } // end layers loop if(AliTRDReconstructor::RecoParam()->GetStreamLevel() > 1){ TTreeSRedirector &cstreamer = *fgDebugStreamer; @@ -855,15 +855,15 @@ Float_t AliTRDtrackerV1::FitTiltedRiemanConstraint(AliTRDseedV1 *tracklets, Doub Float_t x, y, z, w, t, error, tilt; Double_t uvt[2]; Int_t nPoints = 0; - for(Int_t ipl = 0; ipl < AliTRDgeometry::kNplan; ipl++){ - if(!tracklets[ipl].IsOK()) continue; + for(Int_t ilr = 0; ilr < AliTRDgeometry::kNlayer; ilr++){ + if(!tracklets[ilr].IsOK()) continue; for(Int_t itb = 0; itb < fgNTimeBins; itb++){ - if(!tracklets[ipl].IsUsable(itb)) continue; - cl = tracklets[ipl].GetClusters(itb); + if(!tracklets[ilr].IsUsable(itb)) continue; + cl = tracklets[ilr].GetClusters(itb); x = cl->GetX(); y = cl->GetY(); z = cl->GetZ(); - tilt = tracklets[ipl].GetTilt(); + tilt = tracklets[ilr].GetTilt(); // Transformation t = 1./(x * x + y * y); uvt[0] = 2. * x * t; @@ -1320,7 +1320,7 @@ Float_t AliTRDtrackerV1::CalculateChi2Z(AliTRDseedV1 *tracklets, Double_t offset // Output: - The Chi2 value of the track in z-Direction // Float_t chi2Z = 0, nLayers = 0; - for (Int_t iLayer = 0; iLayer < AliTRDgeometry::kNplan; iLayer++) { + for (Int_t iLayer = 0; iLayer < AliTRDgeometry::kNlayer; iLayer++) { if(!tracklets[iLayer].IsOK()) continue; Double_t z = offset + slope * (tracklets[iLayer].GetX0() - xref); chi2Z += TMath::Abs(tracklets[iLayer].GetMeanz() - z); @@ -1471,14 +1471,14 @@ Int_t AliTRDtrackerV1::LoadClusters(TTree *cTree) if(c->IsInChamber()) nin++; Int_t detector = c->GetDetector(); Int_t sector = fGeom->GetSector(detector); - Int_t stack = fGeom->GetChamber(detector); - Int_t plane = fGeom->GetPlane(detector); + Int_t stack = fGeom->GetStack(detector); + Int_t layer = fGeom->GetLayer(detector); - fTrSec[sector].GetChamber(stack, plane, kTRUE)->InsertCluster(c, icl); + fTrSec[sector].GetChamber(stack, layer, kTRUE)->InsertCluster(c, icl); } AliInfo(Form("Clusters %d in %6.2f %%", ncl, 100.*float(nin)/ncl)); - for(int isector =0; isectorDelete(); if(fClusters) fClusters->Delete(); - for (int i = 0; i < AliTRDgeometry::kNsect; i++) fTrSec[i].Clear(); + for (int i = 0; i < AliTRDgeometry::kNsector; i++) fTrSec[i].Clear(); // Increment the Event Number AliTRDtrackerDebug::SetEventNumber(AliTRDtrackerDebug::GetEventNumber() + 1); @@ -1567,7 +1567,7 @@ AliTRDseedV1* AliTRDtrackerV1::SetTracklet(AliTRDseedV1 *tracklet) // and adds the new tracklet to the list. // if(!fTracklets){ - fTracklets = new TClonesArray("AliTRDseedV1", AliTRDgeometry::Nsect()*kMaxTracksStack); + fTracklets = new TClonesArray("AliTRDseedV1", AliTRDgeometry::Nsector()*kMaxTracksStack); fTracklets->SetOwner(kTRUE); } Int_t nentries = fTracklets->GetEntriesFast(); @@ -1590,7 +1590,7 @@ AliTRDtrackV1* AliTRDtrackerV1::SetTrack(AliTRDtrackV1 *track) // and adds the new track to the list. // if(!fTracks){ - fTracks = new TClonesArray("AliTRDtrackV1", AliTRDgeometry::Nsect()*kMaxTracksStack); + fTracks = new TClonesArray("AliTRDtrackV1", AliTRDgeometry::Nsector()*kMaxTracksStack); fTracks->SetOwner(kTRUE); } Int_t nentries = fTracks->GetEntriesFast(); @@ -1628,14 +1628,14 @@ Int_t AliTRDtrackerV1::Clusters2TracksSM(Int_t sector, AliESDEvent *esd) Int_t nTracks = 0; Int_t nChambers = 0; AliTRDtrackingChamber **stack = 0x0, *chamber = 0x0; - for(int istack = 0; istackGetNClusters() < fgNTimeBins * AliTRDReconstructor::RecoParam()->GetFindableClusters()) continue; nChambers++; - //AliInfo(Form("sector %d stack %d plane %d clusters %d", sector, istack, iplane, chamber->GetNClusters())); + //AliInfo(Form("sector %d stack %d layer %d clusters %d", sector, istack, ilayer, chamber->GetNClusters())); } if(nChambers < 4) continue; //AliInfo(Form("Doing stack %d", istack)); @@ -2096,7 +2096,7 @@ Int_t AliTRDtrackerV1::MakeSeeds(AliTRDtrackingChamber **stack, AliTRDseedV1 *ss // Init chambers geometry Int_t ic = 0; while(!(chamber = stack[ic])) ic++; - Int_t istack = fGeom->GetChamber(chamber->GetDetector()); + Int_t istack = fGeom->GetStack(chamber->GetDetector()); Double_t hL[kNPlanes]; // Tilting angle Float_t padlength[kNPlanes]; // pad lenghts AliTRDpadPlane *pp = 0x0; diff --git a/TRD/AliTRDtrackingAnalysis.cxx b/TRD/AliTRDtrackingAnalysis.cxx index 64022b3db20..0f160f442ec 100644 --- a/TRD/AliTRDtrackingAnalysis.cxx +++ b/TRD/AliTRDtrackingAnalysis.cxx @@ -427,7 +427,7 @@ void AliTRDtrackingAnalysis::DrawRecPointResolution(int startEvent, int stopEve //fTracker->Transform(cls); fClPos->Fill(cls->GetZ(), cls->GetY()); - int plane = fGeo->GetPlane(cls->GetDetector()); + int layer = fGeo->GetLayer(cls->GetDetector()); int nl = 0; for(int k=0; k<3; k++) if (cls->GetLabel(k) > -1) nl++; @@ -440,7 +440,7 @@ void AliTRDtrackingAnalysis::DrawRecPointResolution(int startEvent, int stopEve fClZXcl->Fill(cls->GetZ(), cls->GetX()); fClZXref->Fill(zref, cls->GetX()); - AliTRDpadPlane *padPlane = fGeo->GetPadPlane(plane,0); + AliTRDpadPlane *padPlane = fGeo->GetPadPlane(layer,0); Double_t h01 = TMath::Tan(-TMath::Pi() / 180.0 * padPlane->GetTiltingAngle()); //double dz = zref - padPlane->GetRow0(); @@ -457,7 +457,7 @@ void AliTRDtrackingAnalysis::DrawRecPointResolution(int startEvent, int stopEve fClZZ->Fill(zref, cls->GetZ()); fClZ->Fill(dz); fTgPhi->Fill(tgphi); - fClYX->Fill(cls->GetY(), cls->GetX() - fGeo->GetTime0(plane)); + fClYX->Fill(cls->GetY(), cls->GetX() - fGeo->GetTime0(layer)); } } } diff --git a/TRD/AliTRDtrackingChamber.cxx b/TRD/AliTRDtrackingChamber.cxx index 5d3d1aeed42..62629f22a43 100644 --- a/TRD/AliTRDtrackingChamber.cxx +++ b/TRD/AliTRDtrackingChamber.cxx @@ -65,11 +65,11 @@ Bool_t AliTRDtrackingChamber::Build(AliTRDgeometry *geo) // Calculates radial position of the chamber based on // radial positions of the time bins (calibration/alignment aware) // - Int_t stack = geo->GetChamber(fDetector); - Int_t plane = geo->GetPlane(fDetector); - AliTRDpadPlane *pp = geo->GetPadPlane(plane, stack); + Int_t stack = geo->GetStack(fDetector); + Int_t layer = geo->GetLayer(fDetector); + AliTRDpadPlane *pp = geo->GetPadPlane(layer, stack); Double_t zl = pp->GetRow0ROC() - pp->GetRowEndROC(); - Double_t z0 = geo->GetRow0(plane, stack, 0) - zl; + Double_t z0 = geo->GetRow0(layer, stack, 0) - zl; Int_t nrows = pp->GetNrows(); Int_t index[50], jtb = 0; @@ -168,10 +168,10 @@ AliTRDchamberTimeBin *AliTRDtrackingChamber::GetSeedingLayer(AliTRDgeometry *geo const Int_t kMaxPads = 2304; // Get the geometrical data of the chamber - Int_t plane = geo->GetPlane(fDetector); - Int_t stack = geo->GetChamber(fDetector); + Int_t layer = geo->GetLayer(fDetector); + Int_t stack = geo->GetStack(fDetector); Int_t sector= geo->GetSector(fDetector); - AliTRDpadPlane *pp = geo->GetPadPlane(plane, stack); + AliTRDpadPlane *pp = geo->GetPadPlane(layer, stack); Int_t nCols = pp->GetNcols(); Float_t ymin = TMath::Min(pp->GetCol0(), pp->GetColEnd()); Float_t ymax = TMath::Max(pp->GetCol0(), pp->GetColEnd()); @@ -293,7 +293,7 @@ AliTRDchamberTimeBin *AliTRDtrackingChamber::GetSeedingLayer(AliTRDgeometry *geo Float_t pos[3], sig[2]; Short_t signal[7]; memset(&signal[0], 0, 7*sizeof(Short_t)); - AliTRDchamberTimeBin *fakeLayer = new AliTRDchamberTimeBin(plane, stack, sector, z0, zl); + AliTRDchamberTimeBin *fakeLayer = new AliTRDchamberTimeBin(layer, stack, sector, z0, zl); AliTRDcluster *cluster = 0x0; if(nCandidates){ UInt_t fakeIndex = 0; @@ -335,7 +335,7 @@ AliTRDchamberTimeBin *AliTRDtrackingChamber::GetSeedingLayer(AliTRDgeometry *geo // hist(i,j) = histogram[i][j]; TTreeSRedirector &cstreamer = *AliTRDtrackerV1::DebugStreamer(); cstreamer << "GetSeedingLayer" - << "plane=" << plane + << "layer=" << layer << "ymin=" << ymin << "ymax=" << ymax << "zmin=" << zmin diff --git a/TRD/AliTRDtrackingSector.cxx b/TRD/AliTRDtrackingSector.cxx index 8e48d75918e..50c125c39e4 100644 --- a/TRD/AliTRDtrackingSector.cxx +++ b/TRD/AliTRDtrackingSector.cxx @@ -46,7 +46,7 @@ AliTRDtrackingSector::AliTRDtrackingSector() fChamber[ic] = 0x0; fIndex[ic] = -1; } - for(int ip=0; ipBuild(fGeom); - Int_t np; - for(int ip=0; ipGetX(); np++; + fX0[il] += tc->GetX(); nl++; } - if(!np){ + if(!nl){ //printf("Could not estimate radial position of plane %d in sector %d.\n", ip, fSector); continue; } - fX0[ip] /= Float_t(np); + fX0[il] /= Float_t(nl); } } //_____________________________________________________________________________ @@ -127,12 +127,12 @@ void AliTRDtrackingSector::Clear(const Option_t *opt) } //_____________________________________________________________________________ -AliTRDtrackingChamber* AliTRDtrackingSector::GetChamber(Int_t stack, Int_t plane, Bool_t build) +AliTRDtrackingChamber* AliTRDtrackingSector::GetChamber(Int_t stack, Int_t layer, Bool_t build) { // Return chamber at position (stack, plane) in current // sector or build a new one if it is not already created - Int_t ch = stack*AliTRDgeometry::kNplan + plane; + Int_t ch = stack*AliTRDgeometry::kNlayer + layer; if(fIndex[ch] >= 0) return fChamber[Int_t(fIndex[ch])]; else if(!build) return 0x0; @@ -144,7 +144,7 @@ AliTRDtrackingChamber* AliTRDtrackingSector::GetChamber(Int_t stack, Int_t plane memmove(&fChamber[Int_t(fIndex[ch])+1], &fChamber[Int_t(fIndex[ch])], (kNChambersSector-fIndex[ch]-1)*sizeof(void*)); for(Int_t ic = ch+1; ic= 0 ? 1 : 0; - return fChamber[Int_t(fIndex[ch])] = new AliTRDtrackingChamber(AliTRDgeometry::GetDetector(plane, stack, fSector)); + return fChamber[Int_t(fIndex[ch])] = new AliTRDtrackingChamber(AliTRDgeometry::GetDetector(layer, stack, fSector)); } //_____________________________________________________________________________ @@ -153,14 +153,14 @@ AliTRDtrackingChamber** AliTRDtrackingSector::GetStack(Int_t stack) // Return chamber at position (stack, plane) in current // sector or build a new one if it is not already created - if(stack<0 || stack>=AliTRDgeometry::kNcham) return 0x0; + if(stack<0 || stack>=AliTRDgeometry::kNstack) return 0x0; Int_t ich, n = 0; - for(int ip=0; ip=0 ? fChamber[Int_t(fIndex[ch])]->GetNClusters() : 0); } printf("\n"); diff --git a/TRD/AliTRDtransform.cxx b/TRD/AliTRDtransform.cxx index 0c725c65923..85d28e896fd 100644 --- a/TRD/AliTRDtransform.cxx +++ b/TRD/AliTRDtransform.cxx @@ -190,9 +190,9 @@ void AliTRDtransform::SetDetector(Int_t det) fCalT0DetValue = fCalT0Det->GetValue(det); // Shift needed to define Z-position relative to middle of chamber - Int_t pla = fGeo->GetPlane(det); - Int_t cha = fGeo->GetChamber(det); - fPadPlane = fGeo->GetPadPlane(pla,cha); + Int_t layer = fGeo->GetLayer(det); + Int_t stack = fGeo->GetStack(det); + fPadPlane = fGeo->GetPadPlane(layer,stack); fZShiftIdeal = 0.5 * (fPadPlane->GetRow0() + fPadPlane->GetRowEnd()); // Get the current transformation matrix diff --git a/TRD/AliTRDtrigger.cxx b/TRD/AliTRDtrigger.cxx index 97340562122..c1d3de90a28 100644 --- a/TRD/AliTRDtrigger.cxx +++ b/TRD/AliTRDtrigger.cxx @@ -336,14 +336,14 @@ Bool_t AliTRDtrigger::ReadTracklets(AliRunLoader *rl) fTrk = (AliTRDmcmTracklet *) tracklets->UncheckedAt(itrk); idet = fTrk->GetDetector(); - iStack = idet / (AliTRDgeometry::Nplan()); + iStack = idet / (AliTRDgeometry::Nlayer()); if (iStackPrev != iStack) { if (iStackPrev == -1) { iStackPrev = iStack; } else { - MakeTracks(idet - AliTRDgeometry::Nplan()); + MakeTracks(idet - AliTRDgeometry::Nlayer()); ResetTracklets(); iStackPrev = iStack; } @@ -354,7 +354,7 @@ Bool_t AliTRDtrigger::ReadTracklets(AliRunLoader *rl) if ((iEntry == (nEntries-1)) && (itrk == (tracklets->GetEntriesFast() - 1))) { idet++; - MakeTracks(idet-AliTRDgeometry::Nplan()); + MakeTracks(idet-AliTRDgeometry::Nlayer()); ResetTracklets(); } @@ -375,12 +375,12 @@ Bool_t AliTRDtrigger::MakeTracklets(Bool_t makeTracks) // Create tracklets from digits // - Int_t chamBeg = 0; - Int_t chamEnd = AliTRDgeometry::Ncham(); - Int_t planBeg = 0; - Int_t planEnd = AliTRDgeometry::Nplan(); - Int_t sectBeg = 0; - Int_t sectEnd = AliTRDgeometry::Nsect(); + Int_t stackBeg = 0; + Int_t stackEnd = AliTRDgeometry::Nstack(); + Int_t layerBeg = 0; + Int_t layerEnd = AliTRDgeometry::Nlayer(); + Int_t sectorBeg = 0; + Int_t sectorEnd = AliTRDgeometry::Nsector(); fTrkTest = new AliTRDmcmTracklet(0,0,0); fMCM = new AliTRDmcm(0); @@ -391,43 +391,43 @@ Bool_t AliTRDtrigger::MakeTracklets(Bool_t makeTracks) Int_t col1; Int_t col2; Int_t idet = -1; - Int_t iStack = -1; + Int_t iStackCur = -1; Int_t iStackPrev = -1; Float_t amp; - for (Int_t isect = sectBeg; isect < sectEnd; isect++) { + for (Int_t isector = sectorBeg; isector < sectorEnd; isector++) { - for (Int_t icham = chamBeg; icham < chamEnd; icham++) { + for (Int_t istack = stackBeg; istack < stackEnd; istack++) { // Number of ROBs in the chamber - if(icham == 2) { + if(istack == 2) { fNROB = 6; } else { fNROB = 8; } - for (Int_t iplan = planBeg; iplan < planEnd; iplan++) { + for (Int_t ilayer = layerBeg; ilayer < layerEnd; ilayer++) { - idet = fGeo->GetDetector(iplan,icham,isect); + idet = fGeo->GetDetector(ilayer,istack,isector); ResetTracklets(); if (makeTracks) { - iStack = idet / (AliTRDgeometry::Nplan()); - if (iStackPrev != iStack) { + iStackCur = idet / (AliTRDgeometry::Nlayer()); + if (iStackPrev != iStackCur) { if (iStackPrev == -1) { - iStackPrev = iStack; + iStackPrev = iStackCur; } else { - MakeTracks(idet-AliTRDgeometry::Nplan()); + MakeTracks(idet-AliTRDgeometry::Nlayer()); ResetTracklets(); - iStackPrev = iStack; + iStackPrev = iStackCur; } } } - Int_t nRowMax = fGeo->GetRowMax(iplan,icham,isect); - Int_t nColMax = fGeo->GetColMax(iplan); + Int_t nRowMax = fGeo->GetRowMax(ilayer,istack,isector); + Int_t nColMax = fGeo->GetColMax(ilayer); Int_t nTimeTotal = AliTRDcalibDB::Instance()->GetNumberOfTimeBins(); // Get the digits @@ -521,7 +521,7 @@ Bool_t AliTRDtrigger::MakeTracklets(Bool_t makeTracks) if (makeTracks) { idet++; - MakeTracks(idet - AliTRDgeometry::Nplan()); + MakeTracks(idet - AliTRDgeometry::Nlayer()); ResetTracklets(); } @@ -804,7 +804,7 @@ void AliTRDtrigger::MakeTracks(Int_t det) fModule->Reset(); - Int_t nRowMax, iplan, icham, isect, row; + Int_t nRowMax, ilayer, istack, isector, row; if ((det < 0) || (det >= AliTRDgeometry::Ndet())) { AliError(Form("Unexpected detector index %d.",det)); @@ -818,11 +818,11 @@ void AliTRDtrigger::MakeTracks(Int_t det) trk = (AliTRDmcmTracklet *) Tracklets()->UncheckedAt(i); - iplan = fGeo->GetPlane(trk->GetDetector()); - icham = fGeo->GetChamber(trk->GetDetector()); - isect = fGeo->GetSector(trk->GetDetector()); + ilayer = fGeo->GetLayer(trk->GetDetector()); + istack = fGeo->GetStack(trk->GetDetector()); + isector = fGeo->GetSector(trk->GetDetector()); - nRowMax = fGeo->GetRowMax(iplan,icham,isect); + nRowMax = fGeo->GetRowMax(ilayer,istack,isector); row = trk->GetRow(); fModule->AddTracklet(trk->GetDetector(), @@ -839,7 +839,7 @@ void AliTRDtrigger::MakeTracks(Int_t det) fModule->SortTracklets(); fModule->RemoveMultipleTracklets(); - fModule->SortZ((Int_t)fGeo->GetChamber(det)); + fModule->SortZ((Int_t)fGeo->GetStack(det)); fModule->FindTracks(); fModule->SortTracks(); fModule->RemoveMultipleTracks(); diff --git a/TRD/AliTRDv1.cxx b/TRD/AliTRDv1.cxx index 0144a102363..32077a871ca 100644 --- a/TRD/AliTRDv1.cxx +++ b/TRD/AliTRDv1.cxx @@ -138,16 +138,16 @@ void AliTRDv1::AddAlignableVolumes() const // ... // TRD/sm17 // - for (Int_t isect = 0; isect < AliTRDgeometry::Nsect(); isect++) { + for (Int_t isector = 0; isector < AliTRDgeometry::Nsector(); isector++) { volPath = vpStr; - volPath += isect; + volPath += isector; volPath += vpApp1; - volPath += isect; + volPath += isector; volPath += vpApp2; symName = snStr; - symName += Form("%02d",isect); + symName += Form("%02d",isector); gGeoManager->SetAlignableEntry(symName.Data(),volPath.Data()); @@ -162,28 +162,28 @@ void AliTRDv1::AddAlignableVolumes() const AliGeomManager::ELayerID idTRD1 = AliGeomManager::kTRD1; Int_t layer, modUID; - for (Int_t isect = 0; isect < AliTRDgeometry::Nsect(); isect++) { + for (Int_t isector = 0; isector < AliTRDgeometry::Nsector(); isector++) { - if (fGeometry->GetSMstatus(isect) == 0) continue; + if (fGeometry->GetSMstatus(isector) == 0) continue; - for (Int_t icham = 0; icham < AliTRDgeometry::Ncham(); icham++) { - for (Int_t iplan = 0; iplan < AliTRDgeometry::Nplan(); iplan++) { + for (Int_t istack = 0; istack < AliTRDgeometry::Nstack(); istack++) { + for (Int_t ilayer = 0; ilayer < AliTRDgeometry::Nlayer(); ilayer++) { - layer = idTRD1 + iplan; - modUID = AliGeomManager::LayerToVolUIDSafe(layer,isect*5+icham); - - Int_t idet = AliTRDgeometry::GetDetectorSec(iplan,icham); + layer = idTRD1 + ilayer; + modUID = AliGeomManager::LayerToVolUIDSafe(layer,isector*5+istack); + + Int_t idet = AliTRDgeometry::GetDetectorSec(ilayer,istack); volPath = vpStr; - volPath += isect; + volPath += isector; volPath += vpApp1; - volPath += isect; + volPath += isector; volPath += vpApp2; - switch (isect) { + switch (isector) { case 13: case 14: case 15: - if (icham == 2) { + if (istack == 2) { continue; } volPath += vpApp3c; @@ -199,11 +199,11 @@ void AliTRDv1::AddAlignableVolumes() const volPath += vpApp2; symName = snStr; - symName += Form("%02d",isect); + symName += Form("%02d",isector); symName += snApp1; - symName += icham; + symName += istack; symName += snApp2; - symName += iplan; + symName += ilayer; TGeoPNEntry *alignableEntry = gGeoManager->SetAlignableEntry(symName.Data(),volPath.Data(),modUID); @@ -212,7 +212,7 @@ void AliTRDv1::AddAlignableVolumes() const if (alignableEntry) { // Is this correct still???? TGeoHMatrix *globMatrix = alignableEntry->GetGlobalOrig(); - Double_t sectorAngle = 20.0 * (isect % 18) + 10.0; + Double_t sectorAngle = 20.0 * (isector % 18) + 10.0; TGeoHMatrix *t2lMatrix = new TGeoHMatrix(); t2lMatrix->RotateZ(sectorAngle); t2lMatrix->MultiplyLeft(&(globMatrix->Inverse())); @@ -441,10 +441,10 @@ void AliTRDv1::StepManagerGeant() // Version by A. Bercuci // - Int_t pla = 0; - Int_t cha = 0; - Int_t sec = 0; - Int_t det = 0; + Int_t layer = 0; + Int_t stack = 0; + Int_t sector = 0; + Int_t det = 0; Int_t iPdg; Int_t qTot; @@ -476,9 +476,9 @@ void AliTRDv1::StepManagerGeant() TArrayI processes; - const Int_t kNplan = AliTRDgeometry::Nplan(); - const Int_t kNcham = AliTRDgeometry::Ncham(); - const Int_t kNdetsec = kNplan * kNcham; + const Int_t kNlayer = AliTRDgeometry::Nlayer(); + const Int_t kNstack = AliTRDgeometry::Nstack(); + const Int_t kNdetsec = kNlayer * kNstack; const Double_t kBig = 1.0e+12; // Infinitely big const Float_t kWion = 23.53; // Ionization energy @@ -536,17 +536,17 @@ void AliTRDv1::StepManagerGeant() cIdPath = gGeoManager->GetPath(); cIdSector[0] = cIdPath[21]; cIdSector[1] = cIdPath[22]; - sec = atoi(cIdSector); + sector = atoi(cIdSector); - // The plane and chamber number + // The layer and stack number cIdChamber[0] = cIdCurrent[2]; cIdChamber[1] = cIdCurrent[3]; Int_t idChamber = (atoi(cIdChamber) % kNdetsec); - cha = ((Int_t) idChamber / kNplan); - pla = ((Int_t) idChamber % kNplan); + stack = ((Int_t) idChamber / kNlayer); + layer = ((Int_t) idChamber % kNlayer); // The detector number - det = fGeometry->GetDetector(pla,cha,sec); + det = fGeometry->GetDetector(layer,stack,sector); // Special hits only in the drift region if ((drRegion) && @@ -590,7 +590,7 @@ void AliTRDv1::StepManagerGeant() pid = 0; } else { - pid = processes[nofprocesses-1]; + pid = processes[nofprocesses-1]; } // Generate Edep according to GEANT parametrisation @@ -698,10 +698,10 @@ void AliTRDv1::StepManagerErmilova() // a spectrum taken from Ermilova et al. // - Int_t pla = 0; - Int_t cha = 0; - Int_t sec = 0; - Int_t det = 0; + Int_t layer = 0; + Int_t stack = 0; + Int_t sector = 0; + Int_t det = 0; Int_t iPdg; Int_t qTot; @@ -732,9 +732,9 @@ void AliTRDv1::StepManagerErmilova() TLorentzVector pos; TLorentzVector mom; - const Int_t kNplan = AliTRDgeometry::Nplan(); - const Int_t kNcham = AliTRDgeometry::Ncham(); - const Int_t kNdetsec = kNplan * kNcham; + const Int_t kNlayer = AliTRDgeometry::Nlayer(); + const Int_t kNstack = AliTRDgeometry::Nstack(); + const Int_t kNdetsec = kNlayer * kNstack; const Double_t kBig = 1.0e+12; // Infinitely big const Float_t kWion = 23.53; // Ionization energy @@ -783,17 +783,17 @@ void AliTRDv1::StepManagerErmilova() cIdPath = gGeoManager->GetPath(); cIdSector[0] = cIdPath[21]; cIdSector[1] = cIdPath[22]; - sec = atoi(cIdSector); + sector = atoi(cIdSector); // The plane and chamber number cIdChamber[0] = cIdCurrent[2]; cIdChamber[1] = cIdCurrent[3]; Int_t idChamber = (atoi(cIdChamber) % kNdetsec); - cha = ((Int_t) idChamber / kNplan); - pla = ((Int_t) idChamber % kNplan); + stack = ((Int_t) idChamber / kNlayer); + layer = ((Int_t) idChamber % kNlayer); // The detector number - det = fGeometry->GetDetector(pla,cha,sec); + det = fGeometry->GetDetector(layer,stack,sector); // Special hits only in the drift region if ((drRegion) && @@ -906,10 +906,10 @@ void AliTRDv1::StepManagerFixedStep() // PDG code electron const Int_t kPdgElectron = 11; - Int_t pla = 0; - Int_t cha = 0; - Int_t sec = 0; - Int_t det = 0; + Int_t layer = 0; + Int_t stack = 0; + Int_t sector = 0; + Int_t det = 0; Int_t qTot; Float_t hits[3]; @@ -931,9 +931,9 @@ void AliTRDv1::StepManagerFixedStep() TLorentzVector pos; TLorentzVector mom; - const Int_t kNplan = AliTRDgeometry::Nplan(); - const Int_t kNcham = AliTRDgeometry::Ncham(); - const Int_t kNdetsec = kNplan * kNcham; + const Int_t kNlayer = AliTRDgeometry::Nlayer(); + const Int_t kNstack = AliTRDgeometry::Nstack(); + const Int_t kNdetsec = kNlayer * kNstack; const Double_t kBig = 1.0e+12; @@ -975,17 +975,17 @@ void AliTRDv1::StepManagerFixedStep() cIdPath = gGeoManager->GetPath(); cIdSector[0] = cIdPath[21]; cIdSector[1] = cIdPath[22]; - sec = atoi(cIdSector); + sector = atoi(cIdSector); // The plane and chamber number cIdChamber[0] = cIdCurrent[2]; cIdChamber[1] = cIdCurrent[3]; Int_t idChamber = (atoi(cIdChamber) % kNdetsec); - cha = ((Int_t) idChamber / kNplan); - pla = ((Int_t) idChamber % kNplan); + stack = ((Int_t) idChamber / kNlayer); + layer = ((Int_t) idChamber % kNlayer); // The detector number - det = fGeometry->GetDetector(pla,cha,sec); + det = fGeometry->GetDetector(layer,stack,sector); // 0: InFlight 1:Entering 2:Exiting Int_t trkStat = 0; -- 2.39.3