22 #include "AliVEventHandler.h"
23 #include "AliEMCALGeometry.h"
24 #include "AliVCaloCells.h"
25 #include "AliVCluster.h"
27 #include "AliMultSelection.h"
28 #include "AliCentrality.h"
29 #include "AliESDEvent.h"
30 #include "AliAnalysisManager.h"
31 #include "AliAODEvent.h"
44 {
"kNonLinCorr", AliVCluster::kNonLinCorr },
45 {
"kHadCorr", AliVCluster::kHadCorr },
46 {
"kUserDefEnergy1", AliVCluster::kUserDefEnergy1 },
47 {
"kUserDefEnergy2", AliVCluster::kUserDefEnergy2 }
64 fUserConfigurationFilename(
""),
65 fUserConfigurationString(
""),
66 fDefaultConfiguration(),
67 fDefaultConfigurationFilename(
""),
68 fDefaultConfigurationString(
""),
69 fCorrectionComponents(),
72 fConfigurationInitialized(false),
73 fOrderedComponentsToExecute(),
74 fEventInitialized(false),
81 fUseNewCentralityEstimation(kFALSE),
85 fNeedEmcalGeom(kTRUE),
93 AliDebug(3, Form(
"%s", __PRETTY_FUNCTION__));
95 fParticleCollArray.SetOwner(kTRUE);
96 fClusterCollArray.SetOwner(kTRUE);
111 fUserConfiguration(),
112 fUserConfigurationFilename(
""),
113 fUserConfigurationString(
""),
114 fDefaultConfiguration(),
115 fDefaultConfigurationFilename(
""),
116 fDefaultConfigurationString(
""),
117 fCorrectionComponents(),
120 fConfigurationInitialized(false),
121 fOrderedComponentsToExecute(),
122 fEventInitialized(false),
129 fUseNewCentralityEstimation(kFALSE),
133 fNeedEmcalGeom(kTRUE),
135 fParticleCollArray(),
141 AliDebug(3, Form(
"%s", __PRETTY_FUNCTION__));
143 fParticleCollArray.SetOwner(kTRUE);
144 fClusterCollArray.SetOwner(kTRUE);
146 DefineInput(0, TChain::Class());
147 DefineOutput(1, TList::Class());
158 fUserConfiguration(task.fUserConfiguration),
159 fDefaultConfiguration(task.fDefaultConfiguration),
160 fSuffix(task.fSuffix),
161 fUserConfigurationString(task.fUserConfigurationString),
162 fDefaultConfigurationString(task.fDefaultConfigurationString),
163 fUserConfigurationFilename(task.fUserConfigurationFilename),
164 fDefaultConfigurationFilename(task.fDefaultConfigurationFilename),
165 fOrderedComponentsToExecute(task.fOrderedComponentsToExecute),
166 fCorrectionComponents(task.fCorrectionComponents),
167 fConfigurationInitialized(task.fConfigurationInitialized),
169 fEventInitialized(task.fEventInitialized),
171 fCentBin(task.fCentBin),
172 fMinCent(task.fMinCent),
173 fMaxCent(task.fMaxCent),
174 fNcentBins(task.fNcentBins),
175 fCentEst(task.fCentEst),
176 fUseNewCentralityEstimation(task.fUseNewCentralityEstimation),
178 fNVertCont(task.fNVertCont),
179 fBeamType(task.fBeamType),
180 fForceBeamType(task.fForceBeamType),
181 fNeedEmcalGeom(task.fNeedEmcalGeom),
183 fParticleCollArray(*(static_cast<TObjArray *>(task.fParticleCollArray.Clone()))),
184 fClusterCollArray(*(static_cast<TObjArray *>(task.fClusterCollArray.Clone()))),
185 fOutput(task.fOutput)
188 std::copy(std::begin(task.fVertex), std::end(task.fVertex), std::begin(fVertex));
191 for (
auto cellCont : task.fCellCollArray)
277 AliVEventHandler *evhand = mgr->GetInputEventHandler();
279 if (evhand->InheritsFrom(
"AliESDInputHandler")) {
287 AliError(
"Event handler not found!");
291 AliError(
"Analysis manager not found!");
295 std::string tempName = GetName();
296 std::size_t foundSuffix = tempName.find(
"_");
297 if (foundSuffix != std::string::npos) {
299 fSuffix = tempName.substr(foundSuffix + 1).c_str();
303 AliInfoStream() <<
"Initializing correction task with suffix \"" <<
fSuffix <<
"\"" << std::endl;
311 AliFatal(
"YAML configuration must be initialized before running (ie. in the run macro or wagon)!");
337 std::cout << GetName() <<
" Settings:\n" << *
this;
388 AliInfo(TString::Format(
"User file at \"%s\" does not exist! All settings will be from the default file!",
fUserConfigurationFilename.c_str()));
393 std::stringstream tempConfiguration;
396 tempConfiguration.str(
"");
419 std::vector <std::string> executionOrder;
425 std::set <std::string> possibleComponents;
427 possibleComponents.insert(node.first.as<std::string>());
430 possibleComponents.insert(node.first.as<std::string>());
434 std::string expectedComponentName =
"";
435 bool foundSuffixComponent =
false;
436 bool foundComponent =
false;
437 bool componentEnabled =
true;
440 for (
auto & execName : executionOrder)
443 expectedComponentName = TString::Format(
"%s_%s", execName.c_str(),
fSuffix.c_str()).
Data();
444 foundComponent =
false;
445 componentEnabled =
false;
453 if (componentEnabled ==
true) {
454 foundSuffixComponent =
true;
455 correctionComponents.push_back(expectedComponentName);
458 AliInfo(TString::Format(
"Component %s is disabled and will not be run!", expectedComponentName.c_str()));
466 expectedComponentName = execName;
471 if (componentEnabled ==
true) {
472 if (foundSuffixComponent ==
true) {
473 AliFatal(TString::Format(
"Found earlier component %s with suffix \"%s\", but could not found component %s with that same suffix!", correctionComponents.back().c_str(),
fSuffix.c_str(), expectedComponentName.c_str()));
477 correctionComponents.push_back(expectedComponentName);
481 AliInfo(TString::Format(
"Component %s is disabled and will not be run!", expectedComponentName.c_str()));
487 AliDebug(2,
"Found EMCal Correction Components: ");
488 for (
auto & component : correctionComponents)
490 component =
"AliEmcalCorrection" + component;
491 AliDebug(2, TString::Format(
"%s", component.c_str()) );
510 std::set <std::string> userPropertyNames;
511 std::set <std::string> defaultPropertyNames;
513 bool foundMatch =
false;
514 std::string tempComponentName =
"";
520 userPropertyNames.clear();
521 defaultPropertyNames.clear();
524 tempComponentName = componentName.substr(componentName.find(
"AliEmcalCorrection")+18);
526 AliDebugStream(2) <<
"Checking component " << componentName <<
" for unmatched user settings" << std::endl;
536 if (tempComponentName.find(
"_") != std::string::npos) {
545 for (
auto userPropertyName : userPropertyNames)
547 AliDebugStream(2) <<
"Checking property " << userPropertyName << std::endl;
549 for (
auto defaultPropertyName : defaultPropertyNames)
551 if (userPropertyName == defaultPropertyName) {
552 AliDebugStream(2) <<
"Found match of " << userPropertyName <<
" with " << defaultPropertyName << std::endl;
556 if (foundMatch ==
false) {
557 AliFatal(TString::Format(
"Property \"%s:%s\" defined in the user configuration file cannot be found in the default configuration file! Check the spelling in your user file!", tempComponentName.c_str(), userPropertyName.c_str()));
575 std::string noPrefixComponentName = componentName.substr(0, componentName.find(
"_" +
fSuffix));
579 AliFatal(TString::Format(
"Failed to create requested component %s!", componentName.c_str()));
583 component->SetName(componentName.c_str());
584 component->SetTitle(componentName.c_str());
603 AliInfo(TString::Format(
"Successfully added correction task: %s", componentName.c_str()));
629 YAML::Node userInputObjectNode;
630 YAML::Node defaultInputObjectNode;
634 AliDebugStream(3) <<
"userInputObjectNode: " << userInputObjectNode << std::endl;
635 AliDebugStream(3) <<
"defaultInputObjectNode: " << defaultInputObjectNode << std::endl;
638 std::set <std::string> requestedContainers;
639 std::vector <std::string> componentRequest;
642 componentRequest.clear();
646 for (
auto & req : componentRequest )
648 AliDebugStream(3) <<
"Component " << componentName <<
" requested container name " << req << std::endl;
649 requestedContainers.insert(req);
653 AliDebugStream(2) << inputObjectName <<
" Containers requested by components: " << std::endl;
654 for (
auto &
str : requestedContainers) {
655 AliDebugStream(2) <<
"\t" <<
str << std::endl;;
659 AliDebug(2, TString::Format(
"Setting up requested containers!"));
674 inputObjectName = inputObjectName +
"Names";
676 std::vector <std::string> inputObjects;
683 for (
auto const &
str : inputObjects)
689 AliDebugStream(2) <<
"Adding cluster container " <<
str <<
" of array " << cont->GetArrayName() <<
" to component " << component->GetName() << std::endl;
691 if (checkObjectExists && !cont) {
692 AliError(TString::Format(
"%s: Unable to retrieve input object \"%s\" because it is null. Please check your configuration!", GetName(),
str.c_str()));
699 AliDebugStream(2) <<
"Adding particle container " <<
str <<
" of array " << cont->GetArrayName() <<
" to component " << component->GetName() << std::endl;
701 if (checkObjectExists && !cont) {
702 AliFatal(TString::Format(
"%s: Unable to retrieve input object \"%s\" because it is null. Please check your configuration!", GetName(),
str.c_str()));
709 if (inputObjects.size() > 1) {
710 AliFatal(TString::Format(
"Component %s requested more than one cell branch, but this is not supported! Check the configuration!", component->GetName()));
715 AliDebugStream(2) <<
"Adding calo cells \"" << cellCont->
GetName() <<
"\" of branch name \"" << cellCont->
GetBranchName() <<
"\" to component " << component->GetName() << std::endl;
724 if (checkObjectExists && !(cellCont->
GetCells())) {
725 AliFatal(TString::Format(
"%s: Unable to retrieve cells \"%s\" in input object \"%s\" because the cells are null. Please check your configuration!", GetName(), cellCont->
GetBranchName().c_str(),
str.c_str()));
736 AliDebugStream(3) <<
"Component GetNumberOfCells: " << component->
GetCaloCells()->GetNumberOfCells() << std::endl;
753 for(
auto & containerName : requestedContainers)
762 AliDebug(2, TString::Format(
"Processing container %s of inputType %d", containerName.c_str(), inputObjectType));
764 SetupContainer(inputObjectType, containerName, userInputObjectNode, defaultInputObjectNode);
767 SetupCellsInfo(containerName, userInputObjectNode, defaultInputObjectNode);
787 AliDebugStream(2) <<
"User: " << std::endl << userNode << std::endl <<
"default: " << std::endl << defaultNode << std::endl;
791 cellObj->
SetName(containerName);
793 std::string tempString =
"";
795 if (tempString ==
"usedefault") {
801 bool tempBool =
false;
829 AliDebugStream(2) <<
"Adding container" << std::endl;
830 AliEmcalContainer * cont =
AddContainer(inputObjectType, containerName, userNode, defaultNode);
831 AliDebugStream(2) <<
"Added container" << std::endl;
843 std::string tempString =
"";
845 bool tempBool =
false;
851 AliDebugStream(2) << cont->GetName() <<
": Setting minPt of " << tempDouble << std::endl;
852 cont->SetMinPt(tempDouble);
857 AliDebugStream(2) << cont->GetName() <<
": Setting minE of " << tempDouble << std::endl;
858 cont->SetMinE(tempDouble);
867 AliDebugStream(2) << cont->GetName() <<
": Setting eta limits of " << tempDouble <<
" to " << tempDouble2 << std::endl;
868 cont->SetEtaLimits(tempDouble, tempDouble2);
878 AliDebugStream(2) << cont->GetName() <<
": Setting phi limits of " << tempDouble <<
" to " << tempDouble2 << std::endl;
879 cont->SetPhiLimits(tempDouble, tempDouble2);
885 AliDebugStream(2) << cont->GetName() <<
": Setting embedding to " << (tempBool ?
"enabled" :
"disabled") << std::endl;
886 cont->SetIsEmbedding(tempBool);
891 if (clusterContainer) {
905 AliDebugStream(2) << clusterContainer->GetName() <<
": Setting clusNonLinCorrEnergyCut of " << tempDouble << std::endl;
912 AliDebugStream(2) << clusterContainer->GetName() <<
": Setting clusHadCorrEnergyCut of " << tempDouble << std::endl;
919 AliDebugStream(2) << clusterContainer->GetName() <<
": Setting Include PHOS to " << (tempBool ?
"enabled" :
"disabled") << std::endl;
926 if (trackContainer) {
929 std::vector <UInt_t> filterBitsVector;
933 for (
int filterBit : filterBitsVector) {
934 filterBits += filterBit;
936 AliDebugStream(2) << trackContainer->GetName() <<
": Setting filterBits of " << filterBits << std::endl;
945 AliDebugStream(2) << trackContainer->GetName() <<
": Setting trackFilterType of " << trackFilterType << std::endl;
953 AliDebugStream(2) << trackContainer->GetName() <<
": Setting track cuts period to " << tempString << std::endl;
979 std::string containerBranch =
"";
981 AliFatal(
"Must specify type of container when requesting branch.");
986 AliDebugStream(2) <<
"User Node: " << userNode << std::endl;
987 AliDebugStream(2) <<
"Default Node: " << defaultNode << std::endl;
996 if (containerBranch ==
"usedefault") {
1001 AliEmcalContainer * cont = 0;
1009 if (containerBranch ==
"mcparticles") {
1017 cont->SetName(containerName.c_str());
1035 AliFatal(
"YAML configuration must be initialized before running (ie. the AddTask, run macro or wagon)!");
1048 AliInfo(
"Reinitializing user configuration from string. Expected if running on grid!");
1053 AliInfo(
"Reinitializing default configuration from string. Expected if running on grid!");
1059 AliDebugStream(4) <<
"(Re)initialized user configuration: " <<
fUserConfiguration << std::endl;
1061 AliDebugStream(4) <<
"(Re)initialized default configuration: " <<
fDefaultConfiguration << std::endl;
1092 component->UserCreateOutputObjects();
1094 if (component->GetOutputList() != 0)
1101 t->SetName(component->GetName());
1104 TIter next(component->GetOutputList());
1105 while (
TObject *obj = next()){
1109 AliDebug(1, TString::Format(
"Added output list from task %s to output.", component->GetName()));
1149 if (!InputEvent()) {
1150 AliError(
"Could not retrieve event! Returning!");
1155 if (dynamic_cast<AliAODEvent*>(InputEvent())) {
1156 AliWarning(
"=============================================================");
1157 AliWarning(
"=== Running on AOD is not equivalent to running on ESD! ===");
1158 AliWarning(
"=============================================================");
1162 fGeom = AliEMCALGeometry::GetInstanceFromRunNumber(InputEvent()->
GetRunNumber());
1164 AliFatal(
"Can not get EMCal geometry instance. If you do not need the EMCal geometry, disable it by setting task->SetNeedEmcalGeometry(kFALSE).");
1194 std::cout <<
"=== NOTE: Additional EMCal Corrections configuration information can be found when the Analysis Manager is configured. For a run macro, see above, while for a LEGO train, see the generation.log ===\n";
1210 component->SetEMCALGeometry(
fGeom);
1214 component->SetEvent(InputEvent());
1215 component->SetMCEvent(MCEvent());
1221 component->ExecOnce();
1225 if (!(component->GetCaloCells())) {
1226 AliDebugStream(2) <<
"Re-initializing cells for component " << component->GetName() << std::endl;
1243 const AliVVertex *vert = InputEvent()->GetPrimaryVertex();
1253 AliMultSelection *MultSelection =
static_cast<AliMultSelection*
>(InputEvent()->FindListObject(
"MultSelection"));
1254 if (MultSelection) {
1255 fCent = MultSelection->GetMultiplicityPercentile(
fCentEst.Data());
1258 AliWarning(
"Could not retrieve centrality information! Assuming 99");
1262 AliCentrality *aliCent = InputEvent()->GetCentrality();
1267 AliWarning(
"Could not retrieve centrality information! Assuming 99");
1277 AliWarning(Form(
"Negative centrality: %f. Assuming 99",
fCent));
1286 else if (
fCent > 90) {
1291 AliWarning(Form(
"Negative centrality: %f. Assuming 99",
fCent));
1304 AliWarning(Form(
"fCentBin too large: cent = %f fCentBin = %d. Assuming 99",
fCent,
fCentBin));
1314 AliEmcalContainer* cont = 0;
1317 while ((cont = static_cast<AliEmcalContainer*>(nextPartColl()))) cont->NextEvent();
1320 while ((cont = static_cast<AliEmcalContainer*>(nextClusColl()))) cont->NextEvent();
1334 component->SetEvent(InputEvent());
1335 component->SetMCEvent(MCEvent());
1336 component->SetCentralityBin(
fCentBin);
1337 component->SetCentrality(
fCent);
1355 component->UserNotify();
1370 if (stringToWrite ==
"") {
1371 AliWarning(TString::Format(
"%s configuration is empty!", userConfig ?
"User" :
"Default"));
1373 in << stringToWrite;
1387 bool returnValue =
false;
1392 std::ofstream outFile(filename);
1400 AliError(TString::Format(
"Configuration not properly initialized! Cannot print %s configuration!", userConfig ?
"user" :
"default"));
1406 AliError(
"Please pass a valid filename instead of empty quotes!");
1420 bool returnValue =
false;
1426 YAML::Node passedNode = YAML::LoadFile(filename);
1431 std::stringstream passedNodeSS;
1432 passedNodeSS << passedNode;
1440 AliWarningStream() <<
"Passed YAML config:\n" << passedNode <<
"\n\nStored YAML config:\n" << comparisonNode <<
"\nPassed config located in file \"" << filename <<
"\" is not the same as the stored " << (userConfig ?
"user" :
"default") <<
"configuration file! YAML configurations printed above.\n";
1445 AliError(TString::Format(
"Configuration not properly initialized! Cannot compare %s configuration!", userConfig ?
"user" :
"default"));
1451 AliError(
"Please pass a valid filename instead of empty quotes!");
1466 std::ifstream inFile(filename);
1467 return inFile.good();
1483 filename =
gSystem->ExpandPathName(filename.c_str());
1486 if(filename.find(
"alien://") != std::string::npos)
1488 AliDebug(2, TString::Format(
"Opening file \"%s\" on the grid!", filename.c_str()));
1491 TGrid::Connect(
"alien://");
1495 std::string localFilename =
gSystem->BaseName(filename.c_str());
1497 if (userFile ==
true) {
1498 localFilename =
"user." + localFilename;
1502 localFilename =
"." + localFilename;
1503 localFilename = tempUUID.AsString() + localFilename;
1506 TFile::Cp(filename.c_str(), localFilename.c_str());
1509 filename = localFilename;
1522 AliDebugStream(2) <<
"Retrieving cells object " << cellContainer->
GetName() << std::endl;
1526 cellContainer->
SetCells(dynamic_cast<AliVCaloCells *>(event->FindListObject(cellContainer->
GetBranchName().c_str())));
1542 TClonesArray * array =
dynamic_cast<TClonesArray *
>(
event->FindListObject(cont->GetArrayName()));
1544 AliWarning(TString::Format(
"Container %s requested branch %s, but it does not exist! Creating it for you! Please check that this is the proper action!", cont->GetName(), cont->GetArrayName().Data()));
1546 array->SetName(cont->GetArrayName());
1547 event->AddObject(array);
1561 std::string inputObjectName =
"";
1563 inputObjectName =
"clusterContainers";
1566 inputObjectName =
"trackContainers";
1569 inputObjectName =
"cells";
1572 AliFatal(TString::Format(
"Unrecognized input object type %d", inputObjectType));
1575 return inputObjectName;
1591 bool foundComponent =
false;
1592 for (
auto & possibleComponent : possibleComponents)
1594 if (possibleComponent == name) {
1595 foundComponent =
true;
1600 return foundComponent;
1616 const AliESDRun *run = esd->GetESDRun();
1617 TString beamType = run->GetBeamType();
1618 if (beamType ==
"p-p")
1620 else if (beamType ==
"A-A")
1622 else if (beamType ==
"p-A")
1627 Int_t runNumber = InputEvent()->GetRunNumber();
1629 if ((runNumber >= 136833 && runNumber <= 139517) ||
1630 (runNumber >= 167693 && runNumber <= 170593) ||
1631 (runNumber >= 244824 && runNumber <= 246994)) {
1633 }
else if ((runNumber >= 188356 && runNumber <= 188366) ||
1634 (runNumber >= 195164 && runNumber <= 197388) ||
1635 (runNumber >= 265015 && runNumber <= 267166)) {
1649 stream <<
"Cells info: " << std::endl;
1651 stream <<
"\tName: " << cellInfo->GetName() <<
"\tBranch: " << cellInfo->GetBranchName() <<
"\tIsEmbedding: " << std::boolalpha << cellInfo->GetIsEmbedding() << std::endl;
1656 AliEmcalContainer * cont = 0;
1658 cont =
static_cast<AliEmcalContainer *
>(containerInfo);
1659 stream <<
"\tName: " << cont->GetName() <<
"\tBranch: " << cont->GetArrayName() <<
"\tTitle: " << cont->GetTitle() <<
"\tIsEmbedding: " << std::boolalpha << cont->GetIsEmbedding() << std::endl;
1663 AliErrorStream() <<
"Unrecognized input object type " << inputObjectType << std::endl;
1682 if (nodeToRetrieveFrom[
"sharedParameters"]) {
1683 inputNode[
"sharedParameters"] = nodeToRetrieveFrom[
"sharedParameters"];
1699 YAML::Node tempNode;
1701 for (
auto propertyName : tempNode)
1703 propertyNames.insert(propertyName.first.as<std::string>());
1718 if (cellContainer->GetName() == cellsContainerName) {
1719 return cellContainer;
1733 ::Error(
"AddTaskEmcalCorrectionTask",
"No analysis manager to connect to.");
1739 AliVEventHandler* handler = mgr->GetInputEventHandler();
1742 ::Error(
"AddTaskEmcalCorrectionTask",
"This task requires an input event handler");
1746 TString name =
"AliEmcalCorrectionTask";
1748 name += TString::Format(
"_%s", suffix.Data());
1752 if (mgrTask)
return mgrTask;
1761 mgr->AddTask(correctionTask);
1764 AliAnalysisDataContainer* cInput = mgr->GetCommonInputContainer();
1766 TString outputContainerName(name);
1767 outputContainerName +=
"_histos";
1769 AliAnalysisDataContainer * cOutput = mgr->CreateContainer(outputContainerName.Data(),
1771 AliAnalysisManager::kOutputContainer,
1772 Form(
"%s", AliAnalysisManager::GetCommonFileName()));
1774 mgr->ConnectInput(correctionTask, 0, cInput);
1775 mgr->ConnectOutput(correctionTask, 1, cOutput);
1779 return correctionTask;
1789 std::stringstream tempSS;
1792 tempSS <<
"Correction components:\n";
1794 tempSS <<
"\t" << component <<
"\n";
1797 tempSS <<
"\nInput objects:\n";
1802 if (includeYAMLConfigurationInfo ==
true) {
1803 tempSS <<
"\nUser Configuration:\n";
1805 tempSS <<
"\n\nDefault Configuration:\n";
1810 return tempSS.str();
1833 std::ostream & result = myTask.
Print(in);
1845 std::string temp(opt);
1846 bool includeYAMLConfig =
false;
1847 if (temp ==
"YAML") {
1848 includeYAMLConfig =
true;
1850 Printf(
"%s",
toString(includeYAMLConfig).c_str());
void AdoptClusterContainer(AliClusterContainer *cont)
Int_t fNcentBins
how many centrality bins
void SetBranchName(std::string branchName)
Set the name of the cells branch (NOT the same as the name!)
std::string fSuffix
Suffix of the Correction Task (used to select components)
void PrintRequestedContainersInformation(AliEmcalContainerUtils::InputObject_t inputObjectType, std::ostream &stream) const
Steering task for the EMCal correction framework.
AliEMCALGeometry * fGeom
! Emcal geometry
return jsonbuilder str().c_str()
static const std::map< std::string, AliVCluster::VCluUserDefEnergy_t > fgkClusterEnergyTypeMap
Relates string to the cluster energy enumeration for YAML configuration.
void SetTrackCutsPeriod(const char *period)
static bool DoesFileExist(const std::string &filename)
std::string GetName() const
Get the name of the cells object (NOT the same as the branch!)
void InitializeConfiguration()
void SetArray(const AliVEvent *event)
AliVCaloCells * GetCaloCells() const
No filter (all tracks passing)
std::vector< std::string > fOrderedComponentsToExecute
Ordered set of components to execute.
bool WriteConfigurationFile(std::string filename, bool userConfig=false) const
bool CheckPossibleNamesForComponentName(std::string &name, std::set< std::string > &possibleComponents)
std::vector< AliEmcalCorrectionComponent * > fCorrectionComponents
Contains the correction components.
Container with name, TClonesArray and cuts for particles.
std::string GetInputFieldNameFromInputObjectType(AliEmcalContainerUtils::InputObject_t inputObjectType)
static std::string DetermineUseDefaultName(InputObject_t objType, bool esdMode, bool returnObjectType=false)
void AdoptClusterContainer(AliClusterContainer *cont)
void SetupConfigurationFilePath(std::string &filename, bool userFile=false)
void UserExec(Option_t *option)
AliEmcalCorrectionTask & operator=(AliEmcalCorrectionTask other)
void UserCreateOutputObjectsComponents()
YAML::Node fUserConfiguration
! User YAML Configuration
Double_t fMaxCent
max centrality for event selection
Double_t fVertex[3]
! Event vertex
Declaration of class AliAnalysisTaskEmcalEmbeddingHelper.
void DetermineComponentsToExecute(std::vector< std::string > &componentsToExecute)
TList * fOutput
! Output for histograms
Wrapper around cells objects for the EMCal Correction Task.
bool fConfigurationInitialized
True if the YAML configuration files are initialized.
AliEmcalContainer * AddContainer(AliEmcalContainerUtils::InputObject_t contType, std::string &containerName, YAML::Node &userNode, YAML::Node &defaultNode)
void CheckForContainerArray(AliEmcalContainer *cont, AliEmcalContainerUtils::InputObject_t objectType)
AliParticleContainer * GetParticleContainer(Int_t i=0) const
friend void swap(AliEmcalCorrectionTask &first, AliEmcalCorrectionTask &second)
Container for particles within the EMCAL framework.
static AliVEvent * GetEvent(AliVEvent *inputEvent, bool isEmbedding=false)
void SetUserConfiguration(YAML::Node &node)
Make copy to ensure that the nodes do not point to each other (?)
bool CompareToStoredConfiguration(std::string filename, bool userConfig=false) const
AliVCaloCells * GetCells() const
Pointer to the actual CaloCells object.
bool fEventInitialized
If the event is initialized properly.
TString fCentEst
name of V0 centrality estimator
void SetAODFilterBits(UInt_t bits)
std::string fUserConfigurationFilename
! User YAML configruation filename
InputObject_t
Type of input object to be created
AliClusterContainer * GetClusterContainer(Int_t i=0) const
std::string fDefaultConfigurationString
Store the default YAML configuration as a string so that it can be streamed.
void SetClusNonLinCorrEnergyCut(Double_t cut)
static AliEmcalCorrectionTask * AddTaskEmcalCorrectionTask(TString suffix="")
void SetCells(AliVCaloCells *cells)
Sets the Pointer to the actual CaloCells object.
Double_t fCent
! Event centrality
void ExecOnceComponents()
void CreateInputObjects(AliEmcalContainerUtils::InputObject_t inputObjectType)
Base class for correction components in the EMCal correction framework.
BeamType
Switch for the beam type.
void AdoptParticleContainer(AliParticleContainer *cont)
void InitializeComponents()
void SetIncludePHOS(Bool_t b)
Bool_t fNeedEmcalGeom
whether or not the task needs the emcal geometry
void CheckForUnmatchedUserSettings()
static const std::map< std::string, AliEmcalTrackSelection::ETrackFilterType_t > fgkTrackFilterTypeMap
Relates string to the track filter enumeration for YAML configuration.
std::string GetBranchName() const
Get the name of the cells branch (NOT the same as the name!)
void SetCellsObjectInCellContainerBasedOnProperties(AliEmcalCorrectionCellContainer *cellContainer)
Bool_t fUseNewCentralityEstimation
Use new centrality estimation (for 2015 data)
bool GetIsEmbedding() const
True if the cells are located in the event that is being embedded.
Bool_t Data(TH1F *h, Double_t *rangefit, Bool_t writefit, Double_t &sgn, Double_t &errsgn, Double_t &bkg, Double_t &errbkg, Double_t &sgnf, Double_t &errsgnf, Double_t &sigmafit, Int_t &status)
Custom (user-defined) tracks.
AliEmcalCorrectionCellContainer * GetCellContainer(const std::string &cellsContainerName) const
BeamType GetBeamType() const
std::string fDefaultConfigurationFilename
! Default YAML configuration filename
void UserCreateOutputObjects()
void GetNodeForInputObjects(YAML::Node &inputNode, YAML::Node &nodeToRetrieveFrom, std::string &inputObjectName, bool requiredProperty)
TObjArray fParticleCollArray
Particle/track collection array.
TObjArray fClusterCollArray
Cluster collection array.
virtual Bool_t Initialize()
void SetDefaultConfiguration(YAML::Node &node)
virtual ~AliEmcalCorrectionTask()
ClassImp(AliAnalysisTaskCRC) AliAnalysisTaskCRC
ETrackFilterType_t
Pre-defined track filters.
void AdoptParticleContainer(AliParticleContainer *cont)
void SetIsESD(Bool_t isESD)
std::ostream & operator<<(std::ostream &in, const AliEmcalCorrectionTask &myTask)
void SetIsEmbedding(bool isEmbedded)
Set to true if the cells are located in the event that is being embedded.
void SetCaloCells(AliVCaloCells *cells)
BeamType fBeamType
! Event beam type
void SetArray(const AliVEvent *event)
Int_t GetRunNumber(TString)
void SetTrackFilterType(ETrackFilterType_t f)
std::string toString(bool includeYAMLConfigurationInfo=false) const
void SetupContainersFromInputNodes(AliEmcalContainerUtils::InputObject_t inputObjectType, YAML::Node &userInputObjectNode, YAML::Node &defaultInputObjectNode, std::set< std::string > &requestedContainers)
YAML::Node fDefaultConfiguration
! Default YAML Configuration
void Print(Option_t *opt="") const
void SetupCellsInfo(std::string containerName, YAML::Node &userNode, YAML::Node &defaultNode)
Int_t fNVertCont
! Event vertex number of contributors
static AliEmcalCorrectionComponent * createInstance(std::string const &s)
Creates an instance of an object based on the name if the name is registered in the map...
void SetName(std::string name)
Set the name of the cells object (NOT the same as the branch!)
Int_t fCentBin
! Event centrality bin
Double_t fMinCent
min centrality for event selection
std::vector< AliEmcalCorrectionCellContainer * > fCellCollArray
Cells collection array.
Bool_t RetrieveEventObjects()
void SetupContainer(AliEmcalContainerUtils::InputObject_t inputObjectType, std::string containerName, YAML::Node &userNode, YAML::Node &defaultNode)
Container structure for EMCAL clusters.
Container for MC-true particles within the EMCAL framework.
void AddContainersToComponent(AliEmcalCorrectionComponent *component, AliEmcalContainerUtils::InputObject_t inputObjectType, bool checkObjectExists=false)
std::string fUserConfigurationString
Store the user YAML configuration as a string so that it can be streamed.
void GetPropertyNamesFromNode(const std::string &componentName, const YAML::Node &node, std::set< std::string > &propertyNames, const bool nodeRequired)
std::ostream & PrintConfigurationString(std::ostream &in, bool userConfig=false) const
TList * OpenFile(const char *fname)
void SetClusHadCorrEnergyCut(Double_t cut)
void swap(AliEmcalCorrectionTask &first, AliEmcalCorrectionTask &second)
bool GetProperty(std::string propertyName, T &property, bool requiredProperty=true, std::string correctionName="")
Retrieve property.
BeamType fForceBeamType
forced beam type