From: schutz Date: Tue, 11 May 2004 12:30:55 +0000 (+0000) Subject: Added method to calculate absID from position in PHOS local coordinate system X-Git-Url: http://git.uio.no/git/?p=u%2Fmrichter%2FAliRoot.git;a=commitdiff_plain;h=842988a5e7e081dd14232520f08c54c975210f68 Added method to calculate absID from position in PHOS local coordinate system --- diff --git a/PHOS/AliPHOSGeometry.cxx b/PHOS/AliPHOSGeometry.cxx index afb41dcf095..c1bf473819f 100644 --- a/PHOS/AliPHOSGeometry.cxx +++ b/PHOS/AliPHOSGeometry.cxx @@ -458,6 +458,19 @@ void AliPHOSGeometry::RelPosInAlice(Int_t id, TVector3 & pos ) const pos.Transform(rot) ; // rotate the baby } +//____________________________________________________________________________ +void AliPHOSGeometry::RelPosToAbsId(const Int_t module, const Double_t x, const Double_t z, Int_t & AbsId) const +{ + // converts local PHOS-module (x, z) coordinates to absId + Int_t relid[4] ; + relid[0] = module ; + relid[1] = 0 ; + relid[2] = static_cast(TMath::Ceil( x/ GetCellStep() + GetNPhi() / 2.) ); + relid[3] = static_cast(TMath::Ceil(-z/ GetCellStep() + GetNZ() / 2.) ) ; + + RelToAbsNumbering(relid,AbsId) ; +} + //____________________________________________________________________________ void AliPHOSGeometry::RelPosInModule(const Int_t * relid, Float_t & x, Float_t & z) const { diff --git a/PHOS/AliPHOSGeometry.h b/PHOS/AliPHOSGeometry.h index 1582a5ea612..fa6a5ffa164 100644 --- a/PHOS/AliPHOSGeometry.h +++ b/PHOS/AliPHOSGeometry.h @@ -77,6 +77,8 @@ public: // gets the position of element (pad or Xtal) relative to Alice Bool_t RelToAbsNumbering(const Int_t * RelId, Int_t & AbsId) const ; // converts the absolute PHOS numbering to a relative + void RelPosToAbsId(const Int_t module, const Double_t x, const Double_t z, Int_t & AbsId) const; + // converts local PHOS-module (x, z) coordinates to absId Bool_t IsInitialized(void) const { return fgInit ; }