]> git.uio.no Git - u/mrichter/AliRoot.git/blob - EMCAL/AliEMCALDigit.h
New version of the EMCAL code: bug fixes, new digitisation classes (B.Nilsen)
[u/mrichter/AliRoot.git] / EMCAL / AliEMCALDigit.h
1 #ifndef ALIEMCALDIGIT_H
2 #define ALIEMCALDIGIT_H
3 /* Copyright(c) 1998-1999, ALICE Experiment at CERN, All rights reserved. *
4  * See cxx source for full Copyright notice                               */
5
6 /* $Id$ */
7
8 //_________________________________________________________________________
9 //  EMCAL digit: Id
10 //              energy
11 //              3 identifiers for the primary particle(s) at the origine of the digit
12 //  The digits are made in FinishEvent() by summing all the hits in a single EMCAL crystal or PPSD gas cell
13 //  It would be nice to replace the 3 identifiers by an array, but, because digits are kept in a TClonesQArray,
14 //   it is not possible to stream such an array... (beyond my understqnding!)
15 //
16 //*-- Author: Laurent Aphecetche & Yves Schutz (SUBATECH)
17
18 // --- ROOT system ---
19
20 #include "TObject.h" 
21
22 // --- Standard library ---
23
24 // --- AliRoot header files ---
25
26 #include "AliDigitNew.h"
27
28 class AliEMCALDigit : public AliDigitNew {
29
30   friend ostream& operator << ( ostream& , const AliEMCALDigit&) ;
31
32  public:
33   
34   AliEMCALDigit() ;
35   AliEMCALDigit(Int_t primary, Int_t iparent, Int_t id, Int_t DigEnergy, Int_t index = -1) ;
36   AliEMCALDigit(const AliEMCALDigit & digit) ;
37   virtual ~AliEMCALDigit() ;
38
39   Bool_t operator==(const AliEMCALDigit &rValue) const;
40   AliEMCALDigit& operator+(AliEMCALDigit const &rValue) ;
41     
42   Int_t   Compare(const TObject * obj) const ;  
43   Int_t   GetNprimary() const { 
44     // returns the number of primaries
45     return fNprimary ; }
46   Int_t   GetPrimary(Int_t index) const ; 
47   Int_t   GetNiparent() const {return fNiparent;}
48   Int_t   GetIparent(Int_t index) const ;
49   Bool_t  IsSortable() const { 
50     // says that AliEMCALDigits are sortable (needed for Sort method
51     return kTRUE ; }
52   void    SetAmp(Int_t Amp) { 
53     // sets the amplitude data member 
54     fAmp=Amp ; } 
55   void ShiftPrimary(Int_t shift); // shift to semarate different TreeK in merging
56   
57  private:
58
59   Int_t fNprimary ;     // Number of primaries
60   Int_t fNMaxPrimary ;  //! Max Number of primaries
61   Int_t fPrimary[5] ;   // Array of primaries       
62     
63   Int_t fNiparent ;     // Number of initial parents 
64   Int_t fNMaxiparent ;  //! Max Number of parents 
65   Int_t fIparent[50] ;   // Array of parents       
66     
67   ClassDef(AliEMCALDigit,1)   // Digit in EMCAL 
68
69 } ;
70
71 #endif //  ALIEMCALDIGIT_H