9 #include "Pandora/AlgorithmHeaders.h" 18 SimpleNeutrinoIdTool::SimpleNeutrinoIdTool() :
19 m_selectAllNeutrinos(true),
20 m_selectOnlyFirstSliceNeutrinos(false)
28 if (nuSliceHypotheses.size() != crSliceHypotheses.size())
29 throw StatusCodeException(STATUS_CODE_INVALID_PARAMETER);
31 for (
unsigned int sliceIndex = 0, nSlices = nuSliceHypotheses.size(); sliceIndex < nSlices; ++sliceIndex)
34 nuSliceHypotheses.at(sliceIndex) : 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(STATUS_CODE_SUCCESS, STATUS_CODE_NOT_FOUND, !=, XmlHelper::ReadValue(xmlHandle,
63 PANDORA_RETURN_RESULT_IF_AND_IF(STATUS_CODE_SUCCESS, STATUS_CODE_NOT_FOUND, !=, XmlHelper::ReadValue(xmlHandle,
68 std::cout <<
"SimpleNeutrinoIdTool::ReadSettings - exactly one of SelectAllNeutrinos and SelectOnlyFirstSliceNeutrinos must be true" << std::endl;
69 return STATUS_CODE_INVALID_PARAMETER;
72 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)