AliPhysics  bba8f44 (bba8f44)
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  void PrintParam();
53 
54  // Event methods, settings
55 
56  Bool_t AcceptCell(Int_t absID);
61  void SetEMCALNcellsCut(Int_t cut) { fEMCALNcellsCut = cut ; }
62 
65 
66  void CheckAndGetEvent();
67 
71 
72  Bool_t IsLEDEvent(const Int_t run);
75 
76  // OCDB, avoid acessing OCDB!
77 
78  void AccessOCDB();
79  void SwitchOnAccessOCDB() { fAccessOCDB = kTRUE ; }
80  void SwitchOffAccessOCDB() { fAccessOCDB = kFALSE ; }
81  void SetOCDBPath(const char *path) { fOCDBpath = path ; }
82 
83  // Geometry methods
84 
85  void InitGeometry();
86  void SetGeometryName(TString &name) { fGeomName = name ; }
87  TString GeometryName() const { return fGeomName ; }
90  void SetGeometryMatrixInSM(TGeoHMatrix* m, Int_t i) { fGeomMatrix[i] = m ; }
91 
93  TString pa = "") { fImportGeometryFromFile = im ;
94  fImportGeometryFilePath = pa ; }
95  // Outout AOD branch methods
96 
98  void SetAODCellsName(TString &name) { fOutputAODCellsName = name ; }
100  void FillAODFile(Bool_t yesno) { fFillAODFile = yesno ; }
101  void FillAODCaloCells();
102  void FillAODHeader();
104  void SwitchOffFillAODHeader() { fFillAODHeader = kFALSE ; }
107 
110 
111  // Algorithms settings
112 
113  AliEMCALRecParam * GetRecParam() { if(!fRecParam) fRecParam = new AliEMCALRecParam ;
114  return fRecParam ; }
115 
116  AliEMCALRecoUtils* GetRecoUtils() { if(!fRecoUtils) fRecoUtils = new AliEMCALRecoUtils ;
117  return fRecoUtils ; }
118  void ConfigureEMCALRecoUtils(Bool_t bMC = kFALSE, Bool_t bExotic= kTRUE, Bool_t bNonLin= kFALSE,
119  Bool_t bRecalE= kTRUE , Bool_t bBad = kTRUE, Bool_t bRecalT= kTRUE, Int_t debug = -1);
120 
121  void InitClusterization();
122  void ClusterizeCells();
123  void ClusterUnfolding();
124  void JustUnfold(Bool_t yesno) { fJustUnfold = yesno ; }
125  void UpdateCells();
126 
127  void SetConfigFileName(TString name) { fConfigName = name ; }
128  void SetMaxEvent(Int_t max) { fMaxEvent = max ; }
129 
132 
133  void SwitchOnUpdateCell() { fUpdateCell = kTRUE ; }
134  void SwitchOffUpdateCell() { fUpdateCell = kFALSE ; }
135 
136  // Cell selection after unfolding
137 
141  fSelectCellMinFrac = frac ; }
143 
144  // OADB options settings
145 
146  void AccessOADB() ;
147 
148  TString GetPass() ;
149 
150  void SwitchOnEMCALOADB() { fAccessOADB = kTRUE ; }
151  void SwitchOffEMCALOADB() { fAccessOADB = kFALSE ; }
152 
153  void SetOADBFilePath(TString path) { fOADBFilePath = path ; }
154 
156 
157  // Centrality selection
158 
159  AliCentrality* GetCentrality() const { return InputEvent()->GetCentrality() ; }
160  AliMultSelection* GetMultSelCen() const { return (AliMultSelection * ) InputEvent()->FindListObject("MultSelection") ; }
163 
166  Float_t GetEventCentrality() const ;
167  void SetCentralityBin(Int_t min, Int_t max) //Set the centrality bin to select the event. If used, then need to get percentile
168  { fCentralityBin[0]=min ; fCentralityBin[1]=max ; }
169  Float_t GetCentralityBin(Int_t i) const { if(i < 0 || i > 1) return -1 ;
170  else return fCentralityBin[i] ; }
171 
172  // MC label properly assignation methods
173 
174  void RemapMCLabelForAODs(Int_t &label);
177 
178  void SetClustersMCLabelFrom2SelectedLabels(AliEMCALRecPoint* recPoint, AliAODCaloCluster *clus) ;
179  void SetClustersMCLabelFromOriginalClusters(AliAODCaloCluster * clus) ;
180 
183 
187 
188  //-----------------------------------------
189  // T-Card correlation emulation, do on MC
190 
191  void MakeCellTCardCorrelation() ;
193 
196  void SwitchOnTCardCorrelation(Bool_t conservEnergy = kFALSE) { fTCardCorrEmulation = kTRUE ; fTCardCorrClusEnerConserv = conservEnergy ; }
197 
200 
201 
207  for(Int_t ism = 0; ism < 22; ism++) {
208  fTCardCorrInduceEner[0][ism] = ud; fTCardCorrInduceEner[1][ism] = udlr;
209  fTCardCorrInduceEner[2][ism] = lr; fTCardCorrInduceEner[3][ism] = sec ; } }
210 
216  for(Int_t ism = 0; ism < 22; ism++) {
217  fTCardCorrInduceEnerFrac[0][ism] = ud; fTCardCorrInduceEnerFrac[1][ism] = udlr;
218  fTCardCorrInduceEnerFrac[2][ism] = lr; fTCardCorrInduceEnerFrac[3][ism] = sec ; } }
219 
225  for(Int_t ism = 0; ism < 22; ism++) {
226  fTCardCorrInduceEnerFracP1[0][ism] = ud; fTCardCorrInduceEnerFracP1[1][ism] = udlr;
227  fTCardCorrInduceEnerFracP1[2][ism] = lr; fTCardCorrInduceEnerFracP1[3][ism] = sec ; } }
228 
235  if ( sm < 22 && sm >= 0 ) {
236  fTCardCorrInduceEner[0][sm] = ud; fTCardCorrInduceEner[1][sm] = udlr;
237  fTCardCorrInduceEner[2][sm] = lr; fTCardCorrInduceEner[3][sm] = sec ; } }
238 
245  if ( sm < 22 && sm >= 0 ) {
246  fTCardCorrInduceEnerFrac[0][sm] = ud; fTCardCorrInduceEnerFrac[1][sm] = udlr;
247  fTCardCorrInduceEnerFrac[2][sm] = lr; fTCardCorrInduceEnerFrac[3][sm] = sec ; } }
248 
255  if ( sm < 22 && sm >= 0 ) {
256  fTCardCorrInduceEnerFracP1[0][sm] = ud; fTCardCorrInduceEnerFracP1[1][sm] = udlr;
257  fTCardCorrInduceEnerFracP1[2][sm] = lr; fTCardCorrInduceEnerFracP1[3][sm] = sec ; } }
258 
264  for(Int_t ism = 0; ism < 22; ism++) {
265  fTCardCorrInduceEnerFracWidth[0][ism] = ud; fTCardCorrInduceEnerFracWidth[1][ism] = udlr;
266  fTCardCorrInduceEnerFracWidth[2][ism] = lr; fTCardCorrInduceEnerFracWidth[3][ism] = sec ; } }
267 
274  if ( sm < 22 && sm >= 0 ) {
276  fTCardCorrInduceEnerFracWidth[2][sm] = lr; fTCardCorrInduceEnerFracWidth[3][sm] = sec ; } }
277 
282  if ( sm < 22 && sm >= 0 ) fTCardCorrInduceEnerFracMax[sm] = max ; }
283 
288  if ( sm < 22 && sm >= 0 ) fTCardCorrInduceEnerFracMin[sm] = min ; }
289 
293  for(Int_t ism = 0; ism < 22; ism++) fTCardCorrInduceEnerFracMax[ism] = max ; }
294 
298  for(Int_t ism = 0; ism < 22; ism++) fTCardCorrInduceEnerFracMin[ism] = min ; }
299 
304  if ( sm < 22 && sm >= 0 ) fTCardCorrInduceEnerProb[sm] = prob ; }
305 
308 
311 
312  void PrintTCardParam();
313 
314  //------------------------------------------
315 
316 private:
317 
318  virtual void FillCaloClusterInEvent();
319 
320  virtual void RecPoints2Clusters();
321 
322  virtual void ResetArrays();
323 
324  AliVEvent *fEvent;
325 
326  // Geometry
327  AliEMCALGeometry *fGeom;
329  TGeoHMatrix *fGeomMatrix[22];
332 
333  // OCDB
336 
337  // Temporal arrays
338  TClonesArray *fDigitsArr;
341  AliVCaloCells *fCaloCells;
342 
343  // Clusterizers
344  AliEMCALRecParam *fRecParam;
345  AliEMCALClusterizer *fClusterizer;
346  AliEMCALAfterBurnerUF *fUnfolder;
348 
349  // AOD
350  TClonesArray *fOutputAODBranch;
352  AliAODCaloCells *fOutputAODCells;
360 
362 
363  AliEMCALRecoUtils* fRecoUtils;
365 
366  static const Int_t fgkNEMCalCells = 17664;
367 
374 
376 
378 
387 
390 
395 
396  // Centrality
400 
401  // Event selection with some signal in EMCAL
405 
411 
415 
417 
419 
420 
421  // T-Card correlation emulation, do on MC
426 
434 
435 
436  TRandom3 fRandom ;
438 
441 
443 
446 
449 
451  ClassDef(AliAnalysisTaskEMCALClusterize, 42) ;
453 
454 };
455 
456 #endif //ALIANALYSISTASKEMCALCLUSTERIZE_H
TString fOutputAODCellsName
New of output cells AOD branch name.
void FillAODCaloCells()
Put calo cells in standard branch.
Float_t fTCardCorrMinAmp
Minimum cell energy to induce signal on adjacent cells.
AliVCaloCells * fCaloCells
! CaloCells container
Bool_t fTCardCorrEmulation
Activate T-Card cells energy correlation.
Float_t fTCardCorrInduceEnerFracP1[4][22]
Induced energy loss gauss fraction param1 on 0-same row, diff col, 1-up/down cells left/right col 2-l...
double Double_t
Definition: External.C:58
virtual void ResetArrays()
Reset arrays containing information for all possible cells.
const int debug
Definition: scanAll.C:15
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.
Float_t fTCardCorrInduceEnerFracMax[22]
In case fTCardCorrInduceEnerFracP1 is non null, restrict the maximum fraction of induced energy per S...
void SetInducedEnergyLossFractionWidth(Float_t ud, Float_t udlr, Float_t lr, Float_t sec)
void PrintTCardParam()
Print parameters for T-Card correlation emulation.
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
Float_t fTCardCorrInduceEnerFrac[4][22]
Induced energy loss gauss fraction param0 on 0-same row, diff col, 1-up/down cells left/right col 2-l...
void ConfigureEMCALRecoUtils(Bool_t bMC=kFALSE, Bool_t bExotic=kTRUE, Bool_t bNonLin=kFALSE, Bool_t bRecalE=kTRUE, Bool_t bBad=kTRUE, Bool_t bRecalT=kTRUE, Int_t debug=-1)
Bool_t fPrintOnce
Print once analysis parameters.
Bool_t fSelectEMCALEvent
Process the event if there is some high energy cluster.
Float_t fTCardCorrMaxInduced
Maximum induced energy signal on adjacent cells.
Float_t GetEventCentrality() const
Get centrality/multiplicity percentile.
Bool_t fInputFromFilter
Get the input from AODs from the filter.
TString fOutputAODBranchName
New of output clusters AOD branch.
AliEMCALGeometry * fGeom
EMCAL geometry.
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.
void SetInducedEnergyLossConstantPerSM(Int_t sm, Float_t ud, Float_t udlr, Float_t lr, Float_t sec)
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 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.
AliAODCaloCells * fOutputAODCells
! AOD Branch with output cells
void SetInducedEnergyLossMaximumFractionPerSM(Float_t max, Int_t sm)
Float_t fTCardCorrInduceEner[4][22]
Induced energy loss gauss constant on 0-same row, diff col, 1-up/down cells left/right col 2-left/rig...
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.
void SetInducedEnergyLossFractionP1PerSM(Int_t sm, Float_t ud, Float_t udlr, Float_t lr, Float_t sec)
Float_t fCellMatchdPhi[fgkNEMCalCells]
Array with cluster-track dEta.
Float_t fTCardCorrInduceEnerProb[22]
Probability to induce energy loss per SM.
TString fInputCaloCellsName
Input cells branch name, if different from default branch.
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.
void PrintParam()
Print clusterization task parameters.
TString fOCDBpath
Path with OCDB location.
AliEMCALAfterBurnerUF * fUnfolder
! Unfolding procedure
void SetInducedEnergyLossMinimumFractionPerSM(Float_t min, Int_t sm)
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
void SetInducedEnergyLossFractionWidthPerSM(Int_t sm, Float_t ud, Float_t udlr, Float_t lr, Float_t sec)
void SetInducedEnergyLossConstant(Float_t ud, Float_t udlr, Float_t lr, Float_t sec)
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)...
Float_t fTCardCorrInduceEnerFracMin[22]
In case fTCardCorrInduceEnerFracP1 is non null, restrict the minimum fraction of induced energy per S...
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 fRandomizeTCard
Use random induced energy.
Bool_t fUseAliCentrality
Use the centrality estimator from AliCentrality or AliMultSelection.
void SetInducedEnergyLossFractionPerSM(Int_t sm, Float_t ud, Float_t udlr, Float_t lr, Float_t sec)
Float_t fTCardCorrInduceEnerFracWidth[4][22]
Induced energy loss gauss witdth on 0-same row, diff col, 1-up/down cells left/right col 2-left/righ ...
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.