LArSoft  v09_90_00
Liquid Argon Software toolkit - https://larsoft.org/
LArThreeDSlidingFitResult.h
Go to the documentation of this file.
1 
8 #ifndef LAR_THREE_D_SLIDING_FIT_RESULT_H
9 #define LAR_THREE_D_SLIDING_FIT_RESULT_H 1
10 
11 #include "Api/PandoraApi.h"
12 
14 
15 #include <unordered_map>
16 
17 namespace lar_content
18 {
19 
24 {
25 public:
33  template <typename T>
34  ThreeDSlidingFitResult(const T *const pT, const unsigned int slidingFitWindow, const float slidingFitLayerPitch);
35 
41  const pandora::Cluster *GetCluster() const;
42 
48  const pandora::CartesianVector &GetAxisIntercept() const;
49 
55  const pandora::CartesianVector &GetAxisDirection() const;
56 
63 
70 
76  const pandora::CartesianVector &GetGlobalMinLayerPosition() const;
77 
83  const pandora::CartesianVector &GetGlobalMaxLayerPosition() const;
84 
90  const pandora::CartesianVector &GetGlobalMinLayerDirection() const;
91 
97  const pandora::CartesianVector &GetGlobalMaxLayerDirection() const;
98 
104  int GetMinLayer() const;
105 
111  int GetMaxLayer() const;
112 
118  float GetMinLayerRms() const;
119 
125  float GetMaxLayerRms() const;
126 
134  float GetFitRms(const float rL) const;
135 
143  float GetLongitudinalDisplacement(const pandora::CartesianVector &position) const;
144 
153  pandora::StatusCode GetGlobalFitPosition(const float rL, pandora::CartesianVector &position) const;
154 
163  pandora::StatusCode GetGlobalFitDirection(const float rL, pandora::CartesianVector &direction) const;
164 
165 private:
174  void GetGlobalPosition(const float rL, const float rT1, const float rT2, pandora::CartesianVector &position) const;
175 
183  void GetGlobalDirection(const float dTdL1, const float dTdL2, pandora::CartesianVector &direction) const;
184 
193  static pandora::TrackState GetPrimaryAxis(const pandora::Cluster *const pCluster, const float slidingFitLayerPitch);
194 
203  static pandora::TrackState GetPrimaryAxis(const pandora::CartesianPointVector *const pPointVector, const float slidingFitLayerPitch);
204 
212  static pandora::CartesianVector GetSeedDirection(const pandora::CartesianVector &axisDirection);
213 
214  const pandora::TrackState m_primaryAxis;
215  const pandora::CartesianVector m_axisIntercept;
216  const pandora::CartesianVector m_axisDirection;
217  const pandora::CartesianVector m_firstOrthoDirection;
218  const pandora::CartesianVector m_secondOrthoDirection;
221  const int m_minLayer;
222  const int m_maxLayer;
223 
224  pandora::CartesianVector m_minLayerPosition;
225  pandora::CartesianVector m_maxLayerPosition;
226  pandora::CartesianVector m_minLayerDirection;
227  pandora::CartesianVector m_maxLayerDirection;
228 };
229 
230 typedef std::vector<ThreeDSlidingFitResult> ThreeDSlidingFitResultList;
231 typedef std::unordered_map<const pandora::Cluster *, ThreeDSlidingFitResult> ThreeDSlidingFitResultMap;
232 
233 //------------------------------------------------------------------------------------------------------------------------------------------
234 //------------------------------------------------------------------------------------------------------------------------------------------
235 
236 inline const pandora::CartesianVector &ThreeDSlidingFitResult::GetAxisIntercept() const
237 {
238  return m_axisIntercept;
239 }
240 
241 //------------------------------------------------------------------------------------------------------------------------------------------
242 
243 inline const pandora::CartesianVector &ThreeDSlidingFitResult::GetAxisDirection() const
244 {
245  return m_axisDirection;
246 }
247 
248 //------------------------------------------------------------------------------------------------------------------------------------------
249 
251 {
252  return m_firstFitResult;
253 }
254 
255 //------------------------------------------------------------------------------------------------------------------------------------------
256 
258 {
259  return m_secondFitResult;
260 }
261 
262 //------------------------------------------------------------------------------------------------------------------------------------------
263 
264 inline const pandora::CartesianVector &ThreeDSlidingFitResult::GetGlobalMinLayerPosition() const
265 {
266  return m_minLayerPosition;
267 }
268 
269 //------------------------------------------------------------------------------------------------------------------------------------------
270 
271 inline const pandora::CartesianVector &ThreeDSlidingFitResult::GetGlobalMaxLayerPosition() const
272 {
273  return m_maxLayerPosition;
274 }
275 
276 //------------------------------------------------------------------------------------------------------------------------------------------
277 
278 inline const pandora::CartesianVector &ThreeDSlidingFitResult::GetGlobalMinLayerDirection() const
279 {
280  return m_minLayerDirection;
281 }
282 
283 //------------------------------------------------------------------------------------------------------------------------------------------
284 
285 inline const pandora::CartesianVector &ThreeDSlidingFitResult::GetGlobalMaxLayerDirection() const
286 {
287  return m_maxLayerDirection;
288 }
289 
290 } // namespace lar_content
291 
292 #endif // #ifndef LAR_THREE_D_SLIDING_FIT_RESULT_H
const int m_maxLayer
The maximum combined layer.
const pandora::CartesianVector & GetAxisIntercept() const
Get the axis intercept position.
static pandora::TrackState GetPrimaryAxis(const pandora::Cluster *const pCluster, const float slidingFitLayerPitch)
Calculate the position and direction of the primary axis.
const TwoDSlidingFitResult & GetSecondFitResult() const
Get the second sliding fit result for this cluster.
std::vector< ThreeDSlidingFitResult > ThreeDSlidingFitResultList
const pandora::CartesianVector & GetGlobalMinLayerDirection() const
Get global direction corresponding to the fit result in minimum fit layer.
const pandora::TrackState m_primaryAxis
The primary axis position and direction.
int GetMaxLayer() const
Get the maximum occupied layer in the sliding fit.
static pandora::CartesianVector GetSeedDirection(const pandora::CartesianVector &axisDirection)
Generate a seed vector to be used in calculating the orthogonal axes.
float GetMaxLayerRms() const
Get rms at maximum layer.
float GetMinLayerRms() const
Get rms at minimum layer.
float GetLongitudinalDisplacement(const pandora::CartesianVector &position) const
Get longitudinal projection onto primary axis.
pandora::CartesianVector m_maxLayerPosition
The global position at the maximum combined layer.
void GetGlobalDirection(const float dTdL1, const float dTdL2, pandora::CartesianVector &direction) const
Get global direction coordinates for a given pair of sliding linear fit gradients.
pandora::CartesianVector m_minLayerPosition
The global position at the minimum combined layer.
const int m_minLayer
The minimum combined layer.
const pandora::CartesianVector & GetAxisDirection() const
Get the axis direction vector.
std::unordered_map< const pandora::Cluster *, ThreeDSlidingFitResult > ThreeDSlidingFitResultMap
const pandora::CartesianVector m_axisIntercept
The axis intercept position.
const TwoDSlidingFitResult m_secondFitResult
The second sliding fit result.
const pandora::CartesianVector & GetGlobalMaxLayerDirection() const
Get global direction corresponding to the fit result in maximum fit layer.
const TwoDSlidingFitResult m_firstFitResult
The first sliding fit result.
Header file for the lar two dimensional sliding fit result class.
pandora::StatusCode GetGlobalFitDirection(const float rL, pandora::CartesianVector &direction) const
Get global fit direction for a given longitudinal coordinate.
const pandora::CartesianVector m_secondOrthoDirection
The orthogonal direction vector.
int GetMinLayer() const
Get the minimum occupied layer in the sliding fit.
const pandora::CartesianVector & GetGlobalMaxLayerPosition() const
Get global position corresponding to the fit result in maximum fit layer.
const pandora::CartesianVector m_firstOrthoDirection
The orthogonal direction vector.
void GetGlobalPosition(const float rL, const float rT1, const float rT2, pandora::CartesianVector &position) const
Get global coordinates for a given pair of sliding linear fit coordinates.
float GetFitRms(const float rL) const
Get fit rms for a given longitudinal coordinate.
const TwoDSlidingFitResult & GetFirstFitResult() const
Get the first sliding fit result for this cluster.
pandora::CartesianVector m_minLayerDirection
The global direction at the minimum combined layer.
pandora::CartesianVector m_maxLayerDirection
The global direction at the maximum combined layer.
pandora::StatusCode GetGlobalFitPosition(const float rL, pandora::CartesianVector &position) const
Get global fit position for a given longitudinal coordinate.
const pandora::CartesianVector m_axisDirection
The axis direction vector.
const pandora::Cluster * GetCluster() const
Get the address of the cluster.
ThreeDSlidingFitResult(const T *const pT, const unsigned int slidingFitWindow, const float slidingFitLayerPitch)
Constructor.
const pandora::CartesianVector & GetGlobalMinLayerPosition() const
Get global position corresponding to the fit result in minimum fit layer.