All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
Public Member Functions | List of all members
lar_pandora::SimpleNeutrinoId Class Reference

Simple neutrino ID tool that selects the most likely neutrino slice using the scores from Pandora. More...

Inheritance diagram for lar_pandora::SimpleNeutrinoId:
lar_pandora::SliceIdBaseTool

Public Member Functions

 SimpleNeutrinoId (fhicl::ParameterSet const &pset)
 Default constructor. More...
 
void ClassifySlices (SliceVector &slices, const art::Event &evt) override
 Classify slices as neutrino or cosmic. More...
 

Additional Inherited Members

- Private Member Functions inherited from lar_pandora::SliceIdBaseTool
virtual ~SliceIdBaseTool () noexcept=default
 

Detailed Description

Simple neutrino ID tool that selects the most likely neutrino slice using the scores from Pandora.

Definition at line 19 of file SimpleNeutrinoId_tool.cc.

Constructor & Destructor Documentation

lar_pandora::SimpleNeutrinoId::SimpleNeutrinoId ( fhicl::ParameterSet const &  pset)

Default constructor.

Parameters
psetFHiCL parameter set

Definition at line 48 of file SimpleNeutrinoId_tool.cc.

49 {
50 }

Member Function Documentation

void lar_pandora::SimpleNeutrinoId::ClassifySlices ( SliceVector slices,
const art::Event &  evt 
)
overridevirtual

Classify slices as neutrino or cosmic.

Parameters
slicesthe input vector of slices to classify
evtthe art event

Implements lar_pandora::SliceIdBaseTool.

Definition at line 54 of file SimpleNeutrinoId_tool.cc.

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).GetTopologicalScore());
65  if (nuScore > highestNuScore)
66  {
67  highestNuScore = nuScore;
68  mostProbableSliceIndex = sliceIndex;
69  }
70  }
71 
72  // Tag the most probable slice as a neutrino
73  slices.at(mostProbableSliceIndex).TagAsTarget();
74 }
std::vector< TCSlice > slices
Definition: DataStructs.cxx:13

The documentation for this class was generated from the following file: