LArSoft  v06_85_00
Liquid Argon Software toolkit - http://larsoft.org/
lar_content::VertexAssociatedPfosTool Class Reference

VertexAssociatedPfosTool class. More...

#include "VertexAssociatedPfosTool.h"

Inheritance diagram for lar_content::VertexAssociatedPfosTool:
lar_content::PfoRelationTool

Public Member Functions

 VertexAssociatedPfosTool ()
 Default constructor. More...
 
void Run (NeutrinoHierarchyAlgorithm *const pAlgorithm, const pandora::Vertex *const pNeutrinoVertex, NeutrinoHierarchyAlgorithm::PfoInfoMap &pfoInfoMap)
 Run the algorithm tool. More...
 

Private Member Functions

pandora::StatusCode ReadSettings (const pandora::TiXmlHandle xmlHandle)
 

Private Attributes

float m_minVertexLongitudinalDistance
 Vertex association check: min longitudinal distance cut. More...
 
float m_maxVertexLongitudinalDistance
 Vertex association check: max longitudinal distance cut. More...
 
float m_maxVertexTransverseDistance
 Vertex association check: max transverse distance cut. More...
 
float m_vertexAngularAllowance
 Vertex association check: pointing angular allowance in degrees. More...
 

Detailed Description

VertexAssociatedPfosTool class.

Definition at line 19 of file VertexAssociatedPfosTool.h.

Constructor & Destructor Documentation

lar_content::VertexAssociatedPfosTool::VertexAssociatedPfosTool ( )

Default constructor.

Definition at line 27 of file VertexAssociatedPfosTool.cc.

27  :
32 {
33 }
float m_vertexAngularAllowance
Vertex association check: pointing angular allowance in degrees.
float m_maxVertexTransverseDistance
Vertex association check: max transverse distance cut.
float m_minVertexLongitudinalDistance
Vertex association check: min longitudinal distance cut.
TFile f
Definition: plotHisto.C:6
float m_maxVertexLongitudinalDistance
Vertex association check: max longitudinal distance cut.

Member Function Documentation

StatusCode lar_content::VertexAssociatedPfosTool::ReadSettings ( const pandora::TiXmlHandle  xmlHandle)
private

Definition at line 72 of file VertexAssociatedPfosTool.cc.

References m_maxVertexLongitudinalDistance, m_maxVertexTransverseDistance, m_minVertexLongitudinalDistance, and m_vertexAngularAllowance.

73 {
74  PANDORA_RETURN_RESULT_IF_AND_IF(STATUS_CODE_SUCCESS, STATUS_CODE_NOT_FOUND, !=, XmlHelper::ReadValue(xmlHandle,
75  "MinVertexLongitudinalDistance", m_minVertexLongitudinalDistance));
76 
77  PANDORA_RETURN_RESULT_IF_AND_IF(STATUS_CODE_SUCCESS, STATUS_CODE_NOT_FOUND, !=, XmlHelper::ReadValue(xmlHandle,
78  "MaxVertexLongitudinalDistance", m_maxVertexLongitudinalDistance));
79 
80  PANDORA_RETURN_RESULT_IF_AND_IF(STATUS_CODE_SUCCESS, STATUS_CODE_NOT_FOUND, !=, XmlHelper::ReadValue(xmlHandle,
81  "MaxVertexTransverseDistance", m_maxVertexTransverseDistance));
82 
83  PANDORA_RETURN_RESULT_IF_AND_IF(STATUS_CODE_SUCCESS, STATUS_CODE_NOT_FOUND, !=, XmlHelper::ReadValue(xmlHandle,
84  "VertexAngularAllowance", m_vertexAngularAllowance));
85 
86  return STATUS_CODE_SUCCESS;
87 }
float m_vertexAngularAllowance
Vertex association check: pointing angular allowance in degrees.
float m_maxVertexTransverseDistance
Vertex association check: max transverse distance cut.
float m_minVertexLongitudinalDistance
Vertex association check: min longitudinal distance cut.
float m_maxVertexLongitudinalDistance
Vertex association check: max longitudinal distance cut.
void lar_content::VertexAssociatedPfosTool::Run ( NeutrinoHierarchyAlgorithm *const  pAlgorithm,
const pandora::Vertex *const  pNeutrinoVertex,
NeutrinoHierarchyAlgorithm::PfoInfoMap pfoInfoMap 
)
virtual

Run the algorithm tool.

Parameters
pAlgorithmaddress of the calling algorithm
pNeutrinoVertexthe address of the three dimensional neutrino interaction vertex
pfoInfoMapmapping from pfos to three dimensional clusters, sliding fits, vertices, etc.

Implements lar_content::PfoRelationTool.

Definition at line 37 of file VertexAssociatedPfosTool.cc.

References lar_content::LArPointingCluster::GetInnerVertex(), lar_content::LArPointingCluster::GetOuterVertex(), lar_content::LArPointingCluster::Vertex::GetPosition(), lar_content::LArPointingClusterHelper::IsEmission(), lar_content::LArPointingClusterHelper::IsNode(), m_maxVertexLongitudinalDistance, m_maxVertexTransverseDistance, m_minVertexLongitudinalDistance, m_vertexAngularAllowance, and lar_content::LArPfoHelper::SortByNHits().

38 {
39  if (PandoraContentApi::GetSettings(*pAlgorithm)->ShouldDisplayAlgorithmInfo())
40  std::cout << "----> Running Algorithm Tool: " << this->GetInstanceName() << ", " << this->GetType() << std::endl;
41 
42  const CartesianVector &neutrinoVertex(pNeutrinoVertex->GetPosition());
43 
44  PfoVector sortedPfos;
45  for (const auto &mapEntry : pfoInfoMap) sortedPfos.push_back(mapEntry.first);
46  std::sort(sortedPfos.begin(), sortedPfos.end(), LArPfoHelper::SortByNHits);
47 
48  for (const Pfo *const pPfo : sortedPfos)
49  {
50  PfoInfo *const pPfoInfo(pfoInfoMap.at(pPfo));
51 
52  if (pPfoInfo->IsNeutrinoVertexAssociated() || pPfoInfo->GetParentPfo())
53  continue;
54 
55  const LArPointingCluster pointingCluster(*(pPfoInfo->GetSlidingFitResult3D()));
56  const bool useInner((pointingCluster.GetInnerVertex().GetPosition() - neutrinoVertex).GetMagnitudeSquared() <
57  (pointingCluster.GetOuterVertex().GetPosition() - neutrinoVertex).GetMagnitudeSquared());
58 
59  const LArPointingCluster::Vertex &daughterVertex(useInner ? pointingCluster.GetInnerVertex() : pointingCluster.GetOuterVertex());
60 
63  {
64  pPfoInfo->SetNeutrinoVertexAssociation(true);
65  pPfoInfo->SetInnerLayerAssociation(useInner);
66  }
67  }
68 }
static bool SortByNHits(const pandora::ParticleFlowObject *const pLhs, const pandora::ParticleFlowObject *const pRhs)
Sort pfos by number of constituent hits.
static bool IsEmission(const pandora::CartesianVector &parentVertex, const LArPointingCluster::Vertex &daughterVertex, const float minLongitudinalDistance, const float maxLongitudinalDistance, const float maxTransverseDistance, const float angularAllowance)
Whether pointing vertex is emitted from a given position.
float m_vertexAngularAllowance
Vertex association check: pointing angular allowance in degrees.
float m_maxVertexTransverseDistance
Vertex association check: max transverse distance cut.
float m_minVertexLongitudinalDistance
Vertex association check: min longitudinal distance cut.
float m_maxVertexLongitudinalDistance
Vertex association check: max longitudinal distance cut.
NeutrinoHierarchyAlgorithm::PfoInfo PfoInfo
static bool IsNode(const pandora::CartesianVector &parentVertex, const LArPointingCluster::Vertex &daughterVertex, const float minLongitudinalDistance, const float maxTransverseDistance)
Whether pointing vertex is adjacent to a given position.

Member Data Documentation

float lar_content::VertexAssociatedPfosTool::m_maxVertexLongitudinalDistance
private

Vertex association check: max longitudinal distance cut.

Definition at line 33 of file VertexAssociatedPfosTool.h.

Referenced by ReadSettings(), and Run().

float lar_content::VertexAssociatedPfosTool::m_maxVertexTransverseDistance
private

Vertex association check: max transverse distance cut.

Definition at line 34 of file VertexAssociatedPfosTool.h.

Referenced by ReadSettings(), and Run().

float lar_content::VertexAssociatedPfosTool::m_minVertexLongitudinalDistance
private

Vertex association check: min longitudinal distance cut.

Definition at line 32 of file VertexAssociatedPfosTool.h.

Referenced by ReadSettings(), and Run().

float lar_content::VertexAssociatedPfosTool::m_vertexAngularAllowance
private

Vertex association check: pointing angular allowance in degrees.

Definition at line 35 of file VertexAssociatedPfosTool.h.

Referenced by ReadSettings(), and Run().


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