All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
SimpleBeamParticleId_tool.cc
Go to the documentation of this file.
1 /**
2  * @file larpandora/LArPandoraEventBuilding/LArPandoraSimpleBeamParticleId_tool.cc
3  *
4  * @brief implementation of the lar pandora simple beam particle id tool
5  */
6 
7 #include "art/Utilities/ToolMacros.h"
8 #include "fhiclcpp/ParameterSet.h"
9 
12 
13 namespace lar_pandora
14 {
15 
16 /**
17  * @brief Simple beam particle ID tool that selects the most likely beam particle slice using the scores from Pandora
18  */
20 {
21 public:
22  /**
23  * @brief Default constructor
24  *
25  * @param pset FHiCL parameter set
26  */
27  SimpleBeamParticleId(fhicl::ParameterSet const &pset);
28 
29  /**
30  * @brief Classify slices as neutrino or cosmic
31  *
32  * @param slices the input vector of slices to classify
33  * @param evt the art event
34  */
35  void ClassifySlices(SliceVector &slices, const art::Event &evt) override;
36 
37 private:
38  float m_minBDTScore; ///< The minimum BDT score to select a slice as a beam particle
39 
40 };
41 
42 DEFINE_ART_CLASS_TOOL(SimpleBeamParticleId)
43 
44 } // namespace lar_pandora
45 
46 //------------------------------------------------------------------------------------------------------------------------------------------
47 // implementation follows
48 
49 namespace lar_pandora
50 {
51 
52 SimpleBeamParticleId::SimpleBeamParticleId(fhicl::ParameterSet const &pset) :
53  m_minBDTScore(pset.get<float>("MinBDTScore"))
54 {
55 }
56 
57 //------------------------------------------------------------------------------------------------------------------------------------------
58 
59 void SimpleBeamParticleId::ClassifySlices(SliceVector &slices, const art::Event &/*evt*/)
60 {
61  for (Slice &slice : slices)
62  {
63  if (slice.GetTopologicalScore() > m_minBDTScore)
64  slice.TagAsTarget();
65  }
66 }
67 
68 } // namespace lar_pandora
Abstract base class for a slice ID tool.
header for the lar pandora slice ID base tool
SimpleBeamParticleId(fhicl::ParameterSet const &pset)
Default constructor.
header for the lar pandora slice class
void ClassifySlices(SliceVector &slices, const art::Event &evt) override
Classify slices as neutrino or cosmic.
std::vector< TCSlice > slices
Definition: DataStructs.cxx:13
float m_minBDTScore
The minimum BDT score to select a slice as a beam particle.
Simple beam particle ID tool that selects the most likely beam particle slice using the scores from P...
TCEvent evt
Definition: DataStructs.cxx:8