9 #include <AliAnalysisManager.h> 10 #include <AliVEvent.h> 12 #include <AliOADBContainer.h> 18 #include "AliDataFile.h" 31 TNamed(
"AliEmcalCorrectionComponent",
"AliEmcalCorrectionComponent"),
36 fGetPassFromFileName(kTRUE),
54 fCustomBadChannelFilePath(
"")
109 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.");
186 Double_t veta = t->GetTrackEtaOnEMCal();
187 Double_t vphi = t->GetTrackPhiOnEMCal();
195 phidiff=TVector2::Phi_mpi_pi(vphi-cphi);
225 AliWarning(Form(
"Run changed, initializing parameters for %d",
fRun));
228 fGeom = AliEMCALGeometry::GetInstanceFromRunNumber(
fRun);
231 AliFatal(
"Can not create geometry");
244 TTree *inputTree = mgr->GetTree();
248 AliError(
"Pointer to tree = 0, returning");
252 TFile *inputFile = inputTree->GetCurrentFile();
254 AliError(
"Null pointer input file, returning");
258 TString fname(inputFile->GetName());
260 else if (fname.Contains(
"pass3_lowIR_pidfix"))
fFilepass =
TString(
"pass3_lowIR_pidfix");
261 else if (fname.Contains(
"pass4_lowIR_pidfix_cookdedx"))
fFilepass =
TString(
"pass4_lowIR_pidfix_cookdedx");
267 else if (fname.Contains(
"LHC11c") && fname.Contains(
"spc_calo"))
fFilepass =
TString(
"spc_calo");
268 else if (fname.Contains(
"calo") || fname.Contains(
"high_lumi"))
270 Printf(
"%s: Path contains <calo> or <high-lumi>, set as <pass1>", GetName());
273 else if (fname.Contains(
"LHC14a1a"))
275 AliInfo(
"Energy calibration activated for this MC production!");
280 AliFatal(Form(
"Pass number string not found: %s. Please set the pass number in the configuration!", fname.Data()));
297 for (
Int_t iCell = 0; iCell <
fCaloCells->GetNumberOfCells(); iCell++){
299 fCaloCells->GetCell(iCell, absId, ecell, tcell, mclabel, efrac);
300 if(name.Contains(
"Energy")){
303 else if(name.Contains(
"Time")){
319 AliInfo(
"Initialising Bad channel map");
327 std::unique_ptr<AliOADBContainer> contBC(
nullptr);
328 std::unique_ptr<TFile> fbad;
331 AliInfo(Form(
"Loading Bad Channels OADB from given path %s",
fBasePath.Data()));
333 fbad = std::unique_ptr<TFile>(TFile::Open(Form(
"%s/EMCALBadChannels.root",
fBasePath.Data()),
"read"));
334 if (!fbad || fbad->IsZombie())
336 AliFatal(Form(
"EMCALBadChannels.root was not found in the path provided: %s",
fBasePath.Data()));
340 contBC = std::unique_ptr<AliOADBContainer>(
static_cast<AliOADBContainer *
>(fbad->Get(
"AliEMCALBadChannels")));
347 if (!fbad || fbad->IsZombie())
349 AliFatal(Form(
"No valid Bad channel OADB object was not found in the path provided: %s",
fCustomBadChannelFilePath.Data()));
353 contBC = std::unique_ptr<AliOADBContainer>(
static_cast<AliOADBContainer *
>(fbad->Get(
"AliEMCALBadChannels")));
357 AliInfo(
"Loading Bad Channels OADB from $ALICE_PHYSICS/OADB/EMCAL");
359 fbad = std::unique_ptr<TFile>(TFile::Open(AliDataFile::GetFileNameOADB(
"EMCAL/EMCALBadChannels.root").data(),
"read"));
360 if (!fbad || fbad->IsZombie())
362 AliFatal(
"OADB/EMCAL/EMCALBadChannels.root was not found");
366 contBC = std::unique_ptr<AliOADBContainer>(
static_cast<AliOADBContainer *
>(fbad->Get(
"AliEMCALBadChannels")));
369 AliError(
"No OADB container found");
372 contBC->SetOwner(
true);
377 AliError(Form(
"No external hot channel set for run number: %d", runBC));
381 Int_t sms =
fGeom->GetEMCGeometry()->GetNumberOfSuperModules();
382 for (
Int_t i=0; i<sms; ++i)
387 h=(TH2I*)arrayBC->FindObject(Form(
"EMCALBadChannelMap_Mod%d",i));
391 AliError(Form(
"Can not get EMCALBadChannelMap_Mod%d",i));
Int_t fNcentBins
How many centrality bins (this member copied from AliAnalysisTaskEmcal)
Bool_t fEsdMode
flag for ESD
AliEMCALGeometry * fGeom
! Geometry object
virtual ~AliEmcalCorrectionComponent()
virtual Bool_t UserNotify()
TObjArray * GetEMCALBadChannelStatusMapArray() const
virtual void UserCreateOutputObjects()
AliVEvent * InputEvent() const
bool UseEmbeddingEvent() const
True if the embedding event should be used.
Int_t fCentBin
! Event centrality bin
void RecalibrateCells(AliVCaloCells *cells, Int_t bc)
AliVCaloCells * fCaloCells
! Pointer to CaloCells
TObjArray fParticleCollArray
Particle/track collection array.
AliEMCALRecoUtils * fRecoUtils
Pointer to RecoUtils.
TH2I * GetEMCALChannelStatusMap(Int_t iSM) const
TObjArray fClusterCollArray
Cluster collection array.
Base class for correction components in the EMCal correction framework.
Int_t fMinMCLabel
Minimum MC label value for the tracks/clusters being considered MC particles.
static map_type * componentMap
Contains the map to all of the components.
std::map< std::string, AliEmcalCorrectionComponent *(*)()> map_type
AliMCEvent * fMCEvent
! MC
Double_t fVertex[3]
! Event vertex
TString fBasePath
Base folder path to get root files.
Double_t fMaxBinPt
Max pt in histograms.
TList * fOutput
! List of output histograms
TString fCustomBadChannelFilePath
Custom path to bad channel map OADB file.
Enhanced TList-derived class that implements correct merging for pt_hard binned production.
Bool_t fCreateHisto
Flag to make some basic histograms.
Bool_t fGetPassFromFileName
Get fFilepass from file name.
Double_t fCent
! Event centrality
virtual Bool_t Initialize()
Double_t fMinBinPt
Min pt in histograms.
AliEmcalCorrectionEventManager fEventManager
Minimal task which inherits from AliAnalysisTaskSE and manages access to the event.
PWG::Tools::AliYAMLConfiguration fYAMLConfig
Contains the YAML configuration used to configure the component.
virtual Bool_t CheckIfRunChanged()
AliEmcalCorrectionComponent()
void GetEtaPhiDiff(const AliVTrack *t, const AliVCluster *v, Double_t &phidiff, Double_t &etadiff)
void InitEMCALBadChannelStatusMap()
Int_t fNbins
No. of pt bins.
void SetEMCALChannelStatusMap(const TObjArray *map)
TString fFilepass
Input data pass number.
bool GetProperty(std::string propertyName, T &property, bool requiredProperty=true, std::string correctionName="")
Retrieve property.