AliPhysics  64f4410 (64f4410)
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  // init reco utils
47  if (!fRecoUtils)
49 
51 
52  Bool_t dead = kFALSE;
53  GetProperty("acceptDead", dead);
54  if ( dead ) fRecoUtils->SetDeadChannelAsGood();
55 
56  Bool_t hot = kFALSE;
57  GetProperty("acceptHot", hot);
58  if ( hot ) fRecoUtils->SetHotChannelAsGood();
59 
60  Bool_t warm = kFALSE;
61  GetProperty("acceptWarm", warm);
62  if ( warm ) fRecoUtils->SetWarmChannelAsGood();
63 
64  return kTRUE;
65 }
66 
71 {
73 
74  if (fCreateHisto){
75  fCellEnergyDistBefore = new TH1F("hCellEnergyDistBefore","hCellEnergyDistBefore;E_{cell} (GeV)",1000,0,10);
77  fCellEnergyDistAfter = new TH1F("hCellEnergyDistAfter","hCellEnergyDistAfter;E_{cell} (GeV)",1000,0,10);
79  }
80 }
81 
86 {
88 
89  if (!fEventManager.InputEvent()) {
90  AliError("Event ptr = 0, returning");
91  return kFALSE;
92  }
93 
95 
96  // CONFIGURE THE RECO UTILS -------------------------------------------------
97 
99 
100  // START PROCESSING ---------------------------------------------------------
101  // Test if cells present
102  if (fCaloCells->GetNumberOfCells()<=0)
103  {
104  AliWarning(Form("Number of EMCAL cells = %d, returning", fCaloCells->GetNumberOfCells()));
105  return kFALSE;
106  }
107 
108  // mark the cells not recalibrated
110 
111  if(fCreateHisto)
112  FillCellQA(fCellEnergyDistBefore); // "before" QA
113 
114  // CELL RECALIBRATION -------------------------------------------------------
115  // update cell objects
116  UpdateCells();
117 
118  if(fCreateHisto)
119  FillCellQA(fCellEnergyDistAfter); // "after" QA
120 
121  return kTRUE;
122 }
123 
129 {
131 
132  if (runChanged) {
133  // init bad channels
134  Int_t fInitBC = InitBadChannels();
135  if (fInitBC==0) {
136  AliError("InitBadChannels returned false, returning");
137  }
138  if (fInitBC==1) {
139  AliWarning("InitBadChannels OK");
140  }
141  if (fInitBC>1) {
142  AliWarning(Form("No external hot channel set: %d - %s", fEventManager.InputEvent()->GetRunNumber(), fFilepass.Data()));
143  }
144  }
145  return runChanged;
146 }
AliVCaloCells * fCaloCells
! Pointer to CaloCells
Some utilities for cluster and cell treatment.
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
void SetPositionAlgorithm(Int_t alg)
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.