OneViewDeltaRayMatchingAlgorithm.cc
Go to the documentation of this file.
1 /**
2  * @file larpandoracontent/LArThreeDReco/LArCosmicRay/OneViewDeltaRayMatchingAlgorithm.cc
3  *
4  * @brief Implementation of the one view delta ray matching algorithm class.
5  *
6  * $Log: $
7  */
8 
9 #include "Pandora/AlgorithmHeaders.h"
10 
13 
15 
17 
18 using namespace pandora;
19 
20 namespace lar_content
21 {
22 
23 OneViewDeltaRayMatchingAlgorithm::OneViewDeltaRayMatchingAlgorithm() : m_overlapExtension(1.f), m_minClusterHits(3)
24 {
25 }
26 
27 //------------------------------------------------------------------------------------------------------------------------------------------
28 
30 {
31  const PfoList muonPfoList(this->GetMuonPfoList());
32  PfoList allPfoList(this->GetDeltaRayPfoList());
33 
34  allPfoList.insert(allPfoList.end(), muonPfoList.begin(), muonPfoList.end());
35 
37  allPfoList, this->GetInputClusterList(TPC_VIEW_U), this->GetInputClusterList(TPC_VIEW_V), this->GetInputClusterList(TPC_VIEW_W));
38 
39  for (const HitType hitType : {TPC_VIEW_U, TPC_VIEW_V, TPC_VIEW_W})
40  this->PerformOneViewMatching(hitType);
41 
42  for (const HitType hitType : {TPC_VIEW_U, TPC_VIEW_V, TPC_VIEW_W})
43  this->PerformRecovery(hitType);
44 
46 
47  return STATUS_CODE_SUCCESS;
48 }
49 
50 //------------------------------------------------------------------------------------------------------------------------------------------
51 
53 {
54  const std::string inputClusterListName(
55  (hitType == TPC_VIEW_U) ? m_inputClusterListNameU : (hitType == TPC_VIEW_V) ? m_inputClusterListNameV : m_inputClusterListNameW);
56 
57  const ClusterList *pInputClusterList(nullptr);
58 
59  PANDORA_THROW_RESULT_IF_AND_IF(
60  STATUS_CODE_SUCCESS, STATUS_CODE_NOT_INITIALIZED, !=, PandoraContentApi::GetList(*this, inputClusterListName, pInputClusterList));
61 
62  if (!pInputClusterList)
63  return ClusterList();
64 
65  return *pInputClusterList;
66 }
67 
68 //------------------------------------------------------------------------------------------------------------------------------------------
69 
71 {
72  const PfoList *pMuonPfoList(nullptr);
73 
74  PANDORA_THROW_RESULT_IF_AND_IF(
75  STATUS_CODE_SUCCESS, STATUS_CODE_NOT_INITIALIZED, !=, PandoraContentApi::GetList(*this, m_muonPfoListName, pMuonPfoList));
76 
77  if (!pMuonPfoList)
78  return PfoList();
79 
80  return *pMuonPfoList;
81 }
82 
83 //------------------------------------------------------------------------------------------------------------------------------------------
84 
86 {
87  const PfoList *pDeltaRayPfoList(nullptr);
88 
89  PANDORA_THROW_RESULT_IF_AND_IF(
90  STATUS_CODE_SUCCESS, STATUS_CODE_NOT_INITIALIZED, !=, PandoraContentApi::GetList(*this, m_deltaRayPfoListName, pDeltaRayPfoList));
91 
92  if (!pDeltaRayPfoList)
93  return PfoList();
94 
95  return *pDeltaRayPfoList;
96 }
97 
98 //------------------------------------------------------------------------------------------------------------------------------------------
99 
101 {
104  ClusterVector availableClusterList;
105 
106  for (auto &entry : clusterProximityMap)
107  {
108  if (entry.first->IsAvailable())
109  availableClusterList.push_back(entry.first);
110  }
111 
112  std::sort(availableClusterList.begin(), availableClusterList.end(), LArClusterHelper::SortByNHits);
113 
114  ClusterSet modifiedClusters;
115 
116  for (const Cluster *const pAvailableCluster : availableClusterList)
117  {
118  if (modifiedClusters.count(pAvailableCluster))
119  continue;
120 
121  const DeltaRayMatchingContainers::ClusterProximityMap::const_iterator iter(clusterProximityMap.find(pAvailableCluster));
122 
123  // ATTN: Map will update during loop
124  if (iter == clusterProximityMap.end())
125  continue;
126 
127  bool found(false);
128  const ClusterList &nearbyClusters(clusterProximityMap.at(pAvailableCluster));
129  PfoVector nearbyMuonPfoVector;
130 
131  do
132  {
133  found = false;
134 
135  const ParticleFlowObject *pClosestMuonPfo(nullptr);
136  float closestDistance(std::numeric_limits<float>::max());
137 
138  for (const Cluster *const pNearbyCluster : nearbyClusters)
139  {
140  if (!this->IsMuonPfo(pNearbyCluster))
141  continue;
142 
143  if (std::find(nearbyMuonPfoVector.begin(), nearbyMuonPfoVector.end(), clusterToPfoMap.at(pNearbyCluster)) !=
144  nearbyMuonPfoVector.end())
145  continue;
146 
147  found = true;
148 
149  const float separation(LArClusterHelper::GetClosestDistance(pNearbyCluster, pAvailableCluster));
150 
151  if (separation < closestDistance)
152  {
153  closestDistance = separation;
154  pClosestMuonPfo = clusterToPfoMap.at(pNearbyCluster);
155  }
156  }
157 
158  if (pClosestMuonPfo)
159  nearbyMuonPfoVector.push_back(pClosestMuonPfo);
160  } while (found);
161 
162  if (nearbyMuonPfoVector.empty())
163  continue;
164 
165  if (this->AddIntoExistingDeltaRay(pAvailableCluster, nearbyMuonPfoVector))
166  continue;
167 
168  this->CreateDeltaRay(pAvailableCluster, nearbyMuonPfoVector, modifiedClusters);
169  }
170 }
171 
172 //------------------------------------------------------------------------------------------------------------------------------------------
173 
174 bool OneViewDeltaRayMatchingAlgorithm::IsMuonPfo(const Cluster *const pCluster)
175 {
176  const HitType hitType(LArClusterHelper::GetClusterHitType(pCluster));
178  const DeltaRayMatchingContainers::ClusterToPfoMap::const_iterator iter(clusterToPfoMap.find(pCluster));
179 
180  if (iter == clusterToPfoMap.end())
181  return false;
182 
183  const ParticleFlowObject *const pPfo(iter->second);
184  const PfoList &muonPfoList(this->GetMuonPfoList());
185 
186  return (std::find(muonPfoList.begin(), muonPfoList.end(), pPfo) != muonPfoList.end());
187 }
188 
189 //------------------------------------------------------------------------------------------------------------------------------------------
190 
191 bool OneViewDeltaRayMatchingAlgorithm::AddIntoExistingDeltaRay(const Cluster *const pAvailableCluster, const PfoVector &nearbyMuonPfoVector)
192 {
193  const HitType hitType(LArClusterHelper::GetClusterHitType(pAvailableCluster));
194  const HitType projectedHitType1((hitType == TPC_VIEW_U) ? TPC_VIEW_V : (hitType == TPC_VIEW_V) ? TPC_VIEW_W : TPC_VIEW_U);
195  const HitType projectedHitType2((projectedHitType1 == TPC_VIEW_U) ? TPC_VIEW_V : (projectedHitType1 == TPC_VIEW_V) ? TPC_VIEW_W : TPC_VIEW_U);
198 
199  for (const ParticleFlowObject *const pNearbyMuonPfo : nearbyMuonPfoVector)
200  {
201  const Cluster *const pProjectedCluster1(this->GetBestProjectedCluster({pAvailableCluster}, pNearbyMuonPfo, projectedHitType1, false));
202  const Cluster *const pProjectedCluster2(this->GetBestProjectedCluster({pAvailableCluster}, pNearbyMuonPfo, projectedHitType2, false));
203 
204  if ((!pProjectedCluster1) || (!pProjectedCluster2))
205  continue;
206 
207  const ParticleFlowObject *const pPfo1(clusterToPfoMap1.at(pProjectedCluster1));
208  const ParticleFlowObject *const pPfo2(clusterToPfoMap2.at(pProjectedCluster2));
209 
210  if (pPfo1 == pPfo2)
211  {
212  PANDORA_RETURN_RESULT_IF(STATUS_CODE_SUCCESS, !=, PandoraContentApi::AddToPfo(*this, pPfo1, pAvailableCluster));
213 
215 
216  return true;
217  }
218  }
219 
220  return false;
221 }
222 
223 //------------------------------------------------------------------------------------------------------------------------------------------
224 
226  const ClusterList &deltaRayClusterGroup, const ParticleFlowObject *const pNearbyMuonPfo, const HitType hitType, const bool findAvailable)
227 {
228  ClusterList muonClusterList;
229  LArPfoHelper::GetClusters(pNearbyMuonPfo, hitType, muonClusterList);
230 
231  if (muonClusterList.size() != 1)
232  return nullptr;
233 
235  auto muonProximityIter(clusterProximityMap.find(muonClusterList.front()));
236 
237  if (muonProximityIter == clusterProximityMap.end())
238  return nullptr;
239 
240  float spanMinX(0.f), spanMaxX(0.f);
241  this->GetClusterSpanX(deltaRayClusterGroup, spanMinX, spanMaxX);
242 
243  unsigned int highestHit(0);
244  const Cluster *pProjectedCluster(nullptr);
245 
246  for (const Cluster *const pNearbyCluster : muonProximityIter->second)
247  {
248  if (findAvailable && !pNearbyCluster->IsAvailable())
249  continue;
250 
251  if (!findAvailable && !this->IsDeltaRayPfo(pNearbyCluster))
252  continue;
253 
254  float minX(0.f), maxX(0.f);
255  pNearbyCluster->GetClusterSpanX(minX, maxX);
256 
257  if ((maxX < (spanMinX - m_overlapExtension)) || (minX > (spanMaxX + m_overlapExtension)))
258  continue;
259 
260  if (pNearbyCluster->GetNCaloHits() > highestHit)
261  {
262  highestHit = pNearbyCluster->GetNCaloHits();
263  pProjectedCluster = pNearbyCluster;
264  }
265  }
266 
267  return pProjectedCluster;
268 }
269 
270 //------------------------------------------------------------------------------------------------------------------------------------------
271 
272 bool OneViewDeltaRayMatchingAlgorithm::IsDeltaRayPfo(const Cluster *const pCluster)
273 {
274  const HitType hitType(LArClusterHelper::GetClusterHitType(pCluster));
276 
277  const DeltaRayMatchingContainers::ClusterToPfoMap::const_iterator iter(clusterToPfoMap.find(pCluster));
278 
279  if (iter == clusterToPfoMap.end())
280  return false;
281 
282  const ParticleFlowObject *const pDeltaRayPfo(iter->second);
283  const PfoList &deltaRayPfoList(this->GetDeltaRayPfoList());
284 
285  return (std::find(deltaRayPfoList.begin(), deltaRayPfoList.end(), pDeltaRayPfo) != deltaRayPfoList.end());
286 }
287 
288 //------------------------------------------------------------------------------------------------------------------------------------------
289 
290 void OneViewDeltaRayMatchingAlgorithm::GetClusterSpanX(const ClusterList &clusterList, float &spanMinX, float &spanMaxX)
291 {
292  spanMinX = std::numeric_limits<float>::max();
293  spanMaxX = -std::numeric_limits<float>::max();
294 
295  for (const Cluster *const pCluster : clusterList)
296  {
297  float minX(0.f), maxX(0.f);
298  pCluster->GetClusterSpanX(minX, maxX);
299 
300  if (minX < spanMinX)
301  spanMinX = minX;
302 
303  if (maxX > spanMaxX)
304  spanMaxX = maxX;
305  }
306 }
307 
308 //------------------------------------------------------------------------------------------------------------------------------------------
309 
310 void OneViewDeltaRayMatchingAlgorithm::CreateDeltaRay(const Cluster *const pAvailableCluster, const PfoVector &nearbyMuonPfoVector, ClusterSet &modifiedClusters)
311 {
312  ClusterList clusterGroup, consideredClusters;
313  this->GetNearbyAvailableClusters(pAvailableCluster, consideredClusters, clusterGroup);
314 
315  for (const Cluster *const pModifiedCluster : clusterGroup)
316  modifiedClusters.insert(pModifiedCluster);
317 
318  const HitType hitType(LArClusterHelper::GetClusterHitType(pAvailableCluster));
319  const HitType projectedHitType1((hitType == TPC_VIEW_U) ? TPC_VIEW_V : (hitType == TPC_VIEW_V) ? TPC_VIEW_W : TPC_VIEW_U);
320  const HitType projectedHitType2((projectedHitType1 == TPC_VIEW_U) ? TPC_VIEW_V : (projectedHitType1 == TPC_VIEW_V) ? TPC_VIEW_W : TPC_VIEW_U);
321  ClusterList projectedClusters1, projectedClusters2;
322 
323  for (const ParticleFlowObject *const pNearbyMuonPfo : nearbyMuonPfoVector)
324  {
325  const Cluster *const pProjectedCluster1(this->GetBestProjectedCluster(clusterGroup, pNearbyMuonPfo, projectedHitType1, true));
326  const Cluster *const pProjectedCluster2(this->GetBestProjectedCluster(clusterGroup, pNearbyMuonPfo, projectedHitType2, true));
327 
328  if ((!pProjectedCluster1) && (!pProjectedCluster2))
329  continue;
330 
331  ClusterList consideredClusters1;
332  if (pProjectedCluster1)
333  this->GetNearbyAvailableClusters(pProjectedCluster1, consideredClusters1, projectedClusters1);
334 
335  ClusterList consideredClusters2;
336  if (pProjectedCluster2)
337  this->GetNearbyAvailableClusters(pProjectedCluster2, consideredClusters2, projectedClusters2);
338  }
339 
340  const Cluster *const pCluster1(this->MergeClusterGroup(clusterGroup));
341  const Cluster *const pCluster2(this->MergeClusterGroup(projectedClusters1));
342  const Cluster *const pCluster3(this->MergeClusterGroup(projectedClusters2));
343 
344  this->CreatePfo(pCluster1, pCluster2, pCluster3);
345 }
346 
347 //------------------------------------------------------------------------------------------------------------------------------------------
348 
349 void OneViewDeltaRayMatchingAlgorithm::GetNearbyAvailableClusters(const Cluster *const pCluster, ClusterList &consideredClusters, ClusterList &foundClusters)
350 {
351  const HitType hitType(LArClusterHelper::GetClusterHitType(pCluster));
353 
354  consideredClusters.push_back(pCluster);
355 
356  if (!pCluster->IsAvailable())
357  return;
358 
359  if (std::find(foundClusters.begin(), foundClusters.end(), pCluster) == foundClusters.end())
360  foundClusters.push_back(pCluster);
361 
362  const DeltaRayMatchingContainers::ClusterProximityMap::const_iterator proximityIter(clusterProximityMap.find(pCluster));
363 
364  if (proximityIter == clusterProximityMap.end())
365  return;
366 
367  for (const Cluster *const pNearbyCluster : proximityIter->second)
368  {
369  if (!pNearbyCluster->IsAvailable())
370  continue;
371 
372  if (std::find(consideredClusters.begin(), consideredClusters.end(), pNearbyCluster) != consideredClusters.end())
373  continue;
374 
375  if (std::find(foundClusters.begin(), foundClusters.end(), pNearbyCluster) != foundClusters.end())
376  continue;
377 
378  this->GetNearbyAvailableClusters(pNearbyCluster, consideredClusters, foundClusters);
379  }
380 }
381 
382 //------------------------------------------------------------------------------------------------------------------------------------------
383 
384 const Cluster *OneViewDeltaRayMatchingAlgorithm::MergeClusterGroup(const ClusterList &clusterGroup)
385 {
386  if (clusterGroup.empty())
387  return nullptr;
388 
389  const Cluster *const pClusterToEnlarge(clusterGroup.front());
390 
391  if (clusterGroup.size() == 1)
392  return pClusterToEnlarge;
393 
394  const HitType hitType(LArClusterHelper::GetClusterHitType(pClusterToEnlarge));
395  const std::string inputClusterListName(
396  (hitType == TPC_VIEW_U) ? m_inputClusterListNameU : (hitType == TPC_VIEW_V) ? m_inputClusterListNameV : m_inputClusterListNameW);
397 
398  for (const Cluster *const pClusterToDelete : clusterGroup)
399  {
401 
402  if (pClusterToDelete != pClusterToEnlarge)
403  {
404  PANDORA_THROW_RESULT_IF(STATUS_CODE_SUCCESS, !=, PandoraContentApi::ReplaceCurrentList<Cluster>(*this, inputClusterListName));
405  PANDORA_THROW_RESULT_IF(STATUS_CODE_SUCCESS, !=, PandoraContentApi::MergeAndDeleteClusters(*this, pClusterToEnlarge, pClusterToDelete));
406  }
407  }
408 
409  m_deltaRayMatchingContainers.AddClustersToContainers({pClusterToEnlarge}, {nullptr});
410 
411  return pClusterToEnlarge;
412 }
413 
414 //------------------------------------------------------------------------------------------------------------------------------------------
415 
416 void OneViewDeltaRayMatchingAlgorithm::CreatePfo(const Cluster *const pCluster1, const Cluster *const pCluster2, const Cluster *const pCluster3)
417 {
418  const PfoList *pPfoList(nullptr);
419  std::string pfoListName;
420  PANDORA_THROW_RESULT_IF(STATUS_CODE_SUCCESS, !=, PandoraContentApi::CreateTemporaryListAndSetCurrent(*this, pPfoList, pfoListName));
421 
422  PandoraContentApi::ParticleFlowObject::Parameters pfoParameters;
423  pfoParameters.m_particleId = E_MINUS;
424  pfoParameters.m_charge = PdgTable::GetParticleCharge(E_MINUS);
425  pfoParameters.m_mass = PdgTable::GetParticleMass(E_MINUS);
426  pfoParameters.m_energy = 0.f;
427  pfoParameters.m_momentum = CartesianVector(0.f, 0.f, 0.f);
428 
429  if (pCluster1)
430  pfoParameters.m_clusterList.push_back(pCluster1);
431 
432  if (pCluster2)
433  pfoParameters.m_clusterList.push_back(pCluster2);
434 
435  if (pCluster3)
436  pfoParameters.m_clusterList.push_back(pCluster3);
437 
438  if (pfoParameters.m_clusterList.empty())
439  throw StatusCodeException(STATUS_CODE_FAILURE);
440 
441  const ParticleFlowObject *pPfo(nullptr);
442 
443  PANDORA_THROW_RESULT_IF(STATUS_CODE_SUCCESS, !=, PandoraContentApi::ParticleFlowObject::Create(*this, pfoParameters, pPfo));
444  PANDORA_THROW_RESULT_IF(STATUS_CODE_SUCCESS, !=, PandoraContentApi::SaveList<Pfo>(*this, m_outputPfoListName));
445  PANDORA_THROW_RESULT_IF(STATUS_CODE_SUCCESS, !=, PandoraContentApi::ReplaceCurrentList<Pfo>(*this, m_outputPfoListName));
446 
448 }
449 
450 //------------------------------------------------------------------------------------------------------------------------------------------
451 
453 {
454  const ClusterList &inputClusterList(this->GetInputClusterList(hitType));
455 
456  for (const Cluster *const pCluster : inputClusterList)
457  {
458  if (!pCluster->IsAvailable())
459  continue;
460 
461  if (pCluster->GetNCaloHits() < m_minClusterHits)
462  continue;
463 
464  this->CreatePfo(pCluster, nullptr, nullptr);
465  }
466 }
467 
468 //------------------------------------------------------------------------------------------------------------------------------------------
469 
470 StatusCode OneViewDeltaRayMatchingAlgorithm::ReadSettings(const TiXmlHandle xmlHandle)
471 {
472  PANDORA_RETURN_RESULT_IF(STATUS_CODE_SUCCESS, !=, XmlHelper::ReadValue(xmlHandle, "MuonPfoListName", m_muonPfoListName));
473 
474  PANDORA_RETURN_RESULT_IF(STATUS_CODE_SUCCESS, !=, XmlHelper::ReadValue(xmlHandle, "DeltaRayPfoListName", m_deltaRayPfoListName));
475 
476  PANDORA_RETURN_RESULT_IF(STATUS_CODE_SUCCESS, !=, XmlHelper::ReadValue(xmlHandle, "InputClusterListNameU", m_inputClusterListNameU));
477 
478  PANDORA_RETURN_RESULT_IF(STATUS_CODE_SUCCESS, !=, XmlHelper::ReadValue(xmlHandle, "InputClusterListNameV", m_inputClusterListNameV));
479 
480  PANDORA_RETURN_RESULT_IF(STATUS_CODE_SUCCESS, !=, XmlHelper::ReadValue(xmlHandle, "InputClusterListNameW", m_inputClusterListNameW));
481 
482  PANDORA_RETURN_RESULT_IF(STATUS_CODE_SUCCESS, !=, XmlHelper::ReadValue(xmlHandle, "OutputPfoListName", m_outputPfoListName));
483 
484  PANDORA_RETURN_RESULT_IF_AND_IF(STATUS_CODE_SUCCESS, STATUS_CODE_NOT_FOUND, !=,
485  XmlHelper::ReadValue(xmlHandle, "SearchRegion1D", m_deltaRayMatchingContainers.m_searchRegion1D));
486 
487  PANDORA_RETURN_RESULT_IF_AND_IF(
488  STATUS_CODE_SUCCESS, STATUS_CODE_NOT_FOUND, !=, XmlHelper::ReadValue(xmlHandle, "OverlapExtension", m_overlapExtension));
489 
490  PANDORA_RETURN_RESULT_IF_AND_IF(STATUS_CODE_SUCCESS, STATUS_CODE_NOT_FOUND, !=, XmlHelper::ReadValue(xmlHandle, "MinClusterHits", m_minClusterHits));
491 
492  return STATUS_CODE_SUCCESS;
493 }
494 
495 } // 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.
QList< Entry > entry
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)
enum cvn::HType HitType
std::string string
Definition: nybbler.cc:12
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...
QCollection::Item first()
Definition: qglist.cpp:807
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.
static int max(int a, int b)
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
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.