Pandora
Pandora source code navigator
Loading...
Searching...
No Matches
SimpleNeutrinoId_tool.cc
Go to the documentation of this file.
1
7#include "art/Utilities/ToolMacros.h"
8#include "fhiclcpp/ParameterSet.h"
9
12
13namespace lar_pandora {
14
19 public:
25 SimpleNeutrinoId(fhicl::ParameterSet const& pset);
26
33 void ClassifySlices(SliceVector& slices, const art::Event& evt) override;
34 };
35
36 DEFINE_ART_CLASS_TOOL(SimpleNeutrinoId)
37
38} // namespace lar_pandora
39
40//------------------------------------------------------------------------------------------------------------------------------------------
41// implementation follows
42
43namespace lar_pandora {
44
45 SimpleNeutrinoId::SimpleNeutrinoId(fhicl::ParameterSet const& /*pset*/) {}
46
47 //------------------------------------------------------------------------------------------------------------------------------------------
48
49 void SimpleNeutrinoId::ClassifySlices(SliceVector& slices, const art::Event& /*evt*/)
50 {
51 if (slices.empty()) return;
52
53 // Find the most probable slice
54 float highestNuScore(-std::numeric_limits<float>::max());
55 unsigned int mostProbableSliceIndex(std::numeric_limits<unsigned int>::max());
56
57 for (unsigned int sliceIndex = 0; sliceIndex < slices.size(); ++sliceIndex) {
58 const float nuScore(slices.at(sliceIndex).GetTopologicalScore());
59 if (nuScore > highestNuScore) {
60 highestNuScore = nuScore;
61 mostProbableSliceIndex = sliceIndex;
62 }
63 }
64
65 // Tag the most probable slice as a neutrino
66 slices.at(mostProbableSliceIndex).TagAsTarget();
67 }
68
69} // namespace lar_pandora
header for the lar pandora slice class
header for the lar pandora slice ID base tool
Simple neutrino ID tool that selects the most likely neutrino slice using the scores from Pandora.
SimpleNeutrinoId(fhicl::ParameterSet const &pset)
Default constructor.
void ClassifySlices(SliceVector &slices, const art::Event &evt) override
Classify slices as neutrino or cosmic.
Abstract base class for a slice ID tool.
std::vector< Slice > SliceVector
Definition Slice.h:70