Select which reconstruction hypotheses to use; neutrino outcomes or cosmic-ray muon outcomes for each slice.
23 if (nuSliceHypotheses.size() != crSliceHypotheses.size())
24 throw StatusCodeException(STATUS_CODE_INVALID_PARAMETER);
26 float bestNeutrinoWeight(0.
f);
29 for (
unsigned int sliceIndex = 0, nSlices = nuSliceHypotheses.size(); sliceIndex < nSlices; ++sliceIndex)
31 float neutrinoWeight(0.
f);
32 const PfoList &neutrinoPfoList(nuSliceHypotheses.at(sliceIndex));
34 for (
const Pfo *
const pNeutrinoPfo : neutrinoPfoList)
37 throw StatusCodeException(STATUS_CODE_INVALID_PARAMETER);
39 PfoList downstreamPfos;
42 float thisNeutrinoWeight(0.
f), thisTotalWeight(0.
f);
44 neutrinoWeight += thisNeutrinoWeight;
47 if (neutrinoWeight > bestNeutrinoWeight)
49 bestNeutrinoWeight = neutrinoWeight;
50 bestSliceIndex = sliceIndex;
54 for (
unsigned int sliceIndex = 0, nSlices = nuSliceHypotheses.size(); sliceIndex < nSlices; ++sliceIndex)
56 const PfoList &sliceOutput((bestSliceIndex == sliceIndex) ? nuSliceHypotheses.at(sliceIndex) : crSliceHypotheses.at(sliceIndex));
57 selectedPfos.insert(selectedPfos.end(), sliceOutput.begin(), sliceOutput.end());
static bool IsNeutrino(const pandora::ParticleFlowObject *const pPfo)
Whether a pfo is a neutrino or (antineutrino)
static void GetTargetParticleWeight(const pandora::PfoList *const pPfoList, float &targetParticleWeight, float &totalWeight, std::function< bool(const pandora::MCParticle *const)> fCriteria)
Get the target particle weight in a list of pfos.
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 bool IsNeutrino(const pandora::MCParticle *const pMCParticle)
Whether a mc particle is a neutrino or antineutrino.