10 #include "AliEMCALRecoUtils.h"
11 #include "AliAnalysisManager.h"
12 #include "AliVEvent.h"
17 #include "AliOADBContainer.h"
30 TNamed(
"AliEmcalCorrectionComponent",
"AliEmcalCorrectionComponent"),
32 fDefaultConfiguration(),
36 fGetPassFromFileName(kTRUE),
68 fDefaultConfiguration(),
72 fGetPassFromFileName(kTRUE),
110 std::string tempString =
"";
117 AliError(
"Received \"default\" as pass value. Defaulting to \"pass1\"! In the case of MC, the user should set the proper pass value in their configuration file! For data, empty quotes should be set so that the pass is automatically set.");
183 Double_t veta = t->GetTrackEtaOnEMCal();
184 Double_t vphi = t->GetTrackPhiOnEMCal();
192 phidiff=TVector2::Phi_mpi_pi(vphi-cphi);
222 AliWarning(Form(
"Run changed, initializing parameters for %d",
fRun));
225 fGeom = AliEMCALGeometry::GetInstanceFromRunNumber(
fRun);
228 AliFatal(
"Can not create geometry");
246 std::size_t sharedParameterLocation = value.find(
"sharedParameters:");
247 if (sharedParameterLocation != std::string::npos)
250 value.erase(sharedParameterLocation, sharedParameterLocation + 17);
263 TTree *inputTree = mgr->GetTree();
267 AliError(
"Pointer to tree = 0, returning");
271 TFile *inputFile = inputTree->GetCurrentFile();
273 AliError(
"Null pointer input file, returning");
277 TString fname(inputFile->GetName());
279 else if (fname.Contains(
"pass3_lowIR_pidfix"))
fFilepass =
TString(
"pass3_lowIR_pidfix");
280 else if (fname.Contains(
"pass4_lowIR_pidfix_cookdedx"))
fFilepass =
TString(
"pass4_lowIR_pidfix_cookdedx");
286 else if (fname.Contains(
"LHC11c") && fname.Contains(
"spc_calo"))
fFilepass =
TString(
"spc_calo");
287 else if (fname.Contains(
"calo") || fname.Contains(
"high_lumi"))
289 Printf(
"%s: Path contains <calo> or <high-lumi>, set as <pass1>", GetName());
292 else if (fname.Contains(
"LHC14a1a"))
294 AliInfo(
"Energy calibration activated for this MC production!");
299 AliFatal(Form(
"Pass number string not found: %s. Please set the pass number in the configuration!", fname.Data()));
316 for (
Int_t iCell = 0; iCell <
fCaloCells->GetNumberOfCells(); iCell++){
318 fCaloCells->GetCell(iCell, absId, ecell, tcell, mclabel, efrac);
319 if(name.Contains(
"Energy")){
322 else if(name.Contains(
"Time")){
338 AliInfo(
"Initialising Bad channel map");
341 if (!
fRecoUtils->GetEMCALBadChannelStatusMapArray())
346 AliOADBContainer *contBC =
new AliOADBContainer(
"");
349 AliInfo(Form(
"Loading Bad Channels OADB from given path %s",
fBasePath.Data()));
351 TFile *fbad=
new TFile(Form(
"%s/EMCALBadChannels.root",
fBasePath.Data()),
"read");
352 if (!fbad || fbad->IsZombie())
354 AliFatal(Form(
"EMCALBadChannels.root was not found in the path provided: %s",
fBasePath.Data()));
358 if (fbad)
delete fbad;
360 contBC->InitFromFile(Form(
"%s/EMCALBadChannels.root",
fBasePath.Data()),
"AliEMCALBadChannels");
364 AliInfo(
"Loading Bad Channels OADB from $ALICE_PHYSICS/OADB/EMCAL");
366 TFile *fbad=
new TFile(
"$ALICE_PHYSICS/OADB/EMCAL/EMCALBadChannels.root",
"read");
367 if (!fbad || fbad->IsZombie())
369 AliFatal(
"$ALICE_PHYSICS/OADB/EMCAL/EMCALBadChannels.root was not found");
373 if (fbad)
delete fbad;
375 contBC->InitFromFile(
"$ALICE_PHYSICS/OADB/EMCAL/EMCALBadChannels.root",
"AliEMCALBadChannels");
381 AliError(Form(
"No external hot channel set for run number: %d", runBC));
386 Int_t sms =
fGeom->GetEMCGeometry()->GetNumberOfSuperModules();
387 for (
Int_t i=0; i<sms; ++i)
389 TH2I *h =
fRecoUtils->GetEMCALChannelStatusMap(i);
392 h=(TH2I*)arrayBC->FindObject(Form(
"EMCALBadChannelMap_Mod%d",i));
396 AliError(Form(
"Can not get EMCALBadChannelMap_Mod%d",i));
AliEMCALGeometry * fGeom
! Geometry object
virtual ~AliEmcalCorrectionComponent()
virtual Bool_t UserNotify()
virtual void UserCreateOutputObjects()
AliVEvent * InputEvent() const
bool UseEmbeddingEvent() const
True if the embedding event should be used.
AliVCaloCells * fCaloCells
! Pointer to CaloCells
AliEMCALRecoUtils * fRecoUtils
Pointer to RecoUtils.
Base class for correction components in the EMCal correction framework.
static map_type * componentMap
Contains the map to all of the components.
std::map< std::string, AliEmcalCorrectionComponent *(*)()> map_type
Double_t fVertex[3]
! Event vertex
TString fBasePath
Base folder path to get root files.
TList * fOutput
! List of output histograms
Enhanced TList-derived class that implements correct merging for pt_hard binned production.
static bool IsSharedValue(std::string &value)
Bool_t fGetPassFromFileName
Get fFilepass from file name.
virtual Bool_t Initialize()
AliEmcalCorrectionEventManager fEventManager
Minimal task which inherits from AliAnalysisTaskSE and manages access to the event.
virtual Bool_t CheckIfRunChanged()
AliEmcalCorrectionComponent()
void GetEtaPhiDiff(const AliVTrack *t, const AliVCluster *v, Double_t &phidiff, Double_t &etadiff)
TString fFilepass
Input data pass number.
bool GetProperty(std::string propertyName, T &property, bool requiredProperty=true, std::string correctionName="")
Retrieve property.