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 class AliEMCALRecPoint;
21 class AliAODCaloCluster;
22 #include "AliEMCALRecParam.h"
23 #include "AliEMCALRecoUtils.h"
26 #include "AliAnalysisTaskSE.h"
28 class AliAnalysisTaskEMCALClusterize : public AliAnalysisTaskSE {
30 AliAnalysisTaskEMCALClusterize();
31 AliAnalysisTaskEMCALClusterize(const char *name);
32 virtual ~AliAnalysisTaskEMCALClusterize();
34 virtual void UserCreateOutputObjects();
35 virtual void UserExec(Option_t *option);
37 virtual void LocalInit() { Init() ; }
39 // Event methods, settings
41 Bool_t AcceptEventEMCAL();
42 void SwitchOnSelectEMCALEvent() { fSelectEMCALEvent = kTRUE ; }
43 void SwitchOffSelectEMCALEvent() { fSelectEMCALEvent = kFALSE ; }
44 void SetEMCALEnergyCut(Float_t cut) { fEMCALEnergyCut = cut ; }
45 void SetEMCALNcellsCut(Int_t cut) { fEMCALNcellsCut = cut ; }
47 void SwitchOnInputAODFilter() { fInputFromFilter = kTRUE ; }
48 void SwitchOffInputAODFilter() { fInputFromFilter = kFALSE ; }
50 void CheckAndGetEvent();
52 Bool_t IsExoticEvent();
53 void SwitchOnExoticEventsRemoval() { fRemoveExoticEvents= kTRUE ; }
54 void SwitchOffExoticEventsRemoval() { fRemoveExoticEvents= kFALSE ; }
56 Bool_t IsLEDEvent(const Int_t run);
57 void SwitchOnLEDEventsRemoval() { fRemoveLEDEvents = kTRUE ; }
58 void SwitchOffLEDEventsRemoval() { fRemoveLEDEvents = kFALSE ; }
62 void SwitchOnAccessOCDB() { fAccessOCDB = kTRUE ; }
63 void SwitchOffAccessOCDB() { fAccessOCDB = kFALSE ; }
64 void SetOCDBPath(const char *path) { fOCDBpath = path ; }
68 void SetGeometryName(TString &name) { fGeomName = name ; }
69 TString GeometryName() const { return fGeomName ; }
70 void SwitchOnLoadOwnGeometryMatrices() { fLoadGeomMatrices = kTRUE ; }
71 void SwitchOffLoadOwnGeometryMatrices() { fLoadGeomMatrices = kFALSE ; }
72 void SetGeometryMatrixInSM(TGeoHMatrix* m, Int_t i) { fGeomMatrix[i] = m ; }
74 void SetImportGeometryFromFile(Bool_t im,
75 TString pa = "") { fImportGeometryFromFile = im ;
76 fImportGeometryFilePath = pa ; }
78 void SetAODBranchName(TString &name) { fOutputAODBranchName = name ; }
79 void FillAODFile(Bool_t yesno) { fFillAODFile = yesno ; }
80 void FillAODCaloCells();
82 void SwitchOnFillAODHeader() { fFillAODHeader = kTRUE ; }
83 void SwitchOffFillAODHeader() { fFillAODHeader = kFALSE ; }
84 void SwitchOnFillAODCaloCells() { fFillAODCaloCells = kTRUE ; }
85 void SwitchOffFillAODCaloCells() { fFillAODCaloCells = kFALSE ; }
87 void SwitchOnRecalibrateWithClusterTime() { fRecalibrateWithClusterTime = kTRUE ; }
88 void SwitchOffRecalibrateWithClusterTime() { fRecalibrateWithClusterTime = kFALSE ; }
94 AliEMCALRecParam * GetRecParam() { if(!fRecParam) fRecParam = new AliEMCALRecParam ;
97 AliEMCALRecoUtils* GetRecoUtils() { if(!fRecoUtils) fRecoUtils = new AliEMCALRecoUtils ;
100 void InitClusterization();
101 void ClusterizeCells();
102 void ClusterUnfolding();
103 void JustUnfold(Bool_t yesno) { fJustUnfold = yesno ; }
105 void SetConfigFileName(TString name) { fConfigName = name ; }
106 void SetMaxEvent(Int_t max) { fMaxEvent = max ; }
108 void SwitchOnTrackMatching() { fDoTrackMatching = kTRUE ; }
109 void SwitchOffTrackMatching() { fDoTrackMatching = kFALSE ; }
111 // Cell selection after unfolding
112 void SwitchOnCellEnergySelection() { fSelectCell = kTRUE ; }
113 void SwitchOffCellEnergySelection() { fSelectCell = kFALSE ; }
114 void SetCellCuts(Float_t e, Float_t frac) { fSelectCellMinE = e ;
115 fSelectCellMinFrac = frac ; }
116 void SetRejectBelowThreshold(Bool_t reject) { fRejectBelowThreshold =reject ; }
117 // OADB options settings
123 void SwitchOnEMCALOADB() { fAccessOADB = kTRUE ; }
124 void SwitchOffEMCALOADB() { fAccessOADB = kFALSE ; }
126 void SetOADBFilePath(TString path) { fOADBFilePath = path ; }
128 // Centrality selection
130 AliCentrality* GetCentrality() { return InputEvent()->GetCentrality() ; } //Look in AOD reader, different there
131 void SetCentralityClass(TString name) { fCentralityClass = name ; }
132 TString GetCentralityClass() const { return fCentralityClass ; }
133 Float_t GetEventCentrality() { if(GetCentrality()) return GetCentrality()->GetCentralityPercentile(fCentralityClass) ;
135 void SetCentralityBin(Int_t min, Int_t max) //Set the centrality bin to select the event. If used, then need to get percentile
136 { fCentralityBin[0]=min ; fCentralityBin[1]=max ; }
137 Float_t GetCentralityBin(Int_t i) const { if(i < 0 || i > 1) return -1 ;
138 else return fCentralityBin[i] ; }
142 void RemapMCLabelForAODs(Int_t &label);
143 void SwitchOnRemapMCLabelForAODs() { fRemapMCLabelForAODs = kTRUE ; }
144 void SwitchOffRemapMCLabelForAODs() { fRemapMCLabelForAODs = kFALSE ; }
146 void SetClustersMCLabelFrom2SelectedLabels(AliEMCALRecPoint* recPoint, AliAODCaloCluster *clus) ;
147 void SetClustersMCLabelFromOriginalClusters(AliAODCaloCluster * clus) ;
149 void SwitchOnUseClusterMCLabelForCell(Int_t opt = 2) { fSetCellMCLabelFromCluster = opt ; }
150 void SwitchOffUseClusterMCLabelForCell() { fSetCellMCLabelFromCluster = 0 ; }
154 virtual void FillCaloClusterInEvent();
156 virtual void RecPoints2Clusters();
158 virtual void ResetArrays();
160 AliVEvent *fEvent; // Event
163 AliEMCALGeometry *fGeom; // EMCAL geometry
164 TString fGeomName; // Name of geometry to use.
165 TGeoHMatrix *fGeomMatrix[12]; // Geometry matrices with alignments
166 Bool_t fGeomMatrixSet; // Set geometry matrices only once, for the first event.
167 Bool_t fLoadGeomMatrices; // Matrices set from configuration, not get from geometry.root or from ESDs/AODs
170 AliEMCALCalibData *fCalibData; // EMCAL calib data
171 AliCaloCalibPedestal *fPedestalData; // EMCAL pedestal
172 TString fOCDBpath; // Path with OCDB location
173 Bool_t fAccessOCDB; // Need to access info from OCDB (not really)
176 TClonesArray *fDigitsArr; //! Digits array
177 TObjArray *fClusterArr; //! Recpoints array
178 TObjArray *fCaloClusterArr; //! CaloClusters array
181 AliEMCALRecParam *fRecParam; // Reconstruction parameters container
182 AliEMCALClusterizer *fClusterizer; //! EMCAL clusterizer
183 AliEMCALAfterBurnerUF *fUnfolder; //! Unfolding procedure
184 Bool_t fJustUnfold; // Just unfold, do not recluster
187 TClonesArray *fOutputAODBranch; //! AOD Branch with output clusters
188 TString fOutputAODBranchName; // New of output AOD branch
189 Bool_t fOutputAODBranchSet ; // Set the AOD clusters branch in the input event once
190 Bool_t fFillAODFile; // Fill the output AOD file with the new clusters,
191 // if not they will be only available for the event they were generated
192 Bool_t fFillAODHeader; // Copy header to standard branch
193 Bool_t fFillAODCaloCells; // Copy calocells to standard branch
195 Int_t fRun; // run number
197 AliEMCALRecoUtils* fRecoUtils; // Access to factorized reconstruction algorithms
198 TString fConfigName; // Name of analysis configuration file
201 Int_t fOrgClusterCellId[12672]; // Array ID of cluster to wich the cell belongs in unmodified clusters
202 Int_t fCellLabels[12672]; // Array with MC label to be passed to digit.
203 Int_t fCellSecondLabels[12672]; // Array with Second MC label to be passed to digit.
204 Double_t fCellTime[12672]; // Array with cluster time to be passed to digit in case of AODs
205 Float_t fCellMatchdEta[12672]; // Array with cluster-track dPhi
206 Float_t fCellMatchdPhi[12672]; // Array with cluster-track dEta
208 Bool_t fRecalibrateWithClusterTime; // Use fCellTime to store time of cells in cluster
210 Int_t fMaxEvent; // Set a maximum event
212 Bool_t fDoTrackMatching; // On/Off the matching recalulation to speed up analysis in PbPb
213 Bool_t fSelectCell; // Reject cells from cluster if energy is too low and recalculate position/energy and other
214 Float_t fSelectCellMinE; // Min energy cell threshold, after unfolding
215 Float_t fSelectCellMinFrac; // Min fraction of cell energy after unfolding cut
216 Bool_t fRejectBelowThreshold; // split (false-default) or reject (true) cell energy below threshold after UF
217 Bool_t fRemoveLEDEvents; // Remove LED events, use only for LHC11a
218 Bool_t fRemoveExoticEvents; // Remove exotic events
220 Bool_t fImportGeometryFromFile; // Import geometry settings in geometry.root file
221 TString fImportGeometryFilePath; // path fo geometry.root file
223 Bool_t fOADBSet ; // AODB parameters already set
224 Bool_t fAccessOADB ; // Get calibration from OADB for EMCAL
225 TString fOADBFilePath ; // Default path $ALICE_ROOT/OADB/EMCAL, if needed change
228 TString fCentralityClass; // Name of selected centrality class
229 Float_t fCentralityBin[2]; // Minimum and maximum value of the centrality for the analysis
231 // Event selection with some signal in EMCAL
232 Bool_t fSelectEMCALEvent; // Process the event if there is some high energy cluster
233 Float_t fEMCALEnergyCut; // At least an EMCAL cluster with this energy in the event
234 Int_t fEMCALNcellsCut; // At least an EMCAL cluster with fNCellsCut cells over fEnergyCut
236 Int_t fSetCellMCLabelFromCluster; // Use cluster MC label as cell label:
237 // 0 - get the MC label stored in cells
238 // 1 - from old way, select 2 most likely labels
239 // 2 - from new way, get the original clusters, add all the MC labels (useful for any reclusterization with output V1 clusters)
240 Bool_t fRemapMCLabelForAODs ; // Remap AOD cells MC label
243 Bool_t fInputFromFilter ; // Get the input from AODs from the filter
245 AliAnalysisTaskEMCALClusterize( const AliAnalysisTaskEMCALClusterize&); // not implemented
246 AliAnalysisTaskEMCALClusterize& operator=(const AliAnalysisTaskEMCALClusterize&); // not implemented
248 ClassDef(AliAnalysisTaskEMCALClusterize, 28);
252 #endif //ALIANALYSISTASKEMCALCLUSTERIZE_H