AliPhysics  master (3d17d9d)
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  // Load 1D bad channel map
70  GetProperty("load1DBadChMap", fLoad1DBadChMap);
72 
73  return kTRUE;
74 }
75 
80 {
82 
83  if (fCreateHisto){
84  fCellEnergyDistBefore = new TH1F("hCellEnergyDistBefore","hCellEnergyDistBefore;E_{cell} (GeV)",7000,0,70);
86  fCellEnergyDistAfter = new TH1F("hCellEnergyDistAfter","hCellEnergyDistAfter;E_{cell} (GeV)",7000,0,70);
88  }
89 }
90 
95 {
97 
98  if (!fEventManager.InputEvent()) {
99  AliError("Event ptr = 0, returning");
100  return kFALSE;
101  }
102 
104 
105  // CONFIGURE THE RECO UTILS -------------------------------------------------
106 
108 
109  // START PROCESSING ---------------------------------------------------------
110  // Test if cells present
111  if (fCaloCells->GetNumberOfCells()<=0)
112  {
113  AliWarning(Form("Number of EMCAL cells = %d, returning", fCaloCells->GetNumberOfCells()));
114  return kFALSE;
115  }
116 
117  // mark the cells not recalibrated
119 
120  if(fCreateHisto)
121  FillCellQA(fCellEnergyDistBefore); // "before" QA
122 
123  // CELL RECALIBRATION -------------------------------------------------------
124  // update cell objects
125  UpdateCells();
126 
127  if(fCreateHisto)
128  FillCellQA(fCellEnergyDistAfter); // "after" QA
129 
130  return kTRUE;
131 }
132 
138 {
140 
141  if (runChanged) {
142  // init bad channels
143  Int_t fInitBC = InitBadChannels();
144  if (fInitBC==0) {
145  AliError("InitBadChannels returned false, returning");
146  }
147  if (fInitBC==1) {
148  AliWarning("InitBadChannels OK");
149  }
150  if (fInitBC>1) {
151  AliWarning(Form("No external hot channel set: %d - %s", fEventManager.InputEvent()->GetRunNumber(), fFilepass.Data()));
152  }
153  }
154  return runChanged;
155 }
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.
void SetUse1DBadChannelMap(Bool_t use)
bool Bool_t
Definition: External.C:53
Bool_t fLoad1DBadChMap
Flag to load 1D bad channel map.
TString fFilepass
Input data pass number.
bool GetProperty(std::string propertyName, T &property, bool requiredProperty=true, std::string correctionName="")
Retrieve property.