All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
RecursivePfoMopUpAlgorithm.h
Go to the documentation of this file.
1 /**
2  * @file larpandoracontent/LArTwoDReco/LArClusterMopUp/RecursivePfoMopUpAlgorithm.h
3  *
4  * @brief Header file for the recursive pfo mop up algorithm that runs other algs:
5  * Recusively loop over a series of algorithms until no more changes are made
6  *
7  * $Log: $
8  */
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 
17 /**
18  * @brief RecursivePfoMopUpAlgorithm class
19  */
20 class RecursivePfoMopUpAlgorithm : public pandora::Algorithm
21 {
22 public:
23  /**
24  * @brief Default constructor
25  */
27 
28 private:
29  typedef std::vector<unsigned int> ClusterNumHitsList;
30 
31  /**
32  * @brief PfoMergeStats class: Object to compare PFO before/after merging algs have run to see if anything changed
33  */
35  {
36  public:
37  /**
38  * @brief Constructor
39  *
40  * @param Vector filled with number of hits in each of the PFO's clusters
41  * @param MVA "Track Score" for the PFO
42  */
43  PfoMergeStats(const ClusterNumHitsList &numClusterHits, const float trackScore);
44 
45  const ClusterNumHitsList m_numClusterHits; ///< Vector filled with number of hits in each of the PFO's clusters
46  const float m_trackScore; ///< MVA "Track Score" for the PFO
47  };
48 
49  typedef std::vector<PfoMergeStats> PfoMergeStatsList;
50 
51  /**
52  * @brief Equality comparator for two PfoMergeStats
53  *
54  * @param lhs PfoMergeStats for comparison
55  * @param rhs PfoMergeStats for comparison
56  *
57  * @return boolean if the lhs and rhs are the same
58  */
59  static bool PfoMergeStatsComp(const PfoMergeStats &lhs, const PfoMergeStats &rhs);
60 
61  /**
62  * @brief Get the PfoMergeStats for all of the particles in the event from m_pfoListNames
63  *
64  * @return List of PfoMergeStats for each Pfo
65  */
67 
68  pandora::StatusCode Run();
69  pandora::StatusCode ReadSettings(const pandora::TiXmlHandle xmlHandle);
70 
71  unsigned int m_maxIterations; ///< Maximum number of iterations
72  pandora::StringVector m_pfoListNames; ///< The list of pfo list names
73  pandora::StringVector m_mopUpAlgorithms; ///< Ordered list of mop up algorithms to run
74 };
75 
76 //------------------------------------------------------------------------------------------------------------------------------------------
77 
79 {
80 }
81 
82 //------------------------------------------------------------------------------------------------------------------------------------------
83 
84 inline RecursivePfoMopUpAlgorithm::PfoMergeStats::PfoMergeStats(const ClusterNumHitsList &numClusterHits, const float trackScore) :
85  m_numClusterHits(numClusterHits),
86  m_trackScore(trackScore)
87 {
88 }
89 
90 //------------------------------------------------------------------------------------------------------------------------------------------
91 
94 {
95  return ((lhs.m_numClusterHits == rhs.m_numClusterHits) && (std::abs(lhs.m_trackScore - rhs.m_trackScore) < std::numeric_limits<float>::epsilon()));
96 }
97 
98 } // namespace lar_content
99 
100 #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...
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 &quot;Track Score&quot; for the PFO.
T abs(T value)
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.