]> git.uio.no Git - u/mrichter/AliRoot.git/commitdiff
Added method to calculate absID from position in PHOS local coordinate system
authorschutz <schutz@f7af4fe6-9843-0410-8265-dc069ae4e863>
Tue, 11 May 2004 12:30:55 +0000 (12:30 +0000)
committerschutz <schutz@f7af4fe6-9843-0410-8265-dc069ae4e863>
Tue, 11 May 2004 12:30:55 +0000 (12:30 +0000)
PHOS/AliPHOSGeometry.cxx
PHOS/AliPHOSGeometry.h

index afb41dcf095c784089c6785fd15a1fb8ff8ad685..c1bf473819ffc2ae8e926dcbe6748d21f1357d0e 100644 (file)
@@ -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<Int_t>(TMath::Ceil( x/ GetCellStep() + GetNPhi() / 2.) );
+  relid[3] = static_cast<Int_t>(TMath::Ceil(-z/ GetCellStep() + GetNZ()   / 2.) ) ;
+  
+  RelToAbsNumbering(relid,AbsId) ;
+}
+
 //____________________________________________________________________________
 void AliPHOSGeometry::RelPosInModule(const Int_t * relid, Float_t & x, Float_t & z) const 
 {
index 1582a5ea612c27e64913db9432f0572fce2110ec..fa6a5ffa164b6d10906421ee7cca57c6984f08ce 100644 (file)
@@ -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 ; }