26 const PfoList *pPfoList =
nullptr;
27 std::string pfoListName;
57 if (!pPfoList->empty())
63 return STATUS_CODE_SUCCESS;
70 for (ClusterList::const_iterator iter = pClusterList->begin(), iterEnd = pClusterList->end(); iter != iterEnd; ++iter)
72 const Cluster *
const pCluster = *iter;
83 PandoraContentApi::ParticleFlowObject::Parameters pfoParameters;
90 if (!fitToAllHitsResult.IsFitSuccessful())
94 pfoParameters.m_particleId = particleType;
95 pfoParameters.m_charge = 0;
96 pfoParameters.m_mass = 0.;
97 pfoParameters.m_energy = clusterEnergy;
98 pfoParameters.m_momentum =
CartesianVector(fitToAllHitsResult.GetDirection() * clusterEnergy);
99 pfoParameters.m_clusterList.push_back(pCluster);
102 PANDORA_RETURN_RESULT_IF(STATUS_CODE_SUCCESS, !=, PandoraContentApi::ParticleFlowObject::Create(*
this, pfoParameters, pPfo));
105 return STATUS_CODE_SUCCESS;
129 return STATUS_CODE_SUCCESS;
#define PANDORA_RETURN_RESULT_IF_AND_IF(StatusCode1, StatusCode2, Operator, Command)
#define PANDORA_RETURN_RESULT_IF(StatusCode1, Operator, Command)
Header file for the two dimensional particle creation algorithm class.
static pandora::StatusCode ReplaceCurrentList(const pandora::Algorithm &algorithm, const std::string &newListName)
Replace the current list with a pre-saved list; use this new list as a permanent replacement for the ...
static pandora::StatusCode CreateTemporaryListAndSetCurrent(const pandora::Algorithm &algorithm, const T *&pT, std::string &temporaryListName)
Create a temporary list and set it to be the current list, enabling object creation.
static const pandora::PluginManager * GetPlugins(const pandora::Algorithm &algorithm)
Get the pandora plugin instance, providing access to user registered functions and calculators.
static pandora::StatusCode GetList(const pandora::Algorithm &algorithm, const std::string &listName, const T *&pT)
Get a named list.
pandora::StatusCode CreatePFOs(const pandora::ClusterList *const pClusterList) const
Create pfos for provided clusters.
pandora::StatusCode Run()
Run the algorithm.
unsigned int m_minHitsInCluster
Min number of hits for clusters to form pfos.
std::string m_outputPfoListName
The output pfo list name.
std::string m_inputClusterListNameU
The input cluster list name for the U view.
pandora::StatusCode ReadSettings(const pandora::TiXmlHandle xmlHandle)
Read the algorithm settings.
std::string m_inputClusterListNameW
The input cluster list name for the W view.
TwoDParticleCreationAlgorithm()
Default constructor.
std::string m_inputClusterListNameV
The input cluster list name for the V view.
float m_minClusterEnergy
Min energy for clusters to form pfos.
unsigned int GetNCaloHits() const
Get the number of calo hits in the cluster.
float GetElectromagneticEnergy() const
Get the sum of electromagnetic energy measures of all constituent calo hits, units GeV.
const ClusterFitResult & GetFitToAllHitsResult() const
Get the result of a linear fit to all calo hits in the cluster.
ParticleFlowObject class.
bool IsMuon(const T *const pT) const
Provide identification of whether a cluster or pfo is a muon.
const ParticleId * GetParticleId() const
Get the address of the pandora particle id instance.
static StatusCode ReadValue(const TiXmlHandle &xmlHandle, const std::string &xmlElementName, T &t)
Read a value from an xml element.
MANAGED_CONTAINER< const Cluster * > ClusterList
ParticleType
The particle type enum.
StatusCode
The StatusCode enum.
MANAGED_CONTAINER< const ParticleFlowObject * > PfoList