LArPfoObjects.cc
Go to the documentation of this file.
1 /**
2  * @file larpandoracontent/LArObjects/LArPfoObjects.cc
3  *
4  * @brief Implementation of lar pfo objects.
5  *
6  * $Log: $
7  */
8 
10 
11 #include "Objects/CaloHit.h"
12 
13 using namespace pandora;
14 
15 namespace lar_content
16 {
17 
18 LArTrackState::LArTrackState(const CartesianVector &position, const CartesianVector &direction, const CaloHit *const pCaloHit) :
19  TrackState(position, direction),
20  m_pCaloHit(pCaloHit)
21 {
22 }
23 
24 //------------------------------------------------------------------------------------------------------------------------------------------
25 
26 LArTrackState::LArTrackState(const CartesianVector &position, const CartesianVector &direction) :
27  TrackState(position, direction),
28  m_pCaloHit(nullptr)
29 {
30 }
31 
32 //------------------------------------------------------------------------------------------------------------------------------------------
33 
34 const CartesianVector &LArTrackState::GetDirection() const
35 {
36  return this->GetMomentum();
37 }
38 
39 //------------------------------------------------------------------------------------------------------------------------------------------
40 
41 const CaloHit *LArTrackState::GetCaloHit() const
42 {
43  if (m_pCaloHit)
44  return m_pCaloHit;
45 
46  throw StatusCodeException(STATUS_CODE_NOT_INITIALIZED);
47 }
48 
49 //------------------------------------------------------------------------------------------------------------------------------------------
50 //------------------------------------------------------------------------------------------------------------------------------------------
51 
52 LArShowerPCA::LArShowerPCA(const CartesianVector &centroid, const CartesianVector &primaryAxis, const CartesianVector &secondaryAxis,
53  const CartesianVector &tertiaryAxis, const CartesianVector &eigenValues) :
54  m_centroid(centroid),
55  m_primaryAxis(primaryAxis),
56  m_secondaryAxis(secondaryAxis),
57  m_tertiaryAxis(tertiaryAxis),
58  m_eigenValues(eigenValues),
59  m_axisLengths(((eigenValues.GetX() > std::numeric_limits<float>::epsilon()) ? 6.f * std::sqrt(eigenValues.GetX()) : 0.f),
60  ((eigenValues.GetY() > std::numeric_limits<float>::epsilon()) ? 6.f * std::sqrt(eigenValues.GetY()) : 0.f),
61  ((eigenValues.GetZ() > std::numeric_limits<float>::epsilon()) ? 6.f * std::sqrt(eigenValues.GetZ()) : 0.f))
62 {
63 }
64 
65 //------------------------------------------------------------------------------------------------------------------------------------------
66 
67 const CartesianVector &LArShowerPCA::GetCentroid() const
68 {
69  return m_centroid;
70 }
71 
72 //------------------------------------------------------------------------------------------------------------------------------------------
73 
74 const CartesianVector &LArShowerPCA::GetPrimaryAxis() const
75 {
76  return m_primaryAxis;
77 }
78 
79 //------------------------------------------------------------------------------------------------------------------------------------------
80 
81 const CartesianVector &LArShowerPCA::GetSecondaryAxis() const
82 {
83  return m_secondaryAxis;
84 }
85 
86 //------------------------------------------------------------------------------------------------------------------------------------------
87 
88 const CartesianVector &LArShowerPCA::GetTertiaryAxis() const
89 {
90  return m_tertiaryAxis;
91 }
92 
93 //------------------------------------------------------------------------------------------------------------------------------------------
94 
95 const CartesianVector &LArShowerPCA::GetEigenValues() const
96 {
97  return m_eigenValues;
98 }
99 
100 //------------------------------------------------------------------------------------------------------------------------------------------
101 
102 const CartesianVector &LArShowerPCA::GetAxisLengths() const
103 {
104  return m_axisLengths;
105 }
106 
107 //------------------------------------------------------------------------------------------------------------------------------------------
108 
110 {
111  return m_axisLengths.GetX();
112 }
113 
114 //------------------------------------------------------------------------------------------------------------------------------------------
115 
117 {
118  return m_axisLengths.GetY();
119 }
120 
121 //------------------------------------------------------------------------------------------------------------------------------------------
122 
124 {
125  return m_axisLengths.GetZ();
126 }
127 
128 } // namespace lar_content
const pandora::CartesianVector & GetCentroid() const
Return centroid.
float GetPrimaryLength() const
Return primary length.
Header file for lar pfo objects.
STL namespace.
const pandora::CartesianVector & GetDirection() const
Return direction at this trajectory point.
const pandora::CartesianVector m_eigenValues
The vector of eigenvalues.
const pandora::CartesianVector m_tertiaryAxis
The tertiary axis.
const pandora::CaloHit * GetCaloHit() const
Return calo hit at this trajectory point.
const pandora::CartesianVector & GetEigenValues() const
Return vector of eigenvalues.
float GetTertiaryLength() const
Return tertiary length.
const pandora::CartesianVector m_primaryAxis
The primary axis.
const pandora::CartesianVector & GetAxisLengths() const
Return vector of lengths.
const pandora::CartesianVector m_centroid
The centroid.
const pandora::CartesianVector m_axisLengths
The vector of lengths.
LArShowerPCA(const pandora::CartesianVector &centroid, const pandora::CartesianVector &primaryAxis, const pandora::CartesianVector &secondaryAxis, const pandora::CartesianVector &tertiaryAxis, const pandora::CartesianVector &eigenvalues)
Constructor.
const pandora::CartesianVector & GetSecondaryAxis() const
Return secondary axis.
const pandora::CartesianVector & GetTertiaryAxis() const
Return tertiary axis.
float GetSecondaryLength() const
Return secondary length.
LArTrackState(const pandora::CartesianVector &position, const pandora::CartesianVector &direction, const pandora::CaloHit *const pCaloHit)
Constructor.
const pandora::CartesianVector m_secondaryAxis
The secondary axis.
const pandora::CartesianVector & GetPrimaryAxis() const
Return primary axis.