AliPhysics  29d4213 (29d4213)
 All Classes Namespaces Files Functions Variables Enumerations Enumerator Macros
AliAnalysisTaskEMCALClusterize.h
Go to the documentation of this file.
1 #ifndef ALIANALYSISTASKEMCALCLUSTERIZE_H
2 #define ALIANALYSISTASKEMCALCLUSTERIZE_H
3 
4 /* Copyright(c) 1998-1999, ALICE Experiment at CERN, All rights reserved. *
5  * See cxx source for full Copyright notice */
6 
7 //_________________________________________________________________________
17 //_________________________________________________________________________
18 
19 // Root
20 class TTree;
21 class TClonesArray;
22 
23 #include "AliCentrality.h"
24 
25 // EMCAL
26 class AliEMCALGeometry;
27 class AliEMCALClusterizer;
28 class AliEMCALAfterBurnerUF;
29 class AliEMCALRecPoint;
30 class AliAODCaloCluster;
31 #include "AliEMCALRecParam.h"
32 #include "AliEMCALRecoUtils.h"
33 
34 #include "AliAnalysisTaskSE.h"
35 
36 class AliAnalysisTaskEMCALClusterize : public AliAnalysisTaskSE {
37 
38  public:
39 
41  AliAnalysisTaskEMCALClusterize(const char *name);
43 
44  virtual void UserCreateOutputObjects();
45  virtual void UserExec(Option_t *option);
46  virtual void Init();
47  virtual void LocalInit() { Init() ; }
48 
49  // Event methods, settings
50 
51  Bool_t AcceptEventEMCAL();
54  void SetEMCALEnergyCut(Float_t cut) { fEMCALEnergyCut = cut ; }
55  void SetEMCALNcellsCut(Int_t cut) { fEMCALNcellsCut = cut ; }
56 
59 
60  void CheckAndGetEvent();
61 
62  Bool_t IsExoticEvent();
65 
66  Bool_t IsLEDEvent(const Int_t run);
69 
70  // OCDB, avoid acessing OCDB!
71 
72  Bool_t AccessOCDB();
73  void SwitchOnAccessOCDB() { fAccessOCDB = kTRUE ; }
74  void SwitchOffAccessOCDB() { fAccessOCDB = kFALSE ; }
75  void SetOCDBPath(const char *path) { fOCDBpath = path ; }
76 
77  // Geometry methods
78 
79  void InitGeometry();
80  void SetGeometryName(TString &name) { fGeomName = name ; }
81  TString GeometryName() const { return fGeomName ; }
84  void SetGeometryMatrixInSM(TGeoHMatrix* m, Int_t i) { fGeomMatrix[i] = m ; }
85 
86  void SetImportGeometryFromFile(Bool_t im,
87  TString pa = "") { fImportGeometryFromFile = im ;
88  fImportGeometryFilePath = pa ; }
89  // Outout AOD branch methods
90 
91  void SetAODBranchName(TString &name) { fOutputAODBranchName = name ; }
92  void FillAODFile(Bool_t yesno) { fFillAODFile = yesno ; }
93  void FillAODCaloCells();
94  void FillAODHeader();
96  void SwitchOffFillAODHeader() { fFillAODHeader = kFALSE ; }
99 
102 
103  // Algorithms settings
104 
105  AliEMCALRecParam * GetRecParam() { if(!fRecParam) fRecParam = new AliEMCALRecParam ;
106  return fRecParam ; }
107 
108  AliEMCALRecoUtils* GetRecoUtils() { if(!fRecoUtils) fRecoUtils = new AliEMCALRecoUtils ;
109  return fRecoUtils ; }
110 
111  void InitClusterization();
112  void ClusterizeCells();
113  void ClusterUnfolding();
114  void JustUnfold(Bool_t yesno) { fJustUnfold = yesno ; }
115 
116  void SetConfigFileName(TString name) { fConfigName = name ; }
117  void SetMaxEvent(Int_t max) { fMaxEvent = max ; }
118 
121 
122  // Cell selection after unfolding
123 
126  void SetCellCuts(Float_t e, Float_t frac) { fSelectCellMinE = e ;
127  fSelectCellMinFrac = frac ; }
129 
130  // OADB options settings
131 
132  void AccessOADB() ;
133 
134  TString GetPass() ;
135 
136  void SwitchOnEMCALOADB() { fAccessOADB = kTRUE ; }
137  void SwitchOffEMCALOADB() { fAccessOADB = kFALSE ; }
138 
139  void SetOADBFilePath(TString path) { fOADBFilePath = path ; }
140 
141  // Centrality selection
142 
143  AliCentrality* GetCentrality() { return InputEvent()->GetCentrality() ; } //Look in AOD reader, different there
144  void SetCentralityClass(TString name) { fCentralityClass = name ; }
145  TString GetCentralityClass() const { return fCentralityClass ; }
146  Float_t GetEventCentrality() { if(GetCentrality()) return GetCentrality()->GetCentralityPercentile(fCentralityClass) ;
147  else return -1. ; }
148  void SetCentralityBin(Int_t min, Int_t max) //Set the centrality bin to select the event. If used, then need to get percentile
149  { fCentralityBin[0]=min ; fCentralityBin[1]=max ; }
150  Float_t GetCentralityBin(Int_t i) const { if(i < 0 || i > 1) return -1 ;
151  else return fCentralityBin[i] ; }
152 
153  // MC label properly assignation methods
154 
155  void RemapMCLabelForAODs(Int_t &label);
158 
159  void SetClustersMCLabelFrom2SelectedLabels(AliEMCALRecPoint* recPoint, AliAODCaloCluster *clus) ;
160  void SetClustersMCLabelFromOriginalClusters(AliAODCaloCluster * clus) ;
161 
164 
165 private:
166 
167  virtual void FillCaloClusterInEvent();
168 
169  virtual void RecPoints2Clusters();
170 
171  virtual void ResetArrays();
172 
173  AliVEvent *fEvent;
174 
175  // Geometry
176  AliEMCALGeometry *fGeom;
177  TString fGeomName;
178  TGeoHMatrix *fGeomMatrix[22];
179  Bool_t fGeomMatrixSet;
181 
182  // OCDB
183  TString fOCDBpath;
184  Bool_t fAccessOCDB;
185 
186  // Temporal arrays
187  TClonesArray *fDigitsArr;
188  TObjArray *fClusterArr;
189  TObjArray *fCaloClusterArr;
190 
191  // Clusterizers
192  AliEMCALRecParam *fRecParam;
193  AliEMCALClusterizer *fClusterizer;
194  AliEMCALAfterBurnerUF *fUnfolder;
195  Bool_t fJustUnfold;
196 
197  // AOD
198  TClonesArray *fOutputAODBranch;
201  Bool_t fFillAODFile;
202  Bool_t fFillAODHeader;
205 
206  Int_t fRun;
207 
208  AliEMCALRecoUtils* fRecoUtils;
209  TString fConfigName;
210 
211  static const Int_t fgkNEMCalCells = 17664;
212 
219 
221 
222  Int_t fMaxEvent;
223 
225  Bool_t fSelectCell;
226  Float_t fSelectCellMinE;
231 
234 
235  Bool_t fOADBSet ;
236  Bool_t fAccessOADB ;
237  TString fOADBFilePath ;
238 
239  // Centrality
241  Float_t fCentralityBin[2];
242 
243  // Event selection with some signal in EMCAL
245  Float_t fEMCALEnergyCut;
247 
253 
255 
256 
258 
261 
264 
266  ClassDef(AliAnalysisTaskEMCALClusterize, 30) ;
268 
269 };
270 
271 #endif //ALIANALYSISTASKEMCALCLUSTERIZE_H
void FillAODCaloCells()
Put calo cells in standard branch.
virtual void ResetArrays()
Reset arrays containing information for all possible cells.
void SetCellCuts(Float_t e, Float_t frac)
TString GetPass()
Get or guess pass number/string from path of filename.
Bool_t fFillAODHeader
Copy header to standard branch.
TClonesArray * fDigitsArr
! Digits array
AliEMCALClusterizer * fClusterizer
! EMCAL clusterizer
Bool_t fJustUnfold
Just unfold, do not recluster.
Bool_t fImportGeometryFromFile
Import geometry settings in geometry.root file.
Bool_t fSelectCell
Reject cells from cluster if energy is too low and recalculate position/energy and other...
TString fConfigName
Name of analysis configuration file.
Int_t fCellSecondLabels[fgkNEMCalCells]
Array with Second MC label to be passed to digit.
void SetClustersMCLabelFrom2SelectedLabels(AliEMCALRecPoint *recPoint, AliAODCaloCluster *clus)
Float_t fCellMatchdEta[fgkNEMCalCells]
Array with cluster-track dPhi.
TClonesArray * fOutputAODBranch
! AOD Branch with output clusters
TString fOADBFilePath
Default path $ALICE_PHYSICS/OADB/EMCAL, if needed change.
TString fImportGeometryFilePath
path fo geometry.root file
Bool_t fSelectEMCALEvent
Process the event if there is some high energy cluster.
Bool_t fInputFromFilter
Get the input from AODs from the filter.
TString fOutputAODBranchName
New of output AOD branch.
AliEMCALGeometry * fGeom
EMCAL geometry.
void ClusterUnfolding()
Take the event clusters and unfold them.
Bool_t fAccessOADB
Get calibration from OADB for EMCAL.
Bool_t fRemoveLEDEvents
Remove LED events, use only for LHC11a.
AliEMCALRecoUtils * fRecoUtils
Access to factorized reconstruction algorithms.
Bool_t fRejectBelowThreshold
split (false-default) or reject (true) cell energy below threshold after UF
void SetClustersMCLabelFromOriginalClusters(AliAODCaloCluster *clus)
Float_t fSelectCellMinE
Min energy cell threshold, after unfolding.
Bool_t fOADBSet
AODB parameters already set.
Int_t fCellLabels[fgkNEMCalCells]
Array with MC label to be passed to digit.
Bool_t fRemoveExoticEvents
Remove exotic events.
Bool_t fDoTrackMatching
On/Off the matching recalulation to speed up analysis in PbPb.
Float_t fCellMatchdPhi[fgkNEMCalCells]
Array with cluster-track dEta.
TGeoHMatrix * fGeomMatrix[22]
Geometry matrices with alignments.
Bool_t IsLEDEvent(const Int_t run)
Check if event is LED, is so remove it. Affected LHC11a runs.
AliEMCALRecParam * fRecParam
Reconstruction parameters container.
TString fGeomName
Name of geometry to use.
Bool_t fOutputAODBranchSet
Set the AOD clusters branch in the input event once.
TString fOCDBpath
Path with OCDB location.
AliEMCALAfterBurnerUF * fUnfolder
! Unfolding procedure
Bool_t fGeomMatrixSet
Set geometry matrices only once, for the first event.
Float_t fCentralityBin[2]
Minimum and maximum value of the centrality for the analysis.
Bool_t fFillAODCaloCells
Copy calocells to standard branch.
TObjArray * fCaloClusterArr
! CaloClusters array
Double_t fCellTime[fgkNEMCalCells]
Array with cluster time to be passed to digit in case of AODs.
TString fCentralityClass
Name of selected centrality class.
void SetImportGeometryFromFile(Bool_t im, TString pa="")
Bool_t fAccessOCDB
Need to access info from OCDB (not really)
AliAnalysisTaskEMCALClusterize & operator=(const AliAnalysisTaskEMCALClusterize &)
Assignment operator not implemented.
TObjArray * fClusterArr
! Recpoints array
Bool_t fRecalibrateWithClusterTime
Use fCellTime to store time of cells in cluster.
void FillAODHeader()
Put event header information in standard AOD branch.
static const Int_t fgkNEMCalCells
Total number of cells in the calorimeter, 10*48*24 (EMCal) + 4*48*8 (EMCal/DCal 1/3) + 6*32*24 (DCal)...
Int_t fEMCALNcellsCut
At least an EMCAL cluster with fNCellsCut cells over fEnergyCut.
void SetGeometryMatrixInSM(TGeoHMatrix *m, Int_t i)
Reclusterize EMCal clusters, put them in a new branch for other following analysis.
Bool_t fLoadGeomMatrices
Matrices set from configuration, not get from geometry.root or from ESDs/AODs.
Float_t fEMCALEnergyCut
At least an EMCAL cluster with this energy in the event.
Int_t fOrgClusterCellId[fgkNEMCalCells]
Array ID of cluster to wich the cell belongs in unmodified clusters.
Float_t fSelectCellMinFrac
Min fraction of cell energy after unfolding cut.
Bool_t reject
Bool_t fRemapMCLabelForAODs
Remap AOD cells MC label. Needed in old AOD productions.