]> git.uio.no Git - u/mrichter/AliRoot.git/blob - PWGGA/EMCALTasks/AliAnalysisTaskEMCALClusterize.h
comment
[u/mrichter/AliRoot.git] / PWGGA / EMCALTasks / 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   // Event methods, settings
41   void           CheckAndGetEvent();
42   
43   Bool_t         IsExoticEvent();
44   void           SwitchOnExoticEventsRemoval()                  { fRemoveExoticEvents= kTRUE   ; }
45   void           SwitchOffExoticEventsRemoval()                 { fRemoveExoticEvents= kFALSE  ; } 
46   
47   Bool_t         IsLEDEvent();
48   void           SwitchOnLEDEventsRemoval()                     { fRemoveLEDEvents   = kTRUE   ; }
49   void           SwitchOffLEDEventsRemoval()                    { fRemoveLEDEvents   = kFALSE  ; } 
50   
51   //OCDB
52   Bool_t         AccessOCDB();
53   void           SwitchOnAccessOCDB()                           { fAccessOCDB       = kTRUE    ; }
54   void           SwitchOffAccessOCDB()                          { fAccessOCDB       = kFALSE   ; } 
55   void           SetOCDBPath(const char *path)                  { fOCDBpath         = path     ; }
56   
57   //Geometry methods
58   void           InitGeometry();
59   void           SetGeometryName(TString &name)                 { fGeomName = name             ; }
60   TString        GeometryName()                          const  { return fGeomName             ; }  
61   void           SwitchOnLoadOwnGeometryMatrices()              { fLoadGeomMatrices = kTRUE    ; }
62   void           SwitchOffLoadOwnGeometryMatrices()             { fLoadGeomMatrices = kFALSE   ; } 
63   void           SetGeometryMatrixInSM(TGeoHMatrix* m, Int_t i) { fGeomMatrix[i]    = m        ; }
64
65   void           SetImportGeometryFromFile(Bool_t  im, 
66                                            TString pa = ".")    { 
67                                                                   fImportGeometryFromFile = im ; 
68                                                                   fImportGeometryFilePath = pa ; }    
69   
70   //AOD methods
71   void           SetAODBranchName(TString &name)                { fOutputAODBranchName = name  ; }
72   void           FillAODFile(Bool_t yesno)                      { fFillAODFile         = yesno ; }
73   void           FillAODCaloCells();
74   void           FillAODHeader();
75   void           SwitchOnFillAODHeader()                        { fFillAODHeader     = kTRUE   ; }
76   void           SwitchOffFillAODHeader()                       { fFillAODHeader     = kFALSE  ; } 
77   void           SwitchOnFillAODCaloCells()                     { fFillAODCaloCells  = kTRUE   ; }
78   void           SwitchOffFillAODCaloCells()                    { fFillAODCaloCells  = kFALSE  ; } 
79   
80   //Algorithms settings
81   AliEMCALRecParam * GetRecParam()                       const  { return fRecParam             ; }
82   void           InitClusterization();
83   void           ClusterizeCells();
84   void           ClusterUnfolding();
85   void           JustUnfold(Bool_t yesno)                       { fJustUnfold        = yesno   ; }
86   
87   void           SetEMCALRecoUtils(AliEMCALRecoUtils * ru)      { fRecoUtils         = ru      ; }
88   AliEMCALRecoUtils* GetRecoUtils()                      const  { return fRecoUtils            ; }
89   
90   void           SetConfigFileName(TString name)                { fConfigName        = name    ; }
91   void           SetMaxEvent(Int_t max)                         { fMaxEvent          = max     ; }
92   
93   void           SwitchOnTrackMatching()                        { fDoTrackMatching   = kTRUE   ; }
94   void           SwitchOffTrackMatching()                       { fDoTrackMatching   = kFALSE  ; } 
95
96   // Cell selection after unfolding
97   void           SwitchOnCellEnergySelection()                  { fSelectCell        = kTRUE   ; }
98   void           SwitchOffCellEnergySelection()                 { fSelectCell        = kFALSE  ; } 
99   void           SetCellCuts(Float_t e, Float_t frac)           { fSelectCellMinE    = e       ; 
100                                                                   fSelectCellMinFrac = frac    ; }  
101   
102  private:
103     
104   virtual void  RecPoints2Clusters(TClonesArray *fdigitsArr, TObjArray *fRecPoints, TObjArray *clusArray);
105   
106   AliVEvent             *fEvent;                   // Event 
107   
108   //Geometry  
109   AliEMCALGeometry      *fGeom;                    // EMCAL geometry
110   TString                fGeomName;                // Name of geometry to use.
111   TGeoHMatrix           *fGeomMatrix[10];          // Geometry matrices with alignments
112   Bool_t                 fGeomMatrixSet;           // Set geometry matrices only once, for the first event.         
113   Bool_t                 fLoadGeomMatrices;        // Matrices set from configuration, not get from geometry.root or from ESDs/AODs
114
115   //OCDB
116   AliEMCALCalibData     *fCalibData;               // EMCAL calib data
117   AliCaloCalibPedestal  *fPedestalData;            // EMCAL pedestal
118   TString                fOCDBpath;                // Path with OCDB location
119   Bool_t                 fAccessOCDB;              // Need to access info from OCDB (not really)   
120
121   //Temporal arrays
122   TClonesArray          *fDigitsArr;               //-> Digits array
123   TObjArray             *fClusterArr;              //-> Recpoints array
124   TObjArray             *fCaloClusterArr;          //-> CaloClusters array
125
126   //Clusterizers 
127   AliEMCALRecParam      *fRecParam;                // Reconstruction parameters container
128   AliEMCALClusterizer   *fClusterizer;             //! EMCAL clusterizer
129   AliEMCALAfterBurnerUF *fUnfolder;                //! Unfolding procedure
130   Bool_t                 fJustUnfold;              // Just unfold, do not recluster
131   
132   //AOD
133   TClonesArray          *fOutputAODBranch;         //! AOD Branch with output clusters  
134   TString                fOutputAODBranchName;     // New of output AOD branch
135   Bool_t                 fFillAODFile;             // Fill the output AOD file with the new clusters, 
136                                                    // if not they will be only available for the event they were generated
137   Bool_t                 fFillAODHeader;           // Copy header to standard branch
138   Bool_t                 fFillAODCaloCells;        // Copy calocells to standard branch
139
140   Int_t                  fRun;                     //!run number
141   
142   AliEMCALRecoUtils*     fRecoUtils;               // Access to factorized reconstruction algorithms
143   TString                fConfigName;              // Name of analysis configuration file
144   
145   Int_t                  fCellLabels[12672];       // Array with MC label to be passed to digit. 
146   Int_t                  fCellSecondLabels[12672]; // Array with Second MC label to be passed to digit. 
147   Double_t               fCellTime[12672];         // Array with cluster time to be passed to digit in case of AODs 
148   Float_t                fCellMatchdEta[12672];    // Array with cluster-track dPhi 
149   Float_t                fCellMatchdPhi[12672];    // Array with cluster-track dEta 
150
151   Int_t                  fMaxEvent;                // Set a maximum event
152   
153   Bool_t                 fDoTrackMatching;         // On/Off the matching recalulation to speed up analysis in PbPb
154   Bool_t                 fSelectCell;              // Reject cells from cluster if energy is too low and recalculate position/energy and other
155   Float_t                fSelectCellMinE;          // Min energy cell threshold, after unfolding
156   Float_t                fSelectCellMinFrac;       // Min fraction of cell energy after unfolding cut
157   Bool_t                 fRemoveLEDEvents;         // Remove LED events, use only for LHC11a 
158   Bool_t                 fRemoveExoticEvents;      // Remove exotic events
159   
160   Bool_t                 fImportGeometryFromFile;  // Import geometry settings in geometry.root file
161   TString                fImportGeometryFilePath;  // path fo geometry.root file
162
163   
164   ClassDef(AliAnalysisTaskEMCALClusterize, 17);
165
166 };
167
168 #endif //ALIANALYSISTASKEMCALCLUSTERIZE_H