LArSoft  v09_90_00
Liquid Argon Software toolkit - https://larsoft.org/
RecursivePfoMopUpAlgorithm.h
Go to the documentation of this file.
1 
9 #ifndef LAR_RECURSIVE_PFO_MOP_UP_ALGORITHM_H
10 #define LAR_RECURSIVE_PFO_MOP_UP_ALGORITHM_H 1
11 
12 #include "Pandora/Algorithm.h"
13 
14 namespace lar_content
15 {
16 
20 class RecursivePfoMopUpAlgorithm : public pandora::Algorithm
21 {
22 public:
27 
28 private:
29  typedef std::vector<unsigned int> ClusterNumHitsList;
30 
35  {
36  public:
43  PfoMergeStats(const ClusterNumHitsList &numClusterHits, const float trackScore);
44 
45  const ClusterNumHitsList m_numClusterHits;
46  const float m_trackScore;
47  };
48 
49  typedef std::vector<PfoMergeStats> PfoMergeStatsList;
50 
59  static bool PfoMergeStatsComp(const PfoMergeStats &lhs, const PfoMergeStats &rhs);
60 
66  PfoMergeStatsList GetPfoMergeStats() const;
67 
68  pandora::StatusCode Run();
69  pandora::StatusCode ReadSettings(const pandora::TiXmlHandle xmlHandle);
70 
71  unsigned int m_maxIterations;
72  pandora::StringVector m_pfoListNames;
73  pandora::StringVector m_mopUpAlgorithms;
74 };
75 
76 //------------------------------------------------------------------------------------------------------------------------------------------
77 
79  m_maxIterations(10)
80 {
81 }
82 
83 //------------------------------------------------------------------------------------------------------------------------------------------
84 
85 inline RecursivePfoMopUpAlgorithm::PfoMergeStats::PfoMergeStats(const ClusterNumHitsList &numClusterHits, const float trackScore) :
86  m_numClusterHits(numClusterHits),
87  m_trackScore(trackScore)
88 {
89 }
90 
91 //------------------------------------------------------------------------------------------------------------------------------------------
92 
95 {
96  return ((lhs.m_numClusterHits == rhs.m_numClusterHits) && (std::abs(lhs.m_trackScore - rhs.m_trackScore) < std::numeric_limits<float>::epsilon()));
97 }
98 
99 } // namespace lar_content
100 
101 #endif // #ifndef LAR_RECURSIVE_PFO_MOP_UP_ALGORITHM_H
pandora::StringVector m_pfoListNames
The list of pfo list names.
PfoMergeStats(const ClusterNumHitsList &numClusterHits, const float trackScore)
Constructor.
unsigned int m_maxIterations
Maximum number of iterations.
PfoMergeStats class: Object to compare PFO before/after merging algs have run to see if anything chan...
constexpr auto abs(T v)
Returns the absolute value of the argument.
PfoMergeStatsList GetPfoMergeStats() const
Get the PfoMergeStats for all of the particles in the event from m_pfoListNames.
static bool PfoMergeStatsComp(const PfoMergeStats &lhs, const PfoMergeStats &rhs)
Equality comparator for two PfoMergeStats.
const float m_trackScore
MVA "Track Score" for the PFO.
pandora::StatusCode ReadSettings(const pandora::TiXmlHandle xmlHandle)
const ClusterNumHitsList m_numClusterHits
Vector filled with number of hits in each of the PFO&#39;s clusters.
pandora::StringVector m_mopUpAlgorithms
Ordered list of mop up algorithms to run.