X-Git-Url: http://git.uio.no/git/?a=blobdiff_plain;ds=sidebyside;f=EMCAL%2FAliEMCALHit.cxx;h=fa7171a5051ecb9208d92d71b0871cced8801500;hb=8a3ad88616648a71c32c7d69f0a520180d04a280;hp=6d724d31148504a31b96a4e84d3cf413d6f83a48;hpb=87c17b7b29bd3bb07a8c307472ea7f5cc427bdeb;p=u%2Fmrichter%2FAliRoot.git diff --git a/EMCAL/AliEMCALHit.cxx b/EMCAL/AliEMCALHit.cxx index 6d724d31148..fa7171a5051 100644 --- a/EMCAL/AliEMCALHit.cxx +++ b/EMCAL/AliEMCALHit.cxx @@ -1,4 +1,4 @@ -/************************************************************************** + /************************************************************************** * Copyright(c) 1998-1999, ALICE Experiment at CERN, All rights reserved. * * * * Author: The ALICE Off-line Project. * @@ -17,91 +17,98 @@ //_________________________________________________________________________ // Hits class for EMCAL -// A hit in EMCAL is the sum of all hits in a single segment -// from a single enterring particle +// A hit in EMCAL is the sum of all hits in a tower +// from a single entering particle //*-- Author: Sahal Yacoob (LBL / UCT) // Based on AliPHOSHit // --- Standard library --- -#include -#include -#include -#include -#include +#include // --- ROOT system --- -#include // --- AliRoot header files --- #include "AliEMCALHit.h" -#include "AliRun.h" -#include "AliConst.h" - +using std::endl; ClassImp(AliEMCALHit) //______________________________________________________________________ -AliEMCALHit::AliEMCALHit(){ +AliEMCALHit::AliEMCALHit() + : fId(0), + fELOS(0.), + fPrimary(0), + fPx(0.), + fPy(0.), + fPz(0.), + fPe(0.), + fIparent(0), + fIenergy(0.), + fTime(0.) +{ // Default ctor - - fId = 0; - fELOS = 0.0; - fPrimary = 0; - fTrack = 0; - fX = 0.0; - fY = 0.0; - fZ = 0.0; - fPx = 0.0; - fPy = 0.0; - fPz = 0.0; - fPe = 0.0; - fIparent = 0; - fIenergy = 0.0; } + //______________________________________________________________________ -AliEMCALHit::AliEMCALHit(const AliEMCALHit & hit){ +AliEMCALHit::AliEMCALHit(const AliEMCALHit & hit) + : AliHit(hit), + fId(hit.fId), + fELOS(hit.fELOS), + fPrimary(hit.fPrimary), + fPx(hit.fPx), + fPy(hit.fPy), + fPz(hit.fPz), + fPe(hit.fPe), + fIparent(hit.fIparent), + fIenergy(hit.fIenergy), + 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; - fPx = hit.fPx; - fPy = hit.fPy; - fPz = hit.fPz; - fPe = hit.fPe; - fIparent = hit.fIparent; - fIenergy = hit.fIenergy; +} +//_____________________________________________________________________ +AliEMCALHit& AliEMCALHit::operator = (const AliEMCALHit &source) +{ // assignment operator; use copy ctor + if (&source == this) return *this; + + new (this) AliEMCALHit(source); + return *this; } //______________________________________________________________________ AliEMCALHit::AliEMCALHit(Int_t shunt, Int_t primary, Int_t track,Int_t iparent, Float_t ienergy, Int_t id, - Float_t *hits,Float_t *p):AliHit(shunt, track){ + Float_t *hits,Float_t *p) + : AliHit(shunt, track), + fId(id), + fELOS(0.), + fPrimary(primary), + fPx(0.), + fPy(0.), + fPz(0.), + fPe(0.), + fIparent(iparent), + fIenergy(ienergy), + fTime(0.) +{ // // Create an EMCAL hit object // fX = hits[0]; fY = hits[1]; fZ = hits[2]; - fId = id; - fELOS = hits[3]; - fPrimary = primary; + fTime = hits[3] ; + fELOS = hits[4]; fPx = p[0]; fPy = p[1]; fPz = p[2]; fPe = p[3]; - fIparent = iparent; - fIenergy = ienergy; } + //______________________________________________________________________ Bool_t AliEMCALHit::operator==(AliEMCALHit const &rValue) const{ // Two hits are identical if they have the same Id and originat // from the same enterring Particle Bool_t rv = kFALSE; - if ( (fId == rValue.GetId()) && ( fIparent == rValue.GetIparent()) ) + if ( (fId == rValue.GetId()) && ( fIparent == rValue.GetIparent())) rv = kTRUE; return rv; @@ -111,7 +118,10 @@ AliEMCALHit AliEMCALHit::operator+(const AliEMCALHit &rValue){ // Add the energy of the hit fELOS += rValue.GetEnergy() ; - + + if(rValue.GetTime() < fTime) + fTime = rValue.GetTime() ; + return *this; } @@ -122,6 +132,7 @@ ostream& operator << (ostream& out,AliEMCALHit& hit){ out << "AliEMCALHit:"; out << "id=" << hit.GetId(); out << ", Eloss=" << hit.GetEnergy(); + out << ", Time=" << hit.GetTime(); out << "GeV , Track no.=" << hit.GetPrimary(); out << ", (xyz)=(" << hit.X()<< ","<< hit.Y()<< ","<