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 ;
}
//____________________________________________________________________________
+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