LArSoft  v09_90_00
Liquid Argon Software toolkit - https://larsoft.org/
lar_content::LArPointingCluster Class Reference

LArPointingCluster class. More...

#include "LArPointingCluster.h"

Classes

class  Vertex
 Vertex class. More...
 

Public Member Functions

 LArPointingCluster (const pandora::Cluster *const pCluster, const unsigned int fitHalfLayerWindow=10, const float fitLayerPitch=0.3f)
 Constructor. More...
 
 LArPointingCluster (const TwoDSlidingFitResult &slidingFitResult)
 Constructor. More...
 
 LArPointingCluster (const ThreeDSlidingFitResult &slidingFitResult)
 Constructor. More...
 
const pandora::Cluster * GetCluster () const
 Get the address of the cluster. More...
 
const VertexGetInnerVertex () const
 Get the inner vertex. More...
 
const VertexGetOuterVertex () const
 Get the outer vertex. More...
 
float GetLengthSquared () const
 Get length squared of pointing cluster. More...
 
float GetLength () const
 Get length of pointing cluster. More...
 

Private Member Functions

void BuildPointingCluster (const TwoDSlidingFitResult &slidingFitResult)
 Build the pointing cluster object from the sliding fit result. More...
 
void BuildPointingCluster (const ThreeDSlidingFitResult &slidingFitResult)
 Build the pointing cluster object from the sliding fit result. More...
 

Private Attributes

const pandora::Cluster * m_pCluster
 The address of the cluster. More...
 
Vertex m_innerVertex
 The inner vertex. More...
 
Vertex m_outerVertex
 The outer vertex. More...
 

Detailed Description

LArPointingCluster class.

Definition at line 20 of file LArPointingCluster.h.

Constructor & Destructor Documentation

lar_content::LArPointingCluster::LArPointingCluster ( const pandora::Cluster *const  pCluster,
const unsigned int  fitHalfLayerWindow = 10,
const float  fitLayerPitch = 0.3f 
)

Constructor.

Parameters
pClusteraddress of the cluster
fitHalfLayerWindowthe fit layer half window
fitLayerPitchthe fit layer pitch, units cm
lar_content::LArPointingCluster::LArPointingCluster ( const TwoDSlidingFitResult slidingFitResult)

Constructor.

Parameters
slidingFitResultthe input sliding fit result

Definition at line 34 of file LArPointingCluster.cc.

35 {
36  this->BuildPointingCluster(slidingFitResult);
37 }
void BuildPointingCluster(const TwoDSlidingFitResult &slidingFitResult)
Build the pointing cluster object from the sliding fit result.
lar_content::LArPointingCluster::LArPointingCluster ( const ThreeDSlidingFitResult slidingFitResult)

Constructor.

Parameters
slidingFitResultthe input sliding fit result

Definition at line 41 of file LArPointingCluster.cc.

42 {
43  this->BuildPointingCluster(slidingFitResult);
44 }
void BuildPointingCluster(const TwoDSlidingFitResult &slidingFitResult)
Build the pointing cluster object from the sliding fit result.

Member Function Documentation

void lar_content::LArPointingCluster::BuildPointingCluster ( const TwoDSlidingFitResult slidingFitResult)
private

Build the pointing cluster object from the sliding fit result.

Parameters
slidingFitResultthe input sliding fit result

Definition at line 48 of file LArPointingCluster.cc.

References lar_content::TwoDSlidingFitResult::GetCluster(), lar_content::TwoDSlidingFitResult::GetGlobalMaxLayerDirection(), lar_content::TwoDSlidingFitResult::GetGlobalMaxLayerPosition(), lar_content::TwoDSlidingFitResult::GetGlobalMinLayerDirection(), lar_content::TwoDSlidingFitResult::GetGlobalMinLayerPosition(), lar_content::TwoDSlidingFitResult::GetMaxLayer(), lar_content::TwoDSlidingFitResult::GetMaxLayerRms(), lar_content::TwoDSlidingFitResult::GetMinLayer(), and lar_content::TwoDSlidingFitResult::GetMinLayerRms().

49 {
50  const HitType hitType(LArClusterHelper::GetClusterHitType(slidingFitResult.GetCluster()));
51 
52  if (!((TPC_VIEW_U == hitType) || (TPC_VIEW_V == hitType) || (TPC_VIEW_W == hitType)))
53  throw StatusCodeException(STATUS_CODE_INVALID_PARAMETER);
54 
55  if (slidingFitResult.GetMinLayer() >= slidingFitResult.GetMaxLayer())
56  throw StatusCodeException(STATUS_CODE_INVALID_PARAMETER);
57 
58  const bool isInner((slidingFitResult.GetGlobalMinLayerPosition().GetZ() < slidingFitResult.GetGlobalMaxLayerPosition().GetZ()));
59 
60  m_pCluster = slidingFitResult.GetCluster();
61 
62  const Vertex minVertex(m_pCluster, slidingFitResult.GetGlobalMinLayerPosition(), slidingFitResult.GetGlobalMinLayerDirection(),
63  slidingFitResult.GetMinLayerRms(), isInner);
64  const Vertex maxVertex(m_pCluster, slidingFitResult.GetGlobalMaxLayerPosition(), slidingFitResult.GetGlobalMaxLayerDirection() * -1.f,
65  slidingFitResult.GetMaxLayerRms(), !isInner);
66 
67  m_innerVertex = (isInner ? minVertex : maxVertex);
68  m_outerVertex = (isInner ? maxVertex : minVertex);
69 }
const pandora::Cluster * m_pCluster
The address of the cluster.
static pandora::HitType GetClusterHitType(const pandora::Cluster *const pCluster)
Get the hit type associated with a two dimensional cluster.
Vertex m_innerVertex
The inner vertex.
Vertex m_outerVertex
The outer vertex.
HitType
Definition: HitType.h:12
boost::graph_traits< ModuleGraph >::vertex_descriptor Vertex
Definition: ModuleGraph.h:25
void lar_content::LArPointingCluster::BuildPointingCluster ( const ThreeDSlidingFitResult slidingFitResult)
private

Build the pointing cluster object from the sliding fit result.

Parameters
slidingFitResultthe input sliding fit result

Definition at line 73 of file LArPointingCluster.cc.

References lar_content::ThreeDSlidingFitResult::GetCluster(), lar_content::ThreeDSlidingFitResult::GetGlobalMaxLayerDirection(), lar_content::ThreeDSlidingFitResult::GetGlobalMaxLayerPosition(), lar_content::ThreeDSlidingFitResult::GetGlobalMinLayerDirection(), lar_content::ThreeDSlidingFitResult::GetGlobalMinLayerPosition(), lar_content::ThreeDSlidingFitResult::GetMaxLayer(), lar_content::ThreeDSlidingFitResult::GetMaxLayerRms(), lar_content::ThreeDSlidingFitResult::GetMinLayer(), and lar_content::ThreeDSlidingFitResult::GetMinLayerRms().

74 {
75  if (TPC_3D != LArClusterHelper::GetClusterHitType(slidingFitResult.GetCluster()))
76  throw StatusCodeException(STATUS_CODE_INVALID_PARAMETER);
77 
78  if (slidingFitResult.GetMinLayer() >= slidingFitResult.GetMaxLayer())
79  throw StatusCodeException(STATUS_CODE_INVALID_PARAMETER);
80 
81  const bool isInner((slidingFitResult.GetGlobalMinLayerPosition().GetZ() < slidingFitResult.GetGlobalMaxLayerPosition().GetZ()) &&
82  (slidingFitResult.GetMinLayer() < slidingFitResult.GetMaxLayer()));
83 
84  m_pCluster = slidingFitResult.GetCluster();
85 
86  const Vertex minVertex(m_pCluster, slidingFitResult.GetGlobalMinLayerPosition(), slidingFitResult.GetGlobalMinLayerDirection(),
87  slidingFitResult.GetMinLayerRms(), isInner);
88  const Vertex maxVertex(m_pCluster, slidingFitResult.GetGlobalMaxLayerPosition(), slidingFitResult.GetGlobalMaxLayerDirection() * -1.f,
89  slidingFitResult.GetMaxLayerRms(), !isInner);
90 
91  m_innerVertex = (isInner ? minVertex : maxVertex);
92  m_outerVertex = (isInner ? maxVertex : minVertex);
93 }
const pandora::Cluster * m_pCluster
The address of the cluster.
static pandora::HitType GetClusterHitType(const pandora::Cluster *const pCluster)
Get the hit type associated with a two dimensional cluster.
Vertex m_innerVertex
The inner vertex.
Vertex m_outerVertex
The outer vertex.
boost::graph_traits< ModuleGraph >::vertex_descriptor Vertex
Definition: ModuleGraph.h:25
const LArPointingCluster::Vertex & lar_content::LArPointingCluster::GetInnerVertex ( ) const
inline

Get the inner vertex.

Returns
the inner vertex

Definition at line 208 of file LArPointingCluster.h.

References m_innerVertex.

Referenced by lar_content::CosmicRayVertexBuildingAlgorithm::BuildCosmicRayParent(), lar_content::NeutrinoDaughterVerticesAlgorithm::BuildDaughterTrack(), lar_content::OvershootSplittingAlgorithm::BuildIntersectionMap(), lar_content::EventSlicingTool::CheckClosestApproach(), lar_content::LArPointingClusterHelper::CollectAssociatedClusters(), lar_content::CosmicRayExtensionAlgorithm::FillClusterAssociationMatrix(), lar_content::LArPointingClusterHelper::GetClosestVertices(), lar_content::LArStitchingHelper::GetClosestVertices(), lar_content::LArVertexHelper::GetClusterDirectionInZ(), lar_content::SlidingConePfoMopUpAlgorithm::GetClusterMergeMap(), lar_content::VertexBasedPfoRecoveryAlgorithm::GetInnerVertex(), lar_content::LArPointingClusterHelper::GetLengthSquared(), lar_content::TransverseExtensionAlgorithm::GetListOfCleanClusters(), lar_content::VertexBasedPfoRecoveryAlgorithm::GetOuterVertex(), lar_content::ThreeDKinkBaseTool::IsALowestInX(), lar_content::TwoViewThreeDKinkTool::IsALowestInX(), lar_content::EventSlicingTool::IsEmission(), lar_content::EventSlicingTool::IsNode(), lar_content::ShowerPfoMopUpAlgorithm::IsVertexAssociated(), lar_content::ShowerGrowingAlgorithm::IsVertexAssociated(), lar_content::NViewTrackMatchingAlgorithm< T >::MakeClusterSplit(), lar_content::CosmicRayTrackRecoveryAlgorithm::MatchClusters(), lar_content::StitchingCosmicRayMergingTool::OrderPfoMerges(), lar_content::TrackSplittingTool::PassesChecks(), lar_content::VertexAssociatedPfosTool::Run(), lar_content::VertexBasedPfoMopUpAlgorithm::Run(), lar_content::VertexBasedPfoRecoveryAlgorithm::SelectVertexClusters(), and lar_content::ParticleRecoveryAlgorithm::VertexClusterSelection().

209 {
210  return m_innerVertex;
211 }
Vertex m_innerVertex
The inner vertex.
float lar_content::LArPointingCluster::GetLength ( ) const
inline

Get length of pointing cluster.

Returns
the length

Definition at line 229 of file LArPointingCluster.h.

References GetLengthSquared().

230 {
231  return std::sqrt(this->GetLengthSquared());
232 }
float GetLengthSquared() const
Get length squared of pointing cluster.
float lar_content::LArPointingCluster::GetLengthSquared ( ) const
inline

Get length squared of pointing cluster.

Returns
the length squared

Definition at line 222 of file LArPointingCluster.h.

References lar_content::LArPointingCluster::Vertex::GetPosition(), m_innerVertex, and m_outerVertex.

Referenced by lar_content::VertexBasedPfoRecoveryAlgorithm::BuildSlidingFitResultMap(), lar_content::StitchingCosmicRayMergingTool::CreatePfoMatches(), and GetLength().

223 {
224  return (m_outerVertex.GetPosition() - m_innerVertex.GetPosition()).GetMagnitudeSquared();
225 }
Vertex m_innerVertex
The inner vertex.
Vertex m_outerVertex
The outer vertex.
const pandora::CartesianVector & GetPosition() const
Get the vertex position.
const LArPointingCluster::Vertex & lar_content::LArPointingCluster::GetOuterVertex ( ) const
inline

Get the outer vertex.

Returns
the outer vertex

Definition at line 215 of file LArPointingCluster.h.

References m_outerVertex.

Referenced by lar_content::CosmicRayVertexBuildingAlgorithm::BuildCosmicRayParent(), lar_content::NeutrinoDaughterVerticesAlgorithm::BuildDaughterTrack(), lar_content::OvershootSplittingAlgorithm::BuildIntersectionMap(), lar_content::EventSlicingTool::CheckClosestApproach(), lar_content::LArPointingClusterHelper::CollectAssociatedClusters(), lar_content::CosmicRayExtensionAlgorithm::FillClusterAssociationMatrix(), lar_content::LArPointingClusterHelper::GetClosestVertices(), lar_content::LArStitchingHelper::GetClosestVertices(), lar_content::LArVertexHelper::GetClusterDirectionInZ(), lar_content::SlidingConePfoMopUpAlgorithm::GetClusterMergeMap(), lar_content::VertexBasedPfoRecoveryAlgorithm::GetInnerVertex(), lar_content::LArPointingClusterHelper::GetLengthSquared(), lar_content::TransverseExtensionAlgorithm::GetListOfCleanClusters(), lar_content::VertexBasedPfoRecoveryAlgorithm::GetOuterVertex(), lar_content::ThreeDKinkBaseTool::IsALowestInX(), lar_content::TwoViewThreeDKinkTool::IsALowestInX(), lar_content::EventSlicingTool::IsEmission(), lar_content::EventSlicingTool::IsNode(), lar_content::ShowerPfoMopUpAlgorithm::IsVertexAssociated(), lar_content::ShowerGrowingAlgorithm::IsVertexAssociated(), lar_content::NViewTrackMatchingAlgorithm< T >::MakeClusterSplit(), lar_content::CosmicRayTrackRecoveryAlgorithm::MatchClusters(), lar_content::StitchingCosmicRayMergingTool::OrderPfoMerges(), lar_content::VertexAssociatedPfosTool::Run(), lar_content::VertexBasedPfoMopUpAlgorithm::Run(), lar_content::VertexBasedPfoRecoveryAlgorithm::SelectVertexClusters(), and lar_content::ParticleRecoveryAlgorithm::VertexClusterSelection().

216 {
217  return m_outerVertex;
218 }
Vertex m_outerVertex
The outer vertex.

Member Data Documentation

Vertex lar_content::LArPointingCluster::m_innerVertex
private

The inner vertex.

Definition at line 191 of file LArPointingCluster.h.

Referenced by GetInnerVertex(), and GetLengthSquared().

Vertex lar_content::LArPointingCluster::m_outerVertex
private

The outer vertex.

Definition at line 192 of file LArPointingCluster.h.

Referenced by GetLengthSquared(), and GetOuterVertex().

const pandora::Cluster* lar_content::LArPointingCluster::m_pCluster
private

The address of the cluster.

Definition at line 190 of file LArPointingCluster.h.


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