AliPhysics  vAN-20150630 (513c479)
 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 AliEMCALCalibData;
28 class AliCaloCalibPedestal;
29 class AliEMCALClusterizer;
30 class AliEMCALAfterBurnerUF;
31 class AliEMCALRecPoint;
32 class AliAODCaloCluster;
33 #include "AliEMCALRecParam.h"
34 #include "AliEMCALRecoUtils.h"
35 
36 #include "AliAnalysisTaskSE.h"
37 
38 class AliAnalysisTaskEMCALClusterize : public AliAnalysisTaskSE {
39 
40  public:
41 
43  AliAnalysisTaskEMCALClusterize(const char *name);
45 
46  virtual void UserCreateOutputObjects();
47  virtual void UserExec(Option_t *option);
48  virtual void Init();
49  virtual void LocalInit() { Init() ; }
50 
51  // Event methods, settings
52 
53  Bool_t AcceptEventEMCAL();
56  void SetEMCALEnergyCut(Float_t cut) { fEMCALEnergyCut = cut ; }
57  void SetEMCALNcellsCut(Int_t cut) { fEMCALNcellsCut = cut ; }
58 
61 
62  void CheckAndGetEvent();
63 
64  Bool_t IsExoticEvent();
67 
68  Bool_t IsLEDEvent(const Int_t run);
71 
72  // OCDB, avoid acessing OCDB!
73 
74  Bool_t AccessOCDB();
75  void SwitchOnAccessOCDB() { fAccessOCDB = kTRUE ; }
76  void SwitchOffAccessOCDB() { fAccessOCDB = kFALSE ; }
77  void SetOCDBPath(const char *path) { fOCDBpath = path ; }
78 
79  // Geometry methods
80 
81  void InitGeometry();
82  void SetGeometryName(TString &name) { fGeomName = name ; }
83  TString GeometryName() const { return fGeomName ; }
86  void SetGeometryMatrixInSM(TGeoHMatrix* m, Int_t i) { fGeomMatrix[i] = m ; }
87 
88  void SetImportGeometryFromFile(Bool_t im,
89  TString pa = "") { fImportGeometryFromFile = im ;
90  fImportGeometryFilePath = pa ; }
91  // Outout AOD branch methods
92 
93  void SetAODBranchName(TString &name) { fOutputAODBranchName = name ; }
94  void FillAODFile(Bool_t yesno) { fFillAODFile = yesno ; }
95  void FillAODCaloCells();
96  void FillAODHeader();
98  void SwitchOffFillAODHeader() { fFillAODHeader = kFALSE ; }
101 
104 
105  // Algorithms settings
106 
107  AliEMCALRecParam * GetRecParam() { if(!fRecParam) fRecParam = new AliEMCALRecParam ;
108  return fRecParam ; }
109 
110  AliEMCALRecoUtils* GetRecoUtils() { if(!fRecoUtils) fRecoUtils = new AliEMCALRecoUtils ;
111  return fRecoUtils ; }
112 
113  void InitClusterization();
114  void ClusterizeCells();
115  void ClusterUnfolding();
116  void JustUnfold(Bool_t yesno) { fJustUnfold = yesno ; }
117 
118  void SetConfigFileName(TString name) { fConfigName = name ; }
119  void SetMaxEvent(Int_t max) { fMaxEvent = max ; }
120 
123 
124  // Cell selection after unfolding
125 
128  void SetCellCuts(Float_t e, Float_t frac) { fSelectCellMinE = e ;
129  fSelectCellMinFrac = frac ; }
130  void SetRejectBelowThreshold(Bool_t reject) { fRejectBelowThreshold =reject ; }
131 
132  // OADB options settings
133 
134  void AccessOADB() ;
135 
136  TString GetPass() ;
137 
138  void SwitchOnEMCALOADB() { fAccessOADB = kTRUE ; }
139  void SwitchOffEMCALOADB() { fAccessOADB = kFALSE ; }
140 
141  void SetOADBFilePath(TString path) { fOADBFilePath = path ; }
142 
143  // Centrality selection
144 
145  AliCentrality* GetCentrality() { return InputEvent()->GetCentrality() ; } //Look in AOD reader, different there
146  void SetCentralityClass(TString name) { fCentralityClass = name ; }
147  TString GetCentralityClass() const { return fCentralityClass ; }
148  Float_t GetEventCentrality() { if(GetCentrality()) return GetCentrality()->GetCentralityPercentile(fCentralityClass) ;
149  else return -1. ; }
150  void SetCentralityBin(Int_t min, Int_t max) //Set the centrality bin to select the event. If used, then need to get percentile
151  { fCentralityBin[0]=min ; fCentralityBin[1]=max ; }
152  Float_t GetCentralityBin(Int_t i) const { if(i < 0 || i > 1) return -1 ;
153  else return fCentralityBin[i] ; }
154 
155  // MC label properly assignation methods
156 
157  void RemapMCLabelForAODs(Int_t &label);
160 
161  void SetClustersMCLabelFrom2SelectedLabels(AliEMCALRecPoint* recPoint, AliAODCaloCluster *clus) ;
162  void SetClustersMCLabelFromOriginalClusters(AliAODCaloCluster * clus) ;
163 
166 
167 private:
168 
169  virtual void FillCaloClusterInEvent();
170 
171  virtual void RecPoints2Clusters();
172 
173  virtual void ResetArrays();
174 
175  AliVEvent *fEvent;
176 
177  // Geometry
178  AliEMCALGeometry *fGeom;
179  TString fGeomName;
180  TGeoHMatrix *fGeomMatrix[22];
181  Bool_t fGeomMatrixSet;
183 
184  // OCDB
185  AliEMCALCalibData *fCalibData;
186  AliCaloCalibPedestal *fPedestalData;
187  TString fOCDBpath;
188  Bool_t fAccessOCDB;
189 
190  // Temporal arrays
191  TClonesArray *fDigitsArr;
192  TObjArray *fClusterArr;
193  TObjArray *fCaloClusterArr;
194 
195  // Clusterizers
196  AliEMCALRecParam *fRecParam;
197  AliEMCALClusterizer *fClusterizer;
198  AliEMCALAfterBurnerUF *fUnfolder;
199  Bool_t fJustUnfold;
200 
201  // AOD
202  TClonesArray *fOutputAODBranch;
205  Bool_t fFillAODFile;
206  Bool_t fFillAODHeader;
209 
210  Int_t fRun;
211 
212  AliEMCALRecoUtils* fRecoUtils;
213  TString fConfigName;
214 
215  static const Int_t fgkNEMCalCells = 17664;
216 
223 
225 
226  Int_t fMaxEvent;
227 
229  Bool_t fSelectCell;
230  Float_t fSelectCellMinE;
235 
238 
239  Bool_t fOADBSet ;
240  Bool_t fAccessOADB ;
241  TString fOADBFilePath ;
242 
243  // Centrality
245  Float_t fCentralityBin[2];
246 
247  // Event selection with some signal in EMCAL
249  Float_t fEMCALEnergyCut;
251 
257 
259 
260 
262 
265 
268 
270  ClassDef(AliAnalysisTaskEMCALClusterize, 29) ;
272 
273 };
274 
275 #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
AliEMCALCalibData * fCalibData
EMCAL calib data.
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.
AliCaloCalibPedestal * fPedestalData
EMCAL pedestal.
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)
Bool_t AccessOCDB()
Access to OCDB stuff, avoid.
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 fRemapMCLabelForAODs
Remap AOD cells MC label. Needed in old AOD productions.