X-Git-Url: http://git.uio.no/git/?a=blobdiff_plain;f=PHOS%2FAliPHOSHit.cxx;h=5e9376b39cc7aaa4dace0441a230c187c5ffb940;hb=dd53103bbccd3417841b2692c67e7294274b92bd;hp=f29774283a1810b9cce26123c82037fb47d24cf7;hpb=1c75044c2dc6f163f43867ddf0a80bbd14feb8c0;p=u%2Fmrichter%2FAliRoot.git diff --git a/PHOS/AliPHOSHit.cxx b/PHOS/AliPHOSHit.cxx index f29774283a1..5e9376b39cc 100644 --- a/PHOS/AliPHOSHit.cxx +++ b/PHOS/AliPHOSHit.cxx @@ -19,83 +19,39 @@ // Hits class for PHOS // A hit in PHOS is the sum of all hits in a single crystal //*-- -//*-- Author: Maxime Volkov (RRC KI) & Yves Schutz (SUBATECH) +//*-- Author: Maxime Volkov (RRC KI) & Yves Schutz (SUBATECH) & Dmitri Peressounko (RRC KI & SUBATECH) // --- ROOT system --- // --- Standard library --- -#include -#include -#include -#include // --- AliRoot header files --- #include "AliPHOSHit.h" -#include "AliRun.h" -#include "AliConst.h" -#include "AliPHOSGetter.h" -#include "AliPHOSGeometry.h" - - ClassImp(AliPHOSHit) - -//____________________________________________________________________________ -AliPHOSHit::AliPHOSHit(const AliPHOSHit & hit) + + //____________________________________________________________________________ +AliPHOSHit::AliPHOSHit(const AliPHOSHit & hit) : + AliHit(hit),fId(hit.fId),fELOS(hit.fELOS),fTime(hit.fTime) { - // copy ctor - - fX = hit.fX ; - fY = hit.fY ; - fZ = hit.fZ ; - fId = hit.fId ; - fELOS = hit.fELOS ; - fPrimary = hit.fPrimary ; - fTrack = hit.fTrack ; - - + // copy ctor } //____________________________________________________________________________ -AliPHOSHit::AliPHOSHit(Int_t shunt, Int_t primary, Int_t track, Int_t id, Float_t *hits): AliHit(shunt, track) +AliPHOSHit::AliPHOSHit(Int_t shunt, Int_t track, Int_t id, Float_t *hits) : + AliHit(shunt, track),fId(0),fELOS(0),fTime(0) { // // Create a CPV hit object // - - 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(); + fTime = hits[3] ; + fId = id ; + fELOS = hits[4] ; } -//____________________________________________________________________________ -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 { @@ -103,7 +59,7 @@ Bool_t AliPHOSHit::operator==(AliPHOSHit const &rValue) const Bool_t rv = kFALSE ; - if ( (fId == rValue.GetId()) && ( fPrimary == rValue.GetPrimary() ) ) + if ( (fId == rValue.GetId()) && ( fTrack == rValue.GetPrimary() ) ) rv = kTRUE; return rv; @@ -115,19 +71,11 @@ AliPHOSHit AliPHOSHit::operator+(const AliPHOSHit &rValue) // Add the energy of the hit fELOS += rValue.GetEnergy() ; + + if(rValue.GetTime() < fTime) + fTime = rValue.GetTime() ; return *this; } -//____________________________________________________________________________ -ostream& operator << (ostream& out, const AliPHOSHit& hit) -{ - // Print out Id and energy - - out << "AliPHOSHit = " << hit.GetId() << " " << hit.GetEnergy() << endl ; - return out ; -} - - -