Added 2 more signature for ImpactOnEMC
authorschutz <schutz@f7af4fe6-9843-0410-8265-dc069ae4e863>
Tue, 10 Feb 2004 15:51:18 +0000 (15:51 +0000)
committerschutz <schutz@f7af4fe6-9843-0410-8265-dc069ae4e863>
Tue, 10 Feb 2004 15:51:18 +0000 (15:51 +0000)
PHOS/AliPHOSGeometry.cxx
PHOS/AliPHOSGeometry.h

index 241a9eb9741a0bfb2f23c4d3c4d829bd882106cd..61012d5a2809684a7e16565689dabb12e08ec06d 100644 (file)
@@ -324,23 +324,24 @@ void AliPHOSGeometry::GetGlobal(const AliRecPoint* RecPoint, TVector3 & gpos) co
 }
 
 //____________________________________________________________________________
-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) ; 
@@ -349,6 +350,32 @@ void AliPHOSGeometry::ImpactOnEmc(Double_t theta, Double_t phi, Int_t & ModuleNu
   }
 }
 
+//____________________________________________________________________________
+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 
 {
index 36592483580e7a5ba1f376f0c00b6d344fee754b..33a4a54df11b351f90b0f8c3a7febab02efc9aac 100644 (file)
@@ -63,7 +63,11 @@ public:
                                          // 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 ;