LArSoft  v09_90_00
Liquid Argon Software toolkit - https://larsoft.org/
lar_content::DeltaRayMatchingContainers Class Reference

DeltaRayMatchingContainers class. More...

#include "DeltaRayMatchingContainers.h"

Public Types

typedef std::map< const pandora::Cluster *, const pandora::ParticleFlowObject * > ClusterToPfoMap
 
typedef std::map< const pandora::Cluster *, pandora::ClusterList > ClusterProximityMap
 

Public Member Functions

 DeltaRayMatchingContainers ()
 Default constructor. More...
 
const ClusterToPfoMapGetClusterToPfoMap (const pandora::HitType hitType) const
 Get the mapping of clusters to the pfos to which they belong. More...
 
const ClusterProximityMapGetClusterProximityMap (const pandora::HitType hitType) const
 Get the mapping of clusters to to their neighbouring clusters. More...
 
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. More...
 
void AddClustersToPfoMaps (const pandora::ParticleFlowObject *const pPfo)
 Add the clusters of a cosmic ray/delta ray pfo to the cluster to pfo maps. More...
 
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. More...
 
void RemoveClusterFromContainers (const pandora::Cluster *const pDeletedCluster)
 Remove an input cluster's hits from the hit to cluster and cluster proximity maps and, if appropriate, from the cluster to pfo map. More...
 
void ClearContainers ()
 Empty all algorithm containers. More...
 

Public Attributes

float m_searchRegion1D
 Search region, applied to each dimension, for look-up from kd-tree. More...
 

Private Types

typedef std::map< const pandora::CaloHit *, const pandora::Cluster * > HitToClusterMap
 
typedef KDTreeLinkerAlgo< const pandora::CaloHit *, 2 > HitKDTree2D
 
typedef KDTreeNodeInfoT< const pandora::CaloHit *, 2 > HitKDNode2D
 
typedef std::vector< HitKDNode2DHitKDNode2DList
 

Private Member Functions

void FillHitToClusterMap (const pandora::ClusterList &inputClusterList)
 Populate the hit to cluster map from a list of clusters. More...
 
void AddToClusterMap (const pandora::Cluster *const pCluster)
 Add the hits of a given cluster to the hit to cluster map. More...
 
void FillClusterToPfoMaps (const pandora::PfoList &pfoList)
 Populate all cluster to pfo maps from a list of particle flow objects. More...
 
void FillClusterProximityMap (const pandora::ClusterList &inputClusterList)
 Populate the cluster proximity map from a list of clusters. More...
 
void BuildKDTree (const pandora::HitType hitType)
 Build the KD tree. More...
 
void AddToClusterProximityMap (const pandora::Cluster *const pCluster)
 Add a cluster to the cluster proximity map. More...
 

Private Attributes

HitToClusterMap m_hitToClusterMapU
 The mapping of hits to the clusters to which they belong (in the U view) More...
 
HitToClusterMap m_hitToClusterMapV
 The mapping of hits to the clusters to which they belong (in the V view) More...
 
HitToClusterMap m_hitToClusterMapW
 The mapping of hits to the clusters to which they belong (in the W view) More...
 
HitKDTree2D m_kdTreeU
 The KD tree (in the U view) More...
 
HitKDTree2D m_kdTreeV
 The KD tree (in the V view) More...
 
HitKDTree2D m_kdTreeW
 The KD tree (in the W view) More...
 
ClusterProximityMap m_clusterProximityMapU
 The mapping of clusters to their neighbouring clusters (in the U view) More...
 
ClusterProximityMap m_clusterProximityMapV
 The mapping of clusters to their neighbouring clusters (in the V view) More...
 
ClusterProximityMap m_clusterProximityMapW
 The mapping of clusters to their neighbouring clusters (in the W view) More...
 
ClusterToPfoMap m_clusterToPfoMapU
 The mapping of cosmic ray U clusters to the cosmic ray pfos to which they belong. More...
 
ClusterToPfoMap m_clusterToPfoMapV
 The mapping of cosmic ray V clusters to the cosmic ray pfos to which they belong. More...
 
ClusterToPfoMap m_clusterToPfoMapW
 The mapping of cosmic ray W clusters to the cosmic ray pfos to which they belong. More...
 

Detailed Description

DeltaRayMatchingContainers class.

Definition at line 21 of file DeltaRayMatchingContainers.h.

Member Typedef Documentation

typedef std::map<const pandora::Cluster *, pandora::ClusterList> lar_content::DeltaRayMatchingContainers::ClusterProximityMap

Definition at line 25 of file DeltaRayMatchingContainers.h.

typedef std::map<const pandora::Cluster *, const pandora::ParticleFlowObject *> lar_content::DeltaRayMatchingContainers::ClusterToPfoMap

Definition at line 24 of file DeltaRayMatchingContainers.h.

typedef KDTreeNodeInfoT<const pandora::CaloHit *, 2> lar_content::DeltaRayMatchingContainers::HitKDNode2D
private

Definition at line 90 of file DeltaRayMatchingContainers.h.

typedef KDTreeLinkerAlgo<const pandora::CaloHit *, 2> lar_content::DeltaRayMatchingContainers::HitKDTree2D
private

Definition at line 89 of file DeltaRayMatchingContainers.h.

typedef std::map<const pandora::CaloHit *, const pandora::Cluster *> lar_content::DeltaRayMatchingContainers::HitToClusterMap
private

Definition at line 88 of file DeltaRayMatchingContainers.h.

Constructor & Destructor Documentation

lar_content::DeltaRayMatchingContainers::DeltaRayMatchingContainers ( )

Default constructor.

Definition at line 23 of file DeltaRayMatchingContainers.cc.

23  :
25 {
26 }
TFile f
Definition: plotHisto.C:6
float m_searchRegion1D
Search region, applied to each dimension, for look-up from kd-tree.

Member Function Documentation

void lar_content::DeltaRayMatchingContainers::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.

Parameters
newClusterVectorthe ordered cluster vector
pfoVectorthe matching ordered vector of pfos to which the clusters belong (nullptr if not applicable)

Definition at line 179 of file DeltaRayMatchingContainers.cc.

References AddClustersToPfoMaps(), AddToClusterMap(), and AddToClusterProximityMap().

Referenced by lar_content::NViewDeltaRayMatchingAlgorithm< T >::AddInStrayClusters(), lar_content::OneViewDeltaRayMatchingAlgorithm::MergeClusterGroup(), and lar_content::NViewDeltaRayMatchingAlgorithm< T >::UpdateForNewClusters().

180 {
181  for (const Cluster *const pNewCluster : newClusterVector)
182  this->AddToClusterMap(pNewCluster);
183 
184  for (unsigned int i = 0; i < newClusterVector.size(); i++)
185  {
186  const Cluster *const pNewCluster(newClusterVector.at(i));
187  const ParticleFlowObject *const pMuonPfo(pfoVector.at(i));
188 
189  this->AddToClusterProximityMap(pNewCluster);
190 
191  if (pMuonPfo)
192  this->AddClustersToPfoMaps(pMuonPfo);
193  }
194 }
void AddClustersToPfoMaps(const pandora::ParticleFlowObject *const pPfo)
Add the clusters of a cosmic ray/delta ray pfo to the cluster to pfo maps.
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 lar_content::DeltaRayMatchingContainers::AddClustersToPfoMaps ( const pandora::ParticleFlowObject *const  pPfo)

Add the clusters of a cosmic ray/delta ray pfo to the cluster to pfo maps.

Parameters
theaddress of the input cosmic ray/delta ray pfo

Definition at line 156 of file DeltaRayMatchingContainers.cc.

References lar_content::LArPfoHelper::GetClusters(), m_clusterToPfoMapU, m_clusterToPfoMapV, and m_clusterToPfoMapW.

Referenced by AddClustersToContainers(), lar_content::OneViewDeltaRayMatchingAlgorithm::AddIntoExistingDeltaRay(), lar_content::OneViewDeltaRayMatchingAlgorithm::CreatePfo(), and FillClusterToPfoMaps().

157 {
158  for (const HitType hitType : {TPC_VIEW_U, TPC_VIEW_V, TPC_VIEW_W})
159  {
160  ClusterList pfoClusters;
161  LArPfoHelper::GetClusters(pPfo, hitType, pfoClusters);
162 
163  ClusterToPfoMap &clusterToPfoMap((hitType == TPC_VIEW_U) ? m_clusterToPfoMapU
164  : (hitType == TPC_VIEW_V) ? m_clusterToPfoMapV
166 
167  for (const Cluster *const pCluster : pfoClusters)
168  {
169  if (clusterToPfoMap.find(pCluster) != clusterToPfoMap.end())
170  continue;
171 
172  clusterToPfoMap[pCluster] = pPfo;
173  }
174  }
175 }
std::map< const pandora::Cluster *, const pandora::ParticleFlowObject * > ClusterToPfoMap
static void GetClusters(const pandora::PfoList &pfoList, const pandora::HitType &hitType, pandora::ClusterList &clusterList)
Get a list of clusters of a particular hit type from a list of pfos.
ClusterToPfoMap m_clusterToPfoMapU
The mapping of cosmic ray U clusters to the cosmic ray pfos to which they belong. ...
ClusterToPfoMap m_clusterToPfoMapW
The mapping of cosmic ray W clusters to the cosmic ray pfos to which they belong. ...
HitType
Definition: HitType.h:12
ClusterToPfoMap m_clusterToPfoMapV
The mapping of cosmic ray V clusters to the cosmic ray pfos to which they belong. ...
void lar_content::DeltaRayMatchingContainers::AddToClusterMap ( const pandora::Cluster *const  pCluster)
private

Add the hits of a given cluster to the hit to cluster map.

Parameters
pClusterthe address of the input cluster

Definition at line 54 of file DeltaRayMatchingContainers.cc.

References lar_content::LArClusterHelper::GetClusterHitType(), m_hitToClusterMapU, m_hitToClusterMapV, and m_hitToClusterMapW.

Referenced by AddClustersToContainers(), and FillHitToClusterMap().

55 {
56  const HitType hitType(LArClusterHelper::GetClusterHitType(pCluster));
57  HitToClusterMap &hitToClusterMap((hitType == TPC_VIEW_U) ? m_hitToClusterMapU
58  : (hitType == TPC_VIEW_V) ? m_hitToClusterMapV
60 
61  CaloHitList caloHitList;
62  pCluster->GetOrderedCaloHitList().FillCaloHitList(caloHitList);
63 
64  for (const CaloHit *const pCaloHit : caloHitList)
65  hitToClusterMap[pCaloHit] = pCluster;
66 }
std::map< const pandora::CaloHit *, const pandora::Cluster * > HitToClusterMap
HitToClusterMap m_hitToClusterMapW
The mapping of hits to the clusters to which they belong (in the W view)
HitToClusterMap m_hitToClusterMapU
The mapping of hits to the clusters to which they belong (in the U view)
static pandora::HitType GetClusterHitType(const pandora::Cluster *const pCluster)
Get the hit type associated with a two dimensional cluster.
HitType
Definition: HitType.h:12
HitToClusterMap m_hitToClusterMapV
The mapping of hits to the clusters to which they belong (in the V view)
void lar_content::DeltaRayMatchingContainers::AddToClusterProximityMap ( const pandora::Cluster *const  pCluster)
private

Add a cluster to the cluster proximity map.

Parameters
pClusterthe address of the input cluster

Definition at line 105 of file DeltaRayMatchingContainers.cc.

References lar_content::build_2d_kd_search_region(), lar_content::LArClusterHelper::GetClusterHitType(), m_clusterProximityMapU, m_clusterProximityMapV, m_clusterProximityMapW, m_hitToClusterMapU, m_hitToClusterMapV, m_hitToClusterMapW, m_kdTreeU, m_kdTreeV, m_kdTreeW, m_searchRegion1D, and lar_content::KDTreeLinkerAlgo< DATA, DIM >::search().

Referenced by AddClustersToContainers(), and FillClusterProximityMap().

106 {
107  const HitType hitType(LArClusterHelper::GetClusterHitType(pCluster));
108  const HitToClusterMap &hitToClusterMap((hitType == TPC_VIEW_U) ? m_hitToClusterMapU
109  : (hitType == TPC_VIEW_V) ? m_hitToClusterMapV
111  HitKDTree2D &kdTree((hitType == TPC_VIEW_U) ? m_kdTreeU : (hitType == TPC_VIEW_V) ? m_kdTreeV : m_kdTreeW);
112  ClusterProximityMap &clusterProximityMap((hitType == TPC_VIEW_U) ? m_clusterProximityMapU
113  : (hitType == TPC_VIEW_V) ? m_clusterProximityMapV
115 
116  CaloHitList caloHitList;
117  pCluster->GetOrderedCaloHitList().FillCaloHitList(caloHitList);
118 
119  for (const CaloHit *const pCaloHit : caloHitList)
120  {
121  HitKDNode2DList found;
123 
124  kdTree.search(searchRegionHits, found);
125 
126  for (const auto &hit : found)
127  {
128  const Cluster *const pNearbyCluster(hitToClusterMap.at(hit.data));
129 
130  if (pNearbyCluster == pCluster)
131  continue;
132 
133  ClusterList &nearbyClusterList(clusterProximityMap[pCluster]);
134 
135  if (std::find(nearbyClusterList.begin(), nearbyClusterList.end(), pNearbyCluster) == nearbyClusterList.end())
136  nearbyClusterList.push_back(pNearbyCluster);
137 
138  ClusterList &invertedNearbyClusterList(clusterProximityMap[pNearbyCluster]);
139 
140  if (std::find(invertedNearbyClusterList.begin(), invertedNearbyClusterList.end(), pCluster) == invertedNearbyClusterList.end())
141  invertedNearbyClusterList.push_back(pCluster);
142  }
143  }
144 }
KDTreeLinkerAlgo< const pandora::CaloHit *, 2 > HitKDTree2D
std::map< const pandora::CaloHit *, const pandora::Cluster * > HitToClusterMap
HitKDTree2D m_kdTreeW
The KD tree (in the W view)
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)
HitToClusterMap m_hitToClusterMapU
The mapping of hits to the clusters to which they belong (in the U view)
static pandora::HitType GetClusterHitType(const pandora::Cluster *const pCluster)
Get the hit type associated with a two dimensional cluster.
ClusterProximityMap m_clusterProximityMapU
The mapping of clusters to their neighbouring clusters (in the U view)
ClusterProximityMap m_clusterProximityMapV
The mapping of clusters to their neighbouring clusters (in the V view)
Detector simulation of raw signals on wires.
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)
KDTreeBox build_2d_kd_search_region(const pandora::CaloHit *const point, const float x_span, const float z_span)
build_2d_kd_search_region
KDTreeBoxT< 2 > KDTreeBox
float m_searchRegion1D
Search region, applied to each dimension, for look-up from kd-tree.
void lar_content::DeltaRayMatchingContainers::BuildKDTree ( const pandora::HitType  hitType)
private

Build the KD tree.

Parameters
hitTypethe hit type of the KD tree to build

Definition at line 85 of file DeltaRayMatchingContainers.cc.

References lar_content::KDTreeLinkerAlgo< DATA, DIM >::build(), lar_content::fill_and_bound_2d_kd_tree(), m_hitToClusterMapU, m_hitToClusterMapV, m_hitToClusterMapW, m_kdTreeU, m_kdTreeV, and m_kdTreeW.

Referenced by FillClusterProximityMap().

86 {
87  const HitToClusterMap &hitToClusterMap((hitType == TPC_VIEW_U) ? m_hitToClusterMapU
88  : (hitType == TPC_VIEW_V) ? m_hitToClusterMapV
90  HitKDTree2D &kdTree((hitType == TPC_VIEW_U) ? m_kdTreeU : (hitType == TPC_VIEW_V) ? m_kdTreeV : m_kdTreeW);
91 
92  CaloHitList allCaloHits;
93 
94  for (auto &entry : hitToClusterMap)
95  allCaloHits.push_back(entry.first);
96 
97  HitKDNode2DList hitKDNode2DList;
98  KDTreeBox hitsBoundingRegion2D(fill_and_bound_2d_kd_tree(allCaloHits, hitKDNode2DList));
99 
100  kdTree.build(hitKDNode2DList, hitsBoundingRegion2D);
101 }
KDTreeLinkerAlgo< const pandora::CaloHit *, 2 > HitKDTree2D
std::map< const pandora::CaloHit *, const pandora::Cluster * > HitToClusterMap
HitKDTree2D m_kdTreeW
The KD tree (in the W view)
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)
HitToClusterMap m_hitToClusterMapU
The mapping of hits to the clusters to which they belong (in the U view)
HitKDTree2D m_kdTreeU
The KD tree (in the U view)
HitToClusterMap m_hitToClusterMapV
The mapping of hits to the clusters to which they belong (in the V view)
KDTreeBox fill_and_bound_2d_kd_tree(const MANAGED_CONTAINER< const T * > &points, std::vector< KDTreeNodeInfoT< const T *, 2 >> &nodes)
fill_and_bound_2d_kd_tree
KDTreeBoxT< 2 > KDTreeBox
void lar_content::DeltaRayMatchingContainers::ClearContainers ( )

Empty all algorithm containers.

Definition at line 254 of file DeltaRayMatchingContainers.cc.

References lar_content::KDTreeLinkerAlgo< DATA, DIM >::clear(), m_clusterProximityMapU, m_clusterProximityMapV, m_clusterProximityMapW, m_clusterToPfoMapU, m_clusterToPfoMapV, m_clusterToPfoMapW, m_hitToClusterMapU, m_hitToClusterMapV, m_hitToClusterMapW, m_kdTreeU, m_kdTreeV, and m_kdTreeW.

Referenced by lar_content::OneViewDeltaRayMatchingAlgorithm::Run(), and lar_content::NViewDeltaRayMatchingAlgorithm< T >::TidyUp().

255 {
256  m_hitToClusterMapU.clear();
257  m_hitToClusterMapV.clear();
258  m_hitToClusterMapW.clear();
259 
260  m_kdTreeU.clear();
261  m_kdTreeV.clear();
262  m_kdTreeW.clear();
263 
264  m_clusterProximityMapU.clear();
265  m_clusterProximityMapV.clear();
266  m_clusterProximityMapW.clear();
267 
268  m_clusterToPfoMapU.clear();
269  m_clusterToPfoMapV.clear();
270  m_clusterToPfoMapW.clear();
271 }
HitKDTree2D m_kdTreeW
The KD tree (in the W view)
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 clear()
Clear all allocated structures.
HitToClusterMap m_hitToClusterMapU
The mapping of hits to the clusters to which they belong (in the U view)
ClusterProximityMap m_clusterProximityMapU
The mapping of clusters to their neighbouring clusters (in the U view)
ClusterProximityMap m_clusterProximityMapV
The mapping of clusters to their neighbouring clusters (in the V view)
ClusterToPfoMap m_clusterToPfoMapU
The mapping of cosmic ray U clusters to the cosmic ray pfos to which they belong. ...
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)
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)
ClusterToPfoMap m_clusterToPfoMapV
The mapping of cosmic ray V clusters to the cosmic ray pfos to which they belong. ...
void lar_content::DeltaRayMatchingContainers::FillClusterProximityMap ( const pandora::ClusterList &  inputClusterList)
private

Populate the cluster proximity map from a list of clusters.

Parameters
inputClusterListthe input list of clusters

Definition at line 70 of file DeltaRayMatchingContainers.cc.

References AddToClusterProximityMap(), BuildKDTree(), and lar_content::LArClusterHelper::GetClusterHitType().

Referenced by FillContainers().

71 {
72  if (inputClusterList.empty())
73  return;
74 
75  const HitType hitType(LArClusterHelper::GetClusterHitType(inputClusterList.front()));
76 
77  this->BuildKDTree(hitType);
78 
79  for (const Cluster *const pCluster : inputClusterList)
80  this->AddToClusterProximityMap(pCluster);
81 }
static pandora::HitType GetClusterHitType(const pandora::Cluster *const pCluster)
Get the hit type associated with a two dimensional cluster.
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.
HitType
Definition: HitType.h:12
void lar_content::DeltaRayMatchingContainers::FillClusterToPfoMaps ( const pandora::PfoList &  pfoList)
private

Populate all cluster to pfo maps from a list of particle flow objects.

Parameters
pfoListthe input list of pfos

Definition at line 148 of file DeltaRayMatchingContainers.cc.

References AddClustersToPfoMaps().

Referenced by FillContainers().

149 {
150  for (const ParticleFlowObject *const pPfo : inputPfoList)
151  this->AddClustersToPfoMaps(pPfo);
152 }
void AddClustersToPfoMaps(const pandora::ParticleFlowObject *const pPfo)
Add the clusters of a cosmic ray/delta ray pfo to the cluster to pfo maps.
void lar_content::DeltaRayMatchingContainers::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.

Parameters
inputPfoListthe input list of pfos
inputClusterList1the input list of clusters in view 1
inputClusterList2the input list of clusters in view 2
inputClusterList3the input list of clusters in view 3

Definition at line 30 of file DeltaRayMatchingContainers.cc.

References FillClusterProximityMap(), FillClusterToPfoMaps(), and FillHitToClusterMap().

Referenced by lar_content::NViewDeltaRayMatchingAlgorithm< T >::PrepareInputClusters(), and lar_content::OneViewDeltaRayMatchingAlgorithm::Run().

32 {
33  this->FillHitToClusterMap(inputClusterList1);
34  this->FillHitToClusterMap(inputClusterList2);
35  this->FillHitToClusterMap(inputClusterList3);
36 
37  this->FillClusterProximityMap(inputClusterList1);
38  this->FillClusterProximityMap(inputClusterList2);
39  this->FillClusterProximityMap(inputClusterList3);
40 
41  this->FillClusterToPfoMaps(inputPfoList);
42 }
void FillHitToClusterMap(const pandora::ClusterList &inputClusterList)
Populate the hit to cluster map from a list of clusters.
void FillClusterProximityMap(const pandora::ClusterList &inputClusterList)
Populate the cluster proximity map from a list of clusters.
void FillClusterToPfoMaps(const pandora::PfoList &pfoList)
Populate all cluster to pfo maps from a list of particle flow objects.
void lar_content::DeltaRayMatchingContainers::FillHitToClusterMap ( const pandora::ClusterList &  inputClusterList)
private

Populate the hit to cluster map from a list of clusters.

Parameters
inputClusterListthe input list of clusters

Definition at line 46 of file DeltaRayMatchingContainers.cc.

References AddToClusterMap().

Referenced by FillContainers().

47 {
48  for (const Cluster *const pCluster : inputClusterList)
49  this->AddToClusterMap(pCluster);
50 }
void AddToClusterMap(const pandora::Cluster *const pCluster)
Add the hits of a given cluster to the hit to cluster map.
const DeltaRayMatchingContainers::ClusterProximityMap & lar_content::DeltaRayMatchingContainers::GetClusterProximityMap ( const pandora::HitType  hitType) const
inline

Get the mapping of clusters to to their neighbouring clusters.

Returns
the cluster to nearby cluster map

Definition at line 152 of file DeltaRayMatchingContainers.h.

References m_clusterProximityMapU, m_clusterProximityMapV, and m_clusterProximityMapW.

Referenced by lar_content::NViewDeltaRayMatchingAlgorithm< T >::CollectStrayClusters(), lar_content::OneViewDeltaRayMatchingAlgorithm::GetBestProjectedCluster(), lar_content::OneViewDeltaRayMatchingAlgorithm::GetNearbyAvailableClusters(), lar_content::NViewDeltaRayMatchingAlgorithm< T >::GetNearbyMuonPfos(), and lar_content::OneViewDeltaRayMatchingAlgorithm::PerformOneViewMatching().

153 {
154  return ((hitType == pandora::TPC_VIEW_U) ? m_clusterProximityMapU
155  : (hitType == pandora::TPC_VIEW_V) ? m_clusterProximityMapV
157 }
ClusterProximityMap m_clusterProximityMapU
The mapping of clusters to their neighbouring clusters (in the U view)
ClusterProximityMap m_clusterProximityMapV
The mapping of clusters to their neighbouring clusters (in the V view)
ClusterProximityMap m_clusterProximityMapW
The mapping of clusters to their neighbouring clusters (in the W view)
const DeltaRayMatchingContainers::ClusterToPfoMap & lar_content::DeltaRayMatchingContainers::GetClusterToPfoMap ( const pandora::HitType  hitType) const
inline

Get the mapping of clusters to the pfos to which they belong.

Returns
the cluster to pfo map

Definition at line 161 of file DeltaRayMatchingContainers.h.

References m_clusterToPfoMapU, m_clusterToPfoMapV, and m_clusterToPfoMapW.

Referenced by lar_content::OneViewDeltaRayMatchingAlgorithm::AddIntoExistingDeltaRay(), lar_content::NViewDeltaRayMatchingAlgorithm< T >::GetNearbyMuonPfos(), lar_content::OneViewDeltaRayMatchingAlgorithm::IsDeltaRayPfo(), lar_content::OneViewDeltaRayMatchingAlgorithm::IsMuonPfo(), lar_content::OneViewDeltaRayMatchingAlgorithm::PerformOneViewMatching(), and lar_content::NViewDeltaRayMatchingAlgorithm< T >::UpdateUponDeletion().

162 {
163  return ((hitType == pandora::TPC_VIEW_U) ? m_clusterToPfoMapU
164  : (hitType == pandora::TPC_VIEW_V) ? m_clusterToPfoMapV
166 }
ClusterToPfoMap m_clusterToPfoMapU
The mapping of cosmic ray U clusters to the cosmic ray pfos to which they belong. ...
ClusterToPfoMap m_clusterToPfoMapW
The mapping of cosmic ray W clusters to the cosmic ray pfos to which they belong. ...
ClusterToPfoMap m_clusterToPfoMapV
The mapping of cosmic ray V clusters to the cosmic ray pfos to which they belong. ...
void lar_content::DeltaRayMatchingContainers::RemoveClusterFromContainers ( const pandora::Cluster *const  pDeletedCluster)

Remove an input cluster's hits from the hit to cluster and cluster proximity maps and, if appropriate, from the cluster to pfo map.

Parameters
pDeletedClusterthe input cluster

Definition at line 198 of file DeltaRayMatchingContainers.cc.

References lar_content::LArClusterHelper::GetClusterHitType(), m_clusterProximityMapU, m_clusterProximityMapV, m_clusterProximityMapW, m_clusterToPfoMapU, m_clusterToPfoMapV, m_clusterToPfoMapW, m_hitToClusterMapU, m_hitToClusterMapV, and m_hitToClusterMapW.

Referenced by lar_content::OneViewDeltaRayMatchingAlgorithm::MergeClusterGroup(), and lar_content::NViewDeltaRayMatchingAlgorithm< T >::UpdateUponDeletion().

199 {
200  const HitType hitType(LArClusterHelper::GetClusterHitType(pDeletedCluster));
201  HitToClusterMap &hitToClusterMap((hitType == TPC_VIEW_U) ? m_hitToClusterMapU
202  : (hitType == TPC_VIEW_V) ? m_hitToClusterMapV
204  ClusterProximityMap &clusterProximityMap((hitType == TPC_VIEW_U) ? m_clusterProximityMapU
205  : (hitType == TPC_VIEW_V) ? m_clusterProximityMapV
207  ClusterToPfoMap &clusterToPfoMap((hitType == TPC_VIEW_U) ? m_clusterToPfoMapU
208  : (hitType == TPC_VIEW_V) ? m_clusterToPfoMapV
210 
211  CaloHitList caloHitList;
212  pDeletedCluster->GetOrderedCaloHitList().FillCaloHitList(caloHitList);
213 
214  for (const CaloHit *const pCaloHit : caloHitList)
215  {
216  const HitToClusterMap::const_iterator iter(hitToClusterMap.find(pCaloHit));
217 
218  if (iter == hitToClusterMap.end())
219  throw StatusCodeException(STATUS_CODE_FAILURE);
220 
221  hitToClusterMap.erase(iter);
222  }
223 
224  const ClusterProximityMap::const_iterator clusterProximityIter(clusterProximityMap.find(pDeletedCluster));
225 
226  if (clusterProximityIter != clusterProximityMap.end())
227  {
228  const ClusterList &nearbyClusterList(clusterProximityIter->second);
229 
230  for (const Cluster *const pNearbyCluster : nearbyClusterList)
231  {
232  const ClusterProximityMap::iterator iter(clusterProximityMap.find(pNearbyCluster));
233 
234  if (iter == clusterProximityMap.end())
235  continue;
236 
237  ClusterList &invertedCloseClusters(iter->second);
238 
239  ClusterList::iterator invertedIter(std::find(invertedCloseClusters.begin(), invertedCloseClusters.end(), pDeletedCluster));
240  invertedCloseClusters.erase(invertedIter);
241  }
242 
243  clusterProximityMap.erase(clusterProximityIter);
244  }
245 
246  const DeltaRayMatchingContainers::ClusterToPfoMap::const_iterator clusterToPfoIter(clusterToPfoMap.find(pDeletedCluster));
247 
248  if (clusterToPfoIter != clusterToPfoMap.end())
249  clusterToPfoMap.erase(clusterToPfoIter);
250 }
intermediate_table::iterator iterator
std::map< const pandora::CaloHit *, const pandora::Cluster * > HitToClusterMap
std::map< const pandora::Cluster *, const pandora::ParticleFlowObject * > ClusterToPfoMap
HitToClusterMap m_hitToClusterMapW
The mapping of hits to the clusters to which they belong (in the W view)
intermediate_table::const_iterator const_iterator
HitToClusterMap m_hitToClusterMapU
The mapping of hits to the clusters to which they belong (in the U view)
static pandora::HitType GetClusterHitType(const pandora::Cluster *const pCluster)
Get the hit type associated with a two dimensional cluster.
ClusterProximityMap m_clusterProximityMapU
The mapping of clusters to their neighbouring clusters (in the U view)
ClusterProximityMap m_clusterProximityMapV
The mapping of clusters to their neighbouring clusters (in the V view)
ClusterToPfoMap m_clusterToPfoMapU
The mapping of cosmic ray U clusters to the cosmic ray pfos to which they belong. ...
ClusterToPfoMap m_clusterToPfoMapW
The mapping of cosmic ray W clusters to the cosmic ray pfos to which they belong. ...
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)
ClusterToPfoMap m_clusterToPfoMapV
The mapping of cosmic ray V clusters to the cosmic ray pfos to which they belong. ...

Member Data Documentation

ClusterProximityMap lar_content::DeltaRayMatchingContainers::m_clusterProximityMapU
private

The mapping of clusters to their neighbouring clusters (in the U view)

Definition at line 141 of file DeltaRayMatchingContainers.h.

Referenced by AddToClusterProximityMap(), ClearContainers(), GetClusterProximityMap(), and RemoveClusterFromContainers().

ClusterProximityMap lar_content::DeltaRayMatchingContainers::m_clusterProximityMapV
private

The mapping of clusters to their neighbouring clusters (in the V view)

Definition at line 142 of file DeltaRayMatchingContainers.h.

Referenced by AddToClusterProximityMap(), ClearContainers(), GetClusterProximityMap(), and RemoveClusterFromContainers().

ClusterProximityMap lar_content::DeltaRayMatchingContainers::m_clusterProximityMapW
private

The mapping of clusters to their neighbouring clusters (in the W view)

Definition at line 143 of file DeltaRayMatchingContainers.h.

Referenced by AddToClusterProximityMap(), ClearContainers(), GetClusterProximityMap(), and RemoveClusterFromContainers().

ClusterToPfoMap lar_content::DeltaRayMatchingContainers::m_clusterToPfoMapU
private

The mapping of cosmic ray U clusters to the cosmic ray pfos to which they belong.

Definition at line 144 of file DeltaRayMatchingContainers.h.

Referenced by AddClustersToPfoMaps(), ClearContainers(), GetClusterToPfoMap(), and RemoveClusterFromContainers().

ClusterToPfoMap lar_content::DeltaRayMatchingContainers::m_clusterToPfoMapV
private

The mapping of cosmic ray V clusters to the cosmic ray pfos to which they belong.

Definition at line 145 of file DeltaRayMatchingContainers.h.

Referenced by AddClustersToPfoMaps(), ClearContainers(), GetClusterToPfoMap(), and RemoveClusterFromContainers().

ClusterToPfoMap lar_content::DeltaRayMatchingContainers::m_clusterToPfoMapW
private

The mapping of cosmic ray W clusters to the cosmic ray pfos to which they belong.

Definition at line 146 of file DeltaRayMatchingContainers.h.

Referenced by AddClustersToPfoMaps(), ClearContainers(), GetClusterToPfoMap(), and RemoveClusterFromContainers().

HitToClusterMap lar_content::DeltaRayMatchingContainers::m_hitToClusterMapU
private

The mapping of hits to the clusters to which they belong (in the U view)

Definition at line 135 of file DeltaRayMatchingContainers.h.

Referenced by AddToClusterMap(), AddToClusterProximityMap(), BuildKDTree(), ClearContainers(), and RemoveClusterFromContainers().

HitToClusterMap lar_content::DeltaRayMatchingContainers::m_hitToClusterMapV
private

The mapping of hits to the clusters to which they belong (in the V view)

Definition at line 136 of file DeltaRayMatchingContainers.h.

Referenced by AddToClusterMap(), AddToClusterProximityMap(), BuildKDTree(), ClearContainers(), and RemoveClusterFromContainers().

HitToClusterMap lar_content::DeltaRayMatchingContainers::m_hitToClusterMapW
private

The mapping of hits to the clusters to which they belong (in the W view)

Definition at line 137 of file DeltaRayMatchingContainers.h.

Referenced by AddToClusterMap(), AddToClusterProximityMap(), BuildKDTree(), ClearContainers(), and RemoveClusterFromContainers().

HitKDTree2D lar_content::DeltaRayMatchingContainers::m_kdTreeU
private

The KD tree (in the U view)

Definition at line 138 of file DeltaRayMatchingContainers.h.

Referenced by AddToClusterProximityMap(), BuildKDTree(), and ClearContainers().

HitKDTree2D lar_content::DeltaRayMatchingContainers::m_kdTreeV
private

The KD tree (in the V view)

Definition at line 139 of file DeltaRayMatchingContainers.h.

Referenced by AddToClusterProximityMap(), BuildKDTree(), and ClearContainers().

HitKDTree2D lar_content::DeltaRayMatchingContainers::m_kdTreeW
private

The KD tree (in the W view)

Definition at line 140 of file DeltaRayMatchingContainers.h.

Referenced by AddToClusterProximityMap(), BuildKDTree(), and ClearContainers().

float lar_content::DeltaRayMatchingContainers::m_searchRegion1D

Search region, applied to each dimension, for look-up from kd-tree.

Definition at line 85 of file DeltaRayMatchingContainers.h.

Referenced by AddToClusterProximityMap(), lar_content::OneViewDeltaRayMatchingAlgorithm::ReadSettings(), and lar_content::NViewDeltaRayMatchingAlgorithm< T >::ReadSettings().


The documentation for this class was generated from the following files: