LArSoft  v09_90_00
Liquid Argon Software toolkit - https://larsoft.org/
TwoViewDeltaRayMatchingAlgorithm.cc
Go to the documentation of this file.
1 
9 #include "Pandora/AlgorithmHeaders.h"
10 
14 
16 
18 
19 using namespace pandora;
20 
21 namespace lar_content
22 {
23 
24 TwoViewDeltaRayMatchingAlgorithm::TwoViewDeltaRayMatchingAlgorithm() :
25  m_nMaxMatrixToolRepeats(10),
26  m_minClusterCaloHits(3),
27  m_maxDistanceFromPrediction(2.f),
28  m_maxGoodMatchReducedChiSquared(1.f),
29  m_minDistanceFromMuon(1.f),
30  m_maxDistanceToCollected(1.f)
31 {
32 }
33 
34 //------------------------------------------------------------------------------------------------------------------------------------------
35 
37 {
38  HitTypeVector hitTypeVector;
39 
40  for (const HitType hitType : {TPC_VIEW_U, TPC_VIEW_V, TPC_VIEW_W})
41  {
42  const unsigned int hitTypeIndex(this->GetMatchingControl().GetHitTypeIndex(hitType));
43 
44  if ((hitTypeIndex != 1) && (hitTypeIndex != 2))
45  continue;
46 
47  hitTypeVector.push_back(hitType);
48  }
49 
50  return hitTypeVector;
51 }
52 
53 //------------------------------------------------------------------------------------------------------------------------------------------
54 
55 const Cluster *TwoViewDeltaRayMatchingAlgorithm::GetCluster(const MatrixType::Element &element, const HitType hitType)
56 {
57  const unsigned int hitTypeIndex(this->GetMatchingControl().GetHitTypeIndex(hitType));
58 
59  if ((hitTypeIndex != 1) && (hitTypeIndex != 2))
60  return element.GetOverlapResult().GetBestMatchedAvailableCluster();
61 
62  return hitTypeIndex == 1 ? element.GetCluster1() : element.GetCluster2();
63 }
64 
65 //------------------------------------------------------------------------------------------------------------------------------------------
66 
68 {
69  return (pCluster->GetNCaloHits() >= m_minClusterCaloHits);
70 }
71 
72 //------------------------------------------------------------------------------------------------------------------------------------------
73 
74 void TwoViewDeltaRayMatchingAlgorithm::CalculateOverlapResult(const Cluster *const pCluster1, const Cluster *const pCluster2, const Cluster *const)
75 {
76  TwoViewDeltaRayOverlapResult overlapResult;
77  PANDORA_THROW_RESULT_IF_AND_IF(STATUS_CODE_SUCCESS, STATUS_CODE_NOT_FOUND, !=, this->CalculateOverlapResult(pCluster1, pCluster2, overlapResult));
78 
79  if (overlapResult.IsInitialized())
80  this->GetMatchingControl().GetOverlapMatrix().SetOverlapResult(pCluster1, pCluster2, overlapResult);
81 }
82 
83 //------------------------------------------------------------------------------------------------------------------------------------------
84 
86  const Cluster *const pCluster1, const Cluster *const pCluster2, TwoViewDeltaRayOverlapResult &overlapResult) const
87 {
88  float xMin1(0.f), xMax1(0.f), xMin2(0.f), xMax2(0.f);
89  pCluster1->GetClusterSpanX(xMin1, xMax1);
90  pCluster2->GetClusterSpanX(xMin2, xMax2);
91 
92  const float xOverlap(std::min(xMax1, xMax2) - std::max(xMin1, xMin2));
93 
94  if (xOverlap < std::numeric_limits<float>::epsilon())
95  return STATUS_CODE_NOT_FOUND;
96 
97  PfoList commonMuonPfoList;
98  this->FindCommonMuonParents(pCluster1, pCluster2, commonMuonPfoList);
99 
100  if (commonMuonPfoList.empty())
101  return STATUS_CODE_NOT_FOUND;
102 
103  CartesianPointVector projectedPositions;
104  StatusCode status(this->GetProjectedPositions(pCluster1, pCluster2, projectedPositions));
105 
106  if (status != STATUS_CODE_SUCCESS)
107  return status;
108 
109  // Find all matched clusters (including unavailable)
110  ClusterList matchedClusterList;
111  this->CollectThirdViewClusters(pCluster1, pCluster2, projectedPositions, matchedClusterList);
112 
113  if (matchedClusterList.empty())
114  return STATUS_CODE_NOT_FOUND;
115 
116  float reducedChiSquared(std::numeric_limits<float>::max());
117  const Cluster *const pBestMatchedCluster =
118  this->GetBestMatchedCluster(pCluster1, pCluster2, commonMuonPfoList, matchedClusterList, reducedChiSquared);
119 
120  //ATTN: Ignore if other clusters matches have more hits
121  if (pBestMatchedCluster && (pBestMatchedCluster->IsAvailable()))
122  {
123  const unsigned int hitSum12(pCluster1->GetNCaloHits() + pCluster2->GetNCaloHits());
124  const unsigned int hitSum13(pCluster1->GetNCaloHits() + pBestMatchedCluster->GetNCaloHits());
125 
126  if (hitSum13 > hitSum12)
127  return STATUS_CODE_NOT_FOUND;
128 
129  const unsigned int hitSum23(pCluster2->GetNCaloHits() + pBestMatchedCluster->GetNCaloHits());
130 
131  if (hitSum23 > hitSum12)
132  return STATUS_CODE_NOT_FOUND;
133  }
134 
135  TwoViewXOverlap xOverlapObject(xMin1, xMax1, xMin2, xMax2);
136  overlapResult = TwoViewDeltaRayOverlapResult(xOverlapObject, commonMuonPfoList, pBestMatchedCluster, matchedClusterList, reducedChiSquared);
137 
138  return STATUS_CODE_SUCCESS;
139 }
140 
141 //------------------------------------------------------------------------------------------------------------------------------------------
142 
143 void TwoViewDeltaRayMatchingAlgorithm::FindCommonMuonParents(const Cluster *const pCluster1, const Cluster *const pCluster2, PfoList &commonMuonPfoList) const
144 {
145  ClusterList consideredClusters1, consideredClusters2;
146  PfoList nearbyMuonPfos1, nearbyMuonPfos2;
147 
148  this->GetNearbyMuonPfos(pCluster1, consideredClusters1, nearbyMuonPfos1);
149 
150  if (nearbyMuonPfos1.empty())
151  return;
152 
153  this->GetNearbyMuonPfos(pCluster2, consideredClusters2, nearbyMuonPfos2);
154 
155  if (nearbyMuonPfos2.empty())
156  return;
157 
158  for (const ParticleFlowObject *const pNearbyMuon1 : nearbyMuonPfos1)
159  {
160  for (const ParticleFlowObject *const pNearbyMuon2 : nearbyMuonPfos2)
161  {
162  if (pNearbyMuon1 == pNearbyMuon2)
163  commonMuonPfoList.push_back(pNearbyMuon1);
164  }
165  }
166 }
167 
168 //------------------------------------------------------------------------------------------------------------------------------------------
169 
170 void TwoViewDeltaRayMatchingAlgorithm::CollectThirdViewClusters(const Cluster *const pCluster1, const Cluster *const pCluster2,
171  const CartesianPointVector &projectedPositions, ClusterList &matchedClusters) const
172 {
173  const ClusterList *pInputClusterList(nullptr);
174  PANDORA_THROW_RESULT_IF(STATUS_CODE_SUCCESS, !=, PandoraContentApi::GetList(*this, m_inputClusterListName, pInputClusterList));
175 
176  if (!pInputClusterList || pInputClusterList->empty())
177  return;
178 
179  for (const Cluster *const pCluster : *pInputClusterList)
180  {
181  const float separation(LArMuonLeadingHelper::GetClosestDistance(pCluster, projectedPositions));
182 
183  if (separation > m_maxDistanceFromPrediction)
184  continue;
185 
186  float reducedChiSquared(0.f);
187  if (this->PerformThreeViewMatching(pCluster1, pCluster2, pCluster, reducedChiSquared) == STATUS_CODE_NOT_FOUND)
188  continue;
189 
190  if (reducedChiSquared > m_maxGoodMatchReducedChiSquared)
191  continue;
192 
193  matchedClusters.push_back(pCluster);
194  }
195 }
196 
197 //------------------------------------------------------------------------------------------------------------------------------------------
198 
199 const Cluster *TwoViewDeltaRayMatchingAlgorithm::GetBestMatchedCluster(const Cluster *const pCluster1, const Cluster *const pCluster2,
200  const PfoList &commonMuonPfoList, const ClusterList &matchedClusters, float &reducedChiSquared) const
201 {
202  const Cluster *pBestMatchedCluster(nullptr);
203 
204  if (matchedClusters.empty())
205  return pBestMatchedCluster;
206 
207  const HitType thirdViewHitType(LArClusterHelper::GetClusterHitType(matchedClusters.front()));
208  ClusterList muonClusterList;
209 
210  for (const ParticleFlowObject *const pMuonPfo : commonMuonPfoList)
211  LArPfoHelper::GetClusters(pMuonPfo, thirdViewHitType, muonClusterList);
212 
213  unsigned int highestNHits(0);
214 
215  for (const Cluster *const pMatchedCluster : matchedClusters)
216  {
217  if (!pMatchedCluster->IsAvailable())
218  {
219  if (std::find(muonClusterList.begin(), muonClusterList.end(), pMatchedCluster) == muonClusterList.end())
220  continue;
221  }
222 
223  if (pMatchedCluster->GetNCaloHits() > highestNHits)
224  {
225  highestNHits = pMatchedCluster->GetNCaloHits();
226  pBestMatchedCluster = pMatchedCluster;
227  }
228  }
229 
230  if (!pBestMatchedCluster)
231  return pBestMatchedCluster;
232 
233  if (this->PerformThreeViewMatching(pCluster1, pCluster2, pBestMatchedCluster, reducedChiSquared) == STATUS_CODE_NOT_FOUND)
234  throw StatusCodeException(STATUS_CODE_FAILURE);
235 
236  return pBestMatchedCluster;
237 }
238 
239 //------------------------------------------------------------------------------------------------------------------------------------------
240 
241 bool TwoViewDeltaRayMatchingAlgorithm::CreatePfo(const MatrixType::Element &protoParticleElement)
242 {
243  ProtoParticle protoParticle;
244 
245  protoParticle.m_clusterList.push_back(protoParticleElement.GetCluster1());
246  protoParticle.m_clusterList.push_back(protoParticleElement.GetCluster2());
247 
248  const Cluster *const pBestMatchedCluster(protoParticleElement.GetOverlapResult().GetBestMatchedCluster());
249 
250  if (pBestMatchedCluster)
251  this->FormThirdViewCluster(protoParticleElement, protoParticle);
252 
253  ProtoParticleVector protoParticleVector({protoParticle});
254 
255  return (this->CreatePfos(protoParticleVector));
256 }
257 
258 //------------------------------------------------------------------------------------------------------------------------------------------
259 
260 void TwoViewDeltaRayMatchingAlgorithm::FormThirdViewCluster(const MatrixType::Element &element, ProtoParticle &protoParticle)
261 {
262  const PfoList &commonMuonPfoList(element.GetOverlapResult().GetCommonMuonPfoList());
263  const Cluster *const pBestMatchedCluster(element.GetOverlapResult().GetBestMatchedCluster());
264  const HitType thirdViewHitType(LArClusterHelper::GetClusterHitType(pBestMatchedCluster));
265  const ParticleFlowObject *pMatchedMuonPfo(nullptr);
266 
267  for (const ParticleFlowObject *const pMuonPfo : commonMuonPfoList)
268  {
269  ClusterList muonClusterList;
270  LArPfoHelper::GetClusters(pMuonPfo, thirdViewHitType, muonClusterList);
271 
272  if (std::find(muonClusterList.begin(), muonClusterList.end(), pBestMatchedCluster) != muonClusterList.end())
273  pMatchedMuonPfo = pMuonPfo;
274  }
275 
276  const Cluster *pThirdViewCluster(pMatchedMuonPfo ? nullptr : pBestMatchedCluster);
277 
278  if (pMatchedMuonPfo)
279  {
280  CaloHitList deltaRayHitList;
281 
282  if (this->CollectHitsFromMuon(element.GetCluster1(), element.GetCluster2(), nullptr, pMatchedMuonPfo, m_minDistanceFromMuon,
283  m_maxDistanceToCollected, deltaRayHitList) == STATUS_CODE_SUCCESS)
284  {
285  this->SplitMuonCluster(this->GetThirdViewClusterListName(), pBestMatchedCluster, deltaRayHitList, pThirdViewCluster);
286  this->UpdateForThirdViewClusterModification(pBestMatchedCluster, true);
287  }
288  else
289  {
290  pThirdViewCluster = element.GetOverlapResult().GetBestMatchedAvailableCluster();
291  }
292  }
293 
294  if (!pThirdViewCluster)
295  return;
296 
297  this->UpdateForThirdViewClusterModification(pThirdViewCluster, false);
298  this->MergeThirdView(element, pThirdViewCluster);
299 
300  protoParticle.m_clusterList.push_back(pThirdViewCluster);
301 }
302 
303 //------------------------------------------------------------------------------------------------------------------------------------------
304 
305 void TwoViewDeltaRayMatchingAlgorithm::MergeThirdView(const MatrixType::Element &element, const Cluster *const pSeedCluster)
306 {
307  CaloHitList caloHitList1, caloHitList2;
308  element.GetCluster1()->GetOrderedCaloHitList().FillCaloHitList(caloHitList1);
309  element.GetCluster2()->GetOrderedCaloHitList().FillCaloHitList(caloHitList2);
310 
311  // ATTN: Need copy as original will change throughout function
312  ClusterList matchedClusters(element.GetOverlapResult().GetMatchedClusterList());
313 
314  ClusterSet checkedClusters;
315 
316  if (std::find(matchedClusters.begin(), matchedClusters.end(), pSeedCluster) != matchedClusters.end())
317  checkedClusters.insert(pSeedCluster);
318 
319  while (checkedClusters.size() != matchedClusters.size())
320  {
321  const Cluster *pClusterToDelete(nullptr);
322  unsigned int highestHit(0);
323 
324  for (const Cluster *const pMatchedCluster : matchedClusters)
325  {
326  if (checkedClusters.count(pMatchedCluster))
327  continue;
328 
329  if (pMatchedCluster->GetNCaloHits() > highestHit)
330  {
331  pClusterToDelete = pMatchedCluster;
332  highestHit = pMatchedCluster->GetNCaloHits();
333  }
334  }
335 
336  if (!pClusterToDelete)
337  return;
338 
339  checkedClusters.insert(pClusterToDelete);
340 
341  if (!pClusterToDelete->IsAvailable())
342  continue;
343 
344  CaloHitList caloHitList3;
345  pSeedCluster->GetOrderedCaloHitList().FillCaloHitList(caloHitList3);
346  pClusterToDelete->GetOrderedCaloHitList().FillCaloHitList(caloHitList3);
347 
348  float reducedChiSquared(std::numeric_limits<float>::max());
349  const StatusCode status(this->PerformThreeViewMatching(caloHitList1, caloHitList2, caloHitList3, reducedChiSquared));
350 
351  if (status == STATUS_CODE_NOT_FOUND)
352  continue;
353 
354  if (reducedChiSquared > m_maxGoodMatchReducedChiSquared)
355  continue;
356 
357  this->UpdateForThirdViewClusterModification(pClusterToDelete, false);
358 
359  PANDORA_THROW_RESULT_IF(STATUS_CODE_SUCCESS, !=, PandoraContentApi::ReplaceCurrentList<Cluster>(*this, this->GetThirdViewClusterListName()));
360 
361  PANDORA_THROW_RESULT_IF(STATUS_CODE_SUCCESS, !=, PandoraContentApi::MergeAndDeleteClusters(*this, pSeedCluster, pClusterToDelete));
362  }
363 }
364 
365 //------------------------------------------------------------------------------------------------------------------------------------------
366 
367 void TwoViewDeltaRayMatchingAlgorithm::UpdateForThirdViewClusterModification(const Cluster *const pModifiedCluster, const bool isMuon)
368 {
369  auto &theMatrix(this->GetMatchingControl().GetOverlapMatrix());
370 
371  for (auto [pCluster1, overlapList] : theMatrix)
372  {
373  for (auto [pCluster2, overlapResult] : overlapList)
374  {
375  ClusterList matchedClusters(overlapResult.GetMatchedClusterList());
376 
377  auto matchedClustersIter(std::find(matchedClusters.begin(), matchedClusters.end(), pModifiedCluster));
378 
379  if (matchedClustersIter == matchedClusters.end())
380  continue;
381 
382  float tempReducedChiSquared(std::numeric_limits<float>::max());
383 
384  if (isMuon)
385  this->PerformThreeViewMatching(pCluster1, pCluster2, pModifiedCluster, tempReducedChiSquared);
386 
387  if (tempReducedChiSquared > m_maxGoodMatchReducedChiSquared)
388  matchedClusters.erase(matchedClustersIter);
389 
390  float reducedChiSquared(std::numeric_limits<float>::max());
391  const Cluster *const pBestMatchedCluster =
392  this->GetBestMatchedCluster(pCluster1, pCluster2, overlapResult.GetCommonMuonPfoList(), matchedClusters, reducedChiSquared);
393 
394  TwoViewDeltaRayOverlapResult newOverlapResult(
395  overlapResult.GetXOverlap(), overlapResult.GetCommonMuonPfoList(), pBestMatchedCluster, matchedClusters, reducedChiSquared);
396  theMatrix.ReplaceOverlapResult(pCluster1, pCluster2, newOverlapResult);
397  }
398  }
399 }
400 
401 //------------------------------------------------------------------------------------------------------------------------------------------
402 
404 {
405  // Apply tools sequentially restarting if a change is made and ending if the tools finish or the restart limit is reached
406  unsigned int repeatCounter(0);
407 
408  for (auto toolIter = m_algorithmToolVector.begin(); toolIter != m_algorithmToolVector.end();)
409  {
410  DeltaRayMatrixTool *const pTool(*toolIter);
411  const bool repeatTools(pTool->Run(this, this->GetMatchingControl().GetOverlapMatrix()));
412 
413  toolIter = repeatTools ? m_algorithmToolVector.begin() : toolIter + 1;
414  repeatCounter = repeatTools ? repeatCounter + 1 : repeatCounter;
415 
416  if (repeatCounter > m_nMaxMatrixToolRepeats)
417  break;
418  }
419 }
420 
421 //------------------------------------------------------------------------------------------------------------------------------------------
422 
423 StatusCode TwoViewDeltaRayMatchingAlgorithm::ReadSettings(const TiXmlHandle xmlHandle)
424 {
425  PANDORA_RETURN_RESULT_IF(STATUS_CODE_SUCCESS, !=, XmlHelper::ReadValue(xmlHandle, "InputClusterListName", m_inputClusterListName));
426 
427  PANDORA_RETURN_RESULT_IF(STATUS_CODE_SUCCESS, !=, XmlHelper::ProcessAlgorithm(*this, xmlHandle, "ClusterRebuilding", m_reclusteringAlgorithmName));
428 
429  AlgorithmToolVector algorithmToolVector;
430  PANDORA_RETURN_RESULT_IF(STATUS_CODE_SUCCESS, !=, XmlHelper::ProcessAlgorithmToolList(*this, xmlHandle, "DeltaRayTools", algorithmToolVector));
431 
432  for (auto algorithmTool : algorithmToolVector)
433  {
434  DeltaRayMatrixTool *const pDeltaRayMatrixTool(dynamic_cast<DeltaRayMatrixTool *>(algorithmTool));
435 
436  if (!pDeltaRayMatrixTool)
437  return STATUS_CODE_INVALID_PARAMETER;
438 
439  m_algorithmToolVector.push_back(pDeltaRayMatrixTool);
440  }
441 
442  PANDORA_RETURN_RESULT_IF_AND_IF(
443  STATUS_CODE_SUCCESS, STATUS_CODE_NOT_FOUND, !=, XmlHelper::ReadValue(xmlHandle, "NMaxMatrixToolRepeats", m_nMaxMatrixToolRepeats));
444 
445  PANDORA_RETURN_RESULT_IF_AND_IF(
446  STATUS_CODE_SUCCESS, STATUS_CODE_NOT_FOUND, !=, XmlHelper::ReadValue(xmlHandle, "MinClusterCaloHits", m_minClusterCaloHits));
447 
448  PANDORA_RETURN_RESULT_IF_AND_IF(STATUS_CODE_SUCCESS, STATUS_CODE_NOT_FOUND, !=,
449  XmlHelper::ReadValue(xmlHandle, "MaxDistanceFromPrediction", m_maxDistanceFromPrediction));
450 
451  PANDORA_RETURN_RESULT_IF_AND_IF(STATUS_CODE_SUCCESS, STATUS_CODE_NOT_FOUND, !=,
452  XmlHelper::ReadValue(xmlHandle, "MaxGoodMatchReducedChiSquared", m_maxGoodMatchReducedChiSquared));
453 
454  PANDORA_RETURN_RESULT_IF_AND_IF(
455  STATUS_CODE_SUCCESS, STATUS_CODE_NOT_FOUND, !=, XmlHelper::ReadValue(xmlHandle, "MinDistanceFromMuon", m_minDistanceFromMuon));
456 
457  PANDORA_RETURN_RESULT_IF_AND_IF(
458  STATUS_CODE_SUCCESS, STATUS_CODE_NOT_FOUND, !=, XmlHelper::ReadValue(xmlHandle, "MaxDistanceToCollected", m_maxDistanceToCollected));
459 
460  return BaseAlgorithm::ReadSettings(xmlHandle);
461 }
462 
463 } // namespace lar_content
std::vector< ProtoParticle > ProtoParticleVector
static float GetClosestDistance(const pandora::Cluster *const pCluster, const pandora::CartesianPointVector &cartesianPointVector)
Get closest distance between a specified cluster and list of positions.
bool IsInitialized() const
Whether the track overlap result has been initialized.
unsigned int m_minClusterCaloHits
The threshold number of hits for a cluster to be considered.
std::string m_inputClusterListName
The name of the cluster list in the view in which to project into.
Header file for the pfo helper class.
void FormThirdViewCluster(const MatrixType::Element &element, ProtoParticle &protoParticle)
Form the third view cluster by removing hits from cosmic ray clusters and merging the matched cluster...
pandora::StatusCode GetProjectedPositions(const pandora::Cluster *const pCluster1, const pandora::Cluster *const pCluster2, pandora::CartesianPointVector &projectedPositions) const
Use two clusters from different views to calculate projected positions in the remaining third view...
unsigned int m_nMaxMatrixToolRepeats
The maximum number of repeat loops over matrix tools.
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 CollectHitsFromMuon(const pandora::Cluster *const pCluster1, const pandora::Cluster *const pCluster2, const pandora::Cluster *const pThirdViewCluster, const pandora::ParticleFlowObject *const pParentMuon, const float minDistanceFromMuon, const float maxDistanceToCollected, pandora::CaloHitList &collectedHits) const
In one view, pull out any hits from a cosmic ray cluster that belong to the child delta ray cluster...
const std::string & GetThirdViewClusterListName() const
Get the name of the third view clusters.
float m_maxGoodMatchReducedChiSquared
The maximum reduced chi squared value of a good 1:1:1 match.
MatrixToolVector m_algorithmToolVector
The algorithm tool vector.
void ExamineOverlapContainer()
Examine contents of overlap container, collect together best-matching 2D particles and modify cluster...
float m_maxDistanceFromPrediction
The maximum distance of a matched cluster from the third view projection points.
void CalculateOverlapResult(const pandora::Cluster *const pCluster1, const pandora::Cluster *const pCluster2, const pandora::Cluster *const pCluster3)
Calculate cluster overlap result and store in container.
float m_maxDistanceToCollected
The maximim distance of a hit from the projected delta ray hits required for removal.
MatrixType & GetOverlapMatrix()
Get the overlap matrix.
virtual bool DoesClusterPassTensorThreshold(const pandora::Cluster *const pCluster) const
To check whether a given cluster meets the requirements to be added into the matching container (tens...
virtual bool Run(TwoViewDeltaRayMatchingAlgorithm *const pAlgorithm, MatrixType &matrixTensor)=0
Run the algorithm tool.
const pandora::Cluster * GetCluster(const MatrixType::Element &element, const pandora::HitType hitType)
Get the address of the given hit type cluster.
static pandora::HitType GetClusterHitType(const pandora::Cluster *const pCluster)
Get the hit type associated with a two dimensional cluster.
const pandora::Cluster * GetBestMatchedCluster(const pandora::Cluster *const pCluster1, const pandora::Cluster *const pCluster2, const pandora::PfoList &commonMuonPfoList, const pandora::ClusterList &matchedClusters, float &reducedChiSquared) const
Determine the best matched third view cluster and calculate the reduced chi-squared value of the thre...
void FindCommonMuonParents(const pandora::Cluster *const pCluster1, const pandora::Cluster *const pCluster2, pandora::PfoList &commonMuonPfoList) const
Find the cosmic ray pfos that, in each view, lie close to the clusters of the matrix element...
HitTypeVector GetHitTypeVector()
Obtain the HitTypeVector of input views.
TFile f
Definition: plotHisto.C:6
pandora::StatusCode PerformThreeViewMatching(const pandora::Cluster *const pCluster1, const pandora::Cluster *const pCluster2, const pandora::Cluster *const pCluster3, float &reducedChiSquared) const
To determine how well three clusters (one in each view) map onto one another expressing this in terms...
void CollectThirdViewClusters(const pandora::Cluster *const pCluster1, const pandora::Cluster *const pCluster2, const pandora::CartesianPointVector &projectedPositions, pandora::ClusterList &matchedClusters) const
Collect the available and unavailable third view clusters that lie close to the projected delta ray h...
float m_minDistanceFromMuon
The minimum distance of a hit from the cosmic ray track required for removal.
Header file for the cluster helper class.
Header file for the muon leading helper class.
std::string m_reclusteringAlgorithmName
The name of the clustering algorithm to be used to recluster created delta ray remnants.
void MergeThirdView(const MatrixType::Element &element, const pandora::Cluster *const pSeedCluster)
Starting with an input seed cluster, sequentially merge in matched clusters that retain a good reduce...
Header file for the lar two dimensional sliding fit result class.
pandora::StatusCode ReadSettings(const pandora::TiXmlHandle xmlHandle)
pandora::ClusterList m_clusterList
List of 2D clusters in a 3D proto particle.
void SplitMuonCluster(const std::string &clusterListName, const pandora::Cluster *const pMuonCluster, const pandora::CaloHitList &collectedHits, const pandora::Cluster *&pDeltaRayCluster) const
Move a list of hits from a cosmic ray cluster into the given child delta ray cluster.
void GetNearbyMuonPfos(const pandora::Cluster *const pCluster, pandora::ClusterList &consideredClusters, pandora::PfoList &nearbyMuonPfos) const
Use the cluster proximity map to travel along paths of nearby clusters finding the cosmic ray cluster...
void SetOverlapResult(const pandora::Cluster *const pCluster1, const pandora::Cluster *const pCluster2, const OverlapResult &overlapResult)
Set overlap result.
bool CreatePfo(const MatrixType::Element &element)
Create delta ray pfos out of a given element, merging the third view clusters together and adding in ...
HitType
Definition: HitType.h:12
void UpdateForThirdViewClusterModification(const pandora::Cluster *const pModifiedCluster, const bool isMuon)
Update the matrix after a third view cluster modification - remove delta ray clusters and reassess th...
TwoViewXOverlap class.
bool CreatePfos(ProtoParticleVector &protoParticleVector)
Create delta ray pfos maxmising completeness by searching for and merging in any stray clusters...
const pandora::ClusterList & GetMatchedClusterList() const
Get the matched cluster list.
const pandora::PfoList & GetCommonMuonPfoList() const
Get the common muon pfo list.
const TwoViewXOverlap & GetXOverlap() const
Get the x overlap object.