19 float &correctedHadronicEnergy)
const
25 PANDORA_RETURN_RESULT_IF(STATUS_CODE_SUCCESS, !=, pPlugin->MakeEnergyCorrections(pCluster, correctedHadronicEnergy));
32 PANDORA_RETURN_RESULT_IF(STATUS_CODE_SUCCESS, !=, pPlugin->MakeEnergyCorrections(pCluster, correctedElectromagneticEnergy));
35 return STATUS_CODE_SUCCESS;
50 delete mapEntry.second;
53 delete mapEntry.second;
70 if (!energyCorrectionPluginMap.insert(EnergyCorrectionPluginMap::value_type(name, pEnergyCorrectionPlugin)).second)
71 return STATUS_CODE_ALREADY_PRESENT;
73 return STATUS_CODE_SUCCESS;
83 if (
nullptr != pXmlElement)
93 if (
nullptr != pXmlElement)
105 return STATUS_CODE_SUCCESS;
113 if (!energyCorrectionPluginVector.empty())
114 return STATUS_CODE_FAILURE;
118 xmlTagName, requestedPluginNames));
122 for (
const std::string &requestedPluginName : requestedPluginNames)
124 EnergyCorrectionPluginMap::const_iterator mapIter = energyCorrectionPluginMap.find(requestedPluginName);
126 if (energyCorrectionPluginMap.end() == mapIter)
127 return STATUS_CODE_NOT_FOUND;
129 energyCorrectionPluginVector.push_back(mapIter->second);
132 return STATUS_CODE_SUCCESS;
139 switch (energyCorrectionType)
162 return STATUS_CODE_SUCCESS;
Header file for the cluster class.
Header file for the calo hit plugin class.
#define PANDORA_RETURN_RESULT_IF_AND_IF(StatusCode1, StatusCode2, Operator, Command)
#define PANDORA_RETURN_RESULT_IF(StatusCode1, Operator, Command)
Header file for the xml helper class.
float GetHadronicEnergy() const
Get the sum of hadronic energy measures of all constituent calo hits, units GeV.
float GetElectromagneticEnergy() const
Get the sum of electromagnetic energy measures of all constituent calo hits, units GeV.
EnergyCorrectionPlugin class.
StatusCode InitializePlugin(const TiXmlHandle *const pXmlHandle, const std::string &xmlTagName, const EnergyCorrectionType energyCorrectionType, EnergyCorrectionPluginVector &energyCorrectionPluginVector)
Read requested plugin names/labels from a specified xml tag and attempt to assign the plugin pointers...
EnergyCorrectionPluginMap m_hadEnergyCorrectionPluginMap
The hadronic energy correction plugin map.
std::vector< EnergyCorrectionPlugin * > EnergyCorrectionPluginVector
StatusCode ResetForNextEvent()
Call the reset callback in all managed plugins.
StatusCode RegisterPlugin(const std::string &pluginName, const EnergyCorrectionType energyCorrectionType, EnergyCorrectionPlugin *const pEnergyCorrectionPlugin)
Register an energy correction plugin.
std::map< std::string, EnergyCorrectionPlugin * > EnergyCorrectionPluginMap
EnergyCorrectionPluginVector m_emEnergyCorrectionPlugins
The final electromagnetic energy correction plugin vector.
StatusCode InitializePlugins(const TiXmlHandle *const pXmlHandle)
Initialize plugins.
StatusCode MakeEnergyCorrections(const Cluster *const pCluster, float &correctedElectromagneticEnergy, float &correctedHadronicEnergy) const
Make an ordered list of energy corrections to a cluster.
~EnergyCorrections()
Destructor.
EnergyCorrectionPluginMap m_emEnergyCorrectionPluginMap
The electromagnetic energy correction plugin map.
const Pandora *const m_pPandora
Address of the associated pandora instance.
EnergyCorrections(const Pandora *const pPandora)
Default constructor.
EnergyCorrectionPluginVector m_hadEnergyCorrectionPlugins
The final hadronic energy correction plugin vector.
EnergyCorrectionPluginMap & GetEnergyCorrectionPluginMap(const EnergyCorrectionType energyCorrectionType)
Get the energy correction plugin map corresponding to the specified energy correction type.
StatusCode RegisterDetails(const Pandora *const pPandora, const std::string &type, const std::string &instanceName)
Register i) the pandora instance that will run the process and ii) the process type.
StatusCodeException class.
TiXmlElement * Element() const
TiXmlHandle FirstChild() const
Return a handle to the first child node.
static StatusCode ReadVectorOfValues(const TiXmlHandle &xmlHandle, const std::string &xmlElementName, std::vector< T > &vector)
Read a vector of values from a (space separated) list in an xml element.
std::vector< std::string > StringVector
EnergyCorrectionType
Energy correction type enum.
StatusCode
The StatusCode enum.