From: pavlinov Date: Fri, 2 Jun 2006 23:04:26 +0000 (+0000) Subject: ALICE numbering scheme X-Git-Url: http://git.uio.no/git/?p=u%2Fmrichter%2FAliRoot.git;a=commitdiff_plain;h=dc7da4367156024a9c39d5b7e9f89360fdaececa ALICE numbering scheme --- diff --git a/EMCAL/AliEMCALClusterizerv1.cxx b/EMCAL/AliEMCALClusterizerv1.cxx index 8ba85c69d4f..044b6b334db 100644 --- a/EMCAL/AliEMCALClusterizerv1.cxx +++ b/EMCAL/AliEMCALClusterizerv1.cxx @@ -251,11 +251,12 @@ Bool_t AliEMCALClusterizerv1::FindFit(AliEMCALRecPoint * emcRP, AliEMCALDigit ** for(iDigit = 0; iDigit < nDigits; iDigit++){ digit = maxAt[iDigit]; - Int_t relid[2] ; Float_t x = 0.; Float_t z = 0.; - fGeom->AbsToRelNumbering(digit->GetId(), relid) ; - fGeom->PosInAlice(relid, x, z) ; + // have to be tune for TRD1; May 31,06 + // Int_t relid[2] ; + // fGeom->AbsToRelNumbering(digit->GetId(), relid) ; // obsolete method + // fGeom->PosInAlice(relid, x, z) ; // obsolete method Float_t energy = maxAtEnergy[iDigit] ; diff --git a/EMCAL/AliEMCALGeometry.cxx b/EMCAL/AliEMCALGeometry.cxx index 775d192323f..3e6b34b1804 100644 --- a/EMCAL/AliEMCALGeometry.cxx +++ b/EMCAL/AliEMCALGeometry.cxx @@ -35,7 +35,7 @@ #include #include -#include + //#include #include #include #include @@ -63,6 +63,22 @@ AliEMCALGeometry *AliEMCALGeometry::fgGeom = 0; Bool_t AliEMCALGeometry::fgInit = kFALSE; AliEMCALAlignData *AliEMCALGeometry::fgAlignData = 0; + + +AliEMCALGeometry::AliEMCALGeometry() : AliGeometry() +{ + // default ctor only for internal usage (singleton) + // must be kept public for root persistency purposes, but should never be called by the outside world + // CreateListOfTrd1Modules(); + AliDebug(2, "AliEMCALGeometry : default ctor "); +} +//______________________________________________________________________ +AliEMCALGeometry::AliEMCALGeometry(const Text_t* name, const Text_t* title) : +AliGeometry(name, title) {// ctor only for internal usage (singleton) + AliDebug(2, Form("AliEMCALGeometry(%s,%s) ", name,title)); + Init(); + CreateListOfTrd1Modules(); +} //______________________________________________________________________ AliEMCALGeometry::~AliEMCALGeometry(void){ // dtor @@ -500,260 +516,8 @@ AliEMCALGeometry* AliEMCALGeometry::GetInstance(const Text_t* name, return rv; } -// These methods are obsolete but use in AliEMCALRecPoint - keep it now -//______________________________________________________________________ -Int_t AliEMCALGeometry::TowerIndex(Int_t ieta,Int_t iphi) const { - // Returns the tower index number from the based on the Z and Phi - // index numbers. - // Inputs: - // Int_t ieta // index along z axis [1-fNZ] - // Int_t iphi // index along phi axis [1-fNPhi] - // Outputs: - // none. - // Returned - // Int_t index // Tower index number - - if ( (ieta <= 0 || ieta>GetNEta()) || - (iphi <= 0 || iphi>GetNPhi())) { - Error("TowerIndex", "Unexpected parameters eta = %d phi = %d!", ieta, iphi) ; - return -1; - } - return ( (iphi - 1)*GetNEta() + ieta ); -} - -//______________________________________________________________________ -void AliEMCALGeometry::TowerIndexes(Int_t index,Int_t &ieta,Int_t &iphi) const { - // Inputs: - // Int_t index // Tower index number [1-fNZ*fNPhi] - // Outputs: - // Int_t ieta // index allong z axis [1-fNZ] - // Int_t iphi // index allong phi axis [1-fNPhi] - // Returned - // none. - - Int_t nindex = 0; - - if ( IsInECA(index) ) { // ECAL index - nindex = index ; - } - else { - Error("TowerIndexes", "Unexpected Id number!") ; - ieta = -1; - iphi = -1; - return; - } - - if (nindex%GetNZ()) - iphi = nindex / GetNZ() + 1 ; - else - iphi = nindex / GetNZ() ; - ieta = nindex - (iphi - 1) * GetNZ() ; - - AliDebug(2,Form("TowerIndexes: index=%d,%d, ieta=%d, iphi = %d", index, nindex,ieta, iphi)); - return; - -} - -//______________________________________________________________________ -void AliEMCALGeometry::EtaPhiFromIndex(Int_t index,Float_t &eta,Float_t &phi) const { - // given the tower index number it returns the based on the eta and phi - // of the tower. - // Inputs: - // Int_t index // Tower index number [1-fNZ*fNPhi] - // Outputs: - // Float_t eta // eta of center of tower in pseudorapidity - // Float_t phi // phi of center of tower in degrees - // Returned - // none. - Int_t ieta, iphi; - Float_t deta, dphi ; - - TowerIndexes(index,ieta,iphi); - - AliDebug(2,Form("EtaPhiFromIndex: index = %d, ieta = %d, iphi = %d", index, ieta, iphi)); - - deta = (GetArm1EtaMax()-GetArm1EtaMin())/(static_cast(GetNEta())); - eta = GetArm1EtaMin() + ((static_cast(ieta) - 0.5 ))*deta; - - dphi = (GetArm1PhiMax() - GetArm1PhiMin())/(static_cast(GetNPhi())); // in degrees. - phi = GetArm1PhiMin() + dphi*(static_cast(iphi) - 0.5);//iphi range [1-fNphi]. -} - -//______________________________________________________________________ -Int_t AliEMCALGeometry::TowerIndexFromEtaPhi(Float_t eta,Float_t phi) const { - // returns the tower index number based on the eta and phi of the tower. - // Inputs: - // Float_t eta // eta of center of tower in pseudorapidity - // Float_t phi // phi of center of tower in degrees - // Outputs: - // none. - // Returned - // Int_t index // Tower index number [1-fNZ*fNPhi] - - Int_t ieta,iphi; - - ieta = static_cast ( 1 + (static_cast(GetNEta()) * (eta - GetArm1EtaMin()) / (GetArm1EtaMax() - GetArm1EtaMin())) ) ; - - if( ieta <= 0 || ieta > GetNEta() ) { - Error("TowerIndexFromEtaPhi", "Unexpected (eta, phi) = (%f, %f) value, outside of EMCAL!", eta, phi) ; - return -1 ; - } - - iphi = static_cast ( 1 + (static_cast(GetNPhi()) * (phi - GetArm1PhiMin()) / (GetArm1PhiMax() - GetArm1PhiMin())) ) ; - - if( iphi <= 0 || iphi > GetNPhi() ) { - Error("TowerIndexFromEtaPhi", "Unexpected (eta, phi) = (%f, %f) value, outside of EMCAL!", eta, phi) ; - return -1 ; - } - - return TowerIndex(ieta,iphi); -} - -//______________________________________________________________________ -Bool_t AliEMCALGeometry::AbsToRelNumbering(Int_t AbsId, Int_t *relid) const { - // Converts the absolute numbering into the following array/ - // relid[0] = Row number inside EMCAL - // relid[1] = Column number inside EMCAL - // Input: - // Int_t AbsId // Tower index number [1-2*fNZ*fNPhi] - // Outputs: - // Int_t *relid // array of 2. Described above. - Bool_t rv = kTRUE ; - Int_t ieta=0,iphi=0,index=AbsId; - - TowerIndexes(index,ieta,iphi); - relid[0] = ieta; - relid[1] = iphi; - - return rv; -} - -//______________________________________________________________________ -void AliEMCALGeometry::PosInAlice(const Int_t *relid, Float_t &theta, Float_t &phi) const -{ - // Converts the relative numbering into the local EMCAL-module (x, z) - // coordinates - Int_t ieta = relid[0]; // offset along x axis - Int_t iphi = relid[1]; // offset along z axis - Int_t index; - Float_t eta; - - index = TowerIndex(ieta,iphi); - EtaPhiFromIndex(index,eta,phi); - //theta = 180.*(2.0*TMath::ATan(TMath::Exp(-eta)))/TMath::Pi(); - theta = 2.0*TMath::ATan(TMath::Exp(-eta)); - - // correct for distance to IP - Float_t d = GetIP2ECASection() - GetIPDistance() ; - - Float_t correction = 1 + d/GetIPDistance() ; - Float_t tantheta = TMath::Tan(theta) * correction ; - theta = TMath::ATan(tantheta) * TMath::RadToDeg() ; - if (theta < 0 ) - theta += 180. ; - - return; -} - -//______________________________________________________________________ -void AliEMCALGeometry::PosInAlice(Int_t absid, Float_t &theta, Float_t &phi) const -{ - // Converts the relative numbering into the local EMCAL-module (x, z) - // coordinates - Int_t relid[2] ; - AbsToRelNumbering(absid, relid) ; - Int_t ieta = relid[0]; // offset along x axis - Int_t iphi = relid[1]; // offset along z axis - Int_t index; - Float_t eta; - - index = TowerIndex(ieta,iphi); - EtaPhiFromIndex(index,eta,phi); - theta = 2.0*TMath::ATan(TMath::Exp(-eta)) ; - - // correct for distance to IP - Float_t d = 0. ; - if (IsInECA(absid)) - d = GetIP2ECASection() - GetIPDistance() ; - else { - Error("PosInAlice", "Unexpected id # %d!", absid) ; - return; - } - - Float_t correction = 1 + d/GetIPDistance() ; - Float_t tantheta = TMath::Tan(theta) * correction ; - theta = TMath::ATan(tantheta) * TMath::RadToDeg() ; - if (theta < 0 ) - theta += 180. ; - - return; -} - -//______________________________________________________________________ -void AliEMCALGeometry::XYZFromIndex(const Int_t *relid,Float_t &x,Float_t &y, Float_t &z) const { - // given the tower relative number it returns the X, Y and Z - // of the tower. - - // Outputs: - // Float_t x // x of center of tower in cm - // Float_t y // y of center of tower in cm - // Float_t z // z of centre of tower in cm - // Returned - // none. - - Float_t eta,theta, phi,cylradius=0. ; - - Int_t ieta = relid[0]; // offset along x axis - Int_t iphi = relid[1]; // offset along z axis. - Int_t index; - - index = TowerIndex(ieta,iphi); - EtaPhiFromIndex(index,eta,phi); - theta = 180.*(2.0*TMath::ATan(TMath::Exp(-eta)))/TMath::Pi(); - - cylradius = GetIP2ECASection() ; - - Double_t kDeg2Rad = TMath::DegToRad() ; - x = cylradius * TMath::Cos(phi * kDeg2Rad ) ; - y = cylradius * TMath::Sin(phi * kDeg2Rad ) ; - z = cylradius / TMath::Tan(theta * kDeg2Rad ) ; - - return; -} - -//______________________________________________________________________ -void AliEMCALGeometry::XYZFromIndex(Int_t absid, TVector3 &v) const { - // given the tower relative number it returns the X, Y and Z - // of the tower. - - // Outputs: - // Float_t x // x of center of tower in cm - // Float_t y // y of center of tower in cm - // Float_t z // z of centre of tower in cm - // Returned - // none. - - Float_t theta, phi,cylradius=0. ; - - PosInAlice(absid, theta, phi) ; - - if ( IsInECA(absid) ) - cylradius = GetIP2ECASection() ; - else { - Error("XYZFromIndex", "Unexpected Tower section") ; - return; - } - - Double_t kDeg2Rad = TMath::DegToRad() ; - v.SetX(cylradius * TMath::Cos(phi * kDeg2Rad ) ); - v.SetY(cylradius * TMath::Sin(phi * kDeg2Rad ) ); - v.SetZ(cylradius / TMath::Tan(theta * kDeg2Rad ) ) ; - - return; -} - Bool_t AliEMCALGeometry::IsInEMCAL(Double_t x, Double_t y, Double_t z) const { - // Checks whether point is inside the EMCal volume + // Checks whether point is inside the EMCal volume, used in AliEMCALv*.cxx // // Code uses cylindrical approximation made of inner radius (for speed) // @@ -785,24 +549,26 @@ Bool_t AliEMCALGeometry::IsInEMCAL(Double_t x, Double_t y, Double_t z) const { // == Shish-kebab cases == // Int_t AliEMCALGeometry::GetAbsCellId(Int_t nSupMod, Int_t nTower, Int_t nIphi, Int_t nIeta) const -{ // 27-aug-04; +{ + // 27-aug-04; // corr. 21-sep-04; // 13-oct-05; 110 degree case - // 1 <= nSupMod <= fNumberOfSuperModules - // 1 <= nTower <= fNPHI * fNZ ( fNPHI * fNZ/2 for fKey110DEG=1) - // 1 <= nIphi <= fNPHIdiv - // 1 <= nIeta <= fNETAdiv - // 1 <= absid <= fNCells - static Int_t id=0; // have to change from 1 to fNCells - if(fKey110DEG == 1 && nSupMod > 10) { // 110 degree case; last two supermodules - id = fNCellsInSupMod*10 + (fNCellsInSupMod/2)*(nSupMod-11); + // May 31, 2006; ALICE numbering scheme: + // 0 <= nSupMod < fNumberOfSuperModules + // 0 <= nTower < fNPHI * fNZ ( fNPHI * fNZ/2 for fKey110DEG=1) + // 0 <= nIphi < fNPHIdiv + // 0 <= nIeta < fNETAdiv + // 0 <= absid < fNCells + static Int_t id=0; // have to change from 0 to fNCells-1 + if(fKey110DEG == 1 && nSupMod >= 10) { // 110 degree case; last two supermodules + id = fNCellsInSupMod*10 + (fNCellsInSupMod/2)*(nSupMod-10); } else { - id = fNCellsInSupMod*(nSupMod-1); + id = fNCellsInSupMod*nSupMod; } - id += fNCellsInTower *(nTower-1); - id += fNPHIdiv *(nIphi-1); + id += fNCellsInTower *nTower; + id += fNPHIdiv *nIphi; id += nIeta; - if(id<=0 || id > fNCells) { + if(id<0 || id >= fNCells) { // printf(" wrong numerations !!\n"); // printf(" id %6i(will be force to -1)\n", id); // printf(" fNCells %6i\n", fNCells); @@ -810,69 +576,67 @@ Int_t AliEMCALGeometry::GetAbsCellId(Int_t nSupMod, Int_t nTower, Int_t nIphi, I // printf(" nTower %6i\n", nTower); // printf(" nIphi %6i\n", nIphi); // printf(" nIeta %6i\n", nIeta); - id = -TMath::Abs(id); + id = -TMath::Abs(id); // if negative something wrong } return id; } -Bool_t AliEMCALGeometry::CheckAbsCellId(Int_t ind) const +Bool_t AliEMCALGeometry::CheckAbsCellId(Int_t absId) const { - // 17-nov-04 - analog of IsInECA - if(fGeoName.Contains("TRD")) { - if(ind<=0 || ind > fNCells) return kFALSE; - else return kTRUE; - } else return IsInECA(ind); + // May 31, 2006; only trd1 now + if(absId<0 || absId >= fNCells) return kFALSE; + else return kTRUE; } Bool_t AliEMCALGeometry::GetCellIndex(Int_t absId,Int_t &nSupMod,Int_t &nTower,Int_t &nIphi,Int_t &nIeta) const { - // 21-sep-04 - // 19-oct-05; + // 21-sep-04; 19-oct-05; + // May 31, 2006; ALICE numbering scheme: static Int_t tmp=0, sm10=0; - if(absId<=0 || absId>fNCells) { -// Info("GetCellIndex"," wrong abs Id %i !! \n", absId); - return kFALSE; - } + if(!CheckAbsCellId(absId)) return kFALSE; + sm10 = fNCellsInSupMod*10; - if(fKey110DEG == 1 && absId > sm10) { // 110 degree case; last two supermodules - nSupMod = (absId-1-sm10) / (fNCellsInSupMod/2) + 11; - tmp = (absId-1-sm10) % (fNCellsInSupMod/2); + if(fKey110DEG == 1 && absId >= sm10) { // 110 degree case; last two supermodules + nSupMod = (absId-sm10) / (fNCellsInSupMod/2) + 10; + tmp = (absId-sm10) % (fNCellsInSupMod/2); } else { - nSupMod = (absId-1) / fNCellsInSupMod + 1; - tmp = (absId-1) % fNCellsInSupMod; + nSupMod = absId / fNCellsInSupMod; + tmp = absId % fNCellsInSupMod; } - nTower = tmp / fNCellsInTower + 1; + nTower = tmp / fNCellsInTower; tmp = tmp % fNCellsInTower; - nIphi = tmp / fNPHIdiv + 1; - nIeta = tmp % fNPHIdiv + 1; + nIphi = tmp / fNPHIdiv; + nIeta = tmp % fNPHIdiv; return kTRUE; } -void AliEMCALGeometry::GetTowerPhiEtaIndexInSModule(Int_t nSupMod, Int_t nTower, int &iphit, int &ietat) const +void AliEMCALGeometry::GetModulePhiEtaIndexInSModule(Int_t nSupMod, Int_t nTower, int &iphim, int &ietam) const { - // added nSupMod; have to check - 19-oct-05 ! + // added nSupMod; have to check - 19-oct-05 ! + // Alice numbering scheme - Jun 01,2006 static Int_t nphi; - if(fKey110DEG == 1 && nSupMod>=11) nphi = fNPhi/2; + if(fKey110DEG == 1 && nSupMod>=10) nphi = fNPhi/2; else nphi = fNPhi; - ietat = (nTower-1)/nphi + 1; // have to change from 1 to fNZ - iphit = (nTower-1)%nphi + 1; // have to change from 1 to fNPhi + ietam = nTower/nphi; // have to change from 0 to fNZ-1 + iphim = nTower%nphi; // have to change from 0 to fNPhi-1 } void AliEMCALGeometry::GetCellPhiEtaIndexInSModule(Int_t nSupMod, Int_t nTower, Int_t nIphi, Int_t nIeta, int &iphi, int &ieta) const { // added nSupMod; Nov 25, 05 - static Int_t iphit, ietat; - - GetTowerPhiEtaIndexInSModule(nSupMod,nTower, iphit, ietat); - // have to change from 1 to fNZ*fNETAdiv - ieta = (ietat-1)*fNETAdiv + (3-nIeta); // x(module) = -z(SM) - // iphi - have to change from 1 to fNPhi*fNPHIdiv - iphi = (iphit-1)*fNPHIdiv + nIphi; // y(module) = y(SM) + // Alice numbering scheme - Jun 01,2006 + static Int_t iphim, ietam; + + GetModulePhiEtaIndexInSModule(nSupMod,nTower, iphim, ietam); + // have to change from 0 to (fNZ*fNETAdiv-1) + ieta = ietam*fNETAdiv + (1-nIeta); // x(module) = -z(SM) + // iphi - have to change from 0 to (fNPhi*fNPHIdiv-1) + iphi = iphim*fNPHIdiv + nIphi; // y(module) = y(SM) } Int_t AliEMCALGeometry::GetSuperModuleNumber(Int_t absId) const @@ -899,10 +663,10 @@ Bool_t AliEMCALGeometry::RelPosCellInSModule(Int_t absId, Double_t &xr, Double_t GetCellIndex(absId, nSupMod, nTower, nIphi, nIeta); GetCellPhiEtaIndexInSModule(nSupMod,nTower,nIphi,nIeta, iphi, ieta); - xr = fXCentersOfCells->At(ieta-1); - zr = fEtaCentersOfCells->At(ieta-1); + xr = fXCentersOfCells.At(ieta); + zr = fEtaCentersOfCells.At(ieta); - yr = fPhiCentersOfCells->At(iphi-1); + yr = fPhiCentersOfCells.At(iphi); // cout<<" absId "<GetSize())); // Feb 20,2006; + // Jun 01, 2006 - ALICE numbering scheme // define grid for cells in eta(z) and x directions in local coordinates system of SM - fEtaCentersOfCells = new TArrayD(fNZ *fNETAdiv); - fXCentersOfCells = new TArrayD(fNZ *fNETAdiv); - AliDebug(2,Form(" Cells grid in eta directions : size %i\n", fEtaCentersOfCells->GetSize())); + // fEtaCentersOfCells = new TArrayD(fNZ *fNETAdiv); + // fXCentersOfCells = new TArrayD(fNZ *fNETAdiv); + fEtaCentersOfCells.Set(fNZ *fNETAdiv); + fXCentersOfCells.Set(fNZ *fNETAdiv); + AliDebug(2,Form(" Cells grid in eta directions : size %i\n", fEtaCentersOfCells.GetSize())); Int_t iphi=0, ieta=0, nTower=0; Double_t xr, zr; for(Int_t it=0; itGetCenterOfCellInLocalCoordinateofSM(ic+1, xr, zr); - GetCellPhiEtaIndexInSModule(1, nTower, 1, ic+1, iphi, ieta); // don't depend from phi - fXCentersOfCells->AddAt(float(xr) - fParSM[0],ieta-1); - fEtaCentersOfCells->AddAt(float(zr) - fParSM[2],ieta-1); + trd1->GetCenterOfCellInLocalCoordinateofSM(ic, xr, zr); + GetCellPhiEtaIndexInSModule(0, nTower, 0, ic, iphi, ieta); // don't depend from phi - ieta in action + fXCentersOfCells.AddAt(float(xr) - fParSM[0],ieta); + fEtaCentersOfCells.AddAt(float(zr) - fParSM[2],ieta); } } - for(Int_t i=0; iGetSize(); i++) { + for(Int_t i=0; iAt(i),fXCentersOfCells->At(i))); + fEtaCentersOfCells.At(i),fXCentersOfCells.At(i))); } // define grid for cells in phi(y) direction in local coordinates system of SM - fPhiCentersOfCells = new TArrayD(fNPhi*fNPHIdiv); - AliDebug(2,Form(" Cells grid in phi directions : size %i\n", fPhiCentersOfCells->GetSize())); + // fPhiCentersOfCells = new TArrayD(fNPhi*fNPHIdiv); + fPhiCentersOfCells.Set(fNPhi*fNPHIdiv); + AliDebug(2,Form(" Cells grid in phi directions : size %i\n", fPhiCentersOfCells.GetSize())); Int_t ind=0; for(Int_t it=0; itAddAt(ytLeftCenterCell,ind); - AliDebug(2,Form(" ind %2.2i : y %8.3f ", ind, fPhiCentersOfCells->At(ind))); + fPhiCentersOfCells.AddAt(ytLeftCenterCell,ind); + AliDebug(2,Form(" ind %2.2i : y %8.3f ", ind, fPhiCentersOfCells.At(ind))); ind++; } } diff --git a/EMCAL/AliEMCALGeometry.h b/EMCAL/AliEMCALGeometry.h index 572ef0774e5..ba9e8810ed9 100644 --- a/EMCAL/AliEMCALGeometry.h +++ b/EMCAL/AliEMCALGeometry.h @@ -19,7 +19,6 @@ class TString ; class TObjArray; class TVector3; class TGeoMatrix; -class TArrayD; class TParticle ; class AliEMCALShishKebabTrd1Module; class AliEMCALRecPoint; @@ -28,6 +27,7 @@ class TClonesArray ; // --- AliRoot header files --- #include "AliGeometry.h" #include "AliEMCALAlignData.h" +#include "TArrayD.h" class AliEMCALGeometry : public AliGeometry { public: @@ -94,7 +94,7 @@ public: Float_t GetECPbRadThick()const {return fECPbRadThickness;} Float_t GetECScintThick() const {return fECScintThick;} Float_t GetSampling() const {return fSampling ; } - Bool_t IsInECA(Int_t index) const { if ( (index > 0 && (index <= GetNZ() * GetNPhi()))) return kTRUE; else return kFALSE ;} + // Bool_t IsInECA(Int_t index) const { if ( (index > 0 && (index <= GetNZ() * GetNPhi()))) return kTRUE; else return kFALSE ;} Int_t GetNumberOfSuperModules() const {return fNumberOfSuperModules;} Float_t GetfPhiGapForSuperModules() const {return fPhiGapForSM;} @@ -134,11 +134,16 @@ public: TGeoMatrix *GetTransformationForSM(int i) { if(i>=0 && GetNumberOfSuperModules()) return fMatrixOfSM[i]; else return 0;} - // abs id <-> indexes; Shish-kebab case (TRD1 or TRD2) + // abs id <-> indexes; Shish-kebab case, only TRD1 now. + // EMCAL -> Super Module -> module -> tower(or cell) - logic tree of EMCAL + // May 31, 2006; ALICE numbering scheme: + // see ALICE-INT-2003-038: ALICE Coordinate System and Software Numbering Convention + // All indexes are stared from zero now. Int_t GetAbsCellId(Int_t nSupMod, Int_t nTower, Int_t nIphi, Int_t nIeta) const; - Bool_t CheckAbsCellId(Int_t ind) const; // replace the IsInECA + Bool_t CheckAbsCellId(Int_t absId) const; Bool_t GetCellIndex(Int_t absId, Int_t &nSupMod, Int_t &nTower, Int_t &nIphi, Int_t &nIeta) const; - void GetTowerPhiEtaIndexInSModule(Int_t nSupMod, Int_t nTower, Int_t &iphit, Int_t &ietat) const; + // Local coordinate of Super Module + void GetModulePhiEtaIndexInSModule(Int_t nSupMod, Int_t nTower, Int_t &iphim, Int_t &ietam) const; void GetCellPhiEtaIndexInSModule(Int_t nSupMod, Int_t nTower, Int_t nIphi, Int_t nIeta, Int_t &iphi, Int_t &ieta) const ; Int_t GetSuperModuleNumber(Int_t absId) const; @@ -152,20 +157,6 @@ public: // pseudorapidity and r=sqrt(x*x+y*y). return r/TMath::Tan(AngleFromEta(eta)); } - // These methods are obsolete but use in AliEMCALRecPoint - keep it now - Int_t TowerIndex(Int_t iz,Int_t iphi) const; // returns tower index - // returns tower indexs iz, iphi. - void TowerIndexes(Int_t index,Int_t &iz,Int_t &iphi) const; - // returns x, y, and z (cm) on the inner surface of a given EMCAL Cell specified by relid. - void XYZFromIndex(const Int_t *relid,Float_t &x,Float_t &y, Float_t &z) const; - void XYZFromIndex(Int_t absid, TVector3 &v) const; - // for a given eta and phi in the EMCAL it returns the tower index. - Int_t TowerIndexFromEtaPhi(Float_t eta,Float_t phi) const; - // for a given eta and phi in the EMCAL it returns the pretower index. - void PosInAlice(const Int_t *relid, Float_t &theta, Float_t &phi) const ; - void PosInAlice(Int_t absid, Float_t &theta, Float_t &phi) const ; - Bool_t AbsToRelNumbering(Int_t AbsId, Int_t *relid) const; - // -- void SetNZ(Int_t nz) { fNZ= nz ; printf("SetNZ: Number of modules in Z set to %d", fNZ) ; } void SetNPhi(Int_t nphi) { fNPhi= nphi ; printf("SetNPhi: Number of modules in Phi set to %d", fNPhi) ; } @@ -178,18 +169,10 @@ public: Int_t GetNCellsInSupMod() const {return fNCellsInSupMod;} Int_t GetNCellsInTower() const {return fNCellsInTower; } - AliEMCALGeometry() : - AliGeometry() {// default ctor only for internal usage (singleton) - // must be kept public for root persistency purposes, but should never be called by the outside world - CreateListOfTrd1Modules(); - }; + AliEMCALGeometry(); // default ctor only for internal usage (singleton) protected: - AliEMCALGeometry(const Text_t* name, const Text_t* title) : - AliGeometry(name, title) {// ctor only for internal usage (singleton) - Init(); - CreateListOfTrd1Modules(); - }; + AliEMCALGeometry(const Text_t* name, const Text_t* title);// ctor only for internal usage (singleton) AliEMCALGeometry(const Text_t* name, const Text_t* title, AliEMCALAlignData* alignData) : AliGeometry(name, title) {// Align data in action @@ -265,9 +248,9 @@ private: Float_t fTubsR; // radius of tubs Float_t fTubsTurnAngle; // turn angle of tubs in degree // Local Coordinates of SM - TArrayD *fEtaCentersOfCells; // size fNEta*fNETAdiv (for TRD1 only) (eta or z in SM) - TArrayD *fXCentersOfCells; // size fNEta*fNETAdiv (for TRD1 only) ( x in SM) - TArrayD *fPhiCentersOfCells; // size fNPhi*fNPHIdiv (for TRD1 only) (phi or y in SM) + TArrayD fEtaCentersOfCells; // size fNEta*fNETAdiv (for TRD1 only) (eta or z in SM) + TArrayD fXCentersOfCells; // size fNEta*fNETAdiv (for TRD1 only) ( x in SM) + TArrayD fPhiCentersOfCells; // size fNPhi*fNPHIdiv (for TRD1 only) (phi or y in SM) // Move from AliEMCALv0 - Feb 19, 2006 TList *fShishKebabTrd1Modules; //! list of modules // Local coordinates of SM for TRD1 diff --git a/EMCAL/AliEMCALSDigitizer.cxx b/EMCAL/AliEMCALSDigitizer.cxx index ffa878f18f4..ee8c0076cda 100644 --- a/EMCAL/AliEMCALSDigitizer.cxx +++ b/EMCAL/AliEMCALSDigitizer.cxx @@ -130,7 +130,7 @@ void AliEMCALSDigitizer::Init(){ //============================================================= YS // The initialisation is now done by the getter - fInit = kTRUE ; + fInit = kTRUE; AliEMCALLoader *emcalLoader = dynamic_cast(AliRunLoader::GetRunLoader()->GetDetectorLoader("EMCAL")); diff --git a/EMCAL/AliEMCALShishKebabTrd1Module.cxx b/EMCAL/AliEMCALShishKebabTrd1Module.cxx index 85854ce8c71..a56953606a3 100644 --- a/EMCAL/AliEMCALShishKebabTrd1Module.cxx +++ b/EMCAL/AliEMCALShishKebabTrd1Module.cxx @@ -52,7 +52,7 @@ AliEMCALShishKebabTrd1Module::AliEMCALShishKebabTrd1Module(Double_t theta, AliEM } } else Warning("AliEMCALShishKebabTrd1Module(theta)","You should call this constractor just once !!"); DefineName(fTheta); - cout<< " theta " << fTheta << " geometry " << g << endl; + cout<< "AliEMCALShishKebabTrd1Module - first module: theta " << fTheta << " geometry " << g << endl; } AliEMCALShishKebabTrd1Module::AliEMCALShishKebabTrd1Module(AliEMCALShishKebabTrd1Module &leftNeighbor) : TNamed() diff --git a/EMCAL/AliEMCALShishKebabTrd1Module.h b/EMCAL/AliEMCALShishKebabTrd1Module.h index da8212ec407..cc727b8d137 100644 --- a/EMCAL/AliEMCALShishKebabTrd1Module.h +++ b/EMCAL/AliEMCALShishKebabTrd1Module.h @@ -43,19 +43,20 @@ class AliEMCALShishKebabTrd1Module : public TNamed { Double_t GetA() const {return fA;} Double_t GetB() const {return fB;} // Additional offline staff + // ieta=0 or 1 - Jun 02, 2006 TVector2& GetCenterOfCellInLocalCoordinateofSM(Int_t ieta) - { if(ieta<=1) return fOK2; + { if(ieta<=0) return fOK2; else return fOK1;} void GetCenterOfCellInLocalCoordinateofSM(Int_t ieta, Double_t &xr, Double_t &zr) { - if(ieta<=1) {xr = fOK2.Y(); zr = fOK2.X(); + if(ieta<=0) {xr = fOK2.Y(); zr = fOK2.X(); } else {xr = fOK1.Y(); zr = fOK1.X(); } } // 15-may-06 TVector2& GetCenterOfModuleFace() {return fOB;} TVector2& GetCenterOfModuleFace(Int_t ieta) { - if(ieta<=1) return fOB2; + if(ieta<=0) return fOB2; else return fOB1; } // @@ -83,12 +84,12 @@ class AliEMCALShishKebabTrd1Module : public TNamed { Double_t fTheta; // theta angle of perependicular to SK module // position of towers(cells) with differents ieta (1 or 2) in local coordinate of SM // Nov 04,2004; Feb 19,2006 - TVector2 fOK1; // ieta=2 - TVector2 fOK2; // ieta=1 + TVector2 fOK1; // ieta=1 + TVector2 fOK2; // ieta=0 // May 13, 2006; local position of module (cells) face TVector2 fOB; // module - TVector2 fOB1; // ieta=2 - TVector2 fOB2; // ieta=1 + TVector2 fOB1; // ieta=1 + TVector2 fOB2; // ieta=0 // public: ClassDef(AliEMCALShishKebabTrd1Module,0) // TRD1 Shish-Kebab module diff --git a/EMCAL/AliEMCALv2.cxx b/EMCAL/AliEMCALv2.cxx index 1ba6d24cb3f..fe7d8585181 100644 --- a/EMCAL/AliEMCALv2.cxx +++ b/EMCAL/AliEMCALv2.cxx @@ -42,7 +42,7 @@ #include "AliHeader.h" #include "AliMC.h" #include "AliPoints.h" -// for TRD1,2 case +// for TRD1 case only; May 31,2006 ClassImp(AliEMCALv2) @@ -220,9 +220,9 @@ void AliEMCALv2::StepManager(void){ else if(strcmp(gMC->CurrentVolOffName(5),"SMON")==0) supModuleNumber = nSMON[supModuleNumber-1]; else assert(0); // something wrong } - absid = fGeometry->GetAbsCellId(supModuleNumber, moduleNumber, yNumber, xNumber); + absid = fGeometry->GetAbsCellId(supModuleNumber-1, moduleNumber-1, yNumber-1, xNumber-1); - if (absid == -1) Fatal("StepManager()", "Wrong id ") ; + if (absid < 0) Fatal("StepManager()", "Wrong id ") ; Float_t lightYield = depositedEnergy ; // Apply Birk's law (copied from G3BIRK) diff --git a/EMCAL/jetfinder/AliEMCALJetFinder.cxx b/EMCAL/jetfinder/AliEMCALJetFinder.cxx index 0ea87000354..73f9bd7ac2c 100644 --- a/EMCAL/jetfinder/AliEMCALJetFinder.cxx +++ b/EMCAL/jetfinder/AliEMCALJetFinder.cxx @@ -1069,7 +1069,7 @@ void AliEMCALJetFinder::FillFromDigits(Int_t flag) { Double_t pedestal = 0.; Double_t channel = 0.; - if (geom->IsInECA(sdg->GetId())) { + if (geom->CheckAbsCellId(sdg->GetId())) { // May 31, 2006; IsInECA(Int_t) -> CheckAbsCellId pedestal = ecADCped; channel = ecADCcha; } diff --git a/EMCAL/jetfinder/AliEMCALJetFinderAlgoOmni.cxx b/EMCAL/jetfinder/AliEMCALJetFinderAlgoOmni.cxx index 990e058fde8..4cad6faeb42 100644 --- a/EMCAL/jetfinder/AliEMCALJetFinderAlgoOmni.cxx +++ b/EMCAL/jetfinder/AliEMCALJetFinderAlgoOmni.cxx @@ -20,6 +20,9 @@ /* $Log$ +Revision 1.1 2006/02/28 21:56:34 jklay +moving jetfinder code to subdirectory + Revision 1.16 2006/02/15 15:11:05 pavlinov update of Jenn and Marco @@ -217,8 +220,11 @@ if (fDebug>0) Info("AliEMCALJetFinderAlgoOmni","Beginning Default Constructor"); { myPart = fInputPointer->GetTrack(j); Float_t eta = myPart->Eta(); - Float_t phi = myPart->Phi(); - Int_t towerID = geom->TowerIndexFromEtaPhi(eta,180.0/TMath::Pi()*phi); + // have to be tune for TRD1; May 31,06 + // Float_t phi = myPart->Phi(); + // Int_t towerID = geom->TowerIndexFromEtaPhi(eta,180.0/TMath::Pi()*phi); + Int_t towerID = 0; + Float_t pT = myPart->Pt(); Float_t unitEnergy = fUnit[towerID-1].GetUnitEnergy(); Float_t unitEnergyNoCuts = fUnitNoCuts[towerID-1].GetUnitEnergy(); diff --git a/EMCAL/jetfinder/AliEMCALJetFinderInputSimPrep.cxx b/EMCAL/jetfinder/AliEMCALJetFinderInputSimPrep.cxx index df12d77edd8..8e6c63dfd22 100644 --- a/EMCAL/jetfinder/AliEMCALJetFinderInputSimPrep.cxx +++ b/EMCAL/jetfinder/AliEMCALJetFinderInputSimPrep.cxx @@ -156,7 +156,7 @@ if (fDebug > 1) Info("FillHits","Beginning FillHits"); // Access hit information // AliEMCAL* pEMCAL = (AliEMCAL*) gAlice->GetModule("EMCAL"); // Info("AliEMCALJetFinderInputSimPrep","Title of the geometry is %s",pEMCAL->GetTitle()); - AliEMCALGeometry* geom = AliEMCALGeometry::GetInstance(); +// AliEMCALGeometry* geom = AliEMCALGeometry::GetInstance(); AliEMCALLoader *emcalLoader = dynamic_cast(AliRunLoader::GetRunLoader()->GetDetectorLoader("EMCAL")); // TTree *treeH = AliEMCALGetter::Instance()->TreeH(); @@ -184,11 +184,12 @@ if (fDebug > 1) Info("FillHits","Beginning FillHits"); Float_t r = TMath::Sqrt(x*x+y*y); Float_t theta = TMath::ATan2(r,z); - Float_t eta = -TMath::Log(TMath::Tan(theta/2.)); - Float_t phi = TMath::ATan2(y,x); + //Float_t eta = -TMath::Log(TMath::Tan(theta/2.)); + //Float_t phi = TMath::ATan2(y,x); etH = eloss*TMath::Sin(theta); if (fDebug > 10) Info("FillHits","Values of hit energy %i",Int_t(1e7*etH)); - if (geom->TowerIndexFromEtaPhi(eta,180.0/TMath::Pi()*phi) == -1) + /* have to be tune for TRD1; May 31,06 + if (geom->TowerIndexFromEtaPhi(eta,180.0/TMath::Pi()*phi) == -1 ) { if (fDebug >5) { @@ -198,6 +199,7 @@ if (fDebug > 1) Info("FillHits","Beginning FillHits"); continue; } fInputObject.AddEnergyToDigit(geom->TowerIndexFromEtaPhi(eta,180.0/TMath::Pi()*phi)-1,Int_t(1e7*etH)); + */ } // Hit Loop // } // Track Loop