LArSoft  v07_13_02
Liquid Argon Software toolkit - http://larsoft.org/
SimpleNeutrinoId_tool.cc
Go to the documentation of this file.
1 
9 
12 
13 namespace lar_pandora
14 {
15 
20 {
21 public:
28 
35  void ClassifySlices(SliceVector &slices, const art::Event &evt) override;
36 };
37 
39 
40 } // namespace lar_pandora
41 
42 //------------------------------------------------------------------------------------------------------------------------------------------
43 // implementation follows
44 
45 namespace lar_pandora
46 {
47 
49 {
50 }
51 
52 //------------------------------------------------------------------------------------------------------------------------------------------
53 
55 {
56  if (slices.empty()) return;
57 
58  // Find the most probable slice
59  float highestNuScore(-std::numeric_limits<float>::max());
60  unsigned int mostProbableSliceIndex(std::numeric_limits<unsigned int>::max());
61 
62  for (unsigned int sliceIndex = 0; sliceIndex < slices.size(); ++sliceIndex)
63  {
64  const float nuScore(slices.at(sliceIndex).GetNeutrinoScore());
65  std::cout << "Slice " << sliceIndex << " - " << nuScore << std::endl;
66  if (nuScore > highestNuScore)
67  {
68  highestNuScore = nuScore;
69  mostProbableSliceIndex = sliceIndex;
70  }
71  }
72 
73  std::cout << "Tagging slice " << mostProbableSliceIndex << std::endl;
74 
75  // Tag the most probable slice as a neutrino
76  slices.at(mostProbableSliceIndex).TagAsNeutrino();
77 }
78 
79 } // namespace lar_pandora
#define DEFINE_ART_CLASS_TOOL(tool)
Definition: ToolMacros.h:45
header for the lar pandora slice class
void ClassifySlices(SliceVector &slices, const art::Event &evt) override
Classify slices as neutrino or cosmic.
Abstract base class for a neutrino ID tool.
Int_t max
Definition: plot.C:27
std::vector< TCSlice > slices
Definition: DataStructs.cxx:10
std::vector< Slice > SliceVector
Definition: Slice.h:68
SimpleNeutrinoId(fhicl::ParameterSet const &pset)
Default constructor.
TCEvent evt
Definition: DataStructs.cxx:5
Simple neutrino ID tool that selects the most likely neutrino slice using the scores from Pandora...