Pandora
Pandora source code navigator
Loading...
Searching...
No Matches
LArPointingCluster.h
Go to the documentation of this file.
1
8#ifndef LAR_POINTING_CLUSTER_H
9#define LAR_POINTING_CLUSTER_H 1
10
13
14namespace lar_content
15{
16
21{
22public:
26 class Vertex
27 {
28 public:
32 Vertex();
33
43 Vertex(const pandora::Cluster *const pCluster, const pandora::CartesianVector &position, const pandora::CartesianVector &direction,
44 const float rms, const bool isInner);
45
51 Vertex(const Vertex &rhs);
52
57 ~Vertex();
58
64 const pandora::Cluster *GetCluster() const;
65
72
79
85 float GetRms() const;
86
92 bool IsInnerVertex() const;
93
99 bool IsInitialized() const;
100
106 Vertex &operator=(const Vertex &rhs);
107
108 private:
112 float m_rms;
115 };
116
124 LArPointingCluster(const pandora::Cluster *const pCluster, const unsigned int fitHalfLayerWindow = 10, const float fitLayerPitch = 0.3f);
125
131 LArPointingCluster(const TwoDSlidingFitResult &slidingFitResult);
132
138 LArPointingCluster(const ThreeDSlidingFitResult &slidingFitResult);
139
145 const pandora::Cluster *GetCluster() const;
146
152 const Vertex &GetInnerVertex() const;
153
159 const Vertex &GetOuterVertex() const;
160
166 float GetLengthSquared() const;
167
173 float GetLength() const;
174
175private:
181 void BuildPointingCluster(const TwoDSlidingFitResult &slidingFitResult);
182
188 void BuildPointingCluster(const ThreeDSlidingFitResult &slidingFitResult);
189
193};
194
195typedef std::vector<LArPointingCluster> LArPointingClusterList;
196typedef std::vector<LArPointingCluster::Vertex> LArPointingClusterVertexList;
197typedef std::unordered_map<const pandora::Cluster *, LArPointingCluster> LArPointingClusterMap;
198
199//------------------------------------------------------------------------------------------------------------------------------------------
200
202{
203 return m_pCluster;
204}
205
206//------------------------------------------------------------------------------------------------------------------------------------------
207
212
213//------------------------------------------------------------------------------------------------------------------------------------------
214
219
220//------------------------------------------------------------------------------------------------------------------------------------------
221
223{
224 return (m_outerVertex.GetPosition() - m_innerVertex.GetPosition()).GetMagnitudeSquared();
225}
226
227//------------------------------------------------------------------------------------------------------------------------------------------
228
230{
231 return std::sqrt(this->GetLengthSquared());
232}
233
234//------------------------------------------------------------------------------------------------------------------------------------------
235//------------------------------------------------------------------------------------------------------------------------------------------
236
238{
239 if (!m_isInitialized)
240 throw pandora::StatusCodeException(pandora::STATUS_CODE_NOT_INITIALIZED);
241
242 return m_pCluster;
243}
244
245//------------------------------------------------------------------------------------------------------------------------------------------
246
248{
249 if (!m_isInitialized)
250 throw pandora::StatusCodeException(pandora::STATUS_CODE_NOT_INITIALIZED);
251
252 return m_position;
253}
254
255//------------------------------------------------------------------------------------------------------------------------------------------
256
258{
259 if (!m_isInitialized)
260 throw pandora::StatusCodeException(pandora::STATUS_CODE_NOT_INITIALIZED);
261
262 return m_direction;
263}
264
265//------------------------------------------------------------------------------------------------------------------------------------------
266
268{
269 if (!m_isInitialized)
270 throw pandora::StatusCodeException(pandora::STATUS_CODE_NOT_INITIALIZED);
271
272 return m_rms;
273}
274
275//------------------------------------------------------------------------------------------------------------------------------------------
276
278{
279 if (!m_isInitialized)
280 throw pandora::StatusCodeException(pandora::STATUS_CODE_NOT_INITIALIZED);
281
282 return m_isInner;
283}
284
285//------------------------------------------------------------------------------------------------------------------------------------------
286
288{
289 return m_isInitialized;
290}
291
292} // namespace lar_content
293
294#endif // #ifndef LAR_POINTING_CLUSTER_H
Header file for the lar three dimensional sliding fit result class.
Header file for the lar two dimensional sliding fit result class.
bool m_isInner
Whether this is the inner vertex.
const pandora::CartesianVector & GetDirection() const
Get the vertex direction.
bool IsInitialized() const
Whether the vertex has been initialized.
bool m_isInitialized
Whether the vertex has been initialized.
pandora::CartesianVector m_direction
The vertex direction.
const pandora::Cluster * m_pCluster
The address of the cluster.
float GetRms() const
Get rms from vertex fit.
const pandora::CartesianVector & GetPosition() const
Get the vertex position.
const pandora::Cluster * GetCluster() const
Get the address of the cluster.
Vertex & operator=(const Vertex &rhs)
Vertex assigment operator.
bool IsInnerVertex() const
Is this the inner vertex.
pandora::CartesianVector m_position
The vertex position.
LArPointingCluster class.
void BuildPointingCluster(const TwoDSlidingFitResult &slidingFitResult)
Build the pointing cluster object from the sliding fit result.
Vertex m_outerVertex
The outer vertex.
const pandora::Cluster * m_pCluster
The address of the cluster.
const Vertex & GetInnerVertex() const
Get the inner vertex.
const pandora::Cluster * GetCluster() const
Get the address of the cluster.
const Vertex & GetOuterVertex() const
Get the outer vertex.
float GetLength() const
Get length of pointing cluster.
Vertex m_innerVertex
The inner vertex.
float GetLengthSquared() const
Get length squared of pointing cluster.
CartesianVector class.
Cluster class.
Definition Cluster.h:31
StatusCodeException class.
std::vector< LArPointingCluster::Vertex > LArPointingClusterVertexList
std::unordered_map< const pandora::Cluster *, LArPointingCluster > LArPointingClusterMap
std::vector< LArPointingCluster > LArPointingClusterList