AliPhysics  a60a912 (a60a912)
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  TString customBCmapPath = "";
53  GetProperty("customBadChannelFilePath", customBCmapPath);
54  if (customBCmapPath!="")
56 
57  Bool_t dead = kFALSE;
58  GetProperty("acceptDead", dead);
59  if ( dead ) fRecoUtils->SetDeadChannelAsGood();
60 
61  Bool_t hot = kFALSE;
62  GetProperty("acceptHot", hot);
63  if ( hot ) fRecoUtils->SetHotChannelAsGood();
64 
65  Bool_t warm = kFALSE;
66  GetProperty("acceptWarm", warm);
67  if ( warm ) fRecoUtils->SetWarmChannelAsGood();
68 
69  return kTRUE;
70 }
71 
76 {
78 
79  if (fCreateHisto){
80  fCellEnergyDistBefore = new TH1F("hCellEnergyDistBefore","hCellEnergyDistBefore;E_{cell} (GeV)",1000,0,10);
82  fCellEnergyDistAfter = new TH1F("hCellEnergyDistAfter","hCellEnergyDistAfter;E_{cell} (GeV)",1000,0,10);
84  }
85 }
86 
91 {
93 
94  if (!fEventManager.InputEvent()) {
95  AliError("Event ptr = 0, returning");
96  return kFALSE;
97  }
98 
100 
101  // CONFIGURE THE RECO UTILS -------------------------------------------------
102 
104 
105  // START PROCESSING ---------------------------------------------------------
106  // Test if cells present
107  if (fCaloCells->GetNumberOfCells()<=0)
108  {
109  AliWarning(Form("Number of EMCAL cells = %d, returning", fCaloCells->GetNumberOfCells()));
110  return kFALSE;
111  }
112 
113  // mark the cells not recalibrated
115 
116  if(fCreateHisto)
117  FillCellQA(fCellEnergyDistBefore); // "before" QA
118 
119  // CELL RECALIBRATION -------------------------------------------------------
120  // update cell objects
121  UpdateCells();
122 
123  if(fCreateHisto)
124  FillCellQA(fCellEnergyDistAfter); // "after" QA
125 
126  return kTRUE;
127 }
128 
134 {
136 
137  if (runChanged) {
138  // init bad channels
139  Int_t fInitBC = InitBadChannels();
140  if (fInitBC==0) {
141  AliError("InitBadChannels returned false, returning");
142  }
143  if (fInitBC==1) {
144  AliWarning("InitBadChannels OK");
145  }
146  if (fInitBC>1) {
147  AliWarning(Form("No external hot channel set: %d - %s", fEventManager.InputEvent()->GetRunNumber(), fFilepass.Data()));
148  }
149  }
150  return runChanged;
151 }
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.
void SetCustomBadChannels(TString customBC)
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.