LArSoft  v09_90_00
Liquid Argon Software toolkit - https://larsoft.org/
OneViewDeltaRayMatchingAlgorithm.cc
Go to the documentation of this file.
1 
9 #include "Pandora/AlgorithmHeaders.h"
10 
13 
15 
17 
18 using namespace pandora;
19 
20 namespace lar_content
21 {
22 
23 OneViewDeltaRayMatchingAlgorithm::OneViewDeltaRayMatchingAlgorithm() :
24  m_overlapExtension(1.f),
25  m_minClusterHits(3)
26 {
27 }
28 
29 //------------------------------------------------------------------------------------------------------------------------------------------
30 
32 {
33  const PfoList muonPfoList(this->GetMuonPfoList());
34  PfoList allPfoList(this->GetDeltaRayPfoList());
35 
36  allPfoList.insert(allPfoList.end(), muonPfoList.begin(), muonPfoList.end());
37 
39  allPfoList, this->GetInputClusterList(TPC_VIEW_U), this->GetInputClusterList(TPC_VIEW_V), this->GetInputClusterList(TPC_VIEW_W));
40 
41  for (const HitType hitType : {TPC_VIEW_U, TPC_VIEW_V, TPC_VIEW_W})
42  this->PerformOneViewMatching(hitType);
43 
44  for (const HitType hitType : {TPC_VIEW_U, TPC_VIEW_V, TPC_VIEW_W})
45  this->PerformRecovery(hitType);
46 
48 
49  return STATUS_CODE_SUCCESS;
50 }
51 
52 //------------------------------------------------------------------------------------------------------------------------------------------
53 
55 {
56  const std::string inputClusterListName((hitType == TPC_VIEW_U) ? m_inputClusterListNameU
57  : (hitType == TPC_VIEW_V) ? m_inputClusterListNameV
59 
60  const ClusterList *pInputClusterList(nullptr);
61 
62  PANDORA_THROW_RESULT_IF_AND_IF(
63  STATUS_CODE_SUCCESS, STATUS_CODE_NOT_INITIALIZED, !=, PandoraContentApi::GetList(*this, inputClusterListName, pInputClusterList));
64 
65  if (!pInputClusterList)
66  return ClusterList();
67 
68  return *pInputClusterList;
69 }
70 
71 //------------------------------------------------------------------------------------------------------------------------------------------
72 
74 {
75  const PfoList *pMuonPfoList(nullptr);
76 
77  PANDORA_THROW_RESULT_IF_AND_IF(
78  STATUS_CODE_SUCCESS, STATUS_CODE_NOT_INITIALIZED, !=, PandoraContentApi::GetList(*this, m_muonPfoListName, pMuonPfoList));
79 
80  if (!pMuonPfoList)
81  return PfoList();
82 
83  return *pMuonPfoList;
84 }
85 
86 //------------------------------------------------------------------------------------------------------------------------------------------
87 
89 {
90  const PfoList *pDeltaRayPfoList(nullptr);
91 
92  PANDORA_THROW_RESULT_IF_AND_IF(
93  STATUS_CODE_SUCCESS, STATUS_CODE_NOT_INITIALIZED, !=, PandoraContentApi::GetList(*this, m_deltaRayPfoListName, pDeltaRayPfoList));
94 
95  if (!pDeltaRayPfoList)
96  return PfoList();
97 
98  return *pDeltaRayPfoList;
99 }
100 
101 //------------------------------------------------------------------------------------------------------------------------------------------
102 
104 {
107  ClusterVector availableClusterList;
108 
109  for (auto &entry : clusterProximityMap)
110  {
111  if (entry.first->IsAvailable())
112  availableClusterList.push_back(entry.first);
113  }
114 
115  std::sort(availableClusterList.begin(), availableClusterList.end(), LArClusterHelper::SortByNHits);
116 
117  ClusterSet modifiedClusters;
118 
119  for (const Cluster *const pAvailableCluster : availableClusterList)
120  {
121  if (modifiedClusters.count(pAvailableCluster))
122  continue;
123 
124  const DeltaRayMatchingContainers::ClusterProximityMap::const_iterator iter(clusterProximityMap.find(pAvailableCluster));
125 
126  // ATTN: Map will update during loop
127  if (iter == clusterProximityMap.end())
128  continue;
129 
130  bool found(false);
131  const ClusterList &nearbyClusters(clusterProximityMap.at(pAvailableCluster));
132  PfoVector nearbyMuonPfoVector;
133 
134  do
135  {
136  found = false;
137 
138  const ParticleFlowObject *pClosestMuonPfo(nullptr);
139  float closestDistance(std::numeric_limits<float>::max());
140 
141  for (const Cluster *const pNearbyCluster : nearbyClusters)
142  {
143  if (!this->IsMuonPfo(pNearbyCluster))
144  continue;
145 
146  if (std::find(nearbyMuonPfoVector.begin(), nearbyMuonPfoVector.end(), clusterToPfoMap.at(pNearbyCluster)) !=
147  nearbyMuonPfoVector.end())
148  continue;
149 
150  found = true;
151 
152  const float separation(LArClusterHelper::GetClosestDistance(pNearbyCluster, pAvailableCluster));
153 
154  if (separation < closestDistance)
155  {
156  closestDistance = separation;
157  pClosestMuonPfo = clusterToPfoMap.at(pNearbyCluster);
158  }
159  }
160 
161  if (pClosestMuonPfo)
162  nearbyMuonPfoVector.push_back(pClosestMuonPfo);
163  } while (found);
164 
165  if (nearbyMuonPfoVector.empty())
166  continue;
167 
168  if (this->AddIntoExistingDeltaRay(pAvailableCluster, nearbyMuonPfoVector))
169  continue;
170 
171  this->CreateDeltaRay(pAvailableCluster, nearbyMuonPfoVector, modifiedClusters);
172  }
173 }
174 
175 //------------------------------------------------------------------------------------------------------------------------------------------
176 
177 bool OneViewDeltaRayMatchingAlgorithm::IsMuonPfo(const Cluster *const pCluster)
178 {
179  const HitType hitType(LArClusterHelper::GetClusterHitType(pCluster));
181  const DeltaRayMatchingContainers::ClusterToPfoMap::const_iterator iter(clusterToPfoMap.find(pCluster));
182 
183  if (iter == clusterToPfoMap.end())
184  return false;
185 
186  const ParticleFlowObject *const pPfo(iter->second);
187  const PfoList &muonPfoList(this->GetMuonPfoList());
188 
189  return (std::find(muonPfoList.begin(), muonPfoList.end(), pPfo) != muonPfoList.end());
190 }
191 
192 //------------------------------------------------------------------------------------------------------------------------------------------
193 
194 bool OneViewDeltaRayMatchingAlgorithm::AddIntoExistingDeltaRay(const Cluster *const pAvailableCluster, const PfoVector &nearbyMuonPfoVector)
195 {
196  const HitType hitType(LArClusterHelper::GetClusterHitType(pAvailableCluster));
197  const HitType projectedHitType1((hitType == TPC_VIEW_U) ? TPC_VIEW_V : (hitType == TPC_VIEW_V) ? TPC_VIEW_W : TPC_VIEW_U);
198  const HitType projectedHitType2((projectedHitType1 == TPC_VIEW_U) ? TPC_VIEW_V
199  : (projectedHitType1 == TPC_VIEW_V) ? TPC_VIEW_W
200  : TPC_VIEW_U);
203 
204  for (const ParticleFlowObject *const pNearbyMuonPfo : nearbyMuonPfoVector)
205  {
206  const Cluster *const pProjectedCluster1(this->GetBestProjectedCluster({pAvailableCluster}, pNearbyMuonPfo, projectedHitType1, false));
207  const Cluster *const pProjectedCluster2(this->GetBestProjectedCluster({pAvailableCluster}, pNearbyMuonPfo, projectedHitType2, false));
208 
209  if ((!pProjectedCluster1) || (!pProjectedCluster2))
210  continue;
211 
212  const ParticleFlowObject *const pPfo1(clusterToPfoMap1.at(pProjectedCluster1));
213  const ParticleFlowObject *const pPfo2(clusterToPfoMap2.at(pProjectedCluster2));
214 
215  if (pPfo1 == pPfo2)
216  {
217  PANDORA_RETURN_RESULT_IF(STATUS_CODE_SUCCESS, !=, PandoraContentApi::AddToPfo(*this, pPfo1, pAvailableCluster));
218 
220 
221  return true;
222  }
223  }
224 
225  return false;
226 }
227 
228 //------------------------------------------------------------------------------------------------------------------------------------------
229 
231  const ClusterList &deltaRayClusterGroup, const ParticleFlowObject *const pNearbyMuonPfo, const HitType hitType, const bool findAvailable)
232 {
233  ClusterList muonClusterList;
234  LArPfoHelper::GetClusters(pNearbyMuonPfo, hitType, muonClusterList);
235 
236  if (muonClusterList.size() != 1)
237  return nullptr;
238 
240  auto muonProximityIter(clusterProximityMap.find(muonClusterList.front()));
241 
242  if (muonProximityIter == clusterProximityMap.end())
243  return nullptr;
244 
245  float spanMinX(0.f), spanMaxX(0.f);
246  this->GetClusterSpanX(deltaRayClusterGroup, spanMinX, spanMaxX);
247 
248  unsigned int highestHit(0);
249  const Cluster *pProjectedCluster(nullptr);
250 
251  for (const Cluster *const pNearbyCluster : muonProximityIter->second)
252  {
253  if (findAvailable && !pNearbyCluster->IsAvailable())
254  continue;
255 
256  if (!findAvailable && !this->IsDeltaRayPfo(pNearbyCluster))
257  continue;
258 
259  float minX(0.f), maxX(0.f);
260  pNearbyCluster->GetClusterSpanX(minX, maxX);
261 
262  if ((maxX < (spanMinX - m_overlapExtension)) || (minX > (spanMaxX + m_overlapExtension)))
263  continue;
264 
265  if (pNearbyCluster->GetNCaloHits() > highestHit)
266  {
267  highestHit = pNearbyCluster->GetNCaloHits();
268  pProjectedCluster = pNearbyCluster;
269  }
270  }
271 
272  return pProjectedCluster;
273 }
274 
275 //------------------------------------------------------------------------------------------------------------------------------------------
276 
277 bool OneViewDeltaRayMatchingAlgorithm::IsDeltaRayPfo(const Cluster *const pCluster)
278 {
279  const HitType hitType(LArClusterHelper::GetClusterHitType(pCluster));
281 
282  const DeltaRayMatchingContainers::ClusterToPfoMap::const_iterator iter(clusterToPfoMap.find(pCluster));
283 
284  if (iter == clusterToPfoMap.end())
285  return false;
286 
287  const ParticleFlowObject *const pDeltaRayPfo(iter->second);
288  const PfoList &deltaRayPfoList(this->GetDeltaRayPfoList());
289 
290  return (std::find(deltaRayPfoList.begin(), deltaRayPfoList.end(), pDeltaRayPfo) != deltaRayPfoList.end());
291 }
292 
293 //------------------------------------------------------------------------------------------------------------------------------------------
294 
295 void OneViewDeltaRayMatchingAlgorithm::GetClusterSpanX(const ClusterList &clusterList, float &spanMinX, float &spanMaxX)
296 {
297  spanMinX = std::numeric_limits<float>::max();
298  spanMaxX = -std::numeric_limits<float>::max();
299 
300  for (const Cluster *const pCluster : clusterList)
301  {
302  float minX(0.f), maxX(0.f);
303  pCluster->GetClusterSpanX(minX, maxX);
304 
305  if (minX < spanMinX)
306  spanMinX = minX;
307 
308  if (maxX > spanMaxX)
309  spanMaxX = maxX;
310  }
311 }
312 
313 //------------------------------------------------------------------------------------------------------------------------------------------
314 
315 void OneViewDeltaRayMatchingAlgorithm::CreateDeltaRay(const Cluster *const pAvailableCluster, const PfoVector &nearbyMuonPfoVector, ClusterSet &modifiedClusters)
316 {
317  ClusterList clusterGroup, consideredClusters;
318  this->GetNearbyAvailableClusters(pAvailableCluster, consideredClusters, clusterGroup);
319 
320  for (const Cluster *const pModifiedCluster : clusterGroup)
321  modifiedClusters.insert(pModifiedCluster);
322 
323  const HitType hitType(LArClusterHelper::GetClusterHitType(pAvailableCluster));
324  const HitType projectedHitType1((hitType == TPC_VIEW_U) ? TPC_VIEW_V : (hitType == TPC_VIEW_V) ? TPC_VIEW_W : TPC_VIEW_U);
325  const HitType projectedHitType2((projectedHitType1 == TPC_VIEW_U) ? TPC_VIEW_V
326  : (projectedHitType1 == TPC_VIEW_V) ? TPC_VIEW_W
327  : TPC_VIEW_U);
328  ClusterList projectedClusters1, projectedClusters2;
329 
330  for (const ParticleFlowObject *const pNearbyMuonPfo : nearbyMuonPfoVector)
331  {
332  const Cluster *const pProjectedCluster1(this->GetBestProjectedCluster(clusterGroup, pNearbyMuonPfo, projectedHitType1, true));
333  const Cluster *const pProjectedCluster2(this->GetBestProjectedCluster(clusterGroup, pNearbyMuonPfo, projectedHitType2, true));
334 
335  if ((!pProjectedCluster1) && (!pProjectedCluster2))
336  continue;
337 
338  ClusterList consideredClusters1;
339  if (pProjectedCluster1)
340  this->GetNearbyAvailableClusters(pProjectedCluster1, consideredClusters1, projectedClusters1);
341 
342  ClusterList consideredClusters2;
343  if (pProjectedCluster2)
344  this->GetNearbyAvailableClusters(pProjectedCluster2, consideredClusters2, projectedClusters2);
345  }
346 
347  const Cluster *const pCluster1(this->MergeClusterGroup(clusterGroup));
348  const Cluster *const pCluster2(this->MergeClusterGroup(projectedClusters1));
349  const Cluster *const pCluster3(this->MergeClusterGroup(projectedClusters2));
350 
351  this->CreatePfo(pCluster1, pCluster2, pCluster3);
352 }
353 
354 //------------------------------------------------------------------------------------------------------------------------------------------
355 
356 void OneViewDeltaRayMatchingAlgorithm::GetNearbyAvailableClusters(const Cluster *const pCluster, ClusterList &consideredClusters, ClusterList &foundClusters)
357 {
358  const HitType hitType(LArClusterHelper::GetClusterHitType(pCluster));
360 
361  consideredClusters.push_back(pCluster);
362 
363  if (!pCluster->IsAvailable())
364  return;
365 
366  if (std::find(foundClusters.begin(), foundClusters.end(), pCluster) == foundClusters.end())
367  foundClusters.push_back(pCluster);
368 
369  const DeltaRayMatchingContainers::ClusterProximityMap::const_iterator proximityIter(clusterProximityMap.find(pCluster));
370 
371  if (proximityIter == clusterProximityMap.end())
372  return;
373 
374  for (const Cluster *const pNearbyCluster : proximityIter->second)
375  {
376  if (!pNearbyCluster->IsAvailable())
377  continue;
378 
379  if (std::find(consideredClusters.begin(), consideredClusters.end(), pNearbyCluster) != consideredClusters.end())
380  continue;
381 
382  if (std::find(foundClusters.begin(), foundClusters.end(), pNearbyCluster) != foundClusters.end())
383  continue;
384 
385  this->GetNearbyAvailableClusters(pNearbyCluster, consideredClusters, foundClusters);
386  }
387 }
388 
389 //------------------------------------------------------------------------------------------------------------------------------------------
390 
391 const Cluster *OneViewDeltaRayMatchingAlgorithm::MergeClusterGroup(const ClusterList &clusterGroup)
392 {
393  if (clusterGroup.empty())
394  return nullptr;
395 
396  const Cluster *const pClusterToEnlarge(clusterGroup.front());
397 
398  if (clusterGroup.size() == 1)
399  return pClusterToEnlarge;
400 
401  const HitType hitType(LArClusterHelper::GetClusterHitType(pClusterToEnlarge));
402  const std::string inputClusterListName((hitType == TPC_VIEW_U) ? m_inputClusterListNameU
403  : (hitType == TPC_VIEW_V) ? m_inputClusterListNameV
405 
406  for (const Cluster *const pClusterToDelete : clusterGroup)
407  {
409 
410  if (pClusterToDelete != pClusterToEnlarge)
411  {
412  PANDORA_THROW_RESULT_IF(STATUS_CODE_SUCCESS, !=, PandoraContentApi::ReplaceCurrentList<Cluster>(*this, inputClusterListName));
413  PANDORA_THROW_RESULT_IF(STATUS_CODE_SUCCESS, !=, PandoraContentApi::MergeAndDeleteClusters(*this, pClusterToEnlarge, pClusterToDelete));
414  }
415  }
416 
417  m_deltaRayMatchingContainers.AddClustersToContainers({pClusterToEnlarge}, {nullptr});
418 
419  return pClusterToEnlarge;
420 }
421 
422 //------------------------------------------------------------------------------------------------------------------------------------------
423 
424 void OneViewDeltaRayMatchingAlgorithm::CreatePfo(const Cluster *const pCluster1, const Cluster *const pCluster2, const Cluster *const pCluster3)
425 {
426  const PfoList *pPfoList(nullptr);
427  std::string pfoListName;
428  PANDORA_THROW_RESULT_IF(STATUS_CODE_SUCCESS, !=, PandoraContentApi::CreateTemporaryListAndSetCurrent(*this, pPfoList, pfoListName));
429 
430  PandoraContentApi::ParticleFlowObject::Parameters pfoParameters;
431  pfoParameters.m_particleId = E_MINUS;
432  pfoParameters.m_charge = PdgTable::GetParticleCharge(E_MINUS);
433  pfoParameters.m_mass = PdgTable::GetParticleMass(E_MINUS);
434  pfoParameters.m_energy = 0.f;
435  pfoParameters.m_momentum = CartesianVector(0.f, 0.f, 0.f);
436 
437  if (pCluster1)
438  pfoParameters.m_clusterList.push_back(pCluster1);
439 
440  if (pCluster2)
441  pfoParameters.m_clusterList.push_back(pCluster2);
442 
443  if (pCluster3)
444  pfoParameters.m_clusterList.push_back(pCluster3);
445 
446  if (pfoParameters.m_clusterList.empty())
447  throw StatusCodeException(STATUS_CODE_FAILURE);
448 
449  const ParticleFlowObject *pPfo(nullptr);
450 
451  PANDORA_THROW_RESULT_IF(STATUS_CODE_SUCCESS, !=, PandoraContentApi::ParticleFlowObject::Create(*this, pfoParameters, pPfo));
452  PANDORA_THROW_RESULT_IF(STATUS_CODE_SUCCESS, !=, PandoraContentApi::SaveList<Pfo>(*this, m_outputPfoListName));
453  PANDORA_THROW_RESULT_IF(STATUS_CODE_SUCCESS, !=, PandoraContentApi::ReplaceCurrentList<Pfo>(*this, m_outputPfoListName));
454 
456 }
457 
458 //------------------------------------------------------------------------------------------------------------------------------------------
459 
461 {
462  const ClusterList &inputClusterList(this->GetInputClusterList(hitType));
463 
464  for (const Cluster *const pCluster : inputClusterList)
465  {
466  if (!pCluster->IsAvailable())
467  continue;
468 
469  if (pCluster->GetNCaloHits() < m_minClusterHits)
470  continue;
471 
472  this->CreatePfo(pCluster, nullptr, nullptr);
473  }
474 }
475 
476 //------------------------------------------------------------------------------------------------------------------------------------------
477 
478 StatusCode OneViewDeltaRayMatchingAlgorithm::ReadSettings(const TiXmlHandle xmlHandle)
479 {
480  PANDORA_RETURN_RESULT_IF(STATUS_CODE_SUCCESS, !=, XmlHelper::ReadValue(xmlHandle, "MuonPfoListName", m_muonPfoListName));
481 
482  PANDORA_RETURN_RESULT_IF(STATUS_CODE_SUCCESS, !=, XmlHelper::ReadValue(xmlHandle, "DeltaRayPfoListName", m_deltaRayPfoListName));
483 
484  PANDORA_RETURN_RESULT_IF(STATUS_CODE_SUCCESS, !=, XmlHelper::ReadValue(xmlHandle, "InputClusterListNameU", m_inputClusterListNameU));
485 
486  PANDORA_RETURN_RESULT_IF(STATUS_CODE_SUCCESS, !=, XmlHelper::ReadValue(xmlHandle, "InputClusterListNameV", m_inputClusterListNameV));
487 
488  PANDORA_RETURN_RESULT_IF(STATUS_CODE_SUCCESS, !=, XmlHelper::ReadValue(xmlHandle, "InputClusterListNameW", m_inputClusterListNameW));
489 
490  PANDORA_RETURN_RESULT_IF(STATUS_CODE_SUCCESS, !=, XmlHelper::ReadValue(xmlHandle, "OutputPfoListName", m_outputPfoListName));
491 
492  PANDORA_RETURN_RESULT_IF_AND_IF(STATUS_CODE_SUCCESS, STATUS_CODE_NOT_FOUND, !=,
493  XmlHelper::ReadValue(xmlHandle, "SearchRegion1D", m_deltaRayMatchingContainers.m_searchRegion1D));
494 
495  PANDORA_RETURN_RESULT_IF_AND_IF(
496  STATUS_CODE_SUCCESS, STATUS_CODE_NOT_FOUND, !=, XmlHelper::ReadValue(xmlHandle, "OverlapExtension", m_overlapExtension));
497 
498  PANDORA_RETURN_RESULT_IF_AND_IF(STATUS_CODE_SUCCESS, STATUS_CODE_NOT_FOUND, !=, XmlHelper::ReadValue(xmlHandle, "MinClusterHits", m_minClusterHits));
499 
500  return STATUS_CODE_SUCCESS;
501 }
502 
503 } // namespace lar_content
Header file for the one viw delta ray matching algorithm.
static bool SortByNHits(const pandora::Cluster *const pLhs, const pandora::Cluster *const pRhs)
Sort clusters by number of hits, then layer span, then inner layer, then position, then pulse-height.
std::string m_inputClusterListNameW
The list of reconstructed W clusters.
const pandora::ClusterList GetInputClusterList(const pandora::HitType hitType)
Get the input cluster list of a given hit type.
Header file for the kd tree linker algo template class.
std::map< const pandora::Cluster *, const pandora::ParticleFlowObject * > ClusterToPfoMap
Header file for the pfo helper class.
const ClusterProximityMap & GetClusterProximityMap(const pandora::HitType hitType) const
Get the mapping of clusters to to their neighbouring clusters.
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.
pandora::StatusCode ReadSettings(const pandora::TiXmlHandle xmlHandle)
const pandora::PfoList GetDeltaRayPfoList()
Get the input delta ray pfo list.
bool AddIntoExistingDeltaRay(const pandora::Cluster *const pAvailableCluster, const pandora::PfoVector &nearbyMuonPfoVector)
Use nearby muon pfos to project into other views and attempt to add a remaining delta ray cluster int...
void AddClustersToPfoMaps(const pandora::ParticleFlowObject *const pPfo)
Add the clusters of a cosmic ray/delta ray pfo to the cluster to pfo maps.
void CreateDeltaRay(const pandora::Cluster *const pAvailableCluster, const pandora::PfoVector &nearbyMuonPfoVector, pandora::ClusterSet &modifiedClusters)
Use nearby muon pfos to project into other views and attempt to match a remaining delta ray cluster t...
bool IsDeltaRayPfo(const pandora::Cluster *const pCluster)
Determine whether an input cluster belongs to a delta ray pfo.
unsigned int m_minClusterHits
The minimum number of hits for a cluster to be significant.
intermediate_table::const_iterator const_iterator
void CreatePfo(const pandora::Cluster *const pCluster1, const pandora::Cluster *const pCluster2, const pandora::Cluster *const pCluster3)
Create a pfo from the input clusters updating the cluster to pfo map accordingly. ...
std::string m_inputClusterListNameU
The list of reconstructed U clusters.
std::string m_muonPfoListName
The list of reconstructed cosmic ray pfos.
static pandora::HitType GetClusterHitType(const pandora::Cluster *const pCluster)
Get the hit type associated with a two dimensional cluster.
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...
TFile f
Definition: plotHisto.C:6
std::string m_inputClusterListNameV
The list of reconstructed V clusters.
const pandora::Cluster * GetBestProjectedCluster(const pandora::ClusterList &deltaRayClusterGroup, const pandora::ParticleFlowObject *const pNearbyMuonPfo, const pandora::HitType hitType, const bool findAvailable)
Get the best matched available or unavailable cluster of a remaining delta ray cluster group wrt a co...
Header file for the cluster helper class.
void GetClusterSpanX(const pandora::ClusterList &clusterList, float &spanMinX, float &spanMaxX)
Determine cluster span (in x) of a group of clusters.
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.
void PerformOneViewMatching(const pandora::HitType hitType)
Use nearby muon pfos to project into other views and attempt to match the remaining delta ray cluster...
const pandora::Cluster * MergeClusterGroup(const pandora::ClusterList &clusterGroup)
Merge a collection of available clusters together updating hit containers accordingly.
const ClusterToPfoMap & GetClusterToPfoMap(const pandora::HitType hitType) const
Get the mapping of clusters to the pfos to which they belong.
DeltaRayMatchingContainers m_deltaRayMatchingContainers
The class of hit, cluster and pfo ownership and proximity maps.
bool IsMuonPfo(const pandora::Cluster *const pCluster)
Determine whether an input cluster belongs to a cosmic ray pfo.
std::map< const pandora::Cluster *, pandora::ClusterList > ClusterProximityMap
HitType
Definition: HitType.h:12
float m_overlapExtension
The extension to each side of the x overlap region in which to search for matched clusters...
void GetNearbyAvailableClusters(const pandora::Cluster *const pCluster, pandora::ClusterList &consideredClusters, pandora::ClusterList &foundClusters)
In the view of the input available cluster, gather nearby available clusters.
std::string m_deltaRayPfoListName
The list of reconstructed delta ray pfos.
std::string m_outputPfoListName
The list to receive the created delta ray pfos.
std::vector< art::Ptr< recob::Cluster > > ClusterVector
void PerformRecovery(const pandora::HitType hitType)
Create a delta ray pfo from any remaining, significant clusters.
const pandora::PfoList GetMuonPfoList()
Get the input cosmic ray pfo list.
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.
static float GetClosestDistance(const pandora::ClusterList &clusterList1, const pandora::ClusterList &clusterList2)
Get closest distance between clusters in a pair of cluster lists.