]> git.uio.no Git - u/mrichter/AliRoot.git/blob - EMCAL/AliEMCALReconstructor.h
Simplifications from S.Ailo
[u/mrichter/AliRoot.git] / EMCAL / AliEMCALReconstructor.h
1 #ifndef ALIEMCALRECONSTRUCTOR_H
2 #define ALIEMCALRECONSTRUCTOR_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 //  Wrapping class for reconstruction
10 //*--
11 //*-- Author: Yves Schutz (SUBATECH) 
12 //*--         Dmitri Peressounko (SUBATECH & Kurchatov Institute)
13 // Reconstruction class. Redesigned from the old AliReconstructionner class and 
14 // derived from STEER/AliReconstructor. 
15 // 
16
17 // --- ROOT system ---
18 class TClonesArray;
19 class TTree;
20
21 // --- AliRoot header files ---
22 #include "AliReconstructor.h" 
23 #include "AliEMCALTracker.h" 
24 #include "AliEMCALRecParam.h"
25
26 class AliEMCALDigitizer ;
27 class AliEMCALClusterizer ;
28 class AliEMCALSDigitizer ;
29 class AliEMCALRecParam;
30 class AliESDEvent ;
31 class AliRawReader ;
32 class AliEMCALRawUtils;
33 class AliEMCALGeometry;
34 class AliEMCALCalibData ;
35 class AliCaloCalibPedestal ;
36 class AliEMCALTriggerElectronics;
37 class AliEMCALTriggerData;
38
39 class AliEMCALReconstructor : public AliReconstructor {
40   
41  public:
42   
43   AliEMCALReconstructor() ; //ctor            
44   
45   virtual ~AliEMCALReconstructor() ; //dtor
46   
47   virtual  void  Init() {;}
48   virtual  void  InitClusterizer() const;
49   
50   using AliReconstructor::FillESD;
51   virtual void   FillESD(TTree* digitsTree, TTree* clustersTree, AliESDEvent* esd) const;
52   AliTracker*    CreateTracker () const {return new AliEMCALTracker;} 
53   using AliReconstructor::Reconstruct;
54   virtual void   Reconstruct(TTree* digitsTree, TTree* clustersTree) const ;
55   
56   virtual Bool_t HasDigitConversion() const {return kTRUE;};
57   virtual void   ConvertDigits(AliRawReader* rawReader, TTree* digitsTree) const;
58   
59   static void    SetRecParam(AliEMCALRecParam * recParam){ fgkRecParam = recParam;}
60   
61   void           ReadDigitsArrayFromTree(TTree *digitsTree) const;
62   
63   static const AliEMCALRecParam* GetRecParam() { 
64     return dynamic_cast<const AliEMCALRecParam*>(AliReconstructor::GetRecoParam(6)); }
65   
66   static TClonesArray* GetDigitsArr() {return fgDigitsArr;}
67   
68   void           FillMisalMatrixes(AliESDEvent* esd)const ;
69
70   //New class used to sort the matched tracks
71   class  AliEMCALMatch : public TObject
72   {
73   public:
74     AliEMCALMatch();
75     AliEMCALMatch(const AliEMCALMatch& copy);
76     virtual ~AliEMCALMatch() { }
77     //----------------------------------------------------------------------------
78     Int_t     Compare(const TObject *obj) const;
79     Bool_t    IsSortable() const {return kTRUE;}
80     Double_t  GetDistance() const {return fDistance;}
81     Double_t  GetdEta() const {return fdEta;}
82     Double_t  GetdPhi() const {return fdPhi;}
83     Int_t     GetIndexT() const {return fIndexT;}
84     void      SetIndexT(Int_t itr) {fIndexT=itr;}
85     void      SetDistance(Double_t dist) {fDistance=dist;}
86     void      SetdEta(Double_t dEta) {fdEta=dEta;}
87     void      SetdPhi(Double_t dPhi) {fdPhi=dPhi;}
88   private:
89     Int_t      fIndexT;      // track index in 'fTracks' array
90     Double_t   fDistance;    // track - cluster distance
91     Double_t   fdEta;        // track - cluster residual in eta
92     Double_t   fdPhi;        // track - cluster residual in phi
93   };
94   Bool_t CalculateResidual(AliESDtrack *track, AliESDCaloCluster *cluster, Double_t &dEta, Double_t &dPhi) const;
95   
96  private:
97   
98   AliEMCALReconstructor(const AliEMCALReconstructor &); //Not implemented
99   AliEMCALReconstructor & operator = (const AliEMCALReconstructor &); //Not implemented
100   
101   AliEMCALGeometry           * fGeom;             // pointer to the EMCAL geometry
102   static AliEMCALClusterizer * fgClusterizer;     // clusterizer
103   static AliEMCALRawUtils    * fgRawUtils;        // raw utilities class 
104   
105   //Temporal arrays with clusters, digits, triggers, to be reused per event
106   static TClonesArray        * fgDigitsArr;       //-> Array with EMCAL digits
107   static TObjArray           * fgClustersArr;     //-> Array with EMCAL clusters
108   static TClonesArray        * fgTriggerDigits;   //-> Array with EMCAL trigger digits
109   
110   //OCDB
111   static const AliEMCALRecParam* fgkRecParam;     // reconstruction parameters for EMCAL
112   AliEMCALCalibData          * fCalibData   ;     //! Calibration database if aval
113   AliCaloCalibPedestal       * fPedestalData ;    //! Tower status database if aval
114   
115   //Trigger specific
116   static AliEMCALTriggerElectronics* fgTriggerProcessor; // Trigger preprocessor  
117   AliEMCALTriggerData        * fTriggerData;      // Trigger parameters data container
118
119   //Track matching
120   TList                      * fMatches;          //! collection of matches between tracks and clusters
121   
122   ClassDef(AliEMCALReconstructor,12)  // Reconstruction algorithm class (Base Class)
123 }; 
124
125 #endif // ALIEMCALRECONSTRUCTOR_H
126