]>
Commit | Line | Data |
---|---|---|
37d2296c | 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 | ||
8fa7608a | 12 | #include "AliCentrality.h" |
cb68426a | 13 | |
37d2296c | 14 | //EMCAL |
15 | class AliEMCALGeometry; | |
16 | class AliEMCALCalibData; | |
17 | class AliCaloCalibPedestal; | |
18 | class AliEMCALClusterizer; | |
19 | class AliEMCALAfterBurnerUF; | |
6edb4448 | 20 | class AliEMCALRecPoint; |
21 | class AliAODCaloCluster; | |
3769e0cb | 22 | #include "AliEMCALRecParam.h" |
23 | #include "AliEMCALRecoUtils.h" | |
37d2296c | 24 | |
25 | ||
26 | #include "AliAnalysisTaskSE.h" | |
27 | ||
28 | class AliAnalysisTaskEMCALClusterize : public AliAnalysisTaskSE { | |
29 | public: | |
30 | AliAnalysisTaskEMCALClusterize(); | |
31 | AliAnalysisTaskEMCALClusterize(const char *name); | |
32 | virtual ~AliAnalysisTaskEMCALClusterize(); | |
33 | ||
37d2296c | 34 | virtual void UserCreateOutputObjects(); |
35 | virtual void UserExec(Option_t *option); | |
36 | virtual void Init(); | |
37 | virtual void LocalInit() { Init() ; } | |
6544055e | 38 | |
39 | // Event methods, settings | |
5aa88029 | 40 | |
41 | Bool_t AcceptEventEMCAL(); | |
1c197eba | 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 ; } | |
5aa88029 | 46 | |
1c197eba | 47 | void SwitchOnInputAODFilter() { fInputFromFilter = kTRUE ; } |
48 | void SwitchOffInputAODFilter() { fInputFromFilter = kFALSE ; } | |
49 | ||
6544055e | 50 | void CheckAndGetEvent(); |
51 | ||
52 | Bool_t IsExoticEvent(); | |
53 | void SwitchOnExoticEventsRemoval() { fRemoveExoticEvents= kTRUE ; } | |
54 | void SwitchOffExoticEventsRemoval() { fRemoveExoticEvents= kFALSE ; } | |
55 | ||
3769e0cb | 56 | Bool_t IsLEDEvent(const Int_t run); |
6544055e | 57 | void SwitchOnLEDEventsRemoval() { fRemoveLEDEvents = kTRUE ; } |
58 | void SwitchOffLEDEventsRemoval() { fRemoveLEDEvents = kFALSE ; } | |
e9dd2d80 | 59 | |
60 | //OCDB | |
37d2296c | 61 | Bool_t AccessOCDB(); |
d390e7cb | 62 | void SwitchOnAccessOCDB() { fAccessOCDB = kTRUE ; } |
63 | void SwitchOffAccessOCDB() { fAccessOCDB = kFALSE ; } | |
64 | void SetOCDBPath(const char *path) { fOCDBpath = path ; } | |
37d2296c | 65 | |
66 | //Geometry methods | |
6544055e | 67 | void InitGeometry(); |
37d2296c | 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 ; } | |
73 | ||
9ac44255 | 74 | void SetImportGeometryFromFile(Bool_t im, |
3769e0cb | 75 | TString pa = "") { fImportGeometryFromFile = im ; |
9ac44255 | 76 | fImportGeometryFilePath = pa ; } |
37d2296c | 77 | //AOD methods |
78 | void SetAODBranchName(TString &name) { fOutputAODBranchName = name ; } | |
79 | void FillAODFile(Bool_t yesno) { fFillAODFile = yesno ; } | |
1f77507b | 80 | void FillAODCaloCells(); |
81 | void FillAODHeader(); | |
d390e7cb | 82 | void SwitchOnFillAODHeader() { fFillAODHeader = kTRUE ; } |
83 | void SwitchOffFillAODHeader() { fFillAODHeader = kFALSE ; } | |
84 | void SwitchOnFillAODCaloCells() { fFillAODCaloCells = kTRUE ; } | |
85 | void SwitchOffFillAODCaloCells() { fFillAODCaloCells = kFALSE ; } | |
1e0ff9d3 | 86 | |
87 | void SwitchOnRecalibrateWithClusterTime() { fRecalibrateWithClusterTime = kTRUE ; } | |
88 | void SwitchOffRecalibrateWithClusterTime() { fRecalibrateWithClusterTime = kFALSE ; } | |
37d2296c | 89 | |
6edb4448 | 90 | |
91 | ||
37d2296c | 92 | //Algorithms settings |
3769e0cb | 93 | |
94 | AliEMCALRecParam * GetRecParam() { if(!fRecParam) fRecParam = new AliEMCALRecParam ; | |
95 | return fRecParam ; } | |
96 | ||
97 | AliEMCALRecoUtils* GetRecoUtils() { if(!fRecoUtils) fRecoUtils = new AliEMCALRecoUtils ; | |
98 | return fRecoUtils ; } | |
99 | ||
37d2296c | 100 | void InitClusterization(); |
6544055e | 101 | void ClusterizeCells(); |
102 | void ClusterUnfolding(); | |
103 | void JustUnfold(Bool_t yesno) { fJustUnfold = yesno ; } | |
3769e0cb | 104 | |
d390e7cb | 105 | void SetConfigFileName(TString name) { fConfigName = name ; } |
106 | void SetMaxEvent(Int_t max) { fMaxEvent = max ; } | |
37d2296c | 107 | |
d390e7cb | 108 | void SwitchOnTrackMatching() { fDoTrackMatching = kTRUE ; } |
109 | void SwitchOffTrackMatching() { fDoTrackMatching = kFALSE ; } | |
110 | ||
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 ; | |
3e436b3a | 115 | fSelectCellMinFrac = frac ; } |
116 | void SetRejectBelowThreshold(Bool_t reject) { fRejectBelowThreshold =reject ; } | |
3769e0cb | 117 | // OADB options settings |
118 | ||
119 | void AccessOADB() ; | |
120 | ||
121 | TString GetPass() ; | |
122 | ||
978e653c | 123 | void SwitchOnEMCALOADB() { fAccessOADB = kTRUE ; } |
124 | void SwitchOffEMCALOADB() { fAccessOADB = kFALSE ; } | |
3769e0cb | 125 | |
978e653c | 126 | void SetOADBFilePath(TString path) { fOADBFilePath = path ; } |
cb3001b9 | 127 | |
cb68426a | 128 | // Centrality selection |
129 | ||
130 | AliCentrality* GetCentrality() { return InputEvent()->GetCentrality() ; } //Look in AOD reader, different there | |
6edb4448 | 131 | void SetCentralityClass(TString name) { fCentralityClass = name ; } |
132 | TString GetCentralityClass() const { return fCentralityClass ; } | |
133 | Float_t GetEventCentrality() { if(GetCentrality()) return GetCentrality()->GetCentralityPercentile(fCentralityClass) ; | |
8fa7608a | 134 | else return -1. ; } |
6edb4448 | 135 | void SetCentralityBin(Int_t min, Int_t max) //Set the centrality bin to select the event. If used, then need to get percentile |
cb68426a | 136 | { fCentralityBin[0]=min ; fCentralityBin[1]=max ; } |
6edb4448 | 137 | Float_t GetCentralityBin(Int_t i) const { if(i < 0 || i > 1) return -1 ; |
cb68426a | 138 | else return fCentralityBin[i] ; } |
139 | ||
6edb4448 | 140 | //MC label methods |
141 | ||
142 | void RemapMCLabelForAODs(Int_t &label); | |
143 | void SwitchOnRemapMCLabelForAODs() { fRemapMCLabelForAODs = kTRUE ; } | |
144 | void SwitchOffRemapMCLabelForAODs() { fRemapMCLabelForAODs = kFALSE ; } | |
bdd50327 | 145 | |
6edb4448 | 146 | void SetClustersMCLabelFrom2SelectedLabels(AliEMCALRecPoint* recPoint, AliAODCaloCluster *clus) ; |
147 | void SetClustersMCLabelFromOriginalClusters(AliAODCaloCluster * clus) ; | |
bdd50327 | 148 | |
6edb4448 | 149 | void SwitchOnUseClusterMCLabelForCell(Int_t opt = 2) { fSetCellMCLabelFromCluster = opt ; } |
150 | void SwitchOffUseClusterMCLabelForCell() { fSetCellMCLabelFromCluster = 0 ; } | |
151 | ||
152 | private: | |
37d2296c | 153 | |
afc22931 | 154 | virtual void FillCaloClusterInEvent(); |
b43bdd14 | 155 | |
156 | virtual void RecPoints2Clusters(); | |
157 | ||
6edb4448 | 158 | virtual void ResetArrays(); |
37d2296c | 159 | |
6544055e | 160 | AliVEvent *fEvent; // Event |
161 | ||
37d2296c | 162 | //Geometry |
6544055e | 163 | AliEMCALGeometry *fGeom; // EMCAL geometry |
164 | TString fGeomName; // Name of geometry to use. | |
e3990982 | 165 | TGeoHMatrix *fGeomMatrix[12]; // Geometry matrices with alignments |
6544055e | 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 | |
37d2296c | 168 | |
169 | //OCDB | |
6544055e | 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) | |
37d2296c | 174 | |
175 | //Temporal arrays | |
7377e825 | 176 | TClonesArray *fDigitsArr; //! Digits array |
177 | TObjArray *fClusterArr; //! Recpoints array | |
596697e6 | 178 | TObjArray *fCaloClusterArr; //! CaloClusters array |
37d2296c | 179 | |
180 | //Clusterizers | |
6544055e | 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 | |
37d2296c | 185 | |
186 | //AOD | |
6544055e | 187 | TClonesArray *fOutputAODBranch; //! AOD Branch with output clusters |
188 | TString fOutputAODBranchName; // New of output AOD branch | |
6a797202 | 189 | Bool_t fOutputAODBranchSet ; // Set the AOD clusters branch in the input event once |
6544055e | 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 | |
194 | ||
7377e825 | 195 | Int_t fRun; // run number |
37d2296c | 196 | |
6544055e | 197 | AliEMCALRecoUtils* fRecoUtils; // Access to factorized reconstruction algorithms |
198 | TString fConfigName; // Name of analysis configuration file | |
37d2296c | 199 | |
6edb4448 | 200 | |
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. | |
37d2296c | 203 | Int_t fCellSecondLabels[12672]; // Array with Second MC label to be passed to digit. |
1e0ff9d3 | 204 | Double_t fCellTime[12672]; // Array with cluster time to be passed to digit in case of AODs |
adad4ea9 | 205 | Float_t fCellMatchdEta[12672]; // Array with cluster-track dPhi |
206 | Float_t fCellMatchdPhi[12672]; // Array with cluster-track dEta | |
a39f5b70 | 207 | |
1e0ff9d3 | 208 | Bool_t fRecalibrateWithClusterTime; // Use fCellTime to store time of cells in cluster |
209 | ||
6544055e | 210 | Int_t fMaxEvent; // Set a maximum event |
1f77507b | 211 | |
6544055e | 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 | |
3e436b3a | 216 | Bool_t fRejectBelowThreshold; // split (false-default) or reject (true) cell energy below threshold after UF |
6544055e | 217 | Bool_t fRemoveLEDEvents; // Remove LED events, use only for LHC11a |
218 | Bool_t fRemoveExoticEvents; // Remove exotic events | |
cb3001b9 | 219 | |
9ac44255 | 220 | Bool_t fImportGeometryFromFile; // Import geometry settings in geometry.root file |
221 | TString fImportGeometryFilePath; // path fo geometry.root file | |
222 | ||
596697e6 | 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 | |
6a797202 | 226 | |
cb68426a | 227 | //Centrality |
228 | TString fCentralityClass; // Name of selected centrality class | |
8fa7608a | 229 | Float_t fCentralityBin[2]; // Minimum and maximum value of the centrality for the analysis |
cb68426a | 230 | |
5aa88029 | 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 | |
235 | ||
6edb4448 | 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 | |
bdd50327 | 241 | |
242 | ||
1c197eba | 243 | Bool_t fInputFromFilter ; // Get the input from AODs from the filter |
244 | ||
a1eeb25d | 245 | AliAnalysisTaskEMCALClusterize( const AliAnalysisTaskEMCALClusterize&); // not implemented |
246 | AliAnalysisTaskEMCALClusterize& operator=(const AliAnalysisTaskEMCALClusterize&); // not implemented | |
247 | ||
3e436b3a | 248 | ClassDef(AliAnalysisTaskEMCALClusterize, 28); |
d390e7cb | 249 | |
37d2296c | 250 | }; |
251 | ||
252 | #endif //ALIANALYSISTASKEMCALCLUSTERIZE_H |