9 #include "Pandora/AlgorithmHeaders.h" 21 void CheatingNeutrinoIdTool::SelectOutputPfos(
const pandora::Algorithm *
const ,
const SliceHypotheses &nuSliceHypotheses,
24 if (nuSliceHypotheses.size() != crSliceHypotheses.size())
25 throw StatusCodeException(STATUS_CODE_INVALID_PARAMETER);
27 float bestNeutrinoWeight(0.
f);
28 unsigned int bestSliceIndex(std::numeric_limits<unsigned int>::max());
30 for (
unsigned int sliceIndex = 0, nSlices = nuSliceHypotheses.size(); sliceIndex < nSlices; ++sliceIndex)
32 float neutrinoWeight(0.
f);
33 const PfoList &neutrinoPfoList(nuSliceHypotheses.at(sliceIndex));
35 for (
const Pfo *
const pNeutrinoPfo : neutrinoPfoList)
37 if (!LArPfoHelper::IsNeutrino(pNeutrinoPfo))
38 throw StatusCodeException(STATUS_CODE_INVALID_PARAMETER);
40 PfoList downstreamPfos;
41 LArPfoHelper::GetAllDownstreamPfos(pNeutrinoPfo, downstreamPfos);
43 float thisNeutrinoWeight(0.
f), thisTotalWeight(0.
f);
44 CheatingSliceIdBaseTool::GetTargetParticleWeight(&downstreamPfos, thisNeutrinoWeight, thisTotalWeight, LArMCParticleHelper::IsNeutrino);
45 neutrinoWeight += thisNeutrinoWeight;
48 if (neutrinoWeight > bestNeutrinoWeight)
50 bestNeutrinoWeight = neutrinoWeight;
51 bestSliceIndex = sliceIndex;
55 for (
unsigned int sliceIndex = 0, nSlices = nuSliceHypotheses.size(); sliceIndex < nSlices; ++sliceIndex)
57 const PfoList &sliceOutput((bestSliceIndex == sliceIndex) ? nuSliceHypotheses.at(sliceIndex) : crSliceHypotheses.at(sliceIndex));
58 selectedPfos.insert(selectedPfos.end(), sliceOutput.begin(), sliceOutput.end());
64 StatusCode CheatingNeutrinoIdTool::ReadSettings(
const TiXmlHandle )
66 return STATUS_CODE_SUCCESS;
std::vector< pandora::PfoList > SliceHypotheses
Header file for the pfo helper class.
Header file for the lar monte carlo particle helper helper class.