]> git.uio.no Git - u/mrichter/AliRoot.git/blob - PWG4/CaloCalib/AliAnalysisTaskEMCALClusterize.h
In case of AOD analysis where cell time is not available, assign to the cell the...
[u/mrichter/AliRoot.git] / PWG4 / CaloCalib / AliAnalysisTaskEMCALClusterize.h
1 #ifndef ALIANALYSISTASKEMCALCLUSTERIZE_H
2 #define ALIANALYSISTASKEMCALCLUSTERIZE_H
3
4 // This analysis provides a new list of clusters to be used in other analysis
5 // Author: Gustavo Conesa Balbastre,
6 //         Adapted from analysis class from Deepa Thomas
7
8 //Root
9 class TTree;
10 class TClonesArray;
11
12 //EMCAL
13 class AliEMCALGeometry;
14 class AliEMCALCalibData;
15 class AliCaloCalibPedestal;
16 class AliEMCALClusterizer;
17 class AliEMCALAfterBurnerUF;
18 class AliEMCALRecParam;
19 class AliEMCALRecoUtils;
20
21
22 #include "AliAnalysisTaskSE.h"
23
24 class AliAnalysisTaskEMCALClusterize : public AliAnalysisTaskSE {
25  public:
26   AliAnalysisTaskEMCALClusterize();
27   AliAnalysisTaskEMCALClusterize(const char *name);
28   virtual ~AliAnalysisTaskEMCALClusterize();
29
30  private:  
31   AliAnalysisTaskEMCALClusterize(const AliAnalysisTaskEMCALClusterize&); 
32   AliAnalysisTaskEMCALClusterize& operator=(const AliAnalysisTaskEMCALClusterize&); // not implemented
33   
34  public:
35   virtual void   UserCreateOutputObjects();
36   virtual void   UserExec(Option_t *option);
37   virtual void   Init();
38   virtual void   LocalInit()                                    { Init()                       ; }
39   
40   //OCDB
41   Bool_t         AccessOCDB();
42   void           SwitchOnAccessOCDB()                           { fAccessOCDB = kTRUE          ; }
43   void           SwitchOffAccessOCDB()                          { fAccessOCDB = kFALSE         ; } 
44   void           SetOCDBPath(const char *path)                  { fOCDBpath = path             ; }
45   
46   //Geometry methods
47   void           SetGeometryName(TString &name)                 { fGeomName = name             ; }
48   TString        GeometryName()                          const  { return fGeomName             ; }  
49   void           SwitchOnLoadOwnGeometryMatrices()              { fLoadGeomMatrices = kTRUE    ; }
50   void           SwitchOffLoadOwnGeometryMatrices()             { fLoadGeomMatrices = kFALSE   ; } 
51   void           SetGeometryMatrixInSM(TGeoHMatrix* m, Int_t i) { fGeomMatrix[i]    = m        ; }
52
53   //AOD methods
54   void           SetAODBranchName(TString &name)                { fOutputAODBranchName = name  ; }
55   void           FillAODFile(Bool_t yesno)                      { fFillAODFile         = yesno ; }
56   void           FillAODCaloCells();
57   void           FillAODHeader();
58   void           SwitchOnFillAODHeader()                        { fFillAODHeader    = kTRUE    ; }
59   void           SwitchOffFillAODHeader()                       { fFillAODHeader    = kFALSE   ; } 
60   void           SwitchOnFillAODCaloCells()                     { fFillAODCaloCells = kTRUE    ; }
61   void           SwitchOffFillAODCaloCells()                    { fFillAODCaloCells = kFALSE   ; } 
62   
63   //Algorithms settings
64   void           JustUnfold(Bool_t yesno)                       { fJustUnfold          = yesno ; }
65   AliEMCALRecParam * GetRecParam()                       const  { return fRecParam             ; }
66   void           InitClusterization();
67   
68   void           SetEMCALRecoUtils(AliEMCALRecoUtils * ru)      { fRecoUtils           = ru    ; }
69   AliEMCALRecoUtils* GetRecoUtils()                      const  { return fRecoUtils            ; }
70   
71   void           SetConfigFileName(TString name)                { fConfigName          = name  ; }
72   void           SetMaxEvent(Int_t max)                         { fMaxEvent            = max   ; }
73   
74   void           SwitchOnTrackMatching()                        { fDoTrackMatching    = kTRUE  ; }
75   void           SwitchOffTrackMatching()                       { fDoTrackMatching    = kFALSE ; } 
76
77   void           SwitchOnCellEnergySelection()                  { fSelectCell         = kTRUE  ; }
78   void           SwitchOffCellEnergySelection()                 { fSelectCell         = kFALSE ; } 
79
80   
81  private:
82     
83   virtual void  RecPoints2Clusters(TClonesArray *fdigitsArr, TObjArray *fRecPoints, TObjArray *clusArray);
84   
85   //Geometry  
86   AliEMCALGeometry      *fGeom;             // EMCAL geometry
87   TString                fGeomName;         // Name of geometry to use.
88   TGeoHMatrix           *fGeomMatrix[10];   // Geometry matrices with alignments
89   Bool_t                 fGeomMatrixSet;    // Set geometry matrices only once, for the first event.         
90   Bool_t                 fLoadGeomMatrices; // Matrices set from configuration, not get from geometry.root or from ESDs/AODs
91
92   //OCDB
93   AliEMCALCalibData     *fCalibData;        // EMCAL calib data
94   AliCaloCalibPedestal  *fPedestalData;     // EMCAL pedestal
95   TString                fOCDBpath;         // Path with OCDB location
96   Bool_t                 fAccessOCDB;       // Need to access info from OCDB (not really)   
97
98   //Temporal arrays
99   TClonesArray          *fDigitsArr;        //-> Digits array
100   TObjArray             *fClusterArr;       //-> Recpoints array
101   TObjArray             *fCaloClusterArr;   //-> CaloClusters array
102
103   //Clusterizers 
104   AliEMCALRecParam      *fRecParam;         // Reconstruction parameters container
105   AliEMCALClusterizer   *fClusterizer;      //! EMCAL clusterizer
106   AliEMCALAfterBurnerUF *fUnfolder;         //! Unfolding procedure
107   Bool_t                 fJustUnfold;       // Just unfold, do not recluster
108   
109   //AOD
110   TClonesArray          *fOutputAODBranch;  //! AOD Branch with output clusters  
111   TString                fOutputAODBranchName;  // New of output AOD branch
112   Bool_t                 fFillAODFile;      // Fill the output AOD file with the new clusters, 
113                                             // if not they will be only available for the event they were generated
114   Bool_t                 fFillAODHeader;    // Copy header to standard branch
115   Bool_t                 fFillAODCaloCells; // Copy calocells to standard branch
116
117   Int_t                  fRun;              //!run number
118   
119   AliEMCALRecoUtils*     fRecoUtils;        // Access to factorized reconstruction algorithms
120   TString                fConfigName;       // Name of analysis configuration file
121   
122   Int_t                  fCellLabels[12672];       // Array with MC label to be passed to digit. 
123   Int_t                  fCellSecondLabels[12672]; // Array with Second MC label to be passed to digit. 
124   Double_t               fCellTime[12672];         // Array with cluster time to be passed to digit in case of AODs 
125
126   Int_t                  fMaxEvent;         // Set a maximum event
127   
128   Bool_t                 fDoTrackMatching;  // On/Off the matching recalulation to speed up analysis in PbPb
129   Bool_t                 fSelectCell;       // Reject cells from cluster if energy is too low and recalculate position/energy and other
130   
131   ClassDef(AliAnalysisTaskEMCALClusterize, 10);
132 };
133
134 #endif //ALIANALYSISTASKEMCALCLUSTERIZE_H