9 #include "Pandora/AlgorithmHeaders.h" 18 SimpleNeutrinoIdTool::SimpleNeutrinoIdTool() : m_selectAllNeutrinos(true), m_selectOnlyFirstSliceNeutrinos(false)
27 if (nuSliceHypotheses.size() != crSliceHypotheses.size())
28 throw StatusCodeException(STATUS_CODE_INVALID_PARAMETER);
30 for (
unsigned int sliceIndex = 0, nSlices = nuSliceHypotheses.size(); sliceIndex < nSlices; ++sliceIndex)
33 ? nuSliceHypotheses.at(sliceIndex)
34 : crSliceHypotheses.at(sliceIndex));
38 for (
const ParticleFlowObject *
const pPfo : crSliceHypotheses.at(sliceIndex))
40 object_creation::ParticleFlowObject::Metadata
metadata;
41 metadata.m_propertiesToAdd[
"NuScore"] =
score;
42 PANDORA_THROW_RESULT_IF(STATUS_CODE_SUCCESS, !=, PandoraContentApi::ParticleFlowObject::AlterMetadata(*pAlgorithm, pPfo, metadata));
45 for (
const ParticleFlowObject *
const pPfo : nuSliceHypotheses.at(sliceIndex))
47 object_creation::ParticleFlowObject::Metadata
metadata;
48 metadata.m_propertiesToAdd[
"NuScore"] =
score;
49 PANDORA_THROW_RESULT_IF(STATUS_CODE_SUCCESS, !=, PandoraContentApi::ParticleFlowObject::AlterMetadata(*pAlgorithm, pPfo, metadata));
52 selectedPfos.insert(selectedPfos.end(), sliceOutput.begin(), sliceOutput.end());
60 PANDORA_RETURN_RESULT_IF_AND_IF(
61 STATUS_CODE_SUCCESS, STATUS_CODE_NOT_FOUND, !=, XmlHelper::ReadValue(xmlHandle,
"SelectAllNeutrinos",
m_selectAllNeutrinos));
63 PANDORA_RETURN_RESULT_IF_AND_IF(STATUS_CODE_SUCCESS, STATUS_CODE_NOT_FOUND, !=,
68 std::cout <<
"SimpleNeutrinoIdTool::ReadSettings - exactly one of SelectAllNeutrinos and SelectOnlyFirstSliceNeutrinos must be true" 70 return STATUS_CODE_INVALID_PARAMETER;
73 return STATUS_CODE_SUCCESS;
bool m_selectOnlyFirstSliceNeutrinos
First approach: select first slice neutrinos, cosmics for all subsequent slices.
bool m_selectAllNeutrinos
First approach: select all neutrinos, as opposed to selecting all cosmics.
std::vector< pandora::PfoList > SliceHypotheses
void SelectOutputPfos(const pandora::Algorithm *const pAlgorithm, const SliceHypotheses &nuSliceHypotheses, const SliceHypotheses &crSliceHypotheses, pandora::PfoList &selectedPfos)
Select which reconstruction hypotheses to use; neutrino outcomes or cosmic-ray muon outcomes for each...
pandora::StatusCode ReadSettings(const pandora::TiXmlHandle xmlHandle)
QTextStream & endl(QTextStream &s)