Classes | Public Types | Public Member Functions | Private Types | Private Member Functions | Private Attributes | List of all members
lar_content::ThreeViewShowersAlgorithm Class Reference

ThreeViewShowersAlgorithm class. More...

#include <ThreeViewShowersAlgorithm.h>

Inheritance diagram for lar_content::ThreeViewShowersAlgorithm:
lar_content::NViewMatchingAlgorithm< ThreeViewMatchingControl< ShowerOverlapResult > > lar_content::MatchingBaseAlgorithm

Classes

class  XSampling
 XSampling class. More...
 

Public Types

typedef NViewMatchingAlgorithm< ThreeViewMatchingControl< ShowerOverlapResult > > BaseAlgorithm
 
- Public Types inherited from lar_content::NViewMatchingAlgorithm< ThreeViewMatchingControl< ShowerOverlapResult > >
typedef ThreeViewMatchingControl< ShowerOverlapResultMatchingType
 

Public Member Functions

 ThreeViewShowersAlgorithm ()
 Default constructor. More...
 
const TwoDSlidingShowerFitResultGetCachedSlidingFitResult (const pandora::Cluster *const pCluster) const
 Get a sliding shower fit result from the algorithm cache. More...
 
void UpdateForNewCluster (const pandora::Cluster *const pNewCluster)
 Update to reflect addition of a new cluster to the problem space. More...
 
void UpdateUponDeletion (const pandora::Cluster *const pDeletedCluster)
 Update to reflect cluster deletion. More...
 
void SelectInputClusters (const pandora::ClusterList *const pInputClusterList, pandora::ClusterList &selectedClusterList) const
 Select a subset of input clusters for processing in this algorithm. More...
 
void PrepareInputClusters (pandora::ClusterList &preparedClusterList)
 Perform any preparatory steps required on the input clusters, e.g. caching expensive fit results. More...
 
- Public Member Functions inherited from lar_content::NViewMatchingAlgorithm< ThreeViewMatchingControl< ShowerOverlapResult > >
 NViewMatchingAlgorithm ()
 Default constructor. More...
 
virtual ~NViewMatchingAlgorithm ()
 Destructor. More...
 
void UpdateForNewCluster (const pandora::Cluster *const pNewCluster)
 Update to reflect addition of a new cluster to the problem space. More...
 
void UpdateUponDeletion (const pandora::Cluster *const pDeletedCluster)
 Update to reflect cluster deletion. More...
 
const std::stringGetClusterListName (const pandora::HitType hitType) const
 Get the cluster list name corresponding to a specified hit type. More...
 
const pandora::ClusterList & GetInputClusterList (const pandora::HitType hitType) const
 Get the input cluster list corresponding to a specified hit type. More...
 
const pandora::ClusterList & GetSelectedClusterList (const pandora::HitType hitType) const
 Get the selected cluster list corresponding to a specified hit type. More...
 
- Public Member Functions inherited from lar_content::MatchingBaseAlgorithm
 MatchingBaseAlgorithm ()
 Default constructor. More...
 
virtual ~MatchingBaseAlgorithm ()
 Destructor. More...
 
virtual bool MakeClusterMerges (const ClusterMergeMap &clusterMergeMap)
 Merge clusters together. More...
 
virtual bool CreateThreeDParticles (const ProtoParticleVector &protoParticleVector)
 Create particles using findings from recent algorithm processing. More...
 
virtual void SetPfoParameters (const ProtoParticle &protoParticle, PandoraContentApi::ParticleFlowObject::Parameters &pfoParameters) const
 Set Pfo properties. More...
 
virtual void SetPfoParticleId (PandoraContentApi::ParticleFlowObject::Parameters &pfoParameters) const
 Set pfo particle id. More...
 

Private Types

typedef std::pair< ShowerPositionMap, ShowerPositionMapShowerPositionMapPair
 
typedef std::vector< ShowerTensorTool * > TensorToolVector
 

Private Member Functions

void TidyUp ()
 Tidy member variables in derived class. More...
 
void AddToSlidingFitCache (const pandora::Cluster *const pCluster)
 Add a new sliding fit result, for the specified cluster, to the algorithm cache. More...
 
void RemoveFromSlidingFitCache (const pandora::Cluster *const pCluster)
 Remova an existing sliding fit result, for the specified cluster, from the algorithm cache. More...
 
void CalculateOverlapResult (const pandora::Cluster *const pClusterU, const pandora::Cluster *const pClusterV, const pandora::Cluster *const pClusterW)
 Calculate cluster overlap result and store in container. More...
 
pandora::StatusCode CalculateOverlapResult (const pandora::Cluster *const pClusterU, const pandora::Cluster *const pClusterV, const pandora::Cluster *const pClusterW, ShowerOverlapResult &overlapResult)
 Calculate the overlap result for given group of clusters. More...
 
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. More...
 
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 shower boundaries. More...
 
void ExamineOverlapContainer ()
 Examine contents of overlap container, collect together best-matching 2D particles and modify clusters as required. More...
 
pandora::StatusCode ReadSettings (const pandora::TiXmlHandle xmlHandle)
 

Private Attributes

TensorToolVector m_algorithmToolVector
 The algorithm tool vector. More...
 
unsigned int m_nMaxTensorToolRepeats
 The maximum number of repeat loops over tensor tools. More...
 
unsigned int m_slidingFitWindow
 The layer window for the sliding linear fits. More...
 
TwoDSlidingShowerFitResultMap m_slidingFitResultMap
 The sliding shower fit result map. More...
 
bool m_ignoreUnavailableClusters
 Whether to ignore (skip-over) unavailable clusters. More...
 
unsigned int m_minClusterCaloHits
 The min number of hits in base cluster selection method. More...
 
float m_minClusterLengthSquared
 The min length (squared) in base cluster selection method. More...
 
float m_minShowerMatchedFraction
 The minimum shower matched sampling fraction to allow shower grouping. More...
 
unsigned int m_minShowerMatchedPoints
 The minimum number of matched shower sampling points to allow shower grouping. More...
 
bool m_visualize
 Visualize cluster matching procedure. More...
 

Additional Inherited Members

- Protected Member Functions inherited from lar_content::NViewMatchingAlgorithm< ThreeViewMatchingControl< ShowerOverlapResult > >
MatchingTypeGetMatchingControl ()
 Get the matching control. More...
 
virtual void SelectAllInputClusters ()
 Select a subset of input clusters for processing in this algorithm. More...
 
virtual void PrepareAllInputClusters ()
 Perform any preparatory steps required, e.g. caching expensive fit results for clusters. More...
 
virtual void PerformMainLoop ()
 Main loop over cluster combinations in order to populate the overlap container. Responsible for calling CalculateOverlapResult. More...
 
- Protected Attributes inherited from lar_content::NViewMatchingAlgorithm< ThreeViewMatchingControl< ShowerOverlapResult > >
MatchingType m_matchingControl
 The matching control. More...
 

Detailed Description

ThreeViewShowersAlgorithm class.

Definition at line 29 of file ThreeViewShowersAlgorithm.h.

Member Typedef Documentation

Definition at line 32 of file ThreeViewShowersAlgorithm.h.

Definition at line 118 of file ThreeViewShowersAlgorithm.h.

Definition at line 150 of file ThreeViewShowersAlgorithm.h.

Constructor & Destructor Documentation

lar_content::ThreeViewShowersAlgorithm::ThreeViewShowersAlgorithm ( )

Default constructor.

Definition at line 21 of file ThreeViewShowersAlgorithm.cc.

21  :
29  m_visualize(false)
30 {
31 }
unsigned int m_nMaxTensorToolRepeats
The maximum number of repeat loops over tensor tools.
unsigned int m_minClusterCaloHits
The min number of hits in base cluster selection method.
unsigned int m_minShowerMatchedPoints
The minimum number of matched shower sampling points to allow shower grouping.
float m_minClusterLengthSquared
The min length (squared) in base cluster selection method.
bool m_visualize
Visualize cluster matching procedure.
unsigned int m_slidingFitWindow
The layer window for the sliding linear fits.
bool m_ignoreUnavailableClusters
Whether to ignore (skip-over) unavailable clusters.
float m_minShowerMatchedFraction
The minimum shower matched sampling fraction to allow shower grouping.

Member Function Documentation

void lar_content::ThreeViewShowersAlgorithm::AddToSlidingFitCache ( const pandora::Cluster *const  pCluster)
private

Add a new sliding fit result, for the specified cluster, to the algorithm cache.

Parameters
pClusteraddress of the relevant cluster

Definition at line 136 of file ThreeViewShowersAlgorithm.cc.

137 {
138  const float slidingFitPitch(LArGeometryHelper::GetWireZPitch(this->GetPandora()));
139  const TwoDSlidingShowerFitResult slidingShowerFitResult(pCluster, m_slidingFitWindow, slidingFitPitch);
140 
141  if (!m_slidingFitResultMap.insert(TwoDSlidingShowerFitResultMap::value_type(pCluster, slidingShowerFitResult)).second)
142  throw StatusCodeException(STATUS_CODE_FAILURE);
143 }
static float GetWireZPitch(const pandora::Pandora &pandora, const float maxWirePitchDiscrepancy=0.01)
Return the wire pitch.
TwoDSlidingShowerFitResultMap m_slidingFitResultMap
The sliding shower fit result map.
unsigned int m_slidingFitWindow
The layer window for the sliding linear fits.
void lar_content::ThreeViewShowersAlgorithm::CalculateOverlapResult ( const pandora::Cluster *const  pCluster1,
const pandora::Cluster *const  pCluster2,
const pandora::Cluster *const  pCluster3 
)
privatevirtual

Calculate cluster overlap result and store in container.

Parameters
pCluster1address of cluster1
pCluster2address of cluster2
pCluster3address of cluster3

Implements lar_content::MatchingBaseAlgorithm.

pandora::StatusCode lar_content::ThreeViewShowersAlgorithm::CalculateOverlapResult ( const pandora::Cluster *const  pClusterU,
const pandora::Cluster *const  pClusterV,
const pandora::Cluster *const  pClusterW,
ShowerOverlapResult overlapResult 
)
private

Calculate the overlap result for given group of clusters.

Parameters
pClusterUthe cluster from the U view
pClusterVthe cluster from the V view
pClusterWthe cluster from the W view
overlapResultto receive the overlap result
void lar_content::ThreeViewShowersAlgorithm::ExamineOverlapContainer ( )
privatevirtual

Examine contents of overlap container, collect together best-matching 2D particles and modify clusters as required.

Implements lar_content::MatchingBaseAlgorithm.

Definition at line 323 of file ThreeViewShowersAlgorithm.cc.

324 {
325  unsigned int repeatCounter(0);
326 
327  for (TensorToolVector::const_iterator iter = m_algorithmToolVector.begin(), iterEnd = m_algorithmToolVector.end(); iter != iterEnd;)
328  {
329  if ((*iter)->Run(this, this->GetMatchingControl().GetOverlapTensor()))
330  {
331  iter = m_algorithmToolVector.begin();
332 
333  if (++repeatCounter > m_nMaxTensorToolRepeats)
334  break;
335  }
336  else
337  {
338  ++iter;
339  }
340  }
341 }
TensorToolVector m_algorithmToolVector
The algorithm tool vector.
unsigned int m_nMaxTensorToolRepeats
The maximum number of repeat loops over tensor tools.
intermediate_table::const_iterator const_iterator
void lar_content::ThreeViewShowersAlgorithm::GetBestHitOverlapFraction ( const pandora::Cluster *const  pCluster,
const XSampling xSampling,
const ShowerPositionMapPair positionMaps,
unsigned int &  nSampledHits,
unsigned int &  nMatchedHits 
) const
private

Get the best fraction of hits, in the common x-overlap range, contained within the provided pair of shower boundaries.

Parameters
pClusterthe address of the candidate cluster
xSamplingthe x sampling details
positionMapsthe shower edge position maps
nSampledHitsto receive the number of hits in the common x-overlap range
nMatchedHitsto receive the number of sampled hits contained within the shower edges

Definition at line 282 of file ThreeViewShowersAlgorithm.cc.

284 {
285  if ((xSampling.m_maxX - xSampling.m_minX) < std::numeric_limits<float>::epsilon())
286  throw StatusCodeException(STATUS_CODE_INVALID_PARAMETER);
287 
288  nSampledHits = 0;
289  nMatchedHits = 0;
290  unsigned int nMatchedHits1(0), nMatchedHits2(0);
291  const OrderedCaloHitList &orderedCaloHitList(pCluster->GetOrderedCaloHitList());
292 
293  for (OrderedCaloHitList::const_iterator iter = orderedCaloHitList.begin(), iterEnd = orderedCaloHitList.end(); iter != iterEnd; ++iter)
294  {
295  for (CaloHitList::const_iterator hIter = iter->second->begin(), hIterEnd = iter->second->end(); hIter != hIterEnd; ++hIter)
296  {
297  const CaloHit *const pCaloHit = *hIter;
298  const float x(pCaloHit->GetPositionVector().GetX());
299  const float z(pCaloHit->GetPositionVector().GetZ());
300 
301  int xBin(-1);
302  if (STATUS_CODE_SUCCESS != xSampling.GetBin(x, xBin))
303  continue;
304 
305  ++nSampledHits;
306 
307  ShowerPositionMap::const_iterator positionIter1 = positionMaps.first.find(xBin);
308  ShowerPositionMap::const_iterator positionIter2 = positionMaps.second.find(xBin);
309 
310  if ((positionMaps.first.end() != positionIter1) && (z > positionIter1->second.GetLowEdgeZ()) && (z < positionIter1->second.GetHighEdgeZ()))
311  ++nMatchedHits1;
312 
313  if ((positionMaps.second.end() != positionIter2) && (z > positionIter2->second.GetLowEdgeZ()) && (z < positionIter2->second.GetHighEdgeZ()))
314  ++nMatchedHits2;
315  }
316  }
317 
318  nMatchedHits = std::max(nMatchedHits1, nMatchedHits2);
319 }
intermediate_table::const_iterator const_iterator
static int max(int a, int b)
list x
Definition: train.py:276
second_as<> second
Type of time stored in seconds, in double precision.
Definition: spacetime.h:85
const TwoDSlidingShowerFitResult & lar_content::ThreeViewShowersAlgorithm::GetCachedSlidingFitResult ( const pandora::Cluster *const  pCluster) const

Get a sliding shower fit result from the algorithm cache.

Parameters
pClusteraddress of the relevant cluster

Definition at line 35 of file ThreeViewShowersAlgorithm.cc.

36 {
38 
39  if (m_slidingFitResultMap.end() == iter)
40  throw StatusCodeException(STATUS_CODE_NOT_FOUND);
41 
42  return iter->second;
43 }
intermediate_table::const_iterator const_iterator
TwoDSlidingShowerFitResultMap m_slidingFitResultMap
The sliding shower fit result map.
void lar_content::ThreeViewShowersAlgorithm::GetShowerPositionMaps ( const TwoDSlidingShowerFitResult fitResultU,
const TwoDSlidingShowerFitResult fitResultV,
const TwoDSlidingShowerFitResult fitResultW,
const XSampling xSampling,
ShowerPositionMapPair positionMapsU,
ShowerPositionMapPair positionMapsV,
ShowerPositionMapPair positionMapsW 
) const
private

Get the shower position maps.

Parameters
fitResultUthe sliding shower fit result for the u view
fitResultVthe sliding shower fit result for the v view
fitResultWthe sliding shower fit result for the w view
xSamplingthe x sampling details
positionMapsUto receive the shower position maps for the u view
positionMapsVto receive the shower position maps for the v view
positionMapsWto receive the shower position maps for the w view

Definition at line 219 of file ThreeViewShowersAlgorithm.cc.

222 {
223  const unsigned int nPoints(static_cast<unsigned int>(xSampling.m_nPoints));
224 
225  for (unsigned n = 0; n <= nPoints; ++n)
226  {
227  const float x(xSampling.m_minX + (xSampling.m_maxX - xSampling.m_minX) * static_cast<float>(n) / static_cast<float>(nPoints));
228 
229  int xBin(-1);
230  if (STATUS_CODE_SUCCESS != xSampling.GetBin(x, xBin))
231  continue;
232 
233  FloatVector uValues, vValues, wValues;
234  fitResultU.GetShowerEdges(x, true, uValues);
235  fitResultV.GetShowerEdges(x, true, vValues);
236  fitResultW.GetShowerEdges(x, true, wValues);
237 
238  std::sort(uValues.begin(), uValues.end());
239  std::sort(vValues.begin(), vValues.end());
240  std::sort(wValues.begin(), wValues.end());
241 
242  if ((uValues.size() > 1) && (vValues.size() > 1))
243  {
244  const float uMin(uValues.front()), uMax(uValues.back());
245  const float vMin(vValues.front()), vMax(vValues.back());
246  const float uv2wMinMin(LArGeometryHelper::MergeTwoPositions(this->GetPandora(), TPC_VIEW_U, TPC_VIEW_V, uMin, vMin));
247  const float uv2wMaxMax(LArGeometryHelper::MergeTwoPositions(this->GetPandora(), TPC_VIEW_U, TPC_VIEW_V, uMax, vMax));
248  const float uv2wMinMax(LArGeometryHelper::MergeTwoPositions(this->GetPandora(), TPC_VIEW_U, TPC_VIEW_V, uMin, vMax));
249  const float uv2wMaxMin(LArGeometryHelper::MergeTwoPositions(this->GetPandora(), TPC_VIEW_U, TPC_VIEW_V, uMax, vMin));
250  positionMapsW.first.insert(ShowerPositionMap::value_type(xBin, ShowerExtent(x, uv2wMinMin, uv2wMaxMax)));
251  positionMapsW.second.insert(ShowerPositionMap::value_type(xBin, ShowerExtent(x, uv2wMinMax, uv2wMaxMin)));
252  }
253 
254  if ((uValues.size() > 1) && (wValues.size() > 1))
255  {
256  const float uMin(uValues.front()), uMax(uValues.back());
257  const float wMin(wValues.front()), wMax(wValues.back());
258  const float uw2vMinMin(LArGeometryHelper::MergeTwoPositions(this->GetPandora(), TPC_VIEW_U, TPC_VIEW_W, uMin, wMin));
259  const float uw2vMaxMax(LArGeometryHelper::MergeTwoPositions(this->GetPandora(), TPC_VIEW_U, TPC_VIEW_W, uMax, wMax));
260  const float uw2vMinMax(LArGeometryHelper::MergeTwoPositions(this->GetPandora(), TPC_VIEW_U, TPC_VIEW_W, uMin, wMax));
261  const float uw2vMaxMin(LArGeometryHelper::MergeTwoPositions(this->GetPandora(), TPC_VIEW_U, TPC_VIEW_W, uMax, wMin));
262  positionMapsV.first.insert(ShowerPositionMap::value_type(xBin, ShowerExtent(x, uw2vMinMin, uw2vMaxMax)));
263  positionMapsV.second.insert(ShowerPositionMap::value_type(xBin, ShowerExtent(x, uw2vMinMax, uw2vMaxMin)));
264  }
265 
266  if ((vValues.size() > 1) && (wValues.size() > 1))
267  {
268  const float vMin(vValues.front()), vMax(vValues.back());
269  const float wMin(wValues.front()), wMax(wValues.back());
270  const float vw2uMinMin(LArGeometryHelper::MergeTwoPositions(this->GetPandora(), TPC_VIEW_V, TPC_VIEW_W, vMin, wMin));
271  const float vw2uMaxMax(LArGeometryHelper::MergeTwoPositions(this->GetPandora(), TPC_VIEW_V, TPC_VIEW_W, vMax, wMax));
272  const float vw2uMinMax(LArGeometryHelper::MergeTwoPositions(this->GetPandora(), TPC_VIEW_V, TPC_VIEW_W, vMin, wMax));
273  const float vw2uMaxMin(LArGeometryHelper::MergeTwoPositions(this->GetPandora(), TPC_VIEW_V, TPC_VIEW_W, vMax, wMin));
274  positionMapsU.first.insert(ShowerPositionMap::value_type(xBin, ShowerExtent(x, vw2uMinMin, vw2uMaxMax)));
275  positionMapsU.second.insert(ShowerPositionMap::value_type(xBin, ShowerExtent(x, vw2uMinMax, vw2uMaxMin)));
276  }
277  }
278 }
std::void_t< T > n
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).
list x
Definition: train.py:276
Dft::FloatVector FloatVector
void lar_content::ThreeViewShowersAlgorithm::PrepareInputClusters ( pandora::ClusterList &  preparedClusterList)
virtual

Perform any preparatory steps required on the input clusters, e.g. caching expensive fit results.

Parameters
preparedClusterListto receive the prepared cluster list, non const so as to be able to modify input selected list

Reimplemented from lar_content::MatchingBaseAlgorithm.

Definition at line 100 of file ThreeViewShowersAlgorithm.cc.

101 {
102  for (ClusterList::iterator iter = preparedClusterList.begin(), iterEnd = preparedClusterList.end(); iter != iterEnd;)
103  {
104  const Cluster *const pCluster(*iter);
105 
106  try
107  {
108  this->AddToSlidingFitCache(pCluster);
109  ++iter;
110  }
111  catch (StatusCodeException &statusCodeException)
112  {
113  preparedClusterList.erase(iter++);
114 
115  if (STATUS_CODE_FAILURE == statusCodeException.GetStatusCode())
116  throw statusCodeException;
117  }
118  }
119  if (m_visualize)
120  {
121  PANDORA_MONITORING_API(VisualizeClusters(this->GetPandora(), &preparedClusterList, "Prepared Clusters", GREEN));
122  PANDORA_MONITORING_API(ViewEvent(this->GetPandora()));
123  }
124 }
intermediate_table::iterator iterator
void AddToSlidingFitCache(const pandora::Cluster *const pCluster)
Add a new sliding fit result, for the specified cluster, to the algorithm cache.
bool m_visualize
Visualize cluster matching procedure.
StatusCode lar_content::ThreeViewShowersAlgorithm::ReadSettings ( const pandora::TiXmlHandle  xmlHandle)
privatevirtual

Reimplemented from lar_content::NViewMatchingAlgorithm< ThreeViewMatchingControl< ShowerOverlapResult > >.

Definition at line 383 of file ThreeViewShowersAlgorithm.cc.

384 {
385  AlgorithmToolVector algorithmToolVector;
386  PANDORA_RETURN_RESULT_IF(STATUS_CODE_SUCCESS, !=, XmlHelper::ProcessAlgorithmToolList(*this, xmlHandle, "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 (!pShowerTensorTool)
393  return STATUS_CODE_INVALID_PARAMETER;
394 
395  m_algorithmToolVector.push_back(pShowerTensorTool);
396  }
397 
398  PANDORA_RETURN_RESULT_IF_AND_IF(
399  STATUS_CODE_SUCCESS, STATUS_CODE_NOT_FOUND, !=, XmlHelper::ReadValue(xmlHandle, "NMaxTensorToolRepeats", m_nMaxTensorToolRepeats));
400 
401  PANDORA_RETURN_RESULT_IF_AND_IF(
402  STATUS_CODE_SUCCESS, STATUS_CODE_NOT_FOUND, !=, XmlHelper::ReadValue(xmlHandle, "SlidingFitWindow", m_slidingFitWindow));
403 
404  PANDORA_RETURN_RESULT_IF_AND_IF(STATUS_CODE_SUCCESS, STATUS_CODE_NOT_FOUND, !=,
405  XmlHelper::ReadValue(xmlHandle, "IgnoreUnavailableClusters", m_ignoreUnavailableClusters));
406 
407  PANDORA_RETURN_RESULT_IF_AND_IF(
408  STATUS_CODE_SUCCESS, STATUS_CODE_NOT_FOUND, !=, XmlHelper::ReadValue(xmlHandle, "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, "MinClusterLength", minClusterLength));
412  m_minClusterLengthSquared = minClusterLength * minClusterLength;
413 
414  PANDORA_RETURN_RESULT_IF_AND_IF(STATUS_CODE_SUCCESS, STATUS_CODE_NOT_FOUND, !=,
415  XmlHelper::ReadValue(xmlHandle, "MinShowerMatchedFraction", m_minShowerMatchedFraction));
416 
417  PANDORA_RETURN_RESULT_IF_AND_IF(
418  STATUS_CODE_SUCCESS, STATUS_CODE_NOT_FOUND, !=, XmlHelper::ReadValue(xmlHandle, "MinShowerMatchedPoints", m_minShowerMatchedPoints));
419 
420  PANDORA_RETURN_RESULT_IF_AND_IF(STATUS_CODE_SUCCESS, STATUS_CODE_NOT_FOUND, !=, XmlHelper::ReadValue(xmlHandle, "Visualize", m_visualize));
421 
422  return BaseAlgorithm::ReadSettings(xmlHandle);
423 }
TensorToolVector m_algorithmToolVector
The algorithm tool vector.
unsigned int m_nMaxTensorToolRepeats
The maximum number of repeat loops over tensor tools.
intermediate_table::const_iterator const_iterator
unsigned int m_minClusterCaloHits
The min number of hits in base cluster selection method.
unsigned int m_minShowerMatchedPoints
The minimum number of matched shower sampling points to allow shower grouping.
float m_minClusterLengthSquared
The min length (squared) in base cluster selection method.
virtual pandora::StatusCode ReadSettings(const pandora::TiXmlHandle xmlHandle)
bool m_visualize
Visualize cluster matching procedure.
unsigned int m_slidingFitWindow
The layer window for the sliding linear fits.
bool m_ignoreUnavailableClusters
Whether to ignore (skip-over) unavailable clusters.
float m_minShowerMatchedFraction
The minimum shower matched sampling fraction to allow shower grouping.
void lar_content::ThreeViewShowersAlgorithm::RemoveFromSlidingFitCache ( const pandora::Cluster *const  pCluster)
private

Remova an existing sliding fit result, for the specified cluster, from the algorithm cache.

Parameters
pClusteraddress of the relevant cluster

Definition at line 147 of file ThreeViewShowersAlgorithm.cc.

148 {
150 
151  if (m_slidingFitResultMap.end() != iter)
152  m_slidingFitResultMap.erase(iter);
153 }
intermediate_table::iterator iterator
TwoDSlidingShowerFitResultMap m_slidingFitResultMap
The sliding shower fit result map.
void lar_content::ThreeViewShowersAlgorithm::SelectInputClusters ( const pandora::ClusterList *const  pInputClusterList,
pandora::ClusterList &  selectedClusterList 
) const
virtual

Select a subset of input clusters for processing in this algorithm.

Parameters
pInputClusterListaddress of an input cluster list
selectedClusterListto receive the selected cluster list

Reimplemented from lar_content::MatchingBaseAlgorithm.

Definition at line 74 of file ThreeViewShowersAlgorithm.cc.

75 {
76  for (ClusterList::const_iterator iter = pInputClusterList->begin(), iterEnd = pInputClusterList->end(); iter != iterEnd; ++iter)
77  {
78  const Cluster *const pCluster = *iter;
79 
80  if (m_ignoreUnavailableClusters && !pCluster->IsAvailable())
81  continue;
82 
83  if (pCluster->GetNCaloHits() < m_minClusterCaloHits)
84  continue;
85 
87  continue;
88 
89  selectedClusterList.push_back(pCluster);
90  }
91  if (m_visualize)
92  {
93  PANDORA_MONITORING_API(VisualizeClusters(this->GetPandora(), &selectedClusterList, "Selected Clusters", RED));
94  PANDORA_MONITORING_API(ViewEvent(this->GetPandora()));
95  }
96 }
intermediate_table::const_iterator const_iterator
unsigned int m_minClusterCaloHits
The min number of hits in base cluster selection method.
float m_minClusterLengthSquared
The min length (squared) in base cluster selection method.
bool m_visualize
Visualize cluster matching procedure.
bool m_ignoreUnavailableClusters
Whether to ignore (skip-over) unavailable clusters.
static float GetLengthSquared(const pandora::Cluster *const pCluster)
Get length squared of cluster.
void lar_content::ThreeViewShowersAlgorithm::TidyUp ( )
privatevirtual

Tidy member variables in derived class.

Reimplemented from lar_content::NViewMatchingAlgorithm< ThreeViewMatchingControl< ShowerOverlapResult > >.

Definition at line 128 of file ThreeViewShowersAlgorithm.cc.

129 {
130  m_slidingFitResultMap.clear();
131  return BaseAlgorithm::TidyUp();
132 }
TwoDSlidingShowerFitResultMap m_slidingFitResultMap
The sliding shower fit result map.
void lar_content::ThreeViewShowersAlgorithm::UpdateForNewCluster ( const pandora::Cluster *const  pNewCluster)
virtual

Update to reflect addition of a new cluster to the problem space.

Parameters
pNewClusteraddress of the new cluster

Implements lar_content::MatchingBaseAlgorithm.

Definition at line 47 of file ThreeViewShowersAlgorithm.cc.

48 {
49  try
50  {
51  this->AddToSlidingFitCache(pNewCluster);
52  }
53  catch (StatusCodeException &statusCodeException)
54  {
55  if (STATUS_CODE_FAILURE == statusCodeException.GetStatusCode())
56  throw statusCodeException;
57 
58  return;
59  }
60 
62 }
void AddToSlidingFitCache(const pandora::Cluster *const pCluster)
Add a new sliding fit result, for the specified cluster, to the algorithm cache.
void lar_content::ThreeViewShowersAlgorithm::UpdateUponDeletion ( const pandora::Cluster *const  pDeletedCluster)
virtual

Update to reflect cluster deletion.

Parameters
pDeletedClusteraddress of the deleted cluster

Implements lar_content::MatchingBaseAlgorithm.

Definition at line 66 of file ThreeViewShowersAlgorithm.cc.

67 {
68  this->RemoveFromSlidingFitCache(pDeletedCluster);
69  BaseAlgorithm::UpdateUponDeletion(pDeletedCluster);
70 }
void RemoveFromSlidingFitCache(const pandora::Cluster *const pCluster)
Remova an existing sliding fit result, for the specified cluster, from the algorithm cache...

Member Data Documentation

TensorToolVector lar_content::ThreeViewShowersAlgorithm::m_algorithmToolVector
private

The algorithm tool vector.

Definition at line 151 of file ThreeViewShowersAlgorithm.h.

bool lar_content::ThreeViewShowersAlgorithm::m_ignoreUnavailableClusters
private

Whether to ignore (skip-over) unavailable clusters.

Definition at line 157 of file ThreeViewShowersAlgorithm.h.

unsigned int lar_content::ThreeViewShowersAlgorithm::m_minClusterCaloHits
private

The min number of hits in base cluster selection method.

Definition at line 158 of file ThreeViewShowersAlgorithm.h.

float lar_content::ThreeViewShowersAlgorithm::m_minClusterLengthSquared
private

The min length (squared) in base cluster selection method.

Definition at line 159 of file ThreeViewShowersAlgorithm.h.

float lar_content::ThreeViewShowersAlgorithm::m_minShowerMatchedFraction
private

The minimum shower matched sampling fraction to allow shower grouping.

Definition at line 161 of file ThreeViewShowersAlgorithm.h.

unsigned int lar_content::ThreeViewShowersAlgorithm::m_minShowerMatchedPoints
private

The minimum number of matched shower sampling points to allow shower grouping.

Definition at line 162 of file ThreeViewShowersAlgorithm.h.

unsigned int lar_content::ThreeViewShowersAlgorithm::m_nMaxTensorToolRepeats
private

The maximum number of repeat loops over tensor tools.

Definition at line 152 of file ThreeViewShowersAlgorithm.h.

TwoDSlidingShowerFitResultMap lar_content::ThreeViewShowersAlgorithm::m_slidingFitResultMap
private

The sliding shower fit result map.

Definition at line 155 of file ThreeViewShowersAlgorithm.h.

unsigned int lar_content::ThreeViewShowersAlgorithm::m_slidingFitWindow
private

The layer window for the sliding linear fits.

Definition at line 154 of file ThreeViewShowersAlgorithm.h.

bool lar_content::ThreeViewShowersAlgorithm::m_visualize
private

Visualize cluster matching procedure.

Definition at line 163 of file ThreeViewShowersAlgorithm.h.


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