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
39 Bool_t AcceptEventEMCAL();
40 void SwitchOnSelectEMCALEvent() { fSelectEMCALEvent = kTRUE ; }
41 void SwitchOffSelectEMCALEvent() { fSelectEMCALEvent = kFALSE ; }
42 void SetEMCALEnergyCut(Float_t cut) { fEMCALEnergyCut = cut ; }
43 void SetEMCALNcellsCut(Int_t cut) { fEMCALNcellsCut = cut ; }
45 void CheckAndGetEvent();
47 Bool_t IsExoticEvent();
48 void SwitchOnExoticEventsRemoval() { fRemoveExoticEvents= kTRUE ; }
49 void SwitchOffExoticEventsRemoval() { fRemoveExoticEvents= kFALSE ; }
51 Bool_t IsLEDEvent(const Int_t run);
52 void SwitchOnLEDEventsRemoval() { fRemoveLEDEvents = kTRUE ; }
53 void SwitchOffLEDEventsRemoval() { fRemoveLEDEvents = kFALSE ; }
57 void SwitchOnAccessOCDB() { fAccessOCDB = kTRUE ; }
58 void SwitchOffAccessOCDB() { fAccessOCDB = kFALSE ; }
59 void SetOCDBPath(const char *path) { fOCDBpath = path ; }
63 void SetGeometryName(TString &name) { fGeomName = name ; }
64 TString GeometryName() const { return fGeomName ; }
65 void SwitchOnLoadOwnGeometryMatrices() { fLoadGeomMatrices = kTRUE ; }
66 void SwitchOffLoadOwnGeometryMatrices() { fLoadGeomMatrices = kFALSE ; }
67 void SetGeometryMatrixInSM(TGeoHMatrix* m, Int_t i) { fGeomMatrix[i] = m ; }
69 void SetImportGeometryFromFile(Bool_t im,
70 TString pa = "") { fImportGeometryFromFile = im ;
71 fImportGeometryFilePath = pa ; }
73 void SetAODBranchName(TString &name) { fOutputAODBranchName = name ; }
74 void FillAODFile(Bool_t yesno) { fFillAODFile = yesno ; }
75 void FillAODCaloCells();
77 void SwitchOnFillAODHeader() { fFillAODHeader = kTRUE ; }
78 void SwitchOffFillAODHeader() { fFillAODHeader = kFALSE ; }
79 void SwitchOnFillAODCaloCells() { fFillAODCaloCells = kTRUE ; }
80 void SwitchOffFillAODCaloCells() { fFillAODCaloCells = kFALSE ; }
82 void SwitchOnRecalibrateWithClusterTime() { fRecalibrateWithClusterTime = kTRUE ; }
83 void SwitchOffRecalibrateWithClusterTime() { fRecalibrateWithClusterTime = kFALSE ; }
87 AliEMCALRecParam * GetRecParam() { if(!fRecParam) fRecParam = new AliEMCALRecParam ;
90 AliEMCALRecoUtils* GetRecoUtils() { if(!fRecoUtils) fRecoUtils = new AliEMCALRecoUtils ;
93 void InitClusterization();
94 void ClusterizeCells();
95 void ClusterUnfolding();
96 void JustUnfold(Bool_t yesno) { fJustUnfold = yesno ; }
98 void SetConfigFileName(TString name) { fConfigName = name ; }
99 void SetMaxEvent(Int_t max) { fMaxEvent = max ; }
101 void SwitchOnTrackMatching() { fDoTrackMatching = kTRUE ; }
102 void SwitchOffTrackMatching() { fDoTrackMatching = kFALSE ; }
104 // Cell selection after unfolding
105 void SwitchOnCellEnergySelection() { fSelectCell = kTRUE ; }
106 void SwitchOffCellEnergySelection() { fSelectCell = kFALSE ; }
107 void SetCellCuts(Float_t e, Float_t frac) { fSelectCellMinE = e ;
108 fSelectCellMinFrac = frac ; }
109 // OADB options settings
115 void SwitchOnEMCALOADB() { fAccessOADB = kTRUE ; }
116 void SwitchOffEMCALOADB() { fAccessOADB = kFALSE ; }
118 void SetOADBFilePath(TString path) { fOADBFilePath = path ; }
120 // Centrality selection
122 AliCentrality* GetCentrality() { return InputEvent()->GetCentrality() ; } //Look in AOD reader, different there
123 void SetCentralityClass(TString name) { fCentralityClass = name ; }
124 TString GetCentralityClass() const { return fCentralityClass ; }
125 Float_t GetEventCentrality() { if(GetCentrality()) return GetCentrality()->GetCentralityPercentile(fCentralityClass) ;
127 void SetCentralityBin(Int_t min, Int_t max) //Set the centrality bin to select the event. If used, then need to get percentile
128 { fCentralityBin[0]=min ; fCentralityBin[1]=max ; }
129 Float_t GetCentralityBin(Int_t i) const { if(i < 0 || i > 1) return -1 ;
130 else return fCentralityBin[i] ; }
132 void SwitchOnUseClusterMCLabelForCell() { fSetCellMCLabelFromCluster = kTRUE ;}
133 void SwitchOffUseClusterMCLabelForCell() { fSetCellMCLabelFromCluster = kFALSE ;}
138 virtual void FillCaloClusterInEvent();
140 virtual void RecPoints2Clusters();
143 AliVEvent *fEvent; // Event
146 AliEMCALGeometry *fGeom; // EMCAL geometry
147 TString fGeomName; // Name of geometry to use.
148 TGeoHMatrix *fGeomMatrix[12]; // Geometry matrices with alignments
149 Bool_t fGeomMatrixSet; // Set geometry matrices only once, for the first event.
150 Bool_t fLoadGeomMatrices; // Matrices set from configuration, not get from geometry.root or from ESDs/AODs
153 AliEMCALCalibData *fCalibData; // EMCAL calib data
154 AliCaloCalibPedestal *fPedestalData; // EMCAL pedestal
155 TString fOCDBpath; // Path with OCDB location
156 Bool_t fAccessOCDB; // Need to access info from OCDB (not really)
159 TClonesArray *fDigitsArr; //! Digits array
160 TObjArray *fClusterArr; //! Recpoints array
161 TObjArray *fCaloClusterArr; //! CaloClusters array
164 AliEMCALRecParam *fRecParam; // Reconstruction parameters container
165 AliEMCALClusterizer *fClusterizer; //! EMCAL clusterizer
166 AliEMCALAfterBurnerUF *fUnfolder; //! Unfolding procedure
167 Bool_t fJustUnfold; // Just unfold, do not recluster
170 TClonesArray *fOutputAODBranch; //! AOD Branch with output clusters
171 TString fOutputAODBranchName; // New of output AOD branch
172 Bool_t fOutputAODBranchSet ; // Set the AOD clusters branch in the input event once
173 Bool_t fFillAODFile; // Fill the output AOD file with the new clusters,
174 // if not they will be only available for the event they were generated
175 Bool_t fFillAODHeader; // Copy header to standard branch
176 Bool_t fFillAODCaloCells; // Copy calocells to standard branch
178 Int_t fRun; // run number
180 AliEMCALRecoUtils* fRecoUtils; // Access to factorized reconstruction algorithms
181 TString fConfigName; // Name of analysis configuration file
183 Int_t fCellLabels[12672]; // Array with MC label to be passed to digit.
184 Int_t fCellSecondLabels[12672]; // Array with Second MC label to be passed to digit.
185 Double_t fCellTime[12672]; // Array with cluster time to be passed to digit in case of AODs
186 Float_t fCellMatchdEta[12672]; // Array with cluster-track dPhi
187 Float_t fCellMatchdPhi[12672]; // Array with cluster-track dEta
189 Bool_t fRecalibrateWithClusterTime; // Use fCellTime to store time of cells in cluster
191 Int_t fMaxEvent; // Set a maximum event
193 Bool_t fDoTrackMatching; // On/Off the matching recalulation to speed up analysis in PbPb
194 Bool_t fSelectCell; // Reject cells from cluster if energy is too low and recalculate position/energy and other
195 Float_t fSelectCellMinE; // Min energy cell threshold, after unfolding
196 Float_t fSelectCellMinFrac; // Min fraction of cell energy after unfolding cut
197 Bool_t fRemoveLEDEvents; // Remove LED events, use only for LHC11a
198 Bool_t fRemoveExoticEvents; // Remove exotic events
200 Bool_t fImportGeometryFromFile; // Import geometry settings in geometry.root file
201 TString fImportGeometryFilePath; // path fo geometry.root file
203 Bool_t fOADBSet ; // AODB parameters already set
204 Bool_t fAccessOADB ; // Get calibration from OADB for EMCAL
205 TString fOADBFilePath ; // Default path $ALICE_ROOT/OADB/EMCAL, if needed change
208 TString fCentralityClass; // Name of selected centrality class
209 Float_t fCentralityBin[2]; // Minimum and maximum value of the centrality for the analysis
211 // Event selection with some signal in EMCAL
212 Bool_t fSelectEMCALEvent; // Process the event if there is some high energy cluster
213 Float_t fEMCALEnergyCut; // At least an EMCAL cluster with this energy in the event
214 Int_t fEMCALNcellsCut; // At least an EMCAL cluster with fNCellsCut cells over fEnergyCut
216 Bool_t fSetCellMCLabelFromCluster; // Use cluster MC label as cell label
219 AliAnalysisTaskEMCALClusterize( const AliAnalysisTaskEMCALClusterize&); // not implemented
220 AliAnalysisTaskEMCALClusterize& operator=(const AliAnalysisTaskEMCALClusterize&); // not implemented
222 ClassDef(AliAnalysisTaskEMCALClusterize, 25);
226 #endif //ALIANALYSISTASKEMCALCLUSTERIZE_H