]> git.uio.no Git - u/mrichter/AliRoot.git/blobdiff - PHOS/AliPHOSDigit.cxx
Timing added to reconstruction
[u/mrichter/AliRoot.git] / PHOS / AliPHOSDigit.cxx
index 2bf6f24a6881ff6d6f3c12394b560ed1af038d1f..9ffb54cfe2fe4ac592e192f7abac4c53904b84a5 100644 (file)
@@ -21,7 +21,7 @@
 //              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 ---
@@ -48,12 +48,13 @@ ClassImp(AliPHOSDigit)
 }
 
 //____________________________________________________________________________
-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 ;
+  fTime        = time ;
   fId          = id ;
   fIndexInList = index ; 
   if( primary != -1){
@@ -80,6 +81,7 @@ AliPHOSDigit::AliPHOSDigit(const AliPHOSDigit & digit)
   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 ;
@@ -159,6 +161,8 @@ AliPHOSDigit& AliPHOSDigit::operator+(AliPHOSDigit const & digit)
   // if amplitude is larger than 
   
   fAmp += digit.fAmp ;
+  if(fTime > digit.fTime)
+    fTime = digit.fTime ;
   
   Int_t max1 = fNprimary ; 
   
@@ -188,7 +192,7 @@ ostream& operator << ( ostream& out , const AliPHOSDigit & digit)
 {
   // 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 ;