// 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 <stdio.h>
-#include <string.h>
-#include <stdlib.h>
-#include <strstream.h>
// --- 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 ;
-
-
+ // 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
//
-
+
+ fX = hits[0] ;
+ fY = hits[1] ;
+ fZ = hits[2] ;
+ fTime = hits[3] ;
fId = id ;
- fELOS = hits[3] ;
- fPrimary = primary ;
+ fELOS = hits[4] ;
}
-
//____________________________________________________________________________
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;
// 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 ;
-}
-
-
-