LArSoft  v09_90_00
Liquid Argon Software toolkit - https://larsoft.org/
DeltaRayMatchingContainers.h
Go to the documentation of this file.
1 
8 #ifndef LAR_DELTA_RAY_MATCHING_CONTAINERS_H
9 #define LAR_DELTA_RAY_MATCHING_CONTAINERS_H 1
10 
11 #include "Pandora/PandoraInternal.h"
12 
14 
15 namespace lar_content
16 {
17 
22 {
23 public:
24  typedef std::map<const pandora::Cluster *, const pandora::ParticleFlowObject *> ClusterToPfoMap;
25  typedef std::map<const pandora::Cluster *, pandora::ClusterList> ClusterProximityMap;
26 
31 
37  const ClusterToPfoMap &GetClusterToPfoMap(const pandora::HitType hitType) const;
38 
44  const ClusterProximityMap &GetClusterProximityMap(const pandora::HitType hitType) const;
45 
54  void FillContainers(const pandora::PfoList &inputPfoList, const pandora::ClusterList &inputClusterList1,
55  const pandora::ClusterList &inputClusterList2 = pandora::ClusterList(),
56  const pandora::ClusterList &inputClusterList3 = pandora::ClusterList());
57 
63  void AddClustersToPfoMaps(const pandora::ParticleFlowObject *const pPfo);
64 
71  void AddClustersToContainers(const pandora::ClusterVector &newClusterVector, const pandora::PfoVector &pfoVector);
72 
78  void RemoveClusterFromContainers(const pandora::Cluster *const pDeletedCluster);
79 
83  void ClearContainers();
84 
86 
87 private:
88  typedef std::map<const pandora::CaloHit *, const pandora::Cluster *> HitToClusterMap;
91  typedef std::vector<HitKDNode2D> HitKDNode2DList;
92 
98  void FillHitToClusterMap(const pandora::ClusterList &inputClusterList);
99 
105  void AddToClusterMap(const pandora::Cluster *const pCluster);
106 
112  void FillClusterToPfoMaps(const pandora::PfoList &pfoList);
113 
119  void FillClusterProximityMap(const pandora::ClusterList &inputClusterList);
120 
126  void BuildKDTree(const pandora::HitType hitType);
127 
133  void AddToClusterProximityMap(const pandora::Cluster *const pCluster);
134 
135  HitToClusterMap m_hitToClusterMapU;
136  HitToClusterMap m_hitToClusterMapV;
137  HitToClusterMap m_hitToClusterMapW;
138  HitKDTree2D m_kdTreeU;
139  HitKDTree2D m_kdTreeV;
140  HitKDTree2D m_kdTreeW;
141  ClusterProximityMap m_clusterProximityMapU;
142  ClusterProximityMap m_clusterProximityMapV;
143  ClusterProximityMap m_clusterProximityMapW;
144  ClusterToPfoMap m_clusterToPfoMapU;
145  ClusterToPfoMap m_clusterToPfoMapV;
146  ClusterToPfoMap m_clusterToPfoMapW;
147 };
148 
149 //------------------------------------------------------------------------------------------------------------------------------------------
150 //------------------------------------------------------------------------------------------------------------------------------------------
151 
153 {
154  return ((hitType == pandora::TPC_VIEW_U) ? m_clusterProximityMapU
155  : (hitType == pandora::TPC_VIEW_V) ? m_clusterProximityMapV
157 }
158 
159 //------------------------------------------------------------------------------------------------------------------------------------------
160 
162 {
163  return ((hitType == pandora::TPC_VIEW_U) ? m_clusterToPfoMapU
164  : (hitType == pandora::TPC_VIEW_V) ? m_clusterToPfoMapV
166 }
167 
168 } // namespace lar_content
169 
170 #endif // #ifndef LAR_DELTA_RAY_MATCHING_CONTAINERS_H
KDTreeLinkerAlgo< const pandora::CaloHit *, 2 > HitKDTree2D
std::map< const pandora::CaloHit *, const pandora::Cluster * > HitToClusterMap
Header file for the kd tree linker algo template class.
HitKDTree2D m_kdTreeW
The KD tree (in the W view)
void FillHitToClusterMap(const pandora::ClusterList &inputClusterList)
Populate the hit to cluster map from a list of clusters.
std::map< const pandora::Cluster *, const pandora::ParticleFlowObject * > ClusterToPfoMap
const ClusterProximityMap & GetClusterProximityMap(const pandora::HitType hitType) const
Get the mapping of clusters to to their neighbouring clusters.
HitKDTree2D m_kdTreeV
The KD tree (in the V view)
HitToClusterMap m_hitToClusterMapW
The mapping of hits to the clusters to which they belong (in the W view)
void AddClustersToPfoMaps(const pandora::ParticleFlowObject *const pPfo)
Add the clusters of a cosmic ray/delta ray pfo to the cluster to pfo maps.
HitToClusterMap m_hitToClusterMapU
The mapping of hits to the clusters to which they belong (in the U view)
void FillContainers(const pandora::PfoList &inputPfoList, const pandora::ClusterList &inputClusterList1, const pandora::ClusterList &inputClusterList2=pandora::ClusterList(), const pandora::ClusterList &inputClusterList3=pandora::ClusterList())
Fill the HitToClusterMap, the ClusterProximityMap and the ClusterToPfoMap in all input views...
ClusterProximityMap m_clusterProximityMapU
The mapping of clusters to their neighbouring clusters (in the U view)
Data stored in each KDTree node. The dim1/dim2 fields are usually the duplication of some PFRecHit va...
void FillClusterProximityMap(const pandora::ClusterList &inputClusterList)
Populate the cluster proximity map from a list of clusters.
KDTreeNodeInfoT< const pandora::CaloHit *, 2 > HitKDNode2D
ClusterProximityMap m_clusterProximityMapV
The mapping of clusters to their neighbouring clusters (in the V view)
void AddClustersToContainers(const pandora::ClusterVector &newClusterVector, const pandora::PfoVector &pfoVector)
Add a list of clusters to the hit to cluster and cluster proximity maps and, if appropriate, to the cluster to pfo map.
ClusterToPfoMap m_clusterToPfoMapU
The mapping of cosmic ray U clusters to the cosmic ray pfos to which they belong. ...
const ClusterToPfoMap & GetClusterToPfoMap(const pandora::HitType hitType) const
Get the mapping of clusters to the pfos to which they belong.
void FillClusterToPfoMaps(const pandora::PfoList &pfoList)
Populate all cluster to pfo maps from a list of particle flow objects.
void AddToClusterMap(const pandora::Cluster *const pCluster)
Add the hits of a given cluster to the hit to cluster map.
void AddToClusterProximityMap(const pandora::Cluster *const pCluster)
Add a cluster to the cluster proximity map.
void BuildKDTree(const pandora::HitType hitType)
Build the KD tree.
ClusterToPfoMap m_clusterToPfoMapW
The mapping of cosmic ray W clusters to the cosmic ray pfos to which they belong. ...
HitKDTree2D m_kdTreeU
The KD tree (in the U view)
std::map< const pandora::Cluster *, pandora::ClusterList > ClusterProximityMap
HitType
Definition: HitType.h:12
HitToClusterMap m_hitToClusterMapV
The mapping of hits to the clusters to which they belong (in the V view)
ClusterProximityMap m_clusterProximityMapW
The mapping of clusters to their neighbouring clusters (in the W view)
std::vector< art::Ptr< recob::Cluster > > ClusterVector
void ClearContainers()
Empty all algorithm containers.
void RemoveClusterFromContainers(const pandora::Cluster *const pDeletedCluster)
Remove an input cluster&#39;s hits from the hit to cluster and cluster proximity maps and...
float m_searchRegion1D
Search region, applied to each dimension, for look-up from kd-tree.
ClusterToPfoMap m_clusterToPfoMapV
The mapping of cosmic ray V clusters to the cosmic ray pfos to which they belong. ...