]> git.uio.no Git - u/mrichter/AliRoot.git/blob - EMCAL/AliEMCALRecPoint.h
Simplified version of AliEMCALReconstructor::FillESD without multiple new/delete...
[u/mrichter/AliRoot.git] / EMCAL / AliEMCALRecPoint.h
1 #ifndef ALIEMCALRECPOINT_H
2 #define ALIEMCALRECPOINT_H
3 /* Copyright(c) 1998-2007, ALICE Experiment at CERN, All rights reserved. *
4  * See cxx source for full Copyright notice                               */
5 //_________________________________________________________________________
6 //  Base Class for EMCAL Reconstructed Points  
7 //  A recpoint being equivalent to a cluster in encal terminology                 
8 //*-- Author: Yves Schutz (SUBATECH)
9 //*-- Author: Dmitri Peressounko (RRC KI & SUBATECH)
10 //*-- Author: Heather Gray (LBL): merged AliEMCALRecPoint and AliEMCALTowerRecPoint 02/04
11
12 // --- ROOT system ---
13 class TVector3 ;  
14
15 // --- Standard library ---
16
17 // --- AliRoot header files ---
18
19 #include "AliRecPoint.h"
20 class AliEMCALDigit;
21 class AliEMCALGeometry;
22
23 class AliEMCALRecPoint : public AliRecPoint {
24
25  public:
26   
27   typedef TObjArray RecPointsList ; 
28
29   AliEMCALRecPoint() ;                   // ctor         
30   AliEMCALRecPoint(const char * opt) ;   // ctor 
31   AliEMCALRecPoint(const AliEMCALRecPoint & rp);
32   
33   virtual ~AliEMCALRecPoint();
34   virtual void    AddDigit(AliDigitNew &){ Fatal("AddDigit", "use AddDigit(AliEMCALDigit & digit, Float_t Energy )") ; }
35   virtual void    AddDigit(AliEMCALDigit & digit, Float_t Energy); 
36   virtual Int_t   Compare(const TObject * obj) const;   
37   virtual Int_t   DistancetoPrimitive(Int_t px, Int_t py);
38   virtual void    Draw(Option_t * option="") ;
39   virtual void    ExecuteEvent(Int_t event, Int_t, Int_t) ;
40
41   virtual void    SetClusterType(Int_t ver) { fClusterType = ver; }
42   virtual Int_t   GetClusterType() const { return fClusterType; }
43
44   virtual void    EvalAll(Float_t logWeight, TClonesArray * digits);
45   virtual void    EvalLocalPosition(Float_t logWeight, TClonesArray * digits);
46   virtual void    EvalPrimaries(TClonesArray * digits) ;
47   virtual void    EvalParents(TClonesArray * digits) ;
48
49   //  void            EvalLocalPositionSimple(TClonesArray *digits); // ??
50   void   EvalLocalPositionFit(Double_t deff, Double_t w0, Double_t phiSlope,TClonesArray * digits);
51   Bool_t EvalLocalPosition2(TClonesArray *digits, TArrayD &ed);
52
53   static  Bool_t  EvalLocalPositionFromDigits(const Double_t esum, const Double_t deff, const Double_t w0, 
54                                               TClonesArray *digits, TArrayD &ed, TVector3 &locPos);
55   static  Bool_t  EvalLocalPositionFromDigits(TClonesArray *digits, TArrayD &ed, TVector3 &locPos);
56   static  void    GetDeffW0(const Double_t esum, Double_t &deff,  Double_t &w0);
57
58   using AliRecPoint::GetGlobalPosition;
59   virtual void    GetGlobalPosition(TVector3 & gpos) const; // return global position (x, y, z) in ALICE
60   virtual void    GetLocalPosition(TVector3 & lpos) const;  // return local position  (x, y, z) in EMCAL SM
61   virtual Int_t * GetPrimaries(Int_t & number) const {number = fMulTrack ; 
62                                                       return fTracksList ; }
63   virtual Int_t * GetParents(Int_t & number) const {number = fMulParent ; 
64                                                       return fParentsList ; }
65   Float_t         GetCoreEnergy()const {return fCoreEnergy ;}
66   virtual Float_t GetDispersion()const {return fDispersion ;}
67   virtual void    GetElipsAxis(Float_t * lambda)const {lambda[0] = fLambda[0]; lambda[1] = fLambda[1];};
68   
69   Float_t *   GetEnergiesList() const {return fEnergyList ;}       // gets the list of energies making this recpoint
70   Double_t    GetPointEnergy() const;                              // gets point energy (sum of energy list)
71   Float_t *   GetTimeList() const {return fTimeList ;}       // gets the list of digit times in this recpoint
72   Float_t     GetMaximalEnergy(void) const ;                       // get the highest energy in the cluster
73   Int_t       GetMaximumMultiplicity() const {return fMaxDigit ;}  // gets the maximum number of digits allowed
74   Int_t       GetMultiplicity(void) const { return fMulDigit ; }   // gets the number of digits making this recpoint
75   Int_t       GetMultiplicityAtLevel(Float_t level) const ;  // computes multiplicity of digits with 
76   Int_t *     GetAbsId() const {return fAbsIdList;}
77   Int_t       GetAbsId(int i) const {if(i>=0 && i<fMulDigit)return fAbsIdList[i]; else return -1;}
78   Int_t       GetAbsIdMaxDigit() {return GetAbsId(fDigitIndMax);}
79   Int_t       GetIndMaxDigit() {return fDigitIndMax;}
80   void        SetIndMaxDigit(const Int_t ind) {fDigitIndMax = ind;}
81   // energy above relative level
82   virtual Int_t GetNumberOfLocalMax(AliEMCALDigit **  maxAt, Float_t * maxAtEnergy,
83                                     Float_t locMaxCut,TClonesArray * digits ) const ; 
84                                                                    // searches for the local maxima 
85   
86   Int_t       GetPrimaryIndex() const  ;
87   Float_t     GetTime(void) const{return  fTime ; }
88  
89   virtual Bool_t  IsEmc(void)const { return kTRUE ;  }
90   virtual Bool_t  IsSortable() const { 
91     // tells that this is a sortable object
92     return kTRUE ; 
93   }  
94   virtual void    Paint(Option_t * option="");
95   virtual void    Print(Option_t * option="") const ; 
96   
97   AliEMCALRecPoint & operator = (const AliEMCALRecPoint & )  {
98     Fatal("operator =", "not implemented") ;
99     return *this ; 
100   }
101   static Double_t TmaxInCm(const Double_t e=0.0, const Int_t key=0);
102
103 protected:
104           void  EvalCoreEnergy(Float_t logWeight,TClonesArray * digits) ;             
105           virtual void  EvalDispersion(Float_t logWeight,TClonesArray * digits) ;   // computes the dispersion of the shower
106           virtual void  EvalElipsAxis(Float_t logWeight, TClonesArray * digits );   // computes the axis of shower ellipsoide
107           void  EvalTime( TClonesArray * digits );
108           virtual Bool_t AreNeighbours(AliEMCALDigit * digit1, AliEMCALDigit * digit2 ) const;
109           Float_t ThetaToEta(Float_t arg) const;  //Converts Theta (Radians) to Eta(Radians)
110           Float_t EtaToTheta(Float_t arg) const;  //Converts Eta (Radians) to Theta(Radians)
111
112 private:
113           AliEMCALGeometry* fGeomPtr;  //! Pointer to geometry for utilities
114
115           Int_t   fClusterType;    // type of cluster stored:
116                                    // pseudocluster or v1
117           Float_t fCoreEnergy ;       // energy in a shower core 
118           Float_t fLambda[2] ;        // shower ellipse axes
119           Float_t fDispersion ;       // shower dispersion
120           Float_t *fEnergyList ;      //[fMulDigit] energy of digits
121           Float_t *fTimeList ;        //[fMulDigit] time of digits
122           Int_t   *fAbsIdList;        //[fMulDigit] absId  of digits
123           Float_t fTime ;             // Time of the digit with maximal energy deposition
124           Float_t fCoreRadius;        // The radius in which the core energy is evaluated
125           Float_t *fDETracksList ;    //[fMulTrack] list of tracks to which the point was assigned
126           Int_t fMulParent;           // Multiplicity of the parents
127           Int_t fMaxParent;           // Maximum number of parents allowed
128           Int_t * fParentsList;       // [fMulParent] list of the parents of the digits
129           Float_t * fDEParentsList;   // [fMulParent] list of the parents of the digits
130           Int_t   fSuperModuleNumber; // number identifying supermodule containing recpoint
131           // Aug 16, 2007
132           Int_t   fDigitIndMax;       // Index of digit with max energy in array fAbsIdList
133   ClassDef(AliEMCALRecPoint,9) // RecPoint for EMCAL (Base Class)
134  
135 };
136
137 #endif // AliEMCALRECPOINT_H