X-Git-Url: http://git.uio.no/git/?a=blobdiff_plain;f=PHOS%2FAliPHOSHit.cxx;h=4c1bf85e1aef92feb44bff7797af99dd4406de08;hb=e05c8d6cda87d146e9dc635de5fc76d92f07bef0;hp=4864a7bf7da6bafcc01b1a33c16744e95680876a;hpb=b2a609669e35c09c3298f41c1cf13e86bdcbb39d;p=u%2Fmrichter%2FAliRoot.git diff --git a/PHOS/AliPHOSHit.cxx b/PHOS/AliPHOSHit.cxx index 4864a7bf7da..4c1bf85e1ae 100644 --- a/PHOS/AliPHOSHit.cxx +++ b/PHOS/AliPHOSHit.cxx @@ -18,76 +18,70 @@ //_________________________________________________________________________ // 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" - ClassImp(AliPHOSHit) + + //____________________________________________________________________________ +AliPHOSHit::AliPHOSHit(const AliPHOSHit & hit) : + AliHit(hit),fId(hit.fId),fELOS(hit.fELOS),fTime(hit.fTime) +{ + // copy ctor +} //____________________________________________________________________________ -AliPHOSHit::AliPHOSHit(Int_t primary, Int_t id, Float_t *hits) +AliPHOSHit::AliPHOSHit(Int_t shunt, Int_t track, Int_t id, Float_t *hits) : + AliHit(shunt, track),fId(0),fELOS(0),fTime(0) { - // ctor + // + // Create a CPV hit object + // - fId = id ; - fX = hits[0] ; - fY = hits[1] ; - fZ = hits[2] ; - fELOS = hits[3] ; - fPrimary = primary ; + fX = hits[0] ; + fY = hits[1] ; + fZ = hits[2] ; + fTime = hits[3] ; + fId = id ; + fELOS = hits[4] ; } - //____________________________________________________________________________ Bool_t AliPHOSHit::operator==(AliPHOSHit const &rValue) const { - // Two hits are identical if they have the same Id and originate from the same primary + // Two hits are identical if they have the same Id and originate from the same primary Bool_t rv = kFALSE ; - if ( fId == rValue.GetId() && fPrimary == rValue.GetPrimary() ) + if ( (fId == rValue.GetId()) && ( fTrack == rValue.GetPrimary() ) ) rv = kTRUE; return rv; } //____________________________________________________________________________ -AliPHOSHit AliPHOSHit::operator+(const AliPHOSHit &rValue) const +AliPHOSHit & AliPHOSHit::operator = (const AliPHOSHit &) { - // Add the energy of the hit - - AliPHOSHit added(*this); - - added.fX = rValue.fX ; - added.fY = rValue.fY ; - added.fZ = rValue.fZ ; - - added.fELOS += rValue.GetEnergy() ; - - return added; - + Fatal("operator =", "not implemented"); + return *this; } - //____________________________________________________________________________ -ostream& operator << (ostream& out, const AliPHOSHit& hit) +AliPHOSHit AliPHOSHit::operator+(const AliPHOSHit &rValue) { - // Print out Id and energy + // Add the energy of the hit - out << "AliPHOSHit = " << hit.GetId() << " " << hit.GetEnergy() << endl ; - return out ; -} + fELOS += rValue.GetEnergy() ; + if(rValue.GetTime() < fTime) + fTime = rValue.GetTime() ; + + return *this; +}