LArSoft  v06_85_00
Liquid Argon Software toolkit - http://larsoft.org/
ThreeDShowersAlgorithm.cc
Go to the documentation of this file.
1 
9 #include "Pandora/AlgorithmHeaders.h"
10 
13 
15 
16 using namespace pandora;
17 
18 namespace lar_content
19 {
20 
21 ThreeDShowersAlgorithm::ThreeDShowersAlgorithm() :
22  m_nMaxTensorToolRepeats(1000),
23  m_slidingFitWindow(20),
24  m_ignoreUnavailableClusters(true),
25  m_minClusterCaloHits(5),
26  m_minClusterLengthSquared(3.f * 3.f),
27  m_minShowerMatchedFraction(0.2f),
28  m_minShowerMatchedPoints(20)
29 {
30 }
31 
32 //------------------------------------------------------------------------------------------------------------------------------------------
33 
35 {
37 
38  if (m_slidingFitResultMap.end() == iter)
39  throw StatusCodeException(STATUS_CODE_NOT_FOUND);
40 
41  return iter->second;
42 }
43 
44 //------------------------------------------------------------------------------------------------------------------------------------------
45 
46 void ThreeDShowersAlgorithm::UpdateForNewCluster(const Cluster *const pNewCluster)
47 {
48  try
49  {
50  this->AddToSlidingFitCache(pNewCluster);
51  }
52  catch (StatusCodeException &statusCodeException)
53  {
54  if (STATUS_CODE_FAILURE == statusCodeException.GetStatusCode())
55  throw statusCodeException;
56 
57  return;
58  }
59 
61 }
62 
63 //------------------------------------------------------------------------------------------------------------------------------------------
64 
65 void ThreeDShowersAlgorithm::UpdateUponDeletion(const Cluster *const pDeletedCluster)
66 {
67  this->RemoveFromSlidingFitCache(pDeletedCluster);
69 }
70 
71 //------------------------------------------------------------------------------------------------------------------------------------------
72 
73 void ThreeDShowersAlgorithm::SelectInputClusters(const ClusterList *const pInputClusterList, ClusterList &selectedClusterList) const
74 {
75  for (ClusterList::const_iterator iter = pInputClusterList->begin(), iterEnd = pInputClusterList->end(); iter != iterEnd; ++iter)
76  {
77  const Cluster *const pCluster = *iter;
78 
79  if (m_ignoreUnavailableClusters && !pCluster->IsAvailable())
80  continue;
81 
82  if (pCluster->GetNCaloHits() < m_minClusterCaloHits)
83  continue;
84 
86  continue;
87 
88  selectedClusterList.push_back(pCluster);
89  }
90 }
91 
92 //------------------------------------------------------------------------------------------------------------------------------------------
93 
94 void ThreeDShowersAlgorithm::SetPfoParameters(const ProtoParticle &protoParticle, PandoraContentApi::ParticleFlowObject::Parameters &pfoParameters) const
95 {
96  // TODO Correct these placeholder parameters
97  pfoParameters.m_particleId = E_MINUS; // Shower
98  pfoParameters.m_charge = PdgTable::GetParticleCharge(pfoParameters.m_particleId.Get());
99  pfoParameters.m_mass = PdgTable::GetParticleMass(pfoParameters.m_particleId.Get());
100  pfoParameters.m_energy = 0.f;
101  pfoParameters.m_momentum = CartesianVector(0.f, 0.f, 0.f);
102  pfoParameters.m_clusterList.insert(pfoParameters.m_clusterList.end(), protoParticle.m_clusterListU.begin(), protoParticle.m_clusterListU.end());
103  pfoParameters.m_clusterList.insert(pfoParameters.m_clusterList.end(), protoParticle.m_clusterListV.begin(), protoParticle.m_clusterListV.end());
104  pfoParameters.m_clusterList.insert(pfoParameters.m_clusterList.end(), protoParticle.m_clusterListW.begin(), protoParticle.m_clusterListW.end());
105 }
106 
107 //------------------------------------------------------------------------------------------------------------------------------------------
108 
110 {
111  this->PreparationStep(this->m_clusterListU);
112  this->PreparationStep(this->m_clusterListV);
113  this->PreparationStep(this->m_clusterListW);
114 }
115 
116 //------------------------------------------------------------------------------------------------------------------------------------------
117 
118 void ThreeDShowersAlgorithm::PreparationStep(ClusterList &clusterList)
119 {
120  for (ClusterList::iterator iter = clusterList.begin(), iterEnd = clusterList.end(); iter != iterEnd; )
121  {
122  const Cluster *const pCluster(*iter);
123 
124  try
125  {
126  this->AddToSlidingFitCache(pCluster);
127  ++iter;
128  }
129  catch (StatusCodeException &statusCodeException)
130  {
131  clusterList.erase(iter++);
132 
133  if (STATUS_CODE_FAILURE == statusCodeException.GetStatusCode())
134  throw statusCodeException;
135  }
136  }
137 }
138 
139 //------------------------------------------------------------------------------------------------------------------------------------------
140 
142 {
143  m_slidingFitResultMap.clear();
145 }
146 
147 //------------------------------------------------------------------------------------------------------------------------------------------
148 
149 void ThreeDShowersAlgorithm::AddToSlidingFitCache(const Cluster *const pCluster)
150 {
151  const float slidingFitPitch(LArGeometryHelper::GetWireZPitch(this->GetPandora()));
152  const TwoDSlidingShowerFitResult slidingShowerFitResult(pCluster, m_slidingFitWindow, slidingFitPitch);
153 
154  if (!m_slidingFitResultMap.insert(TwoDSlidingShowerFitResultMap::value_type(pCluster, slidingShowerFitResult)).second)
155  throw StatusCodeException(STATUS_CODE_FAILURE);
156 }
157 
158 //------------------------------------------------------------------------------------------------------------------------------------------
159 
160 void ThreeDShowersAlgorithm::RemoveFromSlidingFitCache(const Cluster *const pCluster)
161 {
163 
164  if (m_slidingFitResultMap.end() != iter)
165  m_slidingFitResultMap.erase(iter);
166 }
167 
168 //------------------------------------------------------------------------------------------------------------------------------------------
169 
170 void ThreeDShowersAlgorithm::CalculateOverlapResult(const Cluster *const pClusterU, const Cluster *const pClusterV, const Cluster *const pClusterW)
171 {
172  ShowerOverlapResult overlapResult;
173  PANDORA_THROW_RESULT_IF_AND_IF(STATUS_CODE_SUCCESS, STATUS_CODE_NOT_FOUND, !=, this->CalculateOverlapResult(pClusterU, pClusterV, pClusterW, overlapResult));
174 
175  if (overlapResult.IsInitialized())
176  m_overlapTensor.SetOverlapResult(pClusterU, pClusterV, pClusterW, overlapResult);
177 }
178 
179 //------------------------------------------------------------------------------------------------------------------------------------------
180 
181 StatusCode ThreeDShowersAlgorithm::CalculateOverlapResult(const Cluster *const pClusterU, const Cluster *const pClusterV, const Cluster *const pClusterW, ShowerOverlapResult &overlapResult)
182 {
183  const TwoDSlidingShowerFitResult &fitResultU(this->GetCachedSlidingFitResult(pClusterU));
184  const TwoDSlidingShowerFitResult &fitResultV(this->GetCachedSlidingFitResult(pClusterV));
185  const TwoDSlidingShowerFitResult &fitResultW(this->GetCachedSlidingFitResult(pClusterW));
186 
187  const XSampling xSampling(fitResultU.GetShowerFitResult(), fitResultV.GetShowerFitResult(), fitResultW.GetShowerFitResult());
188 
189  if (xSampling.m_xOverlapSpan < std::numeric_limits<float>::epsilon())
190  return STATUS_CODE_NOT_FOUND;
191 
192  ShowerPositionMapPair positionMapsU, positionMapsV, positionMapsW;
193  this->GetShowerPositionMaps(fitResultU, fitResultV, fitResultW, xSampling, positionMapsU, positionMapsV, positionMapsW);
194 
195  unsigned int nSampledHitsU(0), nMatchedHitsU(0);
196  this->GetBestHitOverlapFraction(pClusterU, xSampling, positionMapsU, nSampledHitsU, nMatchedHitsU);
197 
198  unsigned int nSampledHitsV(0), nMatchedHitsV(0);
199  this->GetBestHitOverlapFraction(pClusterV, xSampling, positionMapsV, nSampledHitsV, nMatchedHitsV);
200 
201  unsigned int nSampledHitsW(0), nMatchedHitsW(0);
202  this->GetBestHitOverlapFraction(pClusterW, xSampling, positionMapsW, nSampledHitsW, nMatchedHitsW);
203 
204  const unsigned int nMatchedHits(nMatchedHitsU + nMatchedHitsV + nMatchedHitsW);
205  const unsigned int nSampledHits(nSampledHitsU + nSampledHitsV + nSampledHitsW);
206 
207  if (0 == nSampledHits)
208  return STATUS_CODE_NOT_FOUND;
209 
210  const XOverlap xOverlapObject(xSampling.m_uMinX, xSampling.m_uMaxX, xSampling.m_vMinX, xSampling.m_vMaxX, xSampling.m_wMinX, xSampling.m_wMaxX, xSampling.m_xOverlapSpan);
211  const ShowerOverlapResult showerOverlapResult(nMatchedHits, nSampledHits, xOverlapObject);
212 
213  if ((showerOverlapResult.GetMatchedFraction() < m_minShowerMatchedFraction) || (showerOverlapResult.GetNMatchedSamplingPoints() < m_minShowerMatchedPoints))
214  return STATUS_CODE_NOT_FOUND;
215 
216  overlapResult = showerOverlapResult;
217  return STATUS_CODE_SUCCESS;
218 }
219 
220 //------------------------------------------------------------------------------------------------------------------------------------------
221 
223  const TwoDSlidingShowerFitResult &fitResultW, const XSampling &xSampling, ShowerPositionMapPair &positionMapsU, ShowerPositionMapPair &positionMapsV,
224  ShowerPositionMapPair &positionMapsW) const
225 {
226  const unsigned int nPoints(static_cast<unsigned int>(xSampling.m_nPoints));
227 
228  for (unsigned n = 0; n <= nPoints; ++n)
229  {
230  const float x(xSampling.m_minX + (xSampling.m_maxX - xSampling.m_minX) * static_cast<float>(n) / static_cast<float>(nPoints));
231 
232  int xBin(-1);
233  if (STATUS_CODE_SUCCESS != xSampling.GetBin(x, xBin))
234  continue;
235 
236  FloatVector uValues, vValues, wValues;
237  fitResultU.GetShowerEdges(x, true, uValues);
238  fitResultV.GetShowerEdges(x, true, vValues);
239  fitResultW.GetShowerEdges(x, true, wValues);
240 
241  std::sort(uValues.begin(), uValues.end());
242  std::sort(vValues.begin(), vValues.end());
243  std::sort(wValues.begin(), wValues.end());
244 
245  if ((uValues.size() > 1) && (vValues.size() > 1))
246  {
247  const float uMin(uValues.front()), uMax(uValues.back());
248  const float vMin(vValues.front()), vMax(vValues.back());
249  const float uv2wMinMin(LArGeometryHelper::MergeTwoPositions(this->GetPandora(), TPC_VIEW_U, TPC_VIEW_V, uMin, vMin));
250  const float uv2wMaxMax(LArGeometryHelper::MergeTwoPositions(this->GetPandora(), TPC_VIEW_U, TPC_VIEW_V, uMax, vMax));
251  const float uv2wMinMax(LArGeometryHelper::MergeTwoPositions(this->GetPandora(), TPC_VIEW_U, TPC_VIEW_V, uMin, vMax));
252  const float uv2wMaxMin(LArGeometryHelper::MergeTwoPositions(this->GetPandora(), TPC_VIEW_U, TPC_VIEW_V, uMax, vMin));
253  positionMapsW.first.insert(ShowerPositionMap::value_type(xBin, ShowerExtent(x, uv2wMinMin, uv2wMaxMax)));
254  positionMapsW.second.insert(ShowerPositionMap::value_type(xBin, ShowerExtent(x, uv2wMinMax, uv2wMaxMin)));
255  }
256 
257  if ((uValues.size() > 1) && (wValues.size() > 1))
258  {
259  const float uMin(uValues.front()), uMax(uValues.back());
260  const float wMin(wValues.front()), wMax(wValues.back());
261  const float uw2vMinMin(LArGeometryHelper::MergeTwoPositions(this->GetPandora(), TPC_VIEW_U, TPC_VIEW_W, uMin, wMin));
262  const float uw2vMaxMax(LArGeometryHelper::MergeTwoPositions(this->GetPandora(), TPC_VIEW_U, TPC_VIEW_W, uMax, wMax));
263  const float uw2vMinMax(LArGeometryHelper::MergeTwoPositions(this->GetPandora(), TPC_VIEW_U, TPC_VIEW_W, uMin, wMax));
264  const float uw2vMaxMin(LArGeometryHelper::MergeTwoPositions(this->GetPandora(), TPC_VIEW_U, TPC_VIEW_W, uMax, wMin));
265  positionMapsV.first.insert(ShowerPositionMap::value_type(xBin, ShowerExtent(x, uw2vMinMin, uw2vMaxMax)));
266  positionMapsV.second.insert(ShowerPositionMap::value_type(xBin, ShowerExtent(x, uw2vMinMax, uw2vMaxMin)));
267  }
268 
269  if ((vValues.size() > 1) && (wValues.size() > 1))
270  {
271  const float vMin(vValues.front()), vMax(vValues.back());
272  const float wMin(wValues.front()), wMax(wValues.back());
273  const float vw2uMinMin(LArGeometryHelper::MergeTwoPositions(this->GetPandora(), TPC_VIEW_V, TPC_VIEW_W, vMin, wMin));
274  const float vw2uMaxMax(LArGeometryHelper::MergeTwoPositions(this->GetPandora(), TPC_VIEW_V, TPC_VIEW_W, vMax, wMax));
275  const float vw2uMinMax(LArGeometryHelper::MergeTwoPositions(this->GetPandora(), TPC_VIEW_V, TPC_VIEW_W, vMin, wMax));
276  const float vw2uMaxMin(LArGeometryHelper::MergeTwoPositions(this->GetPandora(), TPC_VIEW_V, TPC_VIEW_W, vMax, wMin));
277  positionMapsU.first.insert(ShowerPositionMap::value_type(xBin, ShowerExtent(x, vw2uMinMin, vw2uMaxMax)));
278  positionMapsU.second.insert(ShowerPositionMap::value_type(xBin, ShowerExtent(x, vw2uMinMax, vw2uMaxMin)));
279  }
280  }
281 }
282 
283 //------------------------------------------------------------------------------------------------------------------------------------------
284 
285 void ThreeDShowersAlgorithm::GetBestHitOverlapFraction(const Cluster *const pCluster, const XSampling &xSampling, const ShowerPositionMapPair &positionMaps,
286  unsigned int &nSampledHits, unsigned int &nMatchedHits) const
287 {
288  if ((xSampling.m_maxX - xSampling.m_minX) < std::numeric_limits<float>::epsilon())
289  throw StatusCodeException(STATUS_CODE_INVALID_PARAMETER);
290 
291  nSampledHits = 0; nMatchedHits = 0;
292  unsigned int nMatchedHits1(0), nMatchedHits2(0);
293  const OrderedCaloHitList &orderedCaloHitList(pCluster->GetOrderedCaloHitList());
294 
295  for (OrderedCaloHitList::const_iterator iter = orderedCaloHitList.begin(), iterEnd = orderedCaloHitList.end(); iter != iterEnd; ++iter)
296  {
297  for (CaloHitList::const_iterator hIter = iter->second->begin(), hIterEnd = iter->second->end(); hIter != hIterEnd; ++hIter)
298  {
299  const CaloHit *const pCaloHit = *hIter;
300  const float x(pCaloHit->GetPositionVector().GetX());
301  const float z(pCaloHit->GetPositionVector().GetZ());
302 
303  int xBin(-1);
304  if (STATUS_CODE_SUCCESS != xSampling.GetBin(x, xBin))
305  continue;
306 
307  ++nSampledHits;
308 
309  ShowerPositionMap::const_iterator positionIter1 = positionMaps.first.find(xBin);
310  ShowerPositionMap::const_iterator positionIter2 = positionMaps.second.find(xBin);
311 
312  if ((positionMaps.first.end() != positionIter1) && (z > positionIter1->second.GetLowEdgeZ()) && (z < positionIter1->second.GetHighEdgeZ()))
313  ++nMatchedHits1;
314 
315  if ((positionMaps.second.end() != positionIter2) && (z > positionIter2->second.GetLowEdgeZ()) && (z < positionIter2->second.GetHighEdgeZ()))
316  ++nMatchedHits2;
317  }
318  }
319 
320  nMatchedHits = std::max(nMatchedHits1, nMatchedHits2);
321 }
322 
323 //------------------------------------------------------------------------------------------------------------------------------------------
324 
326 {
327  unsigned int repeatCounter(0);
328 
329  for (TensorToolVector::const_iterator iter = m_algorithmToolVector.begin(), iterEnd = m_algorithmToolVector.end(); iter != iterEnd; )
330  {
331  if ((*iter)->Run(this, m_overlapTensor))
332  {
333  iter = m_algorithmToolVector.begin();
334 
335  if (++repeatCounter > m_nMaxTensorToolRepeats)
336  break;
337  }
338  else
339  {
340  ++iter;
341  }
342  }
343 }
344 
345 //------------------------------------------------------------------------------------------------------------------------------------------
346 //------------------------------------------------------------------------------------------------------------------------------------------
347 
349  const TwoDSlidingFitResult &fitResultW)
350 {
351  fitResultU.GetMinAndMaxX(m_uMinX, m_uMaxX);
352  fitResultV.GetMinAndMaxX(m_vMinX, m_vMaxX);
353  fitResultW.GetMinAndMaxX(m_wMinX, m_wMaxX);
354  m_minX = std::max(m_uMinX, std::max(m_vMinX, m_wMinX));
355  m_maxX = std::min(m_uMaxX, std::min(m_vMaxX, m_wMaxX));
356  m_xOverlapSpan = (m_maxX - m_minX);
357  m_nPoints = 1.f;
358 
359  if (m_xOverlapSpan > std::numeric_limits<float>::epsilon())
360  {
361  const float nPointsU(std::fabs((m_xOverlapSpan / (m_uMaxX - m_uMinX)) * static_cast<float>(fitResultU.GetMaxLayer() - fitResultU.GetMinLayer())));
362  const float nPointsV(std::fabs((m_xOverlapSpan / (m_vMaxX - m_vMinX)) * static_cast<float>(fitResultV.GetMaxLayer() - fitResultV.GetMinLayer())));
363  const float nPointsW(std::fabs((m_xOverlapSpan / (m_wMaxX - m_wMinX)) * static_cast<float>(fitResultW.GetMaxLayer() - fitResultW.GetMinLayer())));
364  m_nPoints = 1.f + ((nPointsU + nPointsV + nPointsW) / 3.f);
365  }
366 }
367 
368 //------------------------------------------------------------------------------------------------------------------------------------------
369 
370 StatusCode ThreeDShowersAlgorithm::XSampling::GetBin(const float x, int &xBin) const
371 {
372  if (((x - m_minX) < -std::numeric_limits<float>::epsilon()) || ((x - m_maxX) > +std::numeric_limits<float>::epsilon()))
373  return STATUS_CODE_NOT_FOUND;
374 
375  xBin = static_cast<int>(0.5f + m_nPoints * (x - m_minX) / (m_maxX - m_minX));
376  return STATUS_CODE_SUCCESS;
377 }
378 
379 //------------------------------------------------------------------------------------------------------------------------------------------
380 //------------------------------------------------------------------------------------------------------------------------------------------
381 
382 StatusCode ThreeDShowersAlgorithm::ReadSettings(const TiXmlHandle xmlHandle)
383 {
384  AlgorithmToolVector algorithmToolVector;
385  PANDORA_RETURN_RESULT_IF(STATUS_CODE_SUCCESS, !=, XmlHelper::ProcessAlgorithmToolList(*this, xmlHandle,
386  "ShowerTools", algorithmToolVector));
387 
388  for (AlgorithmToolVector::const_iterator iter = algorithmToolVector.begin(), iterEnd = algorithmToolVector.end(); iter != iterEnd; ++iter)
389  {
390  ShowerTensorTool *const pShowerTensorTool(dynamic_cast<ShowerTensorTool*>(*iter));
391 
392  if (NULL == pShowerTensorTool)
393  return STATUS_CODE_INVALID_PARAMETER;
394 
395  m_algorithmToolVector.push_back(pShowerTensorTool);
396  }
397 
398  PANDORA_RETURN_RESULT_IF_AND_IF(STATUS_CODE_SUCCESS, STATUS_CODE_NOT_FOUND, !=, XmlHelper::ReadValue(xmlHandle,
399  "NMaxTensorToolRepeats", m_nMaxTensorToolRepeats));
400 
401  PANDORA_RETURN_RESULT_IF_AND_IF(STATUS_CODE_SUCCESS, STATUS_CODE_NOT_FOUND, !=, XmlHelper::ReadValue(xmlHandle,
402  "SlidingFitWindow", m_slidingFitWindow));
403 
404  PANDORA_RETURN_RESULT_IF_AND_IF(STATUS_CODE_SUCCESS, STATUS_CODE_NOT_FOUND, !=, XmlHelper::ReadValue(xmlHandle,
405  "IgnoreUnavailableClusters", m_ignoreUnavailableClusters));
406 
407  PANDORA_RETURN_RESULT_IF_AND_IF(STATUS_CODE_SUCCESS, STATUS_CODE_NOT_FOUND, !=, XmlHelper::ReadValue(xmlHandle,
408  "MinClusterCaloHits", m_minClusterCaloHits));
409 
410  float minClusterLength = std::sqrt(m_minClusterLengthSquared);
411  PANDORA_RETURN_RESULT_IF_AND_IF(STATUS_CODE_SUCCESS, STATUS_CODE_NOT_FOUND, !=, XmlHelper::ReadValue(xmlHandle,
412  "MinClusterLength", minClusterLength));
413  m_minClusterLengthSquared = minClusterLength * minClusterLength;
414 
415  PANDORA_RETURN_RESULT_IF_AND_IF(STATUS_CODE_SUCCESS, STATUS_CODE_NOT_FOUND, !=, XmlHelper::ReadValue(xmlHandle,
416  "MinShowerMatchedFraction", m_minShowerMatchedFraction));
417 
418  PANDORA_RETURN_RESULT_IF_AND_IF(STATUS_CODE_SUCCESS, STATUS_CODE_NOT_FOUND, !=, XmlHelper::ReadValue(xmlHandle,
419  "MinShowerMatchedPoints", m_minShowerMatchedPoints));
420 
422 }
423 
424 } // namespace lar_content
Float_t x
Definition: compare.C:6
bool IsInitialized() const
Whether the track overlap result has been initialized.
pandora::ClusterList m_clusterListW
The selected modified cluster list W.
void GetMinAndMaxX(float &minX, float &maxX) const
Get the minimum and maximum x coordinates associated with the sliding fit.
virtual pandora::StatusCode ReadSettings(const pandora::TiXmlHandle xmlHandle)
intermediate_table::iterator iterator
void PreparationStep()
Perform any preparatory steps required, e.g. caching expensive fit results for clusters.
Double_t z
Definition: plot.C:279
const TwoDSlidingFitResult & GetShowerFitResult() const
Get the sliding fit result for the full shower cluster.
void UpdateUponDeletion(const pandora::Cluster *const pDeletedCluster)
Update to reflect cluster deletion.
void UpdateForNewCluster(const pandora::Cluster *const pNewCluster)
Update to reflect addition of a new cluster to the problem space.
bool m_ignoreUnavailableClusters
Whether to ignore (skip-over) unavailable clusters.
static float GetWireZPitch(const pandora::Pandora &pandora, const float maxWirePitchDiscrepancy=0.01)
Return the wire pitch.
TFile f
Definition: plotHisto.C:6
pandora::ClusterList m_clusterListV
The selected modified cluster list V.
pandora::StatusCode ReadSettings(const pandora::TiXmlHandle xmlHandle)
Header file for the geometry helper class.
pandora::ClusterList m_clusterListW
List of 2D W clusters in a 3D proto particle.
float m_minClusterLengthSquared
The min length (squared) in base cluster selection method.
const TwoDSlidingShowerFitResult & GetCachedSlidingFitResult(const pandora::Cluster *const pCluster) const
Get a sliding shower fit result from the algorithm cache.
void SetOverlapResult(const pandora::Cluster *const pClusterU, const pandora::Cluster *const pClusterV, const pandora::Cluster *const pClusterW, const OverlapResult &overlapResult)
Set overlap result.
Int_t max
Definition: plot.C:27
int GetMaxLayer() const
Get the maximum occupied layer in the sliding fit.
intermediate_table::const_iterator const_iterator
int GetMinLayer() const
Get the minimum occupied layer in the sliding fit.
Header file for the cluster helper class.
float m_nPoints
The number of sampling points to be used.
unsigned int m_minShowerMatchedPoints
The minimum number of matched shower sampling points to allow shower grouping.
TensorToolVector m_algorithmToolVector
The algorithm tool vector.
pandora::ClusterList m_clusterListV
List of 2D V clusters in a 3D proto particle.
void SetPfoParameters(const ProtoParticle &protoParticle, PandoraContentApi::ParticleFlowObject::Parameters &pfoParameters) const
Calculate Pfo properties from proto particle.
static float MergeTwoPositions(const pandora::Pandora &pandora, const pandora::HitType view1, const pandora::HitType view2, const float position1, const float position2)
Merge two views (U,V) to give a third view (Z).
unsigned int GetNMatchedSamplingPoints() const
Get the number of matched sampling points.
pandora::ClusterList m_clusterListU
List of 2D U clusters in a 3D proto particle.
virtual void TidyUp()
Tidy member variables in derived class.
float m_maxX
The max x value of the common x-overlap range.
void ExamineTensor()
Examine contents of tensor, collect together best-matching 2D particles and modify clusters as requir...
unsigned int m_slidingFitWindow
The layer window for the sliding linear fits.
void TidyUp()
Tidy member variables in derived class.
Int_t min
Definition: plot.C:26
std::pair< ShowerPositionMap, ShowerPositionMap > ShowerPositionMapPair
virtual void UpdateUponDeletion(const pandora::Cluster *const pDeletedCluster)
Update to reflect cluster deletion.
virtual void UpdateForNewCluster(const pandora::Cluster *const pNewCluster)
Update to reflect addition of a new cluster to the problem space.
pandora::ClusterList m_clusterListU
The selected modified cluster list U.
static float GetLengthSquared(const pandora::Cluster *const pCluster)
Get length squared of cluster.
void RemoveFromSlidingFitCache(const pandora::Cluster *const pCluster)
Remova an existing sliding fit result, for the specified cluster, from the algorithm cache...
void SelectInputClusters(const pandora::ClusterList *const pInputClusterList, pandora::ClusterList &selectedClusterList) const
Select a subset of input clusters for processing in this algorithm.
Char_t n[5]
Header file for the three dimensional showers algorithm class.
TwoDSlidingShowerFitResultMap m_slidingFitResultMap
The sliding shower fit result map.
float GetMatchedFraction() const
Get the fraction of sampling points resulting in a match.
unsigned int m_nMaxTensorToolRepeats
The maximum number of repeat loops over tensor tools.
pandora::StatusCode GetBin(const float x, int &xBin) const
Convert an x position into a sampling bin.
void CalculateOverlapResult(const pandora::Cluster *const pClusterU, const pandora::Cluster *const pClusterV, const pandora::Cluster *const pClusterW)
Calculate cluster overlap result and store in tensor.
void AddToSlidingFitCache(const pandora::Cluster *const pCluster)
Add a new sliding fit result, for the specified cluster, to the algorithm cache.
XOverlap class.
Definition: LArXOverlap.h:17
void GetBestHitOverlapFraction(const pandora::Cluster *const pCluster, const XSampling &xSampling, const ShowerPositionMapPair &positionMaps, unsigned int &nSampledHits, unsigned int &nMatchedHits) const
Get the best fraction of hits, in the common x-overlap range, contained within the provided pair of s...
void GetShowerPositionMaps(const TwoDSlidingShowerFitResult &fitResultU, const TwoDSlidingShowerFitResult &fitResultV, const TwoDSlidingShowerFitResult &fitResultW, const XSampling &xSampling, ShowerPositionMapPair &positionMapsU, ShowerPositionMapPair &positionMapsV, ShowerPositionMapPair &positionMapsW) const
Get the shower position maps.
unsigned int m_minClusterCaloHits
The min number of hits in base cluster selection method.
XSampling(const TwoDSlidingFitResult &fitResultU, const TwoDSlidingFitResult &fitResultV, const TwoDSlidingFitResult &fitResultW)
Constructor.
float m_minShowerMatchedFraction
The minimum shower matched sampling fraction to allow shower grouping.
void GetShowerEdges(const float x, const bool widenIfAmbiguity, pandora::FloatVector &edgePositions) const
Get the most appropriate shower edges at a given x coordinate.
float m_minX
The min x value of the common x-overlap range.