Classes | Public Member Functions | Protected Types | Protected Member Functions | Protected Attributes | List of all members
lar_content::VertexBasedPfoMopUpAlgorithm Class Reference

VertexBasedPfoMopUpAlgorithm class. More...

#include <VertexBasedPfoMopUpAlgorithm.h>

Inheritance diagram for lar_content::VertexBasedPfoMopUpAlgorithm:
lar_content::PfoMopUpBaseAlgorithm lar_content::MopUpBaseAlgorithm lar_content::ShowerPfoMopUpAlgorithm

Classes

class  ClusterAssociation
 ClusterAssociation class. More...
 
class  ConeParameters
 ConeParameters class. More...
 
class  PfoAssociation
 PfoAssociation class. More...
 

Public Member Functions

 VertexBasedPfoMopUpAlgorithm ()
 Default constructor. More...
 
- Public Member Functions inherited from lar_content::PfoMopUpBaseAlgorithm
virtual void MergeAndDeletePfos (const pandora::ParticleFlowObject *const pPfoToEnlarge, const pandora::ParticleFlowObject *const pPfoToDelete) const
 Merge and delete a pair of pfos, with a specific set of conventions for cluster merging, vertex use, etc. More...
 
- Public Member Functions inherited from lar_content::MopUpBaseAlgorithm
template<typename T >
const std::string GetListName (const T *const pT) const
 Find the name of the list hosting a specific object. More...
 

Protected Types

typedef std::vector< PfoAssociationPfoAssociationList
 
typedef std::map< pandora::HitType, ClusterAssociationHitTypeToAssociationMap
 
typedef std::set< pandora::HitType > HitTypeSet
 
typedef std::map< pandora::HitType, const pandora::Cluster * > HitTypeToClusterMap
 

Protected Member Functions

pandora::StatusCode Run ()
 
virtual bool IsVertexAssociated (const pandora::CartesianVector &vertex2D, const LArPointingCluster &pointingCluster) const
 Whether a specified pfo is associated with a specified vertex. More...
 
virtual PfoAssociation GetPfoAssociation (const pandora::Pfo *const pVertexPfo, const pandora::Pfo *const pDaughterPfo, HitTypeToAssociationMap &hitTypeToAssociationMap) const
 Get pfo association details between a vertex-associated pfo and a non-vertex associated daughter candidate pfo. More...
 
void GetInputPfos (const pandora::Vertex *const pVertex, pandora::PfoList &vertexPfos, pandora::PfoList &nonVertexPfos) const
 Get the list of input pfos and divide them into vertex-associated and non-vertex-associated lists. More...
 
bool IsVertexAssociated (const pandora::Pfo *const pPfo, const pandora::Vertex *const pVertex) const
 Whether a specified pfo is associated with a specified vertex. More...
 
void GetPfoAssociations (const pandora::Vertex *const pVertex, const pandora::PfoList &vertexPfos, const pandora::PfoList &nonVertexPfos, PfoAssociationList &pfoAssociationList) const
 Get the list of associations between vertex-associated pfos and non-vertex-associated pfos. More...
 
PfoAssociation GetPfoAssociation (const pandora::Vertex *const pVertex, const pandora::Pfo *const pVertexPfo, const pandora::Pfo *const pDaughterPfo) const
 Get pfo association details between a vertex-associated pfo and a non-vertex associated daughter candidate pfo. More...
 
ClusterAssociation GetClusterAssociation (const pandora::Vertex *const pVertex, const pandora::Cluster *const pVertexCluster, const pandora::Cluster *const pDaughterCluster) const
 Get cluster association details between a vertex-associated cluster and a non-vertex associated daughter candidate cluster. More...
 
bool ProcessPfoAssociations (const PfoAssociationList &pfoAssociationList) const
 Process the list of pfo associations, merging the best-matching pfo. More...
 
void MergePfos (const PfoAssociation &pfoAssociation) const
 Merge the vertex and daughter pfos (deleting daughter pfo, merging clusters, etc.) described in the specified pfoAssociation. More...
 
pandora::StatusCode ReadSettings (const pandora::TiXmlHandle xmlHandle)
 

Protected Attributes

std::string m_trackPfoListName
 The input track pfo list name. More...
 
std::string m_showerPfoListName
 The input shower pfo list name. More...
 
float m_minVertexLongitudinalDistance
 Vertex association check: min longitudinal distance cut. More...
 
float m_maxVertexTransverseDistance
 Vertex association check: max transverse distance cut. More...
 
unsigned int m_minVertexAssociatedHitTypes
 The min number of vertex associated hit types for a vertex associated pfo. More...
 
float m_coneAngleCentile
 Cluster cone angle is defined using specified centile of distribution of hit half angles. More...
 
float m_maxConeCosHalfAngle
 Maximum value for cosine of cone half angle. More...
 
float m_maxConeLengthMultiplier
 Consider hits as bound if inside cone, with projected distance less than N times cone length. More...
 
float m_directionTanAngle
 Direction determination, look for vertex inside triangle with apex shifted along the cluster length. More...
 
float m_directionApexShift
 Direction determination, look for vertex inside triangle with apex shifted along the cluster length. More...
 
float m_meanBoundedFractionCut
 Cut on association info (mean bounded fraction) for determining pfo merges. More...
 
float m_maxBoundedFractionCut
 Cut on association info (max bounded fraction) for determining pfo merges. More...
 
float m_minBoundedFractionCut
 Cut on association info (min bounded fraction) for determining pfo merges. More...
 
unsigned int m_minConsistentDirections
 The minimum number of consistent cluster directions to allow a pfo merge. More...
 
unsigned int m_minConsistentDirectionsTrack
 The minimum number of consistent cluster directions to allow a merge involving a track pfo. More...
 
- Protected Attributes inherited from lar_content::MopUpBaseAlgorithm
pandora::StringVector m_daughterListNames
 The list of potential daughter object list names. More...
 

Additional Inherited Members

- Static Public Member Functions inherited from lar_content::PfoMopUpBaseAlgorithm
static const pandora::Cluster * GetParentCluster (const pandora::ClusterList &clusterList, const pandora::HitType hitType)
 Select the parent cluster (same hit type and most hits) using a provided cluster list and hit type. More...
 

Detailed Description

VertexBasedPfoMopUpAlgorithm class.

Definition at line 21 of file VertexBasedPfoMopUpAlgorithm.h.

Member Typedef Documentation

typedef std::set<pandora::HitType> lar_content::VertexBasedPfoMopUpAlgorithm::HitTypeSet
protected

Definition at line 344 of file VertexBasedPfoMopUpAlgorithm.h.

Definition at line 258 of file VertexBasedPfoMopUpAlgorithm.h.

typedef std::map<pandora::HitType, const pandora::Cluster *> lar_content::VertexBasedPfoMopUpAlgorithm::HitTypeToClusterMap
protected

Definition at line 345 of file VertexBasedPfoMopUpAlgorithm.h.

Definition at line 186 of file VertexBasedPfoMopUpAlgorithm.h.

Constructor & Destructor Documentation

lar_content::VertexBasedPfoMopUpAlgorithm::VertexBasedPfoMopUpAlgorithm ( )

Default constructor.

Definition at line 26 of file VertexBasedPfoMopUpAlgorithm.cc.

26  :
33  m_directionTanAngle(1.732f),
34  m_directionApexShift(0.333f),
40 {
41 }
unsigned int m_minVertexAssociatedHitTypes
The min number of vertex associated hit types for a vertex associated pfo.
float m_maxConeLengthMultiplier
Consider hits as bound if inside cone, with projected distance less than N times cone length...
float m_coneAngleCentile
Cluster cone angle is defined using specified centile of distribution of hit half angles...
unsigned int m_minConsistentDirections
The minimum number of consistent cluster directions to allow a pfo merge.
float m_maxVertexTransverseDistance
Vertex association check: max transverse distance cut.
float m_minVertexLongitudinalDistance
Vertex association check: min longitudinal distance cut.
float m_maxBoundedFractionCut
Cut on association info (max bounded fraction) for determining pfo merges.
float m_directionApexShift
Direction determination, look for vertex inside triangle with apex shifted along the cluster length...
float m_meanBoundedFractionCut
Cut on association info (mean bounded fraction) for determining pfo merges.
float m_directionTanAngle
Direction determination, look for vertex inside triangle with apex shifted along the cluster length...
unsigned int m_minConsistentDirectionsTrack
The minimum number of consistent cluster directions to allow a merge involving a track pfo...
float m_maxConeCosHalfAngle
Maximum value for cosine of cone half angle.
float m_minBoundedFractionCut
Cut on association info (min bounded fraction) for determining pfo merges.

Member Function Documentation

VertexBasedPfoMopUpAlgorithm::ClusterAssociation lar_content::VertexBasedPfoMopUpAlgorithm::GetClusterAssociation ( const pandora::Vertex *const  pVertex,
const pandora::Cluster *const  pVertexCluster,
const pandora::Cluster *const  pDaughterCluster 
) const
protected

Get cluster association details between a vertex-associated cluster and a non-vertex associated daughter candidate cluster.

Parameters
pVertexthe address of the vertex
pVertexClusterthe address of the vertex-associated cluster
pDaughterClusterthe address of the non-vertex-associated cluster
Returns
the cluster association details

Definition at line 208 of file VertexBasedPfoMopUpAlgorithm.cc.

210 {
211  const HitType vertexHitType(LArClusterHelper::GetClusterHitType(pVertexCluster));
212  const CartesianVector vertexPosition2D(LArGeometryHelper::ProjectPosition(this->GetPandora(), pVertex->GetPosition(), vertexHitType));
213 
214  const ConeParameters coneParameters(pVertexCluster, vertexPosition2D, m_coneAngleCentile, m_maxConeCosHalfAngle);
215  const float boundedFraction(coneParameters.GetBoundedFraction(pDaughterCluster, m_maxConeLengthMultiplier));
216 
217  const LArVertexHelper::ClusterDirection vertexClusterDirection(
218  LArVertexHelper::GetClusterDirectionInZ(this->GetPandora(), pVertex, pVertexCluster, m_directionTanAngle, m_directionApexShift));
219  const LArVertexHelper::ClusterDirection daughterClusterDirection(
220  LArVertexHelper::GetClusterDirectionInZ(this->GetPandora(), pVertex, pDaughterCluster, m_directionTanAngle, m_directionApexShift));
221  const bool isConsistentDirection(vertexClusterDirection == daughterClusterDirection);
222 
223  return ClusterAssociation(pVertexCluster, pDaughterCluster, boundedFraction, isConsistentDirection);
224 }
float m_maxConeLengthMultiplier
Consider hits as bound if inside cone, with projected distance less than N times cone length...
enum cvn::HType HitType
float m_coneAngleCentile
Cluster cone angle is defined using specified centile of distribution of hit half angles...
static pandora::CartesianVector ProjectPosition(const pandora::Pandora &pandora, const pandora::CartesianVector &position3D, const pandora::HitType view)
Project 3D position into a given 2D view.
static pandora::HitType GetClusterHitType(const pandora::Cluster *const pCluster)
Get the hit type associated with a two dimensional cluster.
float m_directionApexShift
Direction determination, look for vertex inside triangle with apex shifted along the cluster length...
float m_directionTanAngle
Direction determination, look for vertex inside triangle with apex shifted along the cluster length...
float m_maxConeCosHalfAngle
Maximum value for cosine of cone half angle.
static ClusterDirection GetClusterDirectionInZ(const pandora::Pandora &pandora, const pandora::Vertex *const pVertex, const pandora::Cluster *const pCluster, const float tanAngle, const float apexShift)
Get the direction of the cluster in z, using a projection of the provided vertex. ...
void lar_content::VertexBasedPfoMopUpAlgorithm::GetInputPfos ( const pandora::Vertex *const  pVertex,
pandora::PfoList &  vertexPfos,
pandora::PfoList &  nonVertexPfos 
) const
protected

Get the list of input pfos and divide them into vertex-associated and non-vertex-associated lists.

Parameters
pVertexthe address of the 3d vertex
vertexPfosto receive the list of vertex-associated pfos
nonVertexPfosto receive the list of nonvertex-associated pfos

Definition at line 101 of file VertexBasedPfoMopUpAlgorithm.cc.

102 {
103  StringVector listNames;
104  listNames.push_back(m_trackPfoListName);
105  listNames.push_back(m_showerPfoListName);
106 
107  for (const std::string &listName : listNames)
108  {
109  const PfoList *pPfoList(nullptr);
110 
111  if (STATUS_CODE_SUCCESS != PandoraContentApi::GetList(*this, listName, pPfoList))
112  continue;
113 
114  for (const Pfo *const pPfo : *pPfoList)
115  {
116  PfoList &pfoTargetList(this->IsVertexAssociated(pPfo, pVertex) ? vertexPfos : nonVertexPfos);
117  pfoTargetList.push_back(pPfo);
118  }
119  }
120 }
std::string string
Definition: nybbler.cc:12
virtual bool IsVertexAssociated(const pandora::CartesianVector &vertex2D, const LArPointingCluster &pointingCluster) const
Whether a specified pfo is associated with a specified vertex.
std::vector< string > StringVector
Definition: fcldump.cxx:29
std::string m_trackPfoListName
The input track pfo list name.
std::string m_showerPfoListName
The input shower pfo list name.
virtual PfoAssociation lar_content::VertexBasedPfoMopUpAlgorithm::GetPfoAssociation ( const pandora::Pfo *const  pVertexPfo,
const pandora::Pfo *const  pDaughterPfo,
HitTypeToAssociationMap hitTypeToAssociationMap 
) const
protectedvirtual

Get pfo association details between a vertex-associated pfo and a non-vertex associated daughter candidate pfo.

Parameters
pVertexPfothe address of the vertex-associated pfo
pDaughterPfothe address of the non-vertex-associated pfo
hitTypeToAssociationMapthe hit type to association map
Returns
the pfo association details

Reimplemented in lar_content::ShowerPfoMopUpAlgorithm.

PfoAssociation lar_content::VertexBasedPfoMopUpAlgorithm::GetPfoAssociation ( const pandora::Vertex *const  pVertex,
const pandora::Pfo *const  pVertexPfo,
const pandora::Pfo *const  pDaughterPfo 
) const
protected

Get pfo association details between a vertex-associated pfo and a non-vertex associated daughter candidate pfo.

Parameters
pVertexthe address of the 3d vertex
pVertexPfothe address of the vertex-associated pfo
pDaughterPfothe address of the non-vertex-associated pfo
Returns
the pfo association details
void lar_content::VertexBasedPfoMopUpAlgorithm::GetPfoAssociations ( const pandora::Vertex *const  pVertex,
const pandora::PfoList &  vertexPfos,
const pandora::PfoList &  nonVertexPfos,
PfoAssociationList pfoAssociationList 
) const
protected

Get the list of associations between vertex-associated pfos and non-vertex-associated pfos.

Parameters
pVertexthe address of the 3d vertex
vertexPfosthe list of vertex-associated pfos
nonVertexPfosthe list of nonvertex-associated pfos
pfoAssociationListto receive the pfo association list

Definition at line 158 of file VertexBasedPfoMopUpAlgorithm.cc.

160 {
161  for (const Pfo *const pVertexPfo : vertexPfos)
162  {
163  for (const Pfo *const pDaughterPfo : nonVertexPfos)
164  {
165  try
166  {
167  const PfoAssociation pfoAssociation(this->GetPfoAssociation(pVertex, pVertexPfo, pDaughterPfo));
168  pfoAssociationList.push_back(pfoAssociation);
169  }
170  catch (StatusCodeException &)
171  {
172  }
173  }
174  }
175 }
virtual PfoAssociation GetPfoAssociation(const pandora::Pfo *const pVertexPfo, const pandora::Pfo *const pDaughterPfo, HitTypeToAssociationMap &hitTypeToAssociationMap) const
Get pfo association details between a vertex-associated pfo and a non-vertex associated daughter cand...
virtual bool lar_content::VertexBasedPfoMopUpAlgorithm::IsVertexAssociated ( const pandora::CartesianVector &  vertex2D,
const LArPointingCluster pointingCluster 
) const
protectedvirtual

Whether a specified pfo is associated with a specified vertex.

Parameters
vertex2Dthe 2d vertex position
pointingClusterthe pointing cluster
Returns
boolean

Reimplemented in lar_content::ShowerPfoMopUpAlgorithm.

bool lar_content::VertexBasedPfoMopUpAlgorithm::IsVertexAssociated ( const pandora::Pfo *const  pPfo,
const pandora::Vertex *const  pVertex 
) const
protected

Whether a specified pfo is associated with a specified vertex.

Parameters
pPfothe address of the pfo
pVertexthe address of the 3d vertex
Returns
boolean
void lar_content::VertexBasedPfoMopUpAlgorithm::MergePfos ( const PfoAssociation pfoAssociation) const
protected

Merge the vertex and daughter pfos (deleting daughter pfo, merging clusters, etc.) described in the specified pfoAssociation.

Parameters
pfoAssociationthe pfo association details

Definition at line 267 of file VertexBasedPfoMopUpAlgorithm.cc.

268 {
269  const PfoList *pTrackPfoList(nullptr), *pShowerPfoList(nullptr);
270  (void)PandoraContentApi::GetList(*this, m_trackPfoListName, pTrackPfoList);
271  (void)PandoraContentApi::GetList(*this, m_showerPfoListName, pShowerPfoList);
272 
273  if (!pTrackPfoList && !pShowerPfoList)
274  throw StatusCodeException(STATUS_CODE_FAILURE);
275 
276  const Pfo *const pVertexPfo(pfoAssociation.GetVertexPfo());
277  const bool isvertexTrack(pTrackPfoList && (pTrackPfoList->end() != std::find(pTrackPfoList->begin(), pTrackPfoList->end(), pVertexPfo)));
278  const Pfo *pDaughterPfo(pfoAssociation.GetDaughterPfo());
279  const bool isDaughterShower(pShowerPfoList && (pShowerPfoList->end() != std::find(pShowerPfoList->begin(), pShowerPfoList->end(), pDaughterPfo)));
280 
281  this->MergeAndDeletePfos(pVertexPfo, pDaughterPfo);
282 
283  if (isvertexTrack && isDaughterShower)
284  {
285  const PfoList vertexPfoList(1, pVertexPfo);
286 
287  PandoraContentApi::ParticleFlowObject::Metadata metadata;
288  metadata.m_particleId = E_MINUS;
289  PANDORA_THROW_RESULT_IF(STATUS_CODE_SUCCESS, !=, PandoraContentApi::ParticleFlowObject::AlterMetadata(*this, pVertexPfo, metadata));
290 
291  PANDORA_THROW_RESULT_IF(STATUS_CODE_SUCCESS, !=, PandoraContentApi::SaveList(*this, m_trackPfoListName, m_showerPfoListName, vertexPfoList));
292  }
293 }
std::string m_trackPfoListName
The input track pfo list name.
virtual void MergeAndDeletePfos(const pandora::ParticleFlowObject *const pPfoToEnlarge, const pandora::ParticleFlowObject *const pPfoToDelete) const
Merge and delete a pair of pfos, with a specific set of conventions for cluster merging, vertex use, etc.
std::string m_showerPfoListName
The input shower pfo list name.
bool lar_content::VertexBasedPfoMopUpAlgorithm::ProcessPfoAssociations ( const PfoAssociationList pfoAssociationList) const
protected

Process the list of pfo associations, merging the best-matching pfo.

Parameters
pfoAssociationListthe pfo association list
Returns
whether a pfo merge was made

Definition at line 228 of file VertexBasedPfoMopUpAlgorithm.cc.

229 {
230  const PfoList *pTrackPfoList(nullptr);
231  (void)PandoraContentApi::GetList(*this, m_trackPfoListName, pTrackPfoList);
232 
233  for (const PfoAssociation &pfoAssociation : pfoAssociationList)
234  {
235  if ((pfoAssociation.GetMeanBoundedFraction() < m_meanBoundedFractionCut) ||
236  (pfoAssociation.GetMaxBoundedFraction() < m_maxBoundedFractionCut) || (pfoAssociation.GetMinBoundedFraction() < m_minBoundedFractionCut) ||
237  (pfoAssociation.GetNConsistentDirections() < m_minConsistentDirections))
238  {
239  continue;
240  }
241 
242  if (pTrackPfoList)
243  {
244  if ((pTrackPfoList->end() != std::find(pTrackPfoList->begin(), pTrackPfoList->end(), pfoAssociation.GetVertexPfo())) &&
245  (pTrackPfoList->end() != std::find(pTrackPfoList->begin(), pTrackPfoList->end(), pfoAssociation.GetDaughterPfo())))
246  {
247  continue;
248  }
249 
250  if (((pTrackPfoList->end() != std::find(pTrackPfoList->begin(), pTrackPfoList->end(), pfoAssociation.GetVertexPfo())) ||
251  (pTrackPfoList->end() != std::find(pTrackPfoList->begin(), pTrackPfoList->end(), pfoAssociation.GetDaughterPfo()))) &&
252  (pfoAssociation.GetNConsistentDirections() < m_minConsistentDirectionsTrack))
253  {
254  continue;
255  }
256  }
257 
258  this->MergePfos(pfoAssociation);
259  return true;
260  }
261 
262  return false;
263 }
unsigned int m_minConsistentDirections
The minimum number of consistent cluster directions to allow a pfo merge.
void MergePfos(const PfoAssociation &pfoAssociation) const
Merge the vertex and daughter pfos (deleting daughter pfo, merging clusters, etc.) described in the s...
float m_maxBoundedFractionCut
Cut on association info (max bounded fraction) for determining pfo merges.
float m_meanBoundedFractionCut
Cut on association info (mean bounded fraction) for determining pfo merges.
unsigned int m_minConsistentDirectionsTrack
The minimum number of consistent cluster directions to allow a merge involving a track pfo...
std::string m_trackPfoListName
The input track pfo list name.
float m_minBoundedFractionCut
Cut on association info (min bounded fraction) for determining pfo merges.
StatusCode lar_content::VertexBasedPfoMopUpAlgorithm::ReadSettings ( const pandora::TiXmlHandle  xmlHandle)
protectedvirtual

Reimplemented from lar_content::PfoMopUpBaseAlgorithm.

Definition at line 508 of file VertexBasedPfoMopUpAlgorithm.cc.

509 {
510  PANDORA_RETURN_RESULT_IF_AND_IF(
511  STATUS_CODE_SUCCESS, STATUS_CODE_NOT_FOUND, !=, XmlHelper::ReadValue(xmlHandle, "TrackPfoListName", m_trackPfoListName));
512 
513  PANDORA_RETURN_RESULT_IF_AND_IF(
514  STATUS_CODE_SUCCESS, STATUS_CODE_NOT_FOUND, !=, XmlHelper::ReadValue(xmlHandle, "ShowerPfoListName", m_showerPfoListName));
515 
516  PANDORA_RETURN_RESULT_IF_AND_IF(STATUS_CODE_SUCCESS, STATUS_CODE_NOT_FOUND, !=,
517  XmlHelper::ReadValue(xmlHandle, "MinVertexLongitudinalDistance", m_minVertexLongitudinalDistance));
518 
519  PANDORA_RETURN_RESULT_IF_AND_IF(STATUS_CODE_SUCCESS, STATUS_CODE_NOT_FOUND, !=,
520  XmlHelper::ReadValue(xmlHandle, "MaxVertexTransverseDistance", m_maxVertexTransverseDistance));
521 
522  PANDORA_RETURN_RESULT_IF_AND_IF(STATUS_CODE_SUCCESS, STATUS_CODE_NOT_FOUND, !=,
523  XmlHelper::ReadValue(xmlHandle, "MinVertexAssociatedHitTypes", m_minVertexAssociatedHitTypes));
524 
525  PANDORA_RETURN_RESULT_IF_AND_IF(
526  STATUS_CODE_SUCCESS, STATUS_CODE_NOT_FOUND, !=, XmlHelper::ReadValue(xmlHandle, "ConeAngleCentile", m_coneAngleCentile));
527 
528  PANDORA_RETURN_RESULT_IF_AND_IF(
529  STATUS_CODE_SUCCESS, STATUS_CODE_NOT_FOUND, !=, XmlHelper::ReadValue(xmlHandle, "MaxConeCosHalfAngle", m_maxConeCosHalfAngle));
530 
531  PANDORA_RETURN_RESULT_IF_AND_IF(STATUS_CODE_SUCCESS, STATUS_CODE_NOT_FOUND, !=,
532  XmlHelper::ReadValue(xmlHandle, "MaxConeLengthMultiplier", m_maxConeLengthMultiplier));
533 
534  PANDORA_RETURN_RESULT_IF_AND_IF(
535  STATUS_CODE_SUCCESS, STATUS_CODE_NOT_FOUND, !=, XmlHelper::ReadValue(xmlHandle, "DirectionTanAngle", m_directionTanAngle));
536 
537  PANDORA_RETURN_RESULT_IF_AND_IF(
538  STATUS_CODE_SUCCESS, STATUS_CODE_NOT_FOUND, !=, XmlHelper::ReadValue(xmlHandle, "DirectionApexShift", m_directionApexShift));
539 
540  PANDORA_RETURN_RESULT_IF_AND_IF(
541  STATUS_CODE_SUCCESS, STATUS_CODE_NOT_FOUND, !=, XmlHelper::ReadValue(xmlHandle, "MeanBoundedFractionCut", m_meanBoundedFractionCut));
542 
543  PANDORA_RETURN_RESULT_IF_AND_IF(
544  STATUS_CODE_SUCCESS, STATUS_CODE_NOT_FOUND, !=, XmlHelper::ReadValue(xmlHandle, "MaxBoundedFractionCut", m_maxBoundedFractionCut));
545 
546  PANDORA_RETURN_RESULT_IF_AND_IF(
547  STATUS_CODE_SUCCESS, STATUS_CODE_NOT_FOUND, !=, XmlHelper::ReadValue(xmlHandle, "MinBoundedFractionCut", m_minBoundedFractionCut));
548 
549  PANDORA_RETURN_RESULT_IF_AND_IF(STATUS_CODE_SUCCESS, STATUS_CODE_NOT_FOUND, !=,
550  XmlHelper::ReadValue(xmlHandle, "MinConsistentDirections", m_minConsistentDirections));
551 
552  PANDORA_RETURN_RESULT_IF_AND_IF(STATUS_CODE_SUCCESS, STATUS_CODE_NOT_FOUND, !=,
553  XmlHelper::ReadValue(xmlHandle, "MinConsistentDirectionsTrack", m_minConsistentDirectionsTrack));
554 
557 
558  return PfoMopUpBaseAlgorithm::ReadSettings(xmlHandle);
559 }
unsigned int m_minVertexAssociatedHitTypes
The min number of vertex associated hit types for a vertex associated pfo.
float m_maxConeLengthMultiplier
Consider hits as bound if inside cone, with projected distance less than N times cone length...
float m_coneAngleCentile
Cluster cone angle is defined using specified centile of distribution of hit half angles...
unsigned int m_minConsistentDirections
The minimum number of consistent cluster directions to allow a pfo merge.
pandora::StringVector m_daughterListNames
The list of potential daughter object list names.
float m_maxVertexTransverseDistance
Vertex association check: max transverse distance cut.
float m_minVertexLongitudinalDistance
Vertex association check: min longitudinal distance cut.
float m_maxBoundedFractionCut
Cut on association info (max bounded fraction) for determining pfo merges.
float m_directionApexShift
Direction determination, look for vertex inside triangle with apex shifted along the cluster length...
float m_meanBoundedFractionCut
Cut on association info (mean bounded fraction) for determining pfo merges.
float m_directionTanAngle
Direction determination, look for vertex inside triangle with apex shifted along the cluster length...
unsigned int m_minConsistentDirectionsTrack
The minimum number of consistent cluster directions to allow a merge involving a track pfo...
float m_maxConeCosHalfAngle
Maximum value for cosine of cone half angle.
virtual pandora::StatusCode ReadSettings(const pandora::TiXmlHandle xmlHandle)
std::string m_trackPfoListName
The input track pfo list name.
std::string m_showerPfoListName
The input shower pfo list name.
float m_minBoundedFractionCut
Cut on association info (min bounded fraction) for determining pfo merges.
StatusCode lar_content::VertexBasedPfoMopUpAlgorithm::Run ( )
protected

Definition at line 45 of file VertexBasedPfoMopUpAlgorithm.cc.

46 {
47  const VertexList *pVertexList = nullptr;
48  PANDORA_RETURN_RESULT_IF_AND_IF(STATUS_CODE_SUCCESS, STATUS_CODE_NOT_INITIALIZED, !=, PandoraContentApi::GetCurrentList(*this, pVertexList));
49 
50  const Vertex *const pSelectedVertex(
51  (pVertexList && (pVertexList->size() == 1) && (VERTEX_3D == (*(pVertexList->begin()))->GetVertexType())) ? *(pVertexList->begin()) : nullptr);
52 
53  if (!pSelectedVertex)
54  {
55  if (PandoraContentApi::GetSettings(*this)->ShouldDisplayAlgorithmInfo())
56  std::cout << "VertexBasedPfoMopUp: unable to find vertex in current list " << std::endl;
57 
58  return STATUS_CODE_SUCCESS;
59  }
60 
61  while (true)
62  {
63  PfoList vertexPfos, nonVertexPfos;
64  this->GetInputPfos(pSelectedVertex, vertexPfos, nonVertexPfos);
65 
66  PfoAssociationList pfoAssociationList;
67  this->GetPfoAssociations(pSelectedVertex, vertexPfos, nonVertexPfos, pfoAssociationList);
68 
69  std::sort(pfoAssociationList.begin(), pfoAssociationList.end());
70  const bool pfoMergeMade(this->ProcessPfoAssociations(pfoAssociationList));
71 
72  if (!pfoMergeMade)
73  break;
74  }
75 
76  return STATUS_CODE_SUCCESS;
77 }
void GetPfoAssociations(const pandora::Vertex *const pVertex, const pandora::PfoList &vertexPfos, const pandora::PfoList &nonVertexPfos, PfoAssociationList &pfoAssociationList) const
Get the list of associations between vertex-associated pfos and non-vertex-associated pfos...
bool ProcessPfoAssociations(const PfoAssociationList &pfoAssociationList) const
Process the list of pfo associations, merging the best-matching pfo.
void GetInputPfos(const pandora::Vertex *const pVertex, pandora::PfoList &vertexPfos, pandora::PfoList &nonVertexPfos) const
Get the list of input pfos and divide them into vertex-associated and non-vertex-associated lists...
boost::graph_traits< ModuleGraph >::vertex_descriptor Vertex
Definition: ModuleGraph.h:25
std::list< Vertex > VertexList
Definition: DCEL.h:182
QTextStream & endl(QTextStream &s)

Member Data Documentation

float lar_content::VertexBasedPfoMopUpAlgorithm::m_coneAngleCentile
protected

Cluster cone angle is defined using specified centile of distribution of hit half angles.

Definition at line 354 of file VertexBasedPfoMopUpAlgorithm.h.

float lar_content::VertexBasedPfoMopUpAlgorithm::m_directionApexShift
protected

Direction determination, look for vertex inside triangle with apex shifted along the cluster length.

Definition at line 359 of file VertexBasedPfoMopUpAlgorithm.h.

float lar_content::VertexBasedPfoMopUpAlgorithm::m_directionTanAngle
protected

Direction determination, look for vertex inside triangle with apex shifted along the cluster length.

Definition at line 358 of file VertexBasedPfoMopUpAlgorithm.h.

float lar_content::VertexBasedPfoMopUpAlgorithm::m_maxBoundedFractionCut
protected

Cut on association info (max bounded fraction) for determining pfo merges.

Definition at line 362 of file VertexBasedPfoMopUpAlgorithm.h.

float lar_content::VertexBasedPfoMopUpAlgorithm::m_maxConeCosHalfAngle
protected

Maximum value for cosine of cone half angle.

Definition at line 355 of file VertexBasedPfoMopUpAlgorithm.h.

float lar_content::VertexBasedPfoMopUpAlgorithm::m_maxConeLengthMultiplier
protected

Consider hits as bound if inside cone, with projected distance less than N times cone length.

Definition at line 356 of file VertexBasedPfoMopUpAlgorithm.h.

float lar_content::VertexBasedPfoMopUpAlgorithm::m_maxVertexTransverseDistance
protected

Vertex association check: max transverse distance cut.

Definition at line 351 of file VertexBasedPfoMopUpAlgorithm.h.

float lar_content::VertexBasedPfoMopUpAlgorithm::m_meanBoundedFractionCut
protected

Cut on association info (mean bounded fraction) for determining pfo merges.

Definition at line 361 of file VertexBasedPfoMopUpAlgorithm.h.

float lar_content::VertexBasedPfoMopUpAlgorithm::m_minBoundedFractionCut
protected

Cut on association info (min bounded fraction) for determining pfo merges.

Definition at line 363 of file VertexBasedPfoMopUpAlgorithm.h.

unsigned int lar_content::VertexBasedPfoMopUpAlgorithm::m_minConsistentDirections
protected

The minimum number of consistent cluster directions to allow a pfo merge.

Definition at line 365 of file VertexBasedPfoMopUpAlgorithm.h.

unsigned int lar_content::VertexBasedPfoMopUpAlgorithm::m_minConsistentDirectionsTrack
protected

The minimum number of consistent cluster directions to allow a merge involving a track pfo.

Definition at line 366 of file VertexBasedPfoMopUpAlgorithm.h.

unsigned int lar_content::VertexBasedPfoMopUpAlgorithm::m_minVertexAssociatedHitTypes
protected

The min number of vertex associated hit types for a vertex associated pfo.

Definition at line 352 of file VertexBasedPfoMopUpAlgorithm.h.

float lar_content::VertexBasedPfoMopUpAlgorithm::m_minVertexLongitudinalDistance
protected

Vertex association check: min longitudinal distance cut.

Definition at line 350 of file VertexBasedPfoMopUpAlgorithm.h.

std::string lar_content::VertexBasedPfoMopUpAlgorithm::m_showerPfoListName
protected

The input shower pfo list name.

Definition at line 348 of file VertexBasedPfoMopUpAlgorithm.h.

std::string lar_content::VertexBasedPfoMopUpAlgorithm::m_trackPfoListName
protected

The input track pfo list name.

Definition at line 347 of file VertexBasedPfoMopUpAlgorithm.h.


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