AliPhysics  32e057f (32e057f)
AliEmcalCorrectionCellBadChannel.cxx
Go to the documentation of this file.
1 // AliEmcalCorrectionCellBadChannel
2 //
3 
4 #include <TObjArray.h>
5 #include <TFile.h>
6 #include "AliEMCALGeometry.h"
7 #include "AliEMCALRecoUtils.h"
8 #include "AliAODEvent.h"
9 
11 
15 
16 // Actually registers the class with the base class
18 
23  AliEmcalCorrectionComponent("AliEmcalCorrectionCellBadChannel")
24  ,fCellEnergyDistBefore(0)
25  ,fCellEnergyDistAfter(0)
26 {
27 }
28 
33 {
34 }
35 
40 {
41  // Initialization
43 
44  AliWarning("Init EMCAL cell bad channel removal");
45 
46  GetProperty("createHistos", fCreateHisto);
47 
48  // init reco utils
49  if (!fRecoUtils)
50  fRecoUtils = new AliEMCALRecoUtils;
51 
52  fRecoUtils->SetPositionAlgorithm(AliEMCALRecoUtils::kPosTowerGlobal);
53 
54  return kTRUE;
55 }
56 
61 {
63 
64  if (fCreateHisto){
65  fCellEnergyDistBefore = new TH1F("hCellEnergyDistBefore","hCellEnergyDistBefore;E_cell",1000,0,10);
67  fCellEnergyDistAfter = new TH1F("hCellEnergyDistAfter","hCellEnergyDistAfter;E_cell",1000,0,10);
69  }
70 }
71 
76 {
78 
79  if (!fEventManager.InputEvent()) {
80  AliError("Event ptr = 0, returning");
81  return kFALSE;
82  }
83 
85 
86  // CONFIGURE THE RECO UTILS -------------------------------------------------
87 
88  fRecoUtils->SwitchOnBadChannelsRemoval();
89 
90  // START PROCESSING ---------------------------------------------------------
91  // Test if cells present
92  if (fCaloCells->GetNumberOfCells()<=0)
93  {
94  AliWarning(Form("Number of EMCAL cells = %d, returning", fCaloCells->GetNumberOfCells()));
95  return kFALSE;
96  }
97 
98  // mark the cells not recalibrated
99  fRecoUtils->ResetCellsCalibrated();
100 
101  if(fCreateHisto)
102  FillCellQA(fCellEnergyDistBefore); // "before" QA
103 
104  // CELL RECALIBRATION -------------------------------------------------------
105  // update cell objects
106  UpdateCells();
107 
108  if(fCreateHisto)
109  FillCellQA(fCellEnergyDistAfter); // "after" QA
110 
111  return kTRUE;
112 }
113 
119 {
121 
122  if (runChanged) {
123  // init bad channels
124  Int_t fInitBC = InitBadChannels();
125  if (fInitBC==0) {
126  AliError("InitBadChannels returned false, returning");
127  }
128  if (fInitBC==1) {
129  AliWarning("InitBadChannels OK");
130  }
131  if (fInitBC>1) {
132  AliWarning(Form("No external hot channel set: %d - %s", fEventManager.InputEvent()->GetRunNumber(), fFilepass.Data()));
133  }
134  }
135  return runChanged;
136 }
AliVCaloCells * fCaloCells
! Pointer to CaloCells
AliEMCALRecoUtils * fRecoUtils
Pointer to RecoUtils.
int Int_t
Definition: External.C:63
Base class for correction components in the EMCal correction framework.
TH1F * fCellEnergyDistBefore
! cell energy distribution, before bad channel correction
static RegisterCorrectionComponent< AliEmcalCorrectionCellBadChannel > reg
TH1F * fCellEnergyDistAfter
! cell energy distribution, after bad channel correction
TList * fOutput
! List of output histograms
Bool_t fCreateHisto
Flag to make some basic histograms.
Bad channel correction component in the EMCal correction framework.
AliEmcalCorrectionEventManager fEventManager
Minimal task which inherits from AliAnalysisTaskSE and manages access to the event.
bool Bool_t
Definition: External.C:53
TString fFilepass
Input data pass number.
bool GetProperty(std::string propertyName, T &property, bool requiredProperty=true, std::string correctionName="")
Retrieve property.