21 #include "AliVEventHandler.h"
22 #include "AliEMCALGeometry.h"
23 #include "AliVCaloCells.h"
24 #include "AliVCluster.h"
26 #include "AliMultSelection.h"
27 #include "AliCentrality.h"
28 #include "AliESDEvent.h"
29 #include "AliAnalysisManager.h"
30 #include "AliAODEvent.h"
43 {
"kNonLinCorr", AliVCluster::kNonLinCorr },
44 {
"kHadCorr", AliVCluster::kHadCorr },
45 {
"kUserDefEnergy1", AliVCluster::kUserDefEnergy1 },
46 {
"kUserDefEnergy2", AliVCluster::kUserDefEnergy2 }
63 fUserConfigurationFilename(
""),
64 fUserConfigurationString(
""),
65 fDefaultConfiguration(),
66 fDefaultConfigurationFilename(
""),
67 fDefaultConfigurationString(
""),
68 fCorrectionComponents(),
71 fConfigurationInitialized(false),
72 fOrderedComponentsToExecute(),
73 fEventInitialized(false),
80 fUseNewCentralityEstimation(kFALSE),
84 fNeedEmcalGeom(kTRUE),
92 AliDebug(3, Form(
"%s", __PRETTY_FUNCTION__));
94 fParticleCollArray.SetOwner(kTRUE);
95 fClusterCollArray.SetOwner(kTRUE);
110 fUserConfiguration(),
111 fUserConfigurationFilename(
""),
112 fUserConfigurationString(
""),
113 fDefaultConfiguration(),
114 fDefaultConfigurationFilename(
""),
115 fDefaultConfigurationString(
""),
116 fCorrectionComponents(),
119 fConfigurationInitialized(false),
120 fOrderedComponentsToExecute(),
121 fEventInitialized(false),
128 fUseNewCentralityEstimation(kFALSE),
132 fNeedEmcalGeom(kTRUE),
134 fParticleCollArray(),
140 AliDebug(3, Form(
"%s", __PRETTY_FUNCTION__));
142 fParticleCollArray.SetOwner(kTRUE);
143 fClusterCollArray.SetOwner(kTRUE);
145 DefineInput(0, TChain::Class());
146 DefineOutput(1, TList::Class());
157 fUserConfiguration(task.fUserConfiguration),
158 fDefaultConfiguration(task.fDefaultConfiguration),
159 fSuffix(task.fSuffix),
160 fUserConfigurationString(task.fUserConfigurationString),
161 fDefaultConfigurationString(task.fDefaultConfigurationString),
162 fUserConfigurationFilename(task.fUserConfigurationFilename),
163 fDefaultConfigurationFilename(task.fDefaultConfigurationFilename),
164 fOrderedComponentsToExecute(task.fOrderedComponentsToExecute),
165 fCorrectionComponents(task.fCorrectionComponents),
166 fConfigurationInitialized(task.fConfigurationInitialized),
168 fEventInitialized(task.fEventInitialized),
170 fCentBin(task.fCentBin),
171 fMinCent(task.fMinCent),
172 fMaxCent(task.fMaxCent),
173 fNcentBins(task.fNcentBins),
174 fCentEst(task.fCentEst),
175 fUseNewCentralityEstimation(task.fUseNewCentralityEstimation),
177 fNVertCont(task.fNVertCont),
178 fBeamType(task.fBeamType),
179 fForceBeamType(task.fForceBeamType),
180 fNeedEmcalGeom(task.fNeedEmcalGeom),
182 fParticleCollArray(*(static_cast<TObjArray *>(task.fParticleCollArray.Clone()))),
183 fClusterCollArray(*(static_cast<TObjArray *>(task.fClusterCollArray.Clone()))),
184 fOutput(task.fOutput)
187 std::copy(std::begin(task.fVertex), std::end(task.fVertex), std::begin(fVertex));
190 for (
auto cellCont : task.fCellCollArray)
276 AliVEventHandler *evhand = mgr->GetInputEventHandler();
278 if (evhand->InheritsFrom(
"AliESDInputHandler")) {
286 AliError(
"Event handler not found!");
290 AliError(
"Analysis manager not found!");
294 std::string tempName = GetName();
295 std::size_t foundSuffix = tempName.find(
"_");
296 if (foundSuffix != std::string::npos) {
298 fSuffix = tempName.substr(foundSuffix + 1).c_str();
302 AliInfoStream() <<
"Initializing correction task with suffix \"" <<
fSuffix <<
"\"" << std::endl;
310 AliFatal(
"YAML configuration must be initialized before running (ie. in the run macro or wagon)!");
336 std::cout << GetName() <<
" Settings:\n" << *
this;
387 AliInfo(TString::Format(
"User file at \"%s\" does not exist! All settings will be from the default file!",
fUserConfigurationFilename.c_str()));
392 std::stringstream tempConfiguration;
395 tempConfiguration.str(
"");
418 std::vector <std::string> executionOrder;
424 std::set <std::string> possibleComponents;
426 possibleComponents.insert(node.first.as<std::string>());
429 possibleComponents.insert(node.first.as<std::string>());
433 std::string expectedComponentName =
"";
434 bool foundSuffixComponent =
false;
435 bool foundComponent =
false;
436 bool componentEnabled =
true;
439 for (
auto & execName : executionOrder)
442 expectedComponentName = TString::Format(
"%s_%s", execName.c_str(),
fSuffix.c_str()).
Data();
443 foundComponent =
false;
444 componentEnabled =
false;
452 if (componentEnabled ==
true) {
453 foundSuffixComponent =
true;
454 correctionComponents.push_back(expectedComponentName);
457 AliInfo(TString::Format(
"Component %s is disabled and will not be run!", expectedComponentName.c_str()));
465 expectedComponentName = execName;
470 if (componentEnabled ==
true) {
471 if (foundSuffixComponent ==
true) {
472 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()));
476 correctionComponents.push_back(expectedComponentName);
480 AliInfo(TString::Format(
"Component %s is disabled and will not be run!", expectedComponentName.c_str()));
486 AliDebug(2,
"Found EMCal Correction Components: ");
487 for (
auto & component : correctionComponents)
489 component =
"AliEmcalCorrection" + component;
490 AliDebug(2, TString::Format(
"%s", component.c_str()) );
509 std::set <std::string> userPropertyNames;
510 std::set <std::string> defaultPropertyNames;
512 bool foundMatch =
false;
513 std::string tempComponentName =
"";
519 userPropertyNames.clear();
520 defaultPropertyNames.clear();
523 tempComponentName = componentName.substr(componentName.find(
"AliEmcalCorrection")+18);
525 AliDebugStream(2) <<
"Checking component " << componentName <<
" for unmatched user settings" << std::endl;
535 if (tempComponentName.find(
"_") != std::string::npos) {
544 for (
auto userPropertyName : userPropertyNames)
546 AliDebugStream(2) <<
"Checking property " << userPropertyName << std::endl;
548 for (
auto defaultPropertyName : defaultPropertyNames)
550 if (userPropertyName == defaultPropertyName) {
551 AliDebugStream(2) <<
"Found match of " << userPropertyName <<
" with " << defaultPropertyName << std::endl;
555 if (foundMatch ==
false) {
556 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()));
574 std::string noPrefixComponentName = componentName.substr(0, componentName.find(
"_" +
fSuffix));
578 AliFatal(TString::Format(
"Failed to create requested component %s!", componentName.c_str()));
582 component->SetName(componentName.c_str());
583 component->SetTitle(componentName.c_str());
602 AliInfo(TString::Format(
"Successfully added correction task: %s", componentName.c_str()));
628 YAML::Node userInputObjectNode;
629 YAML::Node defaultInputObjectNode;
633 AliDebugStream(3) <<
"userInputObjectNode: " << userInputObjectNode << std::endl;
634 AliDebugStream(3) <<
"defaultInputObjectNode: " << defaultInputObjectNode << std::endl;
637 std::set <std::string> requestedContainers;
638 std::vector <std::string> componentRequest;
641 componentRequest.clear();
645 for (
auto & req : componentRequest )
647 AliDebugStream(3) <<
"Component " << componentName <<
" requested container name " << req << std::endl;
648 requestedContainers.insert(req);
652 AliDebugStream(2) << inputObjectName <<
" Containers requested by components: " << std::endl;
653 for (
auto &
str : requestedContainers) {
654 AliDebugStream(2) <<
"\t" <<
str << std::endl;;
658 AliDebug(2, TString::Format(
"Setting up requested containers!"));
673 inputObjectName = inputObjectName +
"Names";
675 std::vector <std::string> inputObjects;
682 for (
auto const &
str : inputObjects)
688 AliDebugStream(2) <<
"Adding cluster container " <<
str <<
" of array " << cont->GetArrayName() <<
" to component " << component->GetName() << std::endl;
690 if (checkObjectExists && !cont) {
691 AliError(TString::Format(
"%s: Unable to retrieve input object \"%s\" because it is null. Please check your configuration!", GetName(),
str.c_str()));
698 AliDebugStream(2) <<
"Adding particle container " <<
str <<
" of array " << cont->GetArrayName() <<
" to component " << component->GetName() << std::endl;
700 if (checkObjectExists && !cont) {
701 AliFatal(TString::Format(
"%s: Unable to retrieve input object \"%s\" because it is null. Please check your configuration!", GetName(),
str.c_str()));
708 if (inputObjects.size() > 1) {
709 AliFatal(TString::Format(
"Component %s requested more than one cell branch, but this is not supported! Check the configuration!", component->GetName()));
714 AliDebugStream(2) <<
"Adding calo cells \"" << cellCont->
GetName() <<
"\" of branch name \"" << cellCont->
GetBranchName() <<
"\" to component " << component->GetName() << std::endl;
723 if (checkObjectExists && !(cellCont->
GetCells())) {
724 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()));
735 AliDebugStream(3) <<
"Component GetNumberOfCells: " << component->
GetCaloCells()->GetNumberOfCells() << std::endl;
752 for(
auto & containerName : requestedContainers)
761 AliDebug(2, TString::Format(
"Processing container %s of inputType %d", containerName.c_str(), inputObjectType));
763 SetupContainer(inputObjectType, containerName, userInputObjectNode, defaultInputObjectNode);
766 SetupCellsInfo(containerName, userInputObjectNode, defaultInputObjectNode);
786 AliDebugStream(2) <<
"User: " << std::endl << userNode << std::endl <<
"default: " << std::endl << defaultNode << std::endl;
790 cellObj->
SetName(containerName);
792 std::string tempString =
"";
794 if (tempString ==
"usedefault") {
800 bool tempBool =
false;
828 AliDebugStream(2) <<
"Adding container" << std::endl;
829 AliEmcalContainer * cont =
AddContainer(inputObjectType, containerName, userNode, defaultNode);
830 AliDebugStream(2) <<
"Added container" << std::endl;
842 std::string tempString =
"";
844 bool tempBool =
false;
850 AliDebugStream(2) << cont->GetName() <<
": Setting minPt of " << tempDouble << std::endl;
851 cont->SetMinPt(tempDouble);
856 AliDebugStream(2) << cont->GetName() <<
": Setting minE of " << tempDouble << std::endl;
857 cont->SetMinE(tempDouble);
866 AliDebugStream(2) << cont->GetName() <<
": Setting eta limits of " << tempDouble <<
" to " << tempDouble2 << std::endl;
867 cont->SetEtaLimits(tempDouble, tempDouble2);
877 AliDebugStream(2) << cont->GetName() <<
": Setting phi limits of " << tempDouble <<
" to " << tempDouble2 << std::endl;
878 cont->SetPhiLimits(tempDouble, tempDouble2);
884 AliDebugStream(2) << cont->GetName() <<
": Setting embedding to " << (tempBool ?
"enabled" :
"disabled") << std::endl;
885 cont->SetIsEmbedding(tempBool);
890 if (clusterContainer) {
904 AliDebugStream(2) << clusterContainer->GetName() <<
": Setting clusNonLinCorrEnergyCut of " << tempDouble << std::endl;
911 AliDebugStream(2) << clusterContainer->GetName() <<
": Setting clusHadCorrEnergyCut of " << tempDouble << std::endl;
918 AliDebugStream(2) << clusterContainer->GetName() <<
": Setting Include PHOS to " << (tempBool ?
"enabled" :
"disabled") << std::endl;
925 if (trackContainer) {
928 std::vector <UInt_t> filterBitsVector;
932 for (
int filterBit : filterBitsVector) {
933 filterBits += filterBit;
935 AliDebugStream(2) << trackContainer->GetName() <<
": Setting filterBits of " << filterBits << std::endl;
944 AliDebugStream(2) << trackContainer->GetName() <<
": Setting trackFilterType of " << trackFilterType << std::endl;
952 AliDebugStream(2) << trackContainer->GetName() <<
": Setting track cuts period to " << tempString << std::endl;
978 std::string containerBranch =
"";
980 AliFatal(
"Must specify type of container when requesting branch.");
985 AliDebugStream(2) <<
"User Node: " << userNode << std::endl;
986 AliDebugStream(2) <<
"Default Node: " << defaultNode << std::endl;
995 if (containerBranch ==
"usedefault") {
1000 AliEmcalContainer * cont = 0;
1008 if (containerBranch ==
"mcparticles") {
1016 cont->SetName(containerName.c_str());
1034 AliFatal(
"YAML configuration must be initialized before running (ie. the AddTask, run macro or wagon)!");
1047 AliInfo(
"Reinitializing user configuration from string. Expected if running on grid!");
1052 AliInfo(
"Reinitializing default configuration from string. Expected if running on grid!");
1058 AliDebugStream(4) <<
"(Re)initialized user configuration: " <<
fUserConfiguration << std::endl;
1060 AliDebugStream(4) <<
"(Re)initialized default configuration: " <<
fDefaultConfiguration << std::endl;
1091 component->UserCreateOutputObjects();
1093 if (component->GetOutputList() != 0)
1100 t->SetName(component->GetName());
1103 TIter next(component->GetOutputList());
1104 while (
TObject *obj = next()){
1108 AliDebug(1, TString::Format(
"Added output list from task %s to output.", component->GetName()));
1148 if (!InputEvent()) {
1149 AliError(
"Could not retrieve event! Returning!");
1154 if (dynamic_cast<AliAODEvent*>(InputEvent())) {
1155 AliWarning(
"=============================================================");
1156 AliWarning(
"=== Running on AOD is not equivalent to running on ESD! ===");
1157 AliWarning(
"=============================================================");
1161 fGeom = AliEMCALGeometry::GetInstanceFromRunNumber(InputEvent()->
GetRunNumber());
1163 AliFatal(
"Can not get EMCal geometry instance. If you do not need the EMCal geometry, disable it by setting task->SetNeedEmcalGeometry(kFALSE).");
1193 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";
1209 component->SetEMCALGeometry(
fGeom);
1213 component->SetEvent(InputEvent());
1214 component->SetMCEvent(MCEvent());
1220 component->ExecOnce();
1224 if (!(component->GetCaloCells())) {
1225 AliDebugStream(2) <<
"Re-initializing cells for component " << component->GetName() << std::endl;
1242 const AliVVertex *vert = InputEvent()->GetPrimaryVertex();
1252 AliMultSelection *MultSelection =
static_cast<AliMultSelection*
>(InputEvent()->FindListObject(
"MultSelection"));
1253 if (MultSelection) {
1254 fCent = MultSelection->GetMultiplicityPercentile(
fCentEst.Data());
1257 AliWarning(
"Could not retrieve centrality information! Assuming 99");
1261 AliCentrality *aliCent = InputEvent()->GetCentrality();
1266 AliWarning(
"Could not retrieve centrality information! Assuming 99");
1276 AliWarning(Form(
"Negative centrality: %f. Assuming 99",
fCent));
1285 else if (
fCent > 90) {
1290 AliWarning(Form(
"Negative centrality: %f. Assuming 99",
fCent));
1303 AliWarning(Form(
"fCentBin too large: cent = %f fCentBin = %d. Assuming 99",
fCent,
fCentBin));
1313 AliEmcalContainer* cont = 0;
1316 while ((cont = static_cast<AliEmcalContainer*>(nextPartColl()))) cont->NextEvent();
1319 while ((cont = static_cast<AliEmcalContainer*>(nextClusColl()))) cont->NextEvent();
1333 component->SetEvent(InputEvent());
1334 component->SetMCEvent(MCEvent());
1335 component->SetCentralityBin(
fCentBin);
1336 component->SetCentrality(
fCent);
1354 component->UserNotify();
1369 if (stringToWrite ==
"") {
1370 AliWarning(TString::Format(
"%s configuration is empty!", userConfig ?
"User" :
"Default"));
1372 in << stringToWrite;
1386 bool returnValue =
false;
1391 std::ofstream outFile(filename);
1399 AliError(TString::Format(
"Configuration not properly initialized! Cannot print %s configuration!", userConfig ?
"user" :
"default"));
1405 AliError(
"Please pass a valid filename instead of empty quotes!");
1419 bool returnValue =
false;
1425 YAML::Node passedNode = YAML::LoadFile(filename);
1430 std::stringstream passedNodeSS;
1431 passedNodeSS << passedNode;
1439 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";
1444 AliError(TString::Format(
"Configuration not properly initialized! Cannot compare %s configuration!", userConfig ?
"user" :
"default"));
1450 AliError(
"Please pass a valid filename instead of empty quotes!");
1465 std::ifstream inFile(filename);
1466 return inFile.good();
1482 filename =
gSystem->ExpandPathName(filename.c_str());
1485 if(filename.find(
"alien://") != std::string::npos)
1487 AliDebug(2, TString::Format(
"Opening file \"%s\" on the grid!", filename.c_str()));
1490 TGrid::Connect(
"alien://");
1494 std::string localFilename =
gSystem->BaseName(filename.c_str());
1496 if (userFile ==
true) {
1497 localFilename =
"user" + localFilename;
1499 TFile::Cp(filename.c_str(), localFilename.c_str());
1502 filename = localFilename;
1515 AliDebugStream(2) <<
"Retrieving cells object " << cellContainer->
GetName() << std::endl;
1519 cellContainer->
SetCells(dynamic_cast<AliVCaloCells *>(event->FindListObject(cellContainer->
GetBranchName().c_str())));
1535 TClonesArray * array =
dynamic_cast<TClonesArray *
>(
event->FindListObject(cont->GetArrayName()));
1537 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()));
1539 array->SetName(cont->GetArrayName());
1540 event->AddObject(array);
1554 std::string inputObjectName =
"";
1556 inputObjectName =
"clusterContainers";
1559 inputObjectName =
"trackContainers";
1562 inputObjectName =
"cells";
1565 AliFatal(TString::Format(
"Unrecognized input object type %d", inputObjectType));
1568 return inputObjectName;
1584 bool foundComponent =
false;
1585 for (
auto & possibleComponent : possibleComponents)
1587 if (possibleComponent == name) {
1588 foundComponent =
true;
1593 return foundComponent;
1609 const AliESDRun *run = esd->GetESDRun();
1610 TString beamType = run->GetBeamType();
1611 if (beamType ==
"p-p")
1613 else if (beamType ==
"A-A")
1615 else if (beamType ==
"p-A")
1620 Int_t runNumber = InputEvent()->GetRunNumber();
1622 if ((runNumber >= 136833 && runNumber <= 139517) ||
1623 (runNumber >= 167693 && runNumber <= 170593) ||
1624 (runNumber >= 244824 && runNumber <= 246994)) {
1626 }
else if ((runNumber >= 188356 && runNumber <= 188366) ||
1627 (runNumber >= 195164 && runNumber <= 197388) ||
1628 (runNumber >= 265015 && runNumber <= 267166)) {
1642 stream <<
"Cells info: " << std::endl;
1644 stream <<
"\tName: " << cellInfo->GetName() <<
"\tBranch: " << cellInfo->GetBranchName() <<
"\tIsEmbedding: " << std::boolalpha << cellInfo->GetIsEmbedding() << std::endl;
1649 AliEmcalContainer * cont = 0;
1651 cont =
static_cast<AliEmcalContainer *
>(containerInfo);
1652 stream <<
"\tName: " << cont->GetName() <<
"\tBranch: " << cont->GetArrayName() <<
"\tTitle: " << cont->GetTitle() <<
"\tIsEmbedding:" << std::boolalpha << cont->GetIsEmbedding() << std::endl;
1656 AliErrorStream() <<
"Unrecognized input object type " << inputObjectType << std::endl;
1675 if (nodeToRetrieveFrom[
"sharedParameters"]) {
1676 inputNode[
"sharedParameters"] = nodeToRetrieveFrom[
"sharedParameters"];
1692 YAML::Node tempNode;
1694 for (
auto propertyName : tempNode)
1696 propertyNames.insert(propertyName.first.as<std::string>());
1711 if (cellContainer->GetName() == cellsContainerName) {
1712 return cellContainer;
1726 ::Error(
"AddTaskEmcalCorrectionTask",
"No analysis manager to connect to.");
1732 AliVEventHandler* handler = mgr->GetInputEventHandler();
1735 ::Error(
"AddTaskEmcalCorrectionTask",
"This task requires an input event handler");
1739 TString name =
"AliEmcalCorrectionTask";
1741 name += TString::Format(
"_%s", suffix.Data());
1745 if (mgrTask)
return mgrTask;
1754 mgr->AddTask(correctionTask);
1757 AliAnalysisDataContainer* cInput = mgr->GetCommonInputContainer();
1759 TString outputContainerName(name);
1760 outputContainerName +=
"_histos";
1762 AliAnalysisDataContainer * cOutput = mgr->CreateContainer(outputContainerName.Data(),
1764 AliAnalysisManager::kOutputContainer,
1765 Form(
"%s", AliAnalysisManager::GetCommonFileName()));
1767 mgr->ConnectInput(correctionTask, 0, cInput);
1768 mgr->ConnectOutput(correctionTask, 1, cOutput);
1772 return correctionTask;
1782 std::stringstream tempSS;
1785 tempSS <<
"Correction components:\n";
1787 tempSS <<
"\t" << component <<
"\n";
1790 tempSS <<
"\nInput objects:\n";
1795 if (includeYAMLConfigurationInfo ==
true) {
1796 tempSS <<
"\nUser Configuration:\n";
1798 tempSS <<
"\n\nDefault Configuration:\n";
1803 return tempSS.str();
1826 std::ostream & result = myTask.
Print(in);
1838 std::string temp(opt);
1839 bool includeYAMLConfig =
false;
1840 if (temp ==
"YAML") {
1841 includeYAMLConfig =
true;
1843 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