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