9 #include "Pandora/AlgorithmHeaders.h" 18 SimpleNeutrinoIdTool::SimpleNeutrinoIdTool() :
19 m_selectAllNeutrinos(true),
20 m_selectOnlyFirstSliceNeutrinos(false)
29 if (nuSliceHypotheses.size() != crSliceHypotheses.size())
30 throw StatusCodeException(STATUS_CODE_INVALID_PARAMETER);
32 for (
unsigned int sliceIndex = 0, nSlices = nuSliceHypotheses.size(); sliceIndex < nSlices; ++sliceIndex)
35 ? nuSliceHypotheses.at(sliceIndex)
36 : crSliceHypotheses.at(sliceIndex));
40 for (
const ParticleFlowObject *
const pPfo : crSliceHypotheses.at(sliceIndex))
42 object_creation::ParticleFlowObject::Metadata metadata;
43 metadata.m_propertiesToAdd[
"NuScore"] = score;
44 PANDORA_THROW_RESULT_IF(STATUS_CODE_SUCCESS, !=, PandoraContentApi::ParticleFlowObject::AlterMetadata(*pAlgorithm, pPfo, metadata));
47 for (
const ParticleFlowObject *
const pPfo : nuSliceHypotheses.at(sliceIndex))
49 object_creation::ParticleFlowObject::Metadata metadata;
50 metadata.m_propertiesToAdd[
"NuScore"] = score;
51 PANDORA_THROW_RESULT_IF(STATUS_CODE_SUCCESS, !=, PandoraContentApi::ParticleFlowObject::AlterMetadata(*pAlgorithm, pPfo, metadata));
54 selectedPfos.insert(selectedPfos.end(), sliceOutput.begin(), sliceOutput.end());
62 PANDORA_RETURN_RESULT_IF_AND_IF(
63 STATUS_CODE_SUCCESS, STATUS_CODE_NOT_FOUND, !=, XmlHelper::ReadValue(xmlHandle,
"SelectAllNeutrinos",
m_selectAllNeutrinos));
65 PANDORA_RETURN_RESULT_IF_AND_IF(STATUS_CODE_SUCCESS, STATUS_CODE_NOT_FOUND, !=,
70 std::cout <<
"SimpleNeutrinoIdTool::ReadSettings - exactly one of SelectAllNeutrinos and SelectOnlyFirstSliceNeutrinos must be true" 72 return STATUS_CODE_INVALID_PARAMETER;
75 return STATUS_CODE_SUCCESS;
std::vector< pandora::PfoList > SliceHypotheses
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.
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)