// 3 identifiers for the primary particle(s) at the origine of the digit
// The digits are made in FinishEvent() by summing all the hits in a single PHOS crystal or PPSD gas cell
//
-//*-- Author: Laurent Aphecetche & Yves Schutz (SUBATECH)
+//*-- Author: Laurent Aphecetche & Yves Schutz (SUBATECH) & Dmitri Peressounko (RRC KI & SUBATECH)
// --- ROOT system ---
}
//____________________________________________________________________________
-AliPHOSDigit::AliPHOSDigit(Int_t primary, Int_t id, Int_t DigEnergy, Int_t index)
+AliPHOSDigit::AliPHOSDigit(Int_t primary, Int_t id, Int_t digEnergy, Float_t time, Int_t index)
{
// ctor with all data
fNMaxPrimary = 5 ;
- fAmp = DigEnergy ;
+ fAmp = digEnergy ;
+ fTime = time ;
fId = id ;
fIndexInList = index ;
if( primary != -1){
for ( i = 0; i < fNMaxPrimary ; i++)
fPrimary[i] = digit.fPrimary[i] ;
fAmp = digit.fAmp ;
+ fTime = digit.fTime ;
fId = digit.fId;
fIndexInList = digit.fIndexInList ;
fNprimary = digit.fNprimary ;
{
// retrieves the primary particle number given its index in the list
Int_t rv = -1 ;
- if ( index <= fNprimary ){
+ if ( index <= fNprimary && index > 0){
rv = fPrimary[index-1] ;
}
}
//____________________________________________________________________________
+void AliPHOSDigit::Print(Option_t *option) const
+{
+ printf("PHOS digit: Amp=%d, Id=%d\n",fAmp,fId);
+}
+//____________________________________________________________________________
void AliPHOSDigit::ShiftPrimary(Int_t shift)
{
//shifts primary number to BIG offset, to separate primary in different TreeK
Int_t index ;
for(index = 0; index <fNprimary; index ++ ){
- fPrimary[index] = fPrimary[index]+ shift * 10000000 ;
+ fPrimary[index] = fPrimary[index]+ shift ;
}
}
//____________________________________________________________________________
// if amplitude is larger than
fAmp += digit.fAmp ;
+ if(fTime > digit.fTime)
+ fTime = digit.fTime ;
Int_t max1 = fNprimary ;
{
// Prints the data of the digit
- out << "ID " << digit.fId << " Energy = " << digit.fAmp << endl ;
+ out << "ID " << digit.fId << " Energy = " << digit.fAmp << " Time = " << digit.fTime << endl ;
Int_t i ;
for(i=0;i<digit.fNprimary;i++)
out << "Primary " << i+1 << " = " << digit.fPrimary[i] << endl ;