fX, fY, fZ Getters have been overloaded to calculate accurate position of every hit...
authorschutz <schutz@f7af4fe6-9843-0410-8265-dc069ae4e863>
Tue, 28 Aug 2001 09:54:51 +0000 (09:54 +0000)
committerschutz <schutz@f7af4fe6-9843-0410-8265-dc069ae4e863>
Tue, 28 Aug 2001 09:54:51 +0000 (09:54 +0000)
PHOS/AliPHOSHit.cxx
PHOS/AliPHOSHit.h

index b4ff709c1d7db8c7d0a66e5f3f9594da9a6cc967..f29774283a1810b9cce26123c82037fb47d24cf7 100644 (file)
@@ -33,6 +33,9 @@
 #include "AliPHOSHit.h"
 #include "AliRun.h"
 #include "AliConst.h"
+#include "AliPHOSGetter.h"
+#include "AliPHOSGeometry.h"
+
 
 
 ClassImp(AliPHOSHit)
@@ -42,6 +45,9 @@ AliPHOSHit::AliPHOSHit(const AliPHOSHit & hit)
 {
    // copy ctor
    
+  fX       = hit.fX ; 
+  fY       = hit.fY ; 
+  fZ       = hit.fZ ; 
   fId      = hit.fId ; 
   fELOS    = hit.fELOS ;
   fPrimary = hit.fPrimary ; 
@@ -58,9 +64,37 @@ AliPHOSHit::AliPHOSHit(Int_t shunt, Int_t primary, Int_t track, Int_t id, Float_
   //
 
   fId         = id ;
+  fX          = hits[0] ;
+  fY          = hits[1] ;
+  fZ          = hits[2] ;
   fELOS       = hits[3] ;
   fPrimary    = primary ;
 }
+//____________________________________________________________________________
+Float_t AliPHOSHit::X() const
+{
+    TVector3  pos ;
+    AliPHOSGetter * gime = AliPHOSGetter::GetInstance() ;  
+    ((AliPHOSGeometry *) gime->PHOSGeometry()) ->RelPosInAlice(GetId(),  pos);
+    return pos.X();
+}
+//____________________________________________________________________________
+Float_t AliPHOSHit::Y() const
+{
+    TVector3  pos ;
+    AliPHOSGetter * gime = AliPHOSGetter::GetInstance() ;  
+    ((AliPHOSGeometry *) gime->PHOSGeometry()) ->RelPosInAlice(GetId(),  pos);
+    return pos.Y();
+}
+//____________________________________________________________________________
+Float_t AliPHOSHit::Z() const
+{
+    TVector3  pos ;
+    AliPHOSGetter * gime = AliPHOSGetter::GetInstance() ;  
+    ((AliPHOSGeometry *) gime->PHOSGeometry()) ->RelPosInAlice(GetId(),  pos);
+    return pos.Z() ;
+}
+
 
 //____________________________________________________________________________
 Bool_t AliPHOSHit::operator==(AliPHOSHit const &rValue) const
index 591e751d1a41b749005a73d76cbc2b4d1aea072e..c23dd225e15523ee6ca14dba03b5661882e5a3c0 100644 (file)
@@ -49,6 +49,10 @@ class AliPHOSHit : public AliHit {
     // returns the primary particle id at the origine of this hit 
     return fPrimary ; 
   }
+  virtual Float_t X() const ;
+  virtual Float_t Y() const ;
+  virtual Float_t Z() const ;
+
 
   Bool_t operator == (AliPHOSHit const &rValue) const ;
   AliPHOSHit operator + (const AliPHOSHit& rValue) ;