LArSoft  v09_90_00
Liquid Argon Software toolkit - https://larsoft.org/
SimpleNeutrinoId_tool.cc
Go to the documentation of this file.
1 
9 
12 
13 namespace lar_pandora {
14 
19  public:
26 
33  void ClassifySlices(SliceVector& slices, const art::Event& evt) override;
34  };
35 
37 
38 } // namespace lar_pandora
39 
40 //------------------------------------------------------------------------------------------------------------------------------------------
41 // implementation follows
42 
43 namespace lar_pandora {
44 
46 
47  //------------------------------------------------------------------------------------------------------------------------------------------
48 
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
Abstract base class for a slice ID tool.
#define DEFINE_ART_CLASS_TOOL(tool)
Definition: ToolMacros.h:42
void ClassifySlices(SliceVector &slices, const art::Event &evt) override
Classify slices as neutrino or cosmic.
header for the lar pandora slice ID base tool
std::vector< TCSlice > slices
Definition: DataStructs.cxx:13
std::vector< Slice > SliceVector
Definition: Slice.h:70
header for the lar pandora slice class
SimpleNeutrinoId(fhicl::ParameterSet const &pset)
Default constructor.
TCEvent evt
Definition: DataStructs.cxx:8
Simple neutrino ID tool that selects the most likely neutrino slice using the scores from Pandora...