]> git.uio.no Git - u/mrichter/AliRoot.git/commitdiff
EmcModuleCoverage() corrected: it assumed twice larger acceptance; RelPosToAbsId...
authorschutz <schutz@f7af4fe6-9843-0410-8265-dc069ae4e863>
Mon, 18 Nov 2002 11:11:19 +0000 (11:11 +0000)
committerschutz <schutz@f7af4fe6-9843-0410-8265-dc069ae4e863>
Mon, 18 Nov 2002 11:11:19 +0000 (11:11 +0000)
PHOS/AliPHOSGeometry.cxx

index a68745cb14e41c919f6d06bc8b103f9e2f079d53..302456a0f8daeea5e19e55cd3e6234bd2b4f3208 100644 (file)
@@ -217,17 +217,16 @@ void AliPHOSGeometry::EmcModuleCoverage(const Int_t mod, Double_t & tm, Double_t
 
   Float_t phi = GetPHOSAngle(mod) *  (TMath::Pi() / 180.)  ;  
   Float_t y0  = GetIPtoCrystalSurface() ; 
-  Float_t * strip = fGeometryEMCA->GetStripHalfSize() ;
-  Float_t x0  = fGeometryEMCA->GetNStripX()*strip[0] ;
-  Float_t z0  = fGeometryEMCA->GetNStripZ()*strip[2] ;
-  Double_t angle = TMath::ATan( x0 / y0 ) ;
+  Float_t x0  = GetCellStep()*GetNPhi() ;
+  Float_t z0  = GetCellStep()*GetNZ();
+  Double_t angle = TMath::ATan( x0 / y0 / 2 ) ;
   phi = phi + 1.5 * TMath::Pi() ; // to follow the convention of the particle generator(PHOS is between 220 and 320 deg.)
   Double_t max  = phi - angle ;
   Double_t min   = phi + angle ;
   pM = TMath::Max(max, min) * conv ;
   pm = TMath::Min(max, min) * conv ; 
   
-  angle =  TMath::ATan( z0 /  y0 ) ;
+  angle =  TMath::ATan( z0 /  y0  / 2 ) ;
   max  = TMath::Pi() / 2.  + angle ; // to follow the convention of the particle generator(PHOS is at 90 deg.)
   min  = TMath::Pi() / 2.  - angle ;
   tM = TMath::Max(max, min) * conv ;
@@ -383,7 +382,24 @@ Bool_t AliPHOSGeometry::RelToAbsNumbering(const Int_t * relid, Int_t &  AbsId) c
 }
 
 //____________________________________________________________________________
+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 
 
+  if(!module){
+    AbsId = 0 ;
+    return ;
+  }
+  
+  Int_t relid[4] ;
+  relid[0] = module ;
+  relid[1] = 0 ;
+  relid[2] = static_cast<Int_t>(TMath::Ceil(GetNPhi()/2.+ x/GetCellStep()));
+  relid[3] = static_cast<Int_t>(TMath::Ceil(GetNZ()/2.  - z/GetCellStep())) ;
+
+  RelToAbsNumbering(relid,AbsId) ;
+
+}
+//____________________________________________________________________________
 void AliPHOSGeometry::RelPosInAlice(const Int_t id, TVector3 & pos ) const
 {
   // Converts the absolute numbering into the global ALICE coordinate system