Classes | Public Member Functions | Private Member Functions | Private Attributes | List of all members
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.

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 }
enum cvn::HType HitType
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
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.

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 pandora::Cluster * lar_content::LArPointingCluster::GetCluster ( ) const
inline

Get the address of the cluster.

Returns
the address of the cluster

Definition at line 201 of file LArPointingCluster.h.

202 {
203  return m_pCluster;
204 }
const pandora::Cluster * m_pCluster
The address of the cluster.
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.

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

Get length of pointing cluster.

Returns
the length

Definition at line 229 of file LArPointingCluster.h.

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.

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.

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.

Vertex lar_content::LArPointingCluster::m_outerVertex
private

The outer vertex.

Definition at line 192 of file LArPointingCluster.h.

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: