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