X-Git-Url: http://git.uio.no/git/?a=blobdiff_plain;f=PHOS%2FAliPHOSHit.cxx;h=5e9376b39cc7aaa4dace0441a230c187c5ffb940;hb=566067b0ce08d16621896e5e3f0badde192f8773;hp=762689547b02a6cd98dee7a8f826cfea50a2d865;hpb=1aa1725484437ceda830f22b4c4075b811c91925;p=u%2Fmrichter%2FAliRoot.git diff --git a/PHOS/AliPHOSHit.cxx b/PHOS/AliPHOSHit.cxx index 762689547b0..5e9376b39cc 100644 --- a/PHOS/AliPHOSHit.cxx +++ b/PHOS/AliPHOSHit.cxx @@ -18,94 +18,64 @@ //_________________________________________________________________________ // 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) + + //____________________________________________________________________________ +AliPHOSHit::AliPHOSHit(const AliPHOSHit & hit) : + AliHit(hit),fId(hit.fId),fELOS(hit.fELOS),fTime(hit.fTime) { - // copy ctor - - fId = hit.fId ; - fELOS = hit.fELOS ; - fPrimary = hit.fPrimary ; - fTrack = hit.fTrack ; - fX = hit.fX ; - fY = hit.fY ; - fZ = hit.fZ ; - fPid = hit.fPid ; - + // copy ctor } //____________________________________________________________________________ -AliPHOSHit::AliPHOSHit(Int_t Shunt, Int_t primary, Int_t Track, Int_t id, Float_t *hits, Int_t pid) : 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) { - // ctor + // + // Create a CPV hit object + // - fId = id ; - fX = hits[0] ; - fY = hits[1] ; - fZ = hits[2] ; - fELOS = hits[3] ; - fPrimary = primary ; - fPid = pid ; + 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 &rValue) { // Add the energy of the hit - AliPHOSHit added(*this); - - // the accumulated hit position is the position of the first hi - // added.fX = rValue.fX ; - // added.fY = rValue.fY ; - // added.fZ = rValue.fZ ; + fELOS += rValue.GetEnergy() ; - added.fELOS += rValue.GetEnergy() ; + if(rValue.GetTime() < fTime) + fTime = rValue.GetTime() ; - return added; + return *this; } -//____________________________________________________________________________ -ostream& operator << (ostream& out, const AliPHOSHit& hit) -{ - // Print out Id and energy - - out << "AliPHOSHit = " << hit.GetId() << " " << hit.GetEnergy() << endl ; - return out ; -} - - -