]> git.uio.no Git - u/mrichter/AliRoot.git/blobdiff - PHOS/AliPHOSDigit.h
New classes added
[u/mrichter/AliRoot.git] / PHOS / AliPHOSDigit.h
index 9df7e2df34de44b54f8e35912b8eac40cc636bae..785c20680e83bcd9d3b186ee59859e8c6f92bfe8 100644 (file)
@@ -5,13 +5,15 @@
 
 /* $Id$ */
 
-////////////////////////////////////////////////
-//  The digit  class: a list of abs Id, energy//
-//  Version SUBATECH                          //
-//  Author Laurent Aphecetche     SUBATECH    //
-//      comment: added sortable YS            //  
-//                                            //
-////////////////////////////////////////////////
+//_________________________________________________________________________
+//  PHOS digit: Id
+//              energy
+//              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
+//  It would be nice to replace the 3 identifiers by an array, but, because digits are kept in a TClonesQArray,
+//   it is not possible to stream such an array... (beyond my understqnding!)
+//
+//*-- Author: Laurent Aphecetche & Yves Schutz (SUBATECH)
 
 // --- ROOT system ---
 
 #include "AliDigitNew.h"
 
 class AliPHOSDigit : public AliDigitNew {
-  
-public:
-  AliPHOSDigit() {}
-  AliPHOSDigit(Int_t id, Int_t DigEnergy) ;
-  virtual ~AliPHOSDigit() {} 
 
-  Bool_t operator==(AliPHOSDigit const &rValue) const;
-  AliPHOSDigit& operator+(AliPHOSDigit const &rValue) ;
-  
   friend ostream& operator << ( ostream& , const AliPHOSDigit&) ;
+
+ public:
   
-  Int_t   Compare(TObject * obj) ;  
-  Int_t   GetId()     { return fId ; }     
-  Int_t   GetAmp() {  return fAmp  ; } 
-  Bool_t  IsSortable() const{ return kTRUE ; }
-  
-private:
-  Int_t fId ;                // absolute id
-  Int_t fAmp ;               // digitalized energy
-  
-  ClassDef(AliPHOSDigit,1)   // Digit in PHOS, version 1 
+  AliPHOSDigit() ;
+  AliPHOSDigit(Int_t primary, Int_t id, Int_t DigEnergy, Float_t Time, Int_t index = -1) ;
+  AliPHOSDigit(const AliPHOSDigit & digit) ;
+  virtual ~AliPHOSDigit() ;
+
+  Bool_t operator==(const AliPHOSDigit &rValue) const;
+  AliPHOSDigit& operator+(AliPHOSDigit const &rValue) ;
+    
+  Int_t   Compare(const TObject * obj) const ;  
+  Int_t   GetNprimary() const { 
+    // returns the number of primaries
+    return fNprimary ; }
+  Int_t   GetPrimary(Int_t index) const ; 
+  Float_t GetTime(void) const {return fTime ;}
+  Bool_t  IsSortable() const { 
+    // says that AliPHOSDigits are sortable (needed for Sort method
+    return kTRUE ; }
+  void    Print(Option_t *option) const;
+  void    SetAmp(Int_t Amp) { 
+    // sets the amplitude data member 
+    fAmp=Amp ; } 
+  void    SetTime(Float_t Time) {fTime = Time ;}
+  void ShiftPrimary(Int_t shift); // shift to semarate different TreeK in merging
+
+ private:
+
+  Int_t fNprimary ;     // Number of primaries
+  Int_t fNMaxPrimary ;  //! Max Number of primaries
+  Int_t fPrimary[5] ;   // Array of primaries      
+  Float_t fTime ; 
+    
+  ClassDef(AliPHOSDigit,1)   // Digit in PHOS 
 
 } ;