From 1c75044c2dc6f163f43867ddf0a80bbd14feb8c0 Mon Sep 17 00:00:00 2001 From: schutz Date: Tue, 28 Aug 2001 09:54:51 +0000 Subject: [PATCH] fX, fY, fZ Getters have been overloaded to calculate accurate position of every hit from its absolute ID --- PHOS/AliPHOSHit.cxx | 34 ++++++++++++++++++++++++++++++++++ PHOS/AliPHOSHit.h | 4 ++++ 2 files changed, 38 insertions(+) diff --git a/PHOS/AliPHOSHit.cxx b/PHOS/AliPHOSHit.cxx index b4ff709c1d7..f29774283a1 100644 --- a/PHOS/AliPHOSHit.cxx +++ b/PHOS/AliPHOSHit.cxx @@ -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 diff --git a/PHOS/AliPHOSHit.h b/PHOS/AliPHOSHit.h index 591e751d1a4..c23dd225e15 100644 --- a/PHOS/AliPHOSHit.h +++ b/PHOS/AliPHOSHit.h @@ -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) ; -- 2.39.3