AliPhysics  3337bb0 (3337bb0)
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
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 //_________________________________________________________________________
18 //_________________________________________________________________________
19 
20 // Root
21 class TTree;
22 class TClonesArray;
23 #include <TRandom3.h>
24 
25 // EMCAL
26 class AliEMCALGeometry;
27 class AliEMCALClusterizer;
28 class AliEMCALAfterBurnerUF;
29 class AliEMCALRecPoint;
30 class AliAODCaloCluster;
31 class AliCentrality;
32 class AliMultSelection;
33 class AliVCaloCells;
34 
35 #include "AliEMCALRecParam.h"
36 #include "AliEMCALRecoUtils.h"
37 
38 #include "AliAnalysisTaskSE.h"
39 
41 
42  public:
43 
45  AliAnalysisTaskEMCALClusterize(const char *name);
47 
48  virtual void UserCreateOutputObjects();
49  virtual void UserExec(Option_t *option);
50  virtual void Init();
51  virtual void LocalInit() { Init() ; }
52 
53  // Event methods, settings
54 
55  Bool_t AcceptCell(Int_t absID);
60  void SetEMCALNcellsCut(Int_t cut) { fEMCALNcellsCut = cut ; }
61 
64 
65  void CheckAndGetEvent();
66 
70 
71  Bool_t IsLEDEvent(const Int_t run);
74 
75  // OCDB, avoid acessing OCDB!
76 
78  void SwitchOnAccessOCDB() { fAccessOCDB = kTRUE ; }
79  void SwitchOffAccessOCDB() { fAccessOCDB = kFALSE ; }
80  void SetOCDBPath(const char *path) { fOCDBpath = path ; }
81 
82  // Geometry methods
83 
84  void InitGeometry();
85  void SetGeometryName(TString &name) { fGeomName = name ; }
86  TString GeometryName() const { return fGeomName ; }
89  void SetGeometryMatrixInSM(TGeoHMatrix* m, Int_t i) { fGeomMatrix[i] = m ; }
90 
92  TString pa = "") { fImportGeometryFromFile = im ;
93  fImportGeometryFilePath = pa ; }
94  // Outout AOD branch methods
95 
97  void FillAODFile(Bool_t yesno) { fFillAODFile = yesno ; }
98  void FillAODCaloCells();
99  void FillAODHeader();
101  void SwitchOffFillAODHeader() { fFillAODHeader = kFALSE ; }
104 
107 
108  // Algorithms settings
109 
110  AliEMCALRecParam * GetRecParam() { if(!fRecParam) fRecParam = new AliEMCALRecParam ;
111  return fRecParam ; }
112 
113  AliEMCALRecoUtils* GetRecoUtils() { if(!fRecoUtils) fRecoUtils = new AliEMCALRecoUtils ;
114  return fRecoUtils ; }
115 
116  void InitClusterization();
117  void ClusterizeCells();
118  void ClusterUnfolding();
119  void JustUnfold(Bool_t yesno) { fJustUnfold = yesno ; }
120  void UpdateCells();
121 
122  void SetConfigFileName(TString name) { fConfigName = name ; }
123  void SetMaxEvent(Int_t max) { fMaxEvent = max ; }
124 
127 
128  void SwitchOnUpdateCell() { fUpdateCell = kTRUE ; }
129  void SwitchOffUpdateCell() { fUpdateCell = kFALSE ; }
130 
131  // Cell selection after unfolding
132 
136  fSelectCellMinFrac = frac ; }
138 
139  // OADB options settings
140 
141  void AccessOADB() ;
142 
143  TString GetPass() ;
144 
145  void SwitchOnEMCALOADB() { fAccessOADB = kTRUE ; }
146  void SwitchOffEMCALOADB() { fAccessOADB = kFALSE ; }
147 
148  void SetOADBFilePath(TString path) { fOADBFilePath = path ; }
149 
151 
152  // Centrality selection
153 
154  AliCentrality* GetCentrality() const { return InputEvent()->GetCentrality() ; }
155  AliMultSelection* GetMultSelCen() const { return (AliMultSelection * ) InputEvent()->FindListObject("MultSelection") ; }
158 
161  Float_t GetEventCentrality() const ;
162  void SetCentralityBin(Int_t min, Int_t max) //Set the centrality bin to select the event. If used, then need to get percentile
163  { fCentralityBin[0]=min ; fCentralityBin[1]=max ; }
164  Float_t GetCentralityBin(Int_t i) const { if(i < 0 || i > 1) return -1 ;
165  else return fCentralityBin[i] ; }
166 
167  // MC label properly assignation methods
168 
169  void RemapMCLabelForAODs(Int_t &label);
172 
173  void SetClustersMCLabelFrom2SelectedLabels(AliEMCALRecPoint* recPoint, AliAODCaloCluster *clus) ;
174  void SetClustersMCLabelFromOriginalClusters(AliAODCaloCluster * clus) ;
175 
178 
182 
183  //-----------------------------------------
184  // T-Card correlation emulation, do on MC
185 
186  void MakeCellTCardCorrelation() ;
188 
191  void SwitchOnTCardCorrelation(Bool_t conservEnergy = kFALSE) { fTCardCorrEmulation = kTRUE ; fTCardCorrClusEnerConserv = conservEnergy ; }
192 
195 
203 
207 
208 
216 
220  void SetInducedEnergyLossProbabilityPerSM(Float_t prob, Int_t sm) { if ( sm < 22 && sm >= 0 ) fTCardCorrInduceEnerProb[sm] = prob ; }
221  //------------------------------------------
222 
223 private:
224 
225  virtual void FillCaloClusterInEvent();
226 
227  virtual void RecPoints2Clusters();
228 
229  virtual void ResetArrays();
230 
231  AliVEvent *fEvent;
232 
233  // Geometry
234  AliEMCALGeometry *fGeom;
236  TGeoHMatrix *fGeomMatrix[22];
239 
240  // OCDB
243 
244  // Temporal arrays
245  TClonesArray *fDigitsArr;
248  AliVCaloCells *fCaloCells;
249 
250  // Clusterizers
251  AliEMCALRecParam *fRecParam;
252  AliEMCALClusterizer *fClusterizer;
253  AliEMCALAfterBurnerUF *fUnfolder;
255 
256  // AOD
257  TClonesArray *fOutputAODBranch;
264 
266 
267  AliEMCALRecoUtils* fRecoUtils;
269 
270  static const Int_t fgkNEMCalCells = 17664;
271 
278 
280 
282 
291 
294 
299 
300  // Centrality
304 
305  // Event selection with some signal in EMCAL
309 
315 
319 
321 
323 
324 
325  // T-Card correlation emulation, do on MC
330 
335  TRandom3 fRandom ;
336 
339 
342 
344  ClassDef(AliAnalysisTaskEMCALClusterize, 35) ;
346 
347 };
348 
349 #endif //ALIANALYSISTASKEMCALCLUSTERIZE_H
void FillAODCaloCells()
Put calo cells in standard branch.
Float_t fTCardCorrInduceEnerFracWidth[4]
Induced energy loss gauss witdth on 0-same row, diff col, 1-up/down cells left/right col 2-left/righ ...
AliVCaloCells * fCaloCells
! CaloCells container
Bool_t fTCardCorrEmulation
Activate T-Card cells energy correlation.
double Double_t
Definition: External.C:58
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
Bool_t fTCardCorrClusEnerConserv
When making correlation, subtract from the reference cell the induced energy on the neighbour cells...
void SetInducedEnergyLossFraction(Float_t ud, Float_t udlr, Float_t lr, Float_t sec)
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.
void SetInducedEnergyLossFractionWidth(Float_t ud, Float_t udlr, Float_t lr, Float_t sec)
Int_t fCellSecondLabels[fgkNEMCalCells]
Array with Second MC label to be passed to digit.
void SwitchOffTCardCorrelation()
De-activate T-Card cells correlation,.
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.
Float_t fTCardCorrCellsEner[fgkNEMCalCells]
Array with induced cell energy in T-Card neighbour cells.
TString fImportGeometryFilePath
path fo geometry.root file
Bool_t fSelectEMCALEvent
Process the event if there is some high energy cluster.
Float_t GetEventCentrality() const
Get centrality/multiplicity percentile.
Bool_t fInputFromFilter
Get the input from AODs from the filter.
TString fOutputAODBranchName
New of output AOD branch.
AliEMCALGeometry * fGeom
EMCAL geometry.
Float_t fTCardCorrInduceEnerFrac[4]
Induced energy loss gauss mean on 0-same row, diff col, 1-up/down cells left/right col 2-left/righ co...
void ClusterUnfolding()
Take the event clusters and unfold them.
int Int_t
Definition: External.C:63
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.
float Float_t
Definition: External.C:68
Bool_t fRejectBelowThreshold
split (false-default) or reject (true) cell energy below threshold after UF
Float_t fTCardCorrInduceEnerFracP1[4]
Induced energy loss gauss mean on 0-same row, diff col, 1-up/down cells left/right col 2-left/righ co...
Float_t fConstantTimeShift
Apply a 600 ns time shift in case of simulation, shift in ns.
void SetClustersMCLabelFromOriginalClusters(AliAODCaloCluster *clus)
Bool_t fUpdateCell
On/Off the upate of the CaloCells container.
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.
void SwitchOnTCardCorrelation(Bool_t conservEnergy=kFALSE)
Bool_t fDoTrackMatching
On/Off the matching recalculation to speed up analysis in PbPb.
Float_t fCellMatchdPhi[fgkNEMCalCells]
Array with cluster-track dEta.
Float_t fTCardCorrInduceEnerProb[22]
Probability to induce energy loss per SM.
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="")
void SetInducedEnergyLossFractionP1(Float_t ud, Float_t udlr, Float_t lr, Float_t sec)
Bool_t fAccessOCDB
Need to access info from OCDB (not really)
void SetInducedEnergyLossProbabilityPerSM(Float_t prob, Int_t sm)
AliAnalysisTaskEMCALClusterize & operator=(const AliAnalysisTaskEMCALClusterize &)
Assignment operator not implemented.
TObjArray * fClusterArr
! Recpoints array
Bool_t fRecalibrateWithClusterTime
Use fCellTime to store time of cells in cluster.
const char Option_t
Definition: External.C:48
bool Bool_t
Definition: External.C:53
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 fTCardCorrCellsNew[fgkNEMCalCells]
Array with induced cell energy in T-Card neighbour cells, that before had no signal.
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.
Bool_t fUseAliCentrality
Use the centrality estimator from AliCentrality or AliMultSelection.
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.