TwoViewMatchingControl.h
Go to the documentation of this file.
1 /**
2  * @file larpandoracontent/LArThreeDReco/LArThreeDBase/TwoViewMatchingControl.h
3  *
4  * @brief Header file for the two view matching control class.
5  *
6  * $Log: $
7  */
8 #ifndef LAR_TWO_VIEW_MATCHING_CONTROL_H
9 #define LAR_TWO_VIEW_MATCHING_CONTROL_H 1
10 
12 
14 
15 #include <unordered_map>
16 
17 namespace lar_content
18 {
19 
20 /**
21  * @brief TwoViewMatchingControl class
22  */
23 template <typename T>
25 {
26 public:
28 
29  /**
30  * @brief Constructor
31  *
32  * @param pAlgorithm address of the matching base algorithm
33  */
35 
36  /**
37  * @brief Destructor
38  */
39  virtual ~TwoViewMatchingControl();
40 
41  /**
42  * @brief Get the overlap matrix
43  *
44  * @return the overlap matrix
45  */
46  MatrixType &GetOverlapMatrix();
47 
48  /**
49  * @brief Get the index of an input hit type returning 0 if not found in map
50  *
51  * @return the hit type index
52  */
53  unsigned int GetHitTypeIndex(const pandora::HitType hitType);
54 
55 private:
56  void UpdateForNewCluster(const pandora::Cluster *const pNewCluster);
57  void UpdateUponDeletion(const pandora::Cluster *const pDeletedCluster);
58  const std::string &GetClusterListName(const pandora::HitType hitType) const;
59  const pandora::ClusterList &GetInputClusterList(const pandora::HitType hitType) const;
60  const pandora::ClusterList &GetSelectedClusterList(const pandora::HitType hitType) const;
63  void PerformMainLoop();
64  void TidyUp();
65  pandora::StatusCode ReadSettings(const pandora::TiXmlHandle xmlHandle);
66 
67  const pandora::ClusterList *m_pInputClusterList1; ///< Address of the input cluster list 1
68  const pandora::ClusterList *m_pInputClusterList2; ///< Address of the input cluster list 2
69 
70  pandora::ClusterList m_clusterList1; ///< The selected modified cluster list 1
71  pandora::ClusterList m_clusterList2; ///< The selected modified cluster list 2
72 
73  MatrixType m_overlapMatrix; ///< The overlap matrix
74 
75  typedef std::unordered_map<pandora::HitType, unsigned int, std::hash<int>> HitTypeToIndexMap;
76  HitTypeToIndexMap m_hitTypeToIndexMap; ///< The hit type to index map
77 
78  std::string m_inputClusterListName1; ///< The name of the view 1 cluster list
79  std::string m_inputClusterListName2; ///< The name of the view 2 cluster list
80 
81  template <typename U>
82  friend class NViewMatchingAlgorithm;
83 };
84 
85 } // namespace lar_content
86 
87 #endif // #ifndef LAR_TWO_VIEW_MATCHING_CONTROL_H
void UpdateForNewCluster(const pandora::Cluster *const pNewCluster)
Update to reflect addition of a new cluster to the problem space.
NViewMatchingAlgorithm class.
TwoViewMatchingControl class.
const std::string & GetClusterListName(const pandora::HitType hitType) const
Get the cluster list name corresponding to a specified hit type.
NViewMatchingControl class.
enum cvn::HType HitType
std::string string
Definition: nybbler.cc:12
pandora::ClusterList m_clusterList1
The selected modified cluster list 1.
void TidyUp()
Tidy member variables.
MatrixType & GetOverlapMatrix()
Get the overlap matrix.
void UpdateUponDeletion(const pandora::Cluster *const pDeletedCluster)
Update to reflect cluster deletion.
MatchingBaseAlgorithm class.
void SelectAllInputClusters()
Select a subset of input clusters for processing in this algorithm.
std::string m_inputClusterListName2
The name of the view 2 cluster list.
Header file for the matching control class.
const pandora::ClusterList & GetInputClusterList(const pandora::HitType hitType) const
Get the input cluster list corresponding to a specified hit type.
std::unordered_map< pandora::HitType, unsigned int, std::hash< int > > HitTypeToIndexMap
MatrixType m_overlapMatrix
The overlap matrix.
const pandora::ClusterList * m_pInputClusterList1
Address of the input cluster list 1.
pandora::StatusCode ReadSettings(const pandora::TiXmlHandle xmlHandle)
Read settings from xml.
pandora::ClusterList m_clusterList2
The selected modified cluster list 2.
HitTypeToIndexMap m_hitTypeToIndexMap
The hit type to index map.
Header file for the lar overlap matrix class.
TwoViewMatchingControl(MatchingBaseAlgorithm *const pAlgorithm)
Constructor.
void PrepareAllInputClusters()
Perform any preparatory steps required on the input clusters, e.g. caching expensive fit results...
unsigned int GetHitTypeIndex(const pandora::HitType hitType)
Get the index of an input hit type returning 0 if not found in map.
const pandora::ClusterList & GetSelectedClusterList(const pandora::HitType hitType) const
Get the selected cluster list corresponding to a specified hit type.
std::string m_inputClusterListName1
The name of the view 1 cluster list.
void PerformMainLoop()
Main loop over cluster combinations in order to populate the overlap container. Responsible for calli...
const pandora::ClusterList * m_pInputClusterList2
Address of the input cluster list 2.
OverlapMatrix class.