29 const PfoList *pPfoList(
nullptr);
33 if (!pPfoList || pPfoList->empty())
36 std::cout <<
"NeutrinoPropertiesAlgorithm: unable to find pfo list " <<
m_neutrinoPfoListName << std::endl;
38 return STATUS_CODE_SUCCESS;
42 const ParticleFlowObject *
const pNeutrinoPfo((1 == pPfoList->size()) ? *(pPfoList->begin()) :
nullptr);
45 return STATUS_CODE_FAILURE;
57 return STATUS_CODE_SUCCESS;
64 unsigned int nPrimaryTwoDHits(0);
74 if (!pPrimaryDaughter || (nTwoDHits > nPrimaryTwoDHits))
76 nPrimaryTwoDHits = nTwoDHits;
77 pPrimaryDaughter = pDaughterPfo;
81 if (!pPrimaryDaughter)
84 PandoraContentApi::ParticleFlowObject::Metadata metadata;
88 metadata.m_particleId = NU_E;
90 else if (MU_MINUS == std::abs(pPrimaryDaughter->
GetParticleId()))
92 metadata.m_particleId = NU_MU;
95 if (metadata.m_particleId.IsInitialized())
107 unsigned int nTwoDHits(0);
115 nTwoDHits += pCluster->GetNCaloHits();
118 nTwoDHits += pCluster->GetNIsolatedCaloHits();
139 return STATUS_CODE_SUCCESS;
Header file for the cluster helper class.
Header file for the pfo helper class.
Header file for the neutrino properties algorithm class.
#define PANDORA_THROW_RESULT_IF_AND_IF(StatusCode1, StatusCode2, Operator, Command)
#define PANDORA_THROW_RESULT_IF(StatusCode1, Operator, Command)
#define PANDORA_RETURN_RESULT_IF_AND_IF(StatusCode1, StatusCode2, Operator, Command)
#define PANDORA_RETURN_RESULT_IF(StatusCode1, Operator, Command)
static pandora::StatusCode Delete(const pandora::Algorithm &algorithm, const T *const pT)
Delete an object from the current list.
static pandora::StatusCode GetList(const pandora::Algorithm &algorithm, const std::string &listName, const T *&pT)
Get a named list.
static const pandora::PandoraSettings * GetSettings(const pandora::Algorithm &algorithm)
Get the pandora settings instance.
static pandora::HitType GetClusterHitType(const pandora::Cluster *const pCluster)
Get the hit type associated with a two dimensional cluster.
static bool IsNeutrino(const pandora::ParticleFlowObject *const pPfo)
Whether a pfo is a neutrino or (antineutrino)
static bool SortByNHits(const pandora::ParticleFlowObject *const pLhs, const pandora::ParticleFlowObject *const pRhs)
Sort pfos by number of constituent hits.
bool m_includeIsolatedHits
Whether to include isolated hits when counting 2d hits in pfo chain.
unsigned int GetNTwoDHitsInPfoChain(const pandora::ParticleFlowObject *const pPfo) const
Get the number of two dimensional hits (TPC_VIEW_U, V or W) contained in clusters in a pfo and all it...
NeutrinoPropertiesAlgorithm()
Default constructor.
void SetNeutrinoId(const pandora::ParticleFlowObject *const pNeutrinoPfo) const
identifying the primary daughter of a neutrino pfo and set the particle id accordingly
std::string m_neutrinoPfoListName
The name of the output neutrino pfo list.
pandora::StatusCode ReadSettings(const pandora::TiXmlHandle xmlHandle)
Read the algorithm settings.
pandora::StatusCode Run()
Run the algorithm.
bool ShouldDisplayAlgorithmInfo() const
Whether to display algorithm information during processing.
ParticleFlowObject class.
const PfoList & GetDaughterPfoList() const
Get the daughter pfo list.
const ClusterList & GetClusterList() const
Get the cluster list.
StatusCode AlterMetadata(const object_creation::ParticleFlowObject::Metadata &metadata)
Alter particle flow object metadata parameters.
int GetParticleId() const
Get the particle flow object id (PDG code)
static float GetParticleMass(const int pdgCode)
Get the mass of a particle type.
static int GetParticleCharge(const int pdgCode)
Get the charge of a particle type.
StatusCodeException class.
static StatusCode ReadValue(const TiXmlHandle &xmlHandle, const std::string &xmlElementName, T &t)
Read a value from an xml element.
HitType
Calorimeter hit type enum.
std::vector< const ParticleFlowObject * > PfoVector
StatusCode
The StatusCode enum.
MANAGED_CONTAINER< const ParticleFlowObject * > PfoList