LArPfoObjects.h
Go to the documentation of this file.
1 /**
2  * @file larpandoracontent/LArObjects/LArPfoObjects.h
3  *
4  * @brief Header file for lar pfo objects.
5  *
6  * $Log: $
7  */
8 #ifndef LAR_PFO_OBJECTS_H
9 #define LAR_PFO_OBJECTS_H 1
10 
11 #include "Objects/CartesianVector.h"
12 #include "Objects/TrackState.h"
13 
14 #include <vector>
15 
16 namespace pandora
17 {
18 class CaloHit;
19 }
20 
21 //------------------------------------------------------------------------------------------------------------------------------------------
22 
23 namespace lar_content
24 {
25 
26 /**
27  * @brief LArTrackState class
28  */
29 class LArTrackState : public pandora::TrackState
30 {
31 public:
32  /**
33  * @brief Constructor
34  *
35  * @param position the position
36  * @param direction the direction
37  * @param pCaloHit the address of the associated calo hit
38  */
39  LArTrackState(const pandora::CartesianVector &position, const pandora::CartesianVector &direction, const pandora::CaloHit *const pCaloHit);
40 
41  /**
42  * @brief Constructor
43  *
44  * @param position the position
45  * @param direction the direction
46  */
47  LArTrackState(const pandora::CartesianVector &position, const pandora::CartesianVector &direction);
48 
49  /**
50  * @brief Return direction at this trajectory point
51  *
52  * @return the direction at this trajectory point
53  */
54  const pandora::CartesianVector &GetDirection() const;
55 
56  /**
57  * @brief Return calo hit at this trajectory point
58  *
59  * @param the address of the calo hit at this trajectory point
60  */
61  const pandora::CaloHit *GetCaloHit() const;
62 
63 private:
64  const pandora::CaloHit *m_pCaloHit;
65 };
66 
67 typedef std::vector<LArTrackState> LArTrackStateVector;
68 
69 //------------------------------------------------------------------------------------------------------------------------------------------
70 
71 /**
72  * @brief LArTrackTrajectoryPoint class
73  */
74 class LArTrackTrajectoryPoint : public std::pair<float, LArTrackState>
75 {
76 public:
77  /**
78  * @brief Constructor
79  *
80  * @param projectedDistance the projected distance
81  * @param larTrackState the lar track state
82  */
83  LArTrackTrajectoryPoint(const float projectedDistance, const LArTrackState &larTrackState);
84 
85  /**
86  * @brief Constructor
87  *
88  * @param projectedDistance the projected distance
89  * @param larTrackState the lar track state
90  * @param index the index associated with the trajectory point
91  */
92  LArTrackTrajectoryPoint(const float projectedDistance, const LArTrackState &larTrackState, const int index);
93 
94  /**
95  * @brief Get the index associated with the trajectory point
96  *
97  * @return the index associated with the trajectory point
98  */
99  int GetIndex() const;
100 
101 private:
102  int m_index; ///< The index associated with the trajectory point
103 };
104 
105 typedef std::vector<LArTrackTrajectoryPoint> LArTrackTrajectory;
106 
107 //------------------------------------------------------------------------------------------------------------------------------------------
108 
109 /**
110  * @brief LArShowerPCA class
111  */
113 {
114 public:
115  /**
116  * @brief Constructor
117  *
118  * @param centroid centroid of shower
119  * @param primaryAxis primary axis of shower
120  * @param secondaryAxis secondary axis of shower
121  * @param tertiaryAxis tertiary axis of shower
122  * @param axisLengths ordered vector of shower lengths
123  */
124  LArShowerPCA(const pandora::CartesianVector &centroid, const pandora::CartesianVector &primaryAxis,
125  const pandora::CartesianVector &secondaryAxis, const pandora::CartesianVector &tertiaryAxis, const pandora::CartesianVector &eigenvalues);
126 
127  /**
128  * @brief Return centroid
129  *
130  * @return the centroid
131  */
132  const pandora::CartesianVector &GetCentroid() const;
133 
134  /**
135  * @brief Return primary axis
136  *
137  * @return the primary axis
138  */
139  const pandora::CartesianVector &GetPrimaryAxis() const;
140 
141  /**
142  * @brief Return secondary axis
143  *
144  * @return the secondary axis
145  */
146  const pandora::CartesianVector &GetSecondaryAxis() const;
147 
148  /**
149  * @brief Return tertiary axis
150  *
151  * @return the tertiary axis
152  */
153  const pandora::CartesianVector &GetTertiaryAxis() const;
154 
155  /**
156  * @brief Return vector of eigenvalues
157  *
158  * @return the vector of eigenvalues
159  */
160  const pandora::CartesianVector &GetEigenValues() const;
161 
162  /**
163  * @brief Return vector of lengths
164  *
165  * @return the vector of lengths
166  */
167  const pandora::CartesianVector &GetAxisLengths() const;
168 
169  /**
170  * @brief Return primary length
171  *
172  * @return the primary length
173  */
174  float GetPrimaryLength() const;
175 
176  /**
177  * @brief Return secondary length
178  *
179  * @return the secondary length
180  */
181  float GetSecondaryLength() const;
182 
183  /**
184  * @brief Return tertiary length
185  *
186  * @return the tertiary length
187  */
188  float GetTertiaryLength() const;
189 
190 private:
191  const pandora::CartesianVector m_centroid; ///< The centroid
192  const pandora::CartesianVector m_primaryAxis; ///< The primary axis
193  const pandora::CartesianVector m_secondaryAxis; ///< The secondary axis
194  const pandora::CartesianVector m_tertiaryAxis; ///< The tertiary axis
195  const pandora::CartesianVector m_eigenValues; ///< The vector of eigenvalues
196  const pandora::CartesianVector m_axisLengths; ///< The vector of lengths
197 };
198 
199 //------------------------------------------------------------------------------------------------------------------------------------------
200 //------------------------------------------------------------------------------------------------------------------------------------------
201 
202 inline LArTrackTrajectoryPoint::LArTrackTrajectoryPoint(const float projectedDistance, const LArTrackState &larTrackState) :
203  std::pair<float, LArTrackState>(projectedDistance, larTrackState),
204  m_index(-1)
205 {
206 }
207 
208 //------------------------------------------------------------------------------------------------------------------------------------------
209 
210 inline LArTrackTrajectoryPoint::LArTrackTrajectoryPoint(const float projectedDistance, const LArTrackState &larTrackState, const int index) :
211  std::pair<float, LArTrackState>(projectedDistance, larTrackState),
212  m_index(index)
213 {
214 }
215 
216 //------------------------------------------------------------------------------------------------------------------------------------------
217 
219 {
220  return m_index;
221 }
222 
223 } // namespace lar_content
224 
225 #endif // #ifndef LAR_PFO_OBJECTS_H
int m_index
The index associated with the trajectory point.
LArTrackState class.
Definition: LArPfoObjects.h:29
STL namespace.
const pandora::CaloHit * m_pCaloHit
Definition: LArPfoObjects.h:64
const pandora::CartesianVector m_eigenValues
The vector of eigenvalues.
int GetIndex() const
Get the index associated with the trajectory point.
std::vector< LArTrackTrajectoryPoint > LArTrackTrajectory
const pandora::CartesianVector m_tertiaryAxis
The tertiary axis.
LArTrackTrajectoryPoint(const float projectedDistance, const LArTrackState &larTrackState)
Constructor.
const pandora::CartesianVector m_primaryAxis
The primary axis.
const pandora::CartesianVector m_centroid
The centroid.
const pandora::CartesianVector m_axisLengths
The vector of lengths.
std::vector< LArTrackState > LArTrackStateVector
Definition: LArPfoObjects.h:67
LArTrackTrajectoryPoint class.
Definition: LArPfoObjects.h:74
LArShowerPCA class.
const pandora::CartesianVector m_secondaryAxis
The secondary axis.