Public Member Functions | Private Member Functions | Private Attributes | List of all members
lar_content::UnambiguousDeltaRayTool Class Reference

UnambiguousDeltaRayTool class. More...

#include <UnambiguousDeltaRayTool.h>

Inheritance diagram for lar_content::UnambiguousDeltaRayTool:
lar_content::DeltaRayTensorTool

Public Member Functions

 UnambiguousDeltaRayTool ()
 Default constructor. More...
 

Private Member Functions

bool Run (ThreeViewDeltaRayMatchingAlgorithm *const pAlgorithm, TensorType &overlapTensor)
 Run the algorithm tool. More...
 
pandora::StatusCode ReadSettings (const pandora::TiXmlHandle xmlHandle)
 
bool ExamineUnambiguousElements (TensorType::ElementList &elementList)
 Create delta ray pfos out of unambiguous (1:1:1) matches that are connected to a parent cosmic ray. More...
 
bool IsConnected (const TensorType::Element &element) const
 Determine whether the clusters of an element are connected to a cosmic ray pfo. More...
 

Private Attributes

float m_maxSeparation
 The maximum separation between a connected delta ray cluster and a cosmic ray cluster. More...
 
unsigned int m_minNConnectedClusters
 The threshold number of connected delta ray clusters required for particle creation. More...
 

Additional Inherited Members

- Public Types inherited from lar_content::DeltaRayTensorTool
typedef ThreeViewDeltaRayMatchingAlgorithm::MatchingType::TensorType TensorType
 
typedef std::vector< TensorType::ElementList::const_iteratorIteratorList
 
- Public Attributes inherited from lar_content::DeltaRayTensorTool
ThreeViewDeltaRayMatchingAlgorithmm_pParentAlgorithm
 Address of the parent matching algorithm. More...
 

Detailed Description

UnambiguousDeltaRayTool class.

Definition at line 18 of file UnambiguousDeltaRayTool.h.

Constructor & Destructor Documentation

lar_content::UnambiguousDeltaRayTool::UnambiguousDeltaRayTool ( )

Default constructor.

Definition at line 21 of file UnambiguousDeltaRayTool.cc.

22 {
23 }
unsigned int m_minNConnectedClusters
The threshold number of connected delta ray clusters required for particle creation.
float m_maxSeparation
The maximum separation between a connected delta ray cluster and a cosmic ray cluster.

Member Function Documentation

bool lar_content::UnambiguousDeltaRayTool::ExamineUnambiguousElements ( TensorType::ElementList elementList)
private

Create delta ray pfos out of unambiguous (1:1:1) matches that are connected to a parent cosmic ray.

Parameters
elementListthe tensor element list
Returns
whether any delta ray pfos were created

Definition at line 42 of file UnambiguousDeltaRayTool.cc.

43 {
44  ProtoParticleVector protoParticleVector;
45 
46  for (TensorType::Element &element : elementList)
47  {
48  if (!this->IsConnected(element))
49  continue;
50 
51  ProtoParticle protoParticle;
52  protoParticle.m_clusterList.push_back(element.GetClusterU());
53  protoParticle.m_clusterList.push_back(element.GetClusterV());
54  protoParticle.m_clusterList.push_back(element.GetClusterW());
55  protoParticleVector.push_back(protoParticle);
56  }
57 
58  return m_pParentAlgorithm->CreatePfos(protoParticleVector);
59 }
std::vector< ProtoParticle > ProtoParticleVector
bool IsConnected(const TensorType::Element &element) const
Determine whether the clusters of an element are connected to a cosmic ray pfo.
ThreeViewDeltaRayMatchingAlgorithm * m_pParentAlgorithm
Address of the parent matching algorithm.
bool CreatePfos(ProtoParticleVector &protoParticleVector)
Create delta ray pfos maxmising completeness by searching for and merging in any stray clusters...
bool lar_content::UnambiguousDeltaRayTool::IsConnected ( const TensorType::Element &  element) const
private

Determine whether the clusters of an element are connected to a cosmic ray pfo.

Parameters
elementListthe tensor element
Returns
whether the clusters are connected to a cosmic ray pfo

Definition at line 63 of file UnambiguousDeltaRayTool.cc.

64 {
65  PfoList commonMuonPfoList(element.GetOverlapResult().GetCommonMuonPfoList());
66 
67  for (const ParticleFlowObject *const pMuonPfo : commonMuonPfoList)
68  {
69  unsigned int connectedClusterCount(0);
70 
71  for (const HitType hitType : {TPC_VIEW_U, TPC_VIEW_V, TPC_VIEW_W})
72  {
73  ClusterList muonClusterList;
74  LArPfoHelper::GetClusters(pMuonPfo, hitType, muonClusterList);
75 
76  const float separation(LArClusterHelper::GetClosestDistance(element.GetCluster(hitType), muonClusterList));
77 
78  if (separation < m_maxSeparation)
79  ++connectedClusterCount;
80  }
81 
82  if (connectedClusterCount > m_minNConnectedClusters)
83  return true;
84  }
85 
86  return false;
87 }
unsigned int m_minNConnectedClusters
The threshold number of connected delta ray clusters required for particle creation.
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.
enum cvn::HType HitType
float m_maxSeparation
The maximum separation between a connected delta ray cluster and a cosmic ray cluster.
static float GetClosestDistance(const pandora::ClusterList &clusterList1, const pandora::ClusterList &clusterList2)
Get closest distance between clusters in a pair of cluster lists.
StatusCode lar_content::UnambiguousDeltaRayTool::ReadSettings ( const pandora::TiXmlHandle  xmlHandle)
private

Definition at line 91 of file UnambiguousDeltaRayTool.cc.

92 {
93  PANDORA_RETURN_RESULT_IF_AND_IF(STATUS_CODE_SUCCESS, STATUS_CODE_NOT_FOUND, !=, XmlHelper::ReadValue(xmlHandle, "MinSeparation", m_maxSeparation));
94 
95  PANDORA_RETURN_RESULT_IF_AND_IF(
96  STATUS_CODE_SUCCESS, STATUS_CODE_NOT_FOUND, !=, XmlHelper::ReadValue(xmlHandle, "MinNConnectedClusters", m_minNConnectedClusters));
97 
98  return STATUS_CODE_SUCCESS;
99 }
unsigned int m_minNConnectedClusters
The threshold number of connected delta ray clusters required for particle creation.
float m_maxSeparation
The maximum separation between a connected delta ray cluster and a cosmic ray cluster.
bool lar_content::UnambiguousDeltaRayTool::Run ( ThreeViewDeltaRayMatchingAlgorithm *const  pAlgorithm,
TensorType overlapTensor 
)
privatevirtual

Run the algorithm tool.

Parameters
pAlgorithmaddress of the calling algorithm
overlapTensorthe overlap tensor
Returns
whether changes have been made by the tool

Implements lar_content::DeltaRayTensorTool.

Definition at line 27 of file UnambiguousDeltaRayTool.cc.

28 {
29  m_pParentAlgorithm = pAlgorithm;
30 
31  if (PandoraContentApi::GetSettings(*m_pParentAlgorithm)->ShouldDisplayAlgorithmInfo())
32  std::cout << "----> Running Algorithm Tool: " << this->GetInstanceName() << ", " << this->GetType() << std::endl;
33 
34  TensorType::ElementList elementList;
35  overlapTensor.GetUnambiguousElements(true, elementList);
36 
37  return this->ExamineUnambiguousElements(elementList);
38 }
bool ExamineUnambiguousElements(TensorType::ElementList &elementList)
Create delta ray pfos out of unambiguous (1:1:1) matches that are connected to a parent cosmic ray...
ThreeViewDeltaRayMatchingAlgorithm * m_pParentAlgorithm
Address of the parent matching algorithm.
QTextStream & endl(QTextStream &s)

Member Data Documentation

float lar_content::UnambiguousDeltaRayTool::m_maxSeparation
private

The maximum separation between a connected delta ray cluster and a cosmic ray cluster.

Definition at line 48 of file UnambiguousDeltaRayTool.h.

unsigned int lar_content::UnambiguousDeltaRayTool::m_minNConnectedClusters
private

The threshold number of connected delta ray clusters required for particle creation.

Definition at line 49 of file UnambiguousDeltaRayTool.h.


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