1 #ifndef ALIANALYSISTASKEMCALCLUSTERIZE_H
2 #define ALIANALYSISTASKEMCALCLUSTERIZE_H
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
12 #include "AliCentrality.h";
15 class AliEMCALGeometry;
16 class AliEMCALCalibData;
17 class AliCaloCalibPedestal;
18 class AliEMCALClusterizer;
19 class AliEMCALAfterBurnerUF;
20 #include "AliEMCALRecParam.h"
21 #include "AliEMCALRecoUtils.h"
24 #include "AliAnalysisTaskSE.h"
26 class AliAnalysisTaskEMCALClusterize : public AliAnalysisTaskSE {
28 AliAnalysisTaskEMCALClusterize();
29 AliAnalysisTaskEMCALClusterize(const char *name);
30 virtual ~AliAnalysisTaskEMCALClusterize();
32 virtual void UserCreateOutputObjects();
33 virtual void UserExec(Option_t *option);
35 virtual void LocalInit() { Init() ; }
37 // Event methods, settings
38 void CheckAndGetEvent();
40 Bool_t IsExoticEvent();
41 void SwitchOnExoticEventsRemoval() { fRemoveExoticEvents= kTRUE ; }
42 void SwitchOffExoticEventsRemoval() { fRemoveExoticEvents= kFALSE ; }
44 Bool_t IsLEDEvent(const Int_t run);
45 void SwitchOnLEDEventsRemoval() { fRemoveLEDEvents = kTRUE ; }
46 void SwitchOffLEDEventsRemoval() { fRemoveLEDEvents = kFALSE ; }
50 void SwitchOnAccessOCDB() { fAccessOCDB = kTRUE ; }
51 void SwitchOffAccessOCDB() { fAccessOCDB = kFALSE ; }
52 void SetOCDBPath(const char *path) { fOCDBpath = path ; }
56 void SetGeometryName(TString &name) { fGeomName = name ; }
57 TString GeometryName() const { return fGeomName ; }
58 void SwitchOnLoadOwnGeometryMatrices() { fLoadGeomMatrices = kTRUE ; }
59 void SwitchOffLoadOwnGeometryMatrices() { fLoadGeomMatrices = kFALSE ; }
60 void SetGeometryMatrixInSM(TGeoHMatrix* m, Int_t i) { fGeomMatrix[i] = m ; }
62 void SetImportGeometryFromFile(Bool_t im,
63 TString pa = "") { fImportGeometryFromFile = im ;
64 fImportGeometryFilePath = pa ; }
66 void SetAODBranchName(TString &name) { fOutputAODBranchName = name ; }
67 void FillAODFile(Bool_t yesno) { fFillAODFile = yesno ; }
68 void FillAODCaloCells();
70 void SwitchOnFillAODHeader() { fFillAODHeader = kTRUE ; }
71 void SwitchOffFillAODHeader() { fFillAODHeader = kFALSE ; }
72 void SwitchOnFillAODCaloCells() { fFillAODCaloCells = kTRUE ; }
73 void SwitchOffFillAODCaloCells() { fFillAODCaloCells = kFALSE ; }
77 AliEMCALRecParam * GetRecParam() { if(!fRecParam) fRecParam = new AliEMCALRecParam ;
80 AliEMCALRecoUtils* GetRecoUtils() { if(!fRecoUtils) fRecoUtils = new AliEMCALRecoUtils ;
83 void InitClusterization();
84 void ClusterizeCells();
85 void ClusterUnfolding();
86 void JustUnfold(Bool_t yesno) { fJustUnfold = yesno ; }
88 void SetConfigFileName(TString name) { fConfigName = name ; }
89 void SetMaxEvent(Int_t max) { fMaxEvent = max ; }
91 void SwitchOnTrackMatching() { fDoTrackMatching = kTRUE ; }
92 void SwitchOffTrackMatching() { fDoTrackMatching = kFALSE ; }
94 // Cell selection after unfolding
95 void SwitchOnCellEnergySelection() { fSelectCell = kTRUE ; }
96 void SwitchOffCellEnergySelection() { fSelectCell = kFALSE ; }
97 void SetCellCuts(Float_t e, Float_t frac) { fSelectCellMinE = e ;
98 fSelectCellMinFrac = frac ; }
99 // OADB options settings
105 void SwitchOnEMCALOADB() { fAccessOADB = kTRUE ; }
106 void SwitchOffEMCALOADB() { fAccessOADB = kFALSE ; }
108 void SetOADBFilePath(TString path) { fOADBFilePath = path ; }
110 // Centrality selection
112 AliCentrality* GetCentrality() { return InputEvent()->GetCentrality() ; } //Look in AOD reader, different there
113 void SetCentralityClass(TString name) { fCentralityClass = name ; }
114 TString GetCentralityClass() const { return fCentralityClass ; }
115 Int_t GetEventCentrality() { if(GetCentrality()) return GetCentrality()->GetCentralityPercentile(fCentralityClass) ;
117 void SetCentralityBin(Int_t min, Int_t max) //Set the centrality bin to select the event. If used, then need to get percentile
118 { fCentralityBin[0]=min ; fCentralityBin[1]=max ; }
119 Float_t GetCentralityBin(Int_t i) const { if(i < 0 || i > 1) return -1 ;
120 else return fCentralityBin[i] ; }
124 virtual void FillCaloClusterInEvent();
126 virtual void RecPoints2Clusters();
129 AliVEvent *fEvent; // Event
132 AliEMCALGeometry *fGeom; // EMCAL geometry
133 TString fGeomName; // Name of geometry to use.
134 TGeoHMatrix *fGeomMatrix[12]; // Geometry matrices with alignments
135 Bool_t fGeomMatrixSet; // Set geometry matrices only once, for the first event.
136 Bool_t fLoadGeomMatrices; // Matrices set from configuration, not get from geometry.root or from ESDs/AODs
139 AliEMCALCalibData *fCalibData; // EMCAL calib data
140 AliCaloCalibPedestal *fPedestalData; // EMCAL pedestal
141 TString fOCDBpath; // Path with OCDB location
142 Bool_t fAccessOCDB; // Need to access info from OCDB (not really)
145 TClonesArray *fDigitsArr; //! Digits array
146 TObjArray *fClusterArr; //! Recpoints array
147 TObjArray *fCaloClusterArr; //! CaloClusters array
150 AliEMCALRecParam *fRecParam; // Reconstruction parameters container
151 AliEMCALClusterizer *fClusterizer; //! EMCAL clusterizer
152 AliEMCALAfterBurnerUF *fUnfolder; //! Unfolding procedure
153 Bool_t fJustUnfold; // Just unfold, do not recluster
156 TClonesArray *fOutputAODBranch; //! AOD Branch with output clusters
157 TString fOutputAODBranchName; // New of output AOD branch
158 Bool_t fOutputAODBranchSet ; // Set the AOD clusters branch in the input event once
159 Bool_t fFillAODFile; // Fill the output AOD file with the new clusters,
160 // if not they will be only available for the event they were generated
161 Bool_t fFillAODHeader; // Copy header to standard branch
162 Bool_t fFillAODCaloCells; // Copy calocells to standard branch
164 Int_t fRun; // run number
166 AliEMCALRecoUtils* fRecoUtils; // Access to factorized reconstruction algorithms
167 TString fConfigName; // Name of analysis configuration file
169 Int_t fCellLabels[12672]; // Array with MC label to be passed to digit.
170 Int_t fCellSecondLabels[12672]; // Array with Second MC label to be passed to digit.
171 Double_t fCellTime[12672]; // Array with cluster time to be passed to digit in case of AODs
172 Float_t fCellMatchdEta[12672]; // Array with cluster-track dPhi
173 Float_t fCellMatchdPhi[12672]; // Array with cluster-track dEta
175 Int_t fMaxEvent; // Set a maximum event
177 Bool_t fDoTrackMatching; // On/Off the matching recalulation to speed up analysis in PbPb
178 Bool_t fSelectCell; // Reject cells from cluster if energy is too low and recalculate position/energy and other
179 Float_t fSelectCellMinE; // Min energy cell threshold, after unfolding
180 Float_t fSelectCellMinFrac; // Min fraction of cell energy after unfolding cut
181 Bool_t fRemoveLEDEvents; // Remove LED events, use only for LHC11a
182 Bool_t fRemoveExoticEvents; // Remove exotic events
184 Bool_t fImportGeometryFromFile; // Import geometry settings in geometry.root file
185 TString fImportGeometryFilePath; // path fo geometry.root file
187 Bool_t fOADBSet ; // AODB parameters already set
188 Bool_t fAccessOADB ; // Get calibration from OADB for EMCAL
189 TString fOADBFilePath ; // Default path $ALICE_ROOT/OADB/EMCAL, if needed change
192 TString fCentralityClass; // Name of selected centrality class
193 Int_t fCentralityBin[2]; // Minimum and maximum value of the centrality for the analysis
196 AliAnalysisTaskEMCALClusterize( const AliAnalysisTaskEMCALClusterize&); // not implemented
197 AliAnalysisTaskEMCALClusterize& operator=(const AliAnalysisTaskEMCALClusterize&); // not implemented
199 ClassDef(AliAnalysisTaskEMCALClusterize, 22);
203 #endif //ALIANALYSISTASKEMCALCLUSTERIZE_H