}
//____________________________________________________________________________
-void AliPHOSGeometry::ImpactOnEmc(Double_t theta, Double_t phi, Int_t & ModuleNumber, Double_t & z, Double_t & x) const
+void AliPHOSGeometry::ImpactOnEmc(Double_t theta, Double_t phi, Int_t & moduleNumber, Double_t & z, Double_t & x) const
{
// calculates the impact coordinates on PHOS of a neutral particle
// emitted in the direction theta and phi in the ALICE global coordinate system
// searches for the PHOS EMC module
- ModuleNumber = 0 ;
+
+ moduleNumber = 0 ;
Double_t tm, tM, pm, pM ;
Int_t index = 1 ;
- while ( ModuleNumber == 0 && index <= GetNModules() ) {
+ while ( moduleNumber == 0 && index <= GetNModules() ) {
EmcModuleCoverage(index, tm, tM, pm, pM) ;
if ( (theta >= tm && theta <= tM) && (phi >= pm && phi <= pM ) )
- ModuleNumber = index ;
+ moduleNumber = index ;
index++ ;
}
- if ( ModuleNumber != 0 ) {
- Float_t phi0 = GetPHOSAngle(ModuleNumber) * (TMath::Pi() / 180.) + 1.5 * TMath::Pi() ;
+ if ( moduleNumber != 0 ) {
+ Float_t phi0 = GetPHOSAngle(moduleNumber) * (TMath::Pi() / 180.) + 1.5 * TMath::Pi() ;
Float_t y0 = GetIPtoCrystalSurface() ;
Double_t angle = phi - phi0;
x = y0 * TMath::Tan(angle) ;
}
}
+//____________________________________________________________________________
+void AliPHOSGeometry::ImpactOnEmc(TVector3 vec, Int_t & moduleNumber, Double_t & z, Double_t & x) const
+{
+ // calculates the impact coordinates on PHOS of a neutral particle
+ // emitted in the direction theta and phi in the ALICE global coordinate system
+ // searches for the PHOS EMC module
+
+ TParticle p ;
+ p.SetMomentum(vec.X(), vec.Y(), vec.Z(), 0.) ;
+
+ ImpactOnEmc(p, moduleNumber, z, x) ;
+}
+
+//____________________________________________________________________________
+void AliPHOSGeometry::ImpactOnEmc(TParticle p, Int_t & moduleNumber, Double_t & z, Double_t & x) const
+{
+ // calculates the impact coordinates on PHOS of a neutral particle
+ // emitted in the direction theta and phi in the ALICE global coordinate system
+
+ // searches for the PHOS EMC module
+ Double_t theta = p.Theta() ;
+ Double_t phi = p.Phi() ;
+
+ ImpactOnEmc(theta, phi, moduleNumber, z, x) ;
+}
+
//____________________________________________________________________________
Bool_t AliPHOSGeometry::Impact(const TParticle * particle) const
{
// single crystal in a EMC module
void ImpactOnEmc(Double_t theta, Double_t phi, Int_t & ModuleNumber,
Double_t & z, Double_t & x) const ;
- // calculates the impact coordinates of a neutral particle
+ void ImpactOnEmc(TVector3 vec, Int_t & ModuleNumber,
+ Double_t & z, Double_t & x) const ;
+ void ImpactOnEmc(TParticle p, Int_t & ModuleNumber,
+ Double_t & z, Double_t & x) const ;
+ // calculates the impact coordinates of a neutral particle
// emitted in direction theta and phi in ALICE
Bool_t IsInEMC(Int_t id) const { if (id > GetNModules() * GetNCristalsInModule() ) return kFALSE; return kTRUE; }
void RelPosInModule(const Int_t * RelId, Float_t & y, Float_t & z) const ;