//_________________________________________________________________________
// Hits class for EMCAL
-// A hit in EMCAL is the sum of all hits in a single crystal
-//
+// A hit in EMCAL is the sum of all hits in a single segment
+// from a single enterring particle
//*-- Author: Sahal Yacoob (LBL / UCT)
// Based on AliPHOSHit
#include "AliEMCALHit.h"
#include "AliRun.h"
#include "AliConst.h"
-
+#include "AliEMCALGeometry.h"
+#include "AliEMCALGetter.h"
ClassImp(AliEMCALHit)
fId = 0;
fELOS = 0.0;
+ fTime = 0.0;
fPrimary = 0;
fTrack = 0;
fX = 0.0;
fPe = hit.fPe;
fIparent = hit.fIparent;
fIenergy = hit.fIenergy;
+ fTime = hit.fTime ;
}
//______________________________________________________________________
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){
//
- // Create a CPV hit object
+ // Create an EMCAL hit object
//
fX = hits[0];
fY = hits[1];
fZ = hits[2];
+ fTime = hits[3] ;
fId = id;
- fELOS = hits[3];
+ fELOS = hits[4];
fPrimary = primary;
fPx = p[0];
fPy = p[1];
fIparent = iparent;
fIenergy = ienergy;
}
+
+//______________________________________________________________________
+const Bool_t AliEMCALHit::IsInPreShower() const
+{
+ Bool_t rv = kFALSE ;
+
+ const AliEMCALGeometry * geom = AliEMCALGetter::GetInstance()->EMCALGeometry() ;
+ if((GetId()/geom->GetNPhi()) < (2*geom->GetNZ()))
+ rv = kTRUE;
+ return rv;
+}
+
//______________________________________________________________________
Bool_t AliEMCALHit::operator==(AliEMCALHit const &rValue) const{
// Two hits are identical if they have the same Id and originat
- // from the same primary
+ // from the same enterring Particle
Bool_t rv = kFALSE;
- if ( (fId == rValue.GetId()) && ( fPrimary == rValue.GetIparent()) )
+ if ( (fId == rValue.GetId()) && ( fIparent == rValue.GetIparent()) )
rv = kTRUE;
return rv;
// Add the energy of the hit
fELOS += rValue.GetEnergy() ;
-
+
+ if(rValue.GetTime() < fTime)
+ fTime = rValue.GetTime() ;
+
return *this;
}
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()<< ","<<hit.Z()<<") cm";
out << ", fTrack=" << hit.GetTrack();