28 const PfoList *pPfoList(
nullptr);
34 std::cout <<
"CheatingNeutrinoDaughterVerticesAlgorithm: pfo list unavailable." << std::endl;
36 return STATUS_CODE_SUCCESS;
47 return STATUS_CODE_SUCCESS;
72 PfoList::iterator neutrinoIter(std::find(daughterPfos.begin(), daughterPfos.end(), pNeutrinoPfo));
74 if (daughterPfos.end() != neutrinoIter)
75 daughterPfos.erase(neutrinoIter);
99 LArMCParticleHelper::MCRelationMap::const_iterator primaryIter = mcPrimaryMap.find(pMCParticle);
101 if (mcPrimaryMap.end() == primaryIter)
104 pMCParticle = primaryIter->second;
108 std::string vertexListName;
111 PandoraContentApi::Vertex::Parameters parameters;
112 parameters.m_position = pMCParticle->
GetVertex();
116 const Vertex *pVertex(
nullptr);
117 PANDORA_THROW_RESULT_IF(STATUS_CODE_SUCCESS, !=, PandoraContentApi::Vertex::Create(*
this, parameters, pVertex));
119 if (!pVertexList->empty())
142 return STATUS_CODE_SUCCESS;
Header file for the cheating neutrino daughter vertices algorithm class.
Header file for the pfo helper 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 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 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.
void ProcessDaughterPfo(const pandora::ParticleFlowObject *const pDaughterPfo, const LArMCParticleHelper::MCRelationMap &mcPrimaryMap) const
Process a daughter pfo.
pandora::StatusCode ReadSettings(const pandora::TiXmlHandle xmlHandle)
Read the algorithm settings.
void ProcessRecoNeutrinos(const pandora::PfoList &neutrinoPfos, const LArMCParticleHelper::MCRelationMap &mcPrimaryMap) const
Process the list of reconstructed neutrinos.
bool m_collapseToPrimaryMCParticles
Whether to collapse mc particle hierarchies to primary particles.
void GetMCPrimaryMap(LArMCParticleHelper::MCRelationMap &mcPrimaryMap) const
Get the mapping from mc particle to primary, only required if collapsed mc particle hierarchy specifi...
std::string m_neutrinoListName
The input list of pfo list names.
std::string m_vertexListName
The name of the output cosmic-ray vertex list.
std::string m_mcParticleListName
The mc particle list name, required if want to collapse mc particle hierarchy.
pandora::StatusCode Run()
Run the algorithm.
CheatingNeutrinoDaughterVerticesAlgorithm()
Default constructor.
std::unordered_map< const pandora::MCParticle *, const pandora::MCParticle * > MCRelationMap
static void GetMCPrimaryMap(const pandora::MCParticleList *const pMCParticleList, MCRelationMap &mcPrimaryMap)
Get mapping from individual mc particles (in a provided list) and their primary parent mc particles.
static const pandora::MCParticle * GetMainMCParticle(const pandora::ParticleFlowObject *const pPfo)
Find the mc particle making the largest contribution to 2D clusters in a specified pfo.
static void GetAllDownstreamPfos(const pandora::PfoList &inputPfoList, pandora::PfoList &outputPfoList)
Get a flat list of all pfos, recursively, of all daughters associated with those pfos in an input lis...
static void GetRecoNeutrinos(const pandora::PfoList *const pPfoList, pandora::PfoList &recoNeutrinos)
Get neutrino pfos from an input pfo list.
const CartesianVector & GetVertex() const
Get the production vertex of the mc particle, units mm.
bool ShouldDisplayAlgorithmInfo() const
Whether to display algorithm information during processing.
ParticleFlowObject class.
StatusCodeException class.
static StatusCode ReadValue(const TiXmlHandle &xmlHandle, const std::string &xmlElementName, T &t)
Read a value from an xml element.
MANAGED_CONTAINER< const MCParticle * > MCParticleList
MANAGED_CONTAINER< const Vertex * > VertexList
StatusCode
The StatusCode enum.
MANAGED_CONTAINER< const ParticleFlowObject * > PfoList