All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
LArTwoDSlidingFitResult.h
Go to the documentation of this file.
1 /**
2  * @file larpandoracontent/LArObjects/LArTwoDSlidingFitResult.h
3  *
4  * @brief Header file for the lar two dimensional sliding fit result class.
5  *
6  * $Log: $
7  */
8 #ifndef LAR_TWO_D_SLIDING_FIT_RESULT_H
9 #define LAR_TWO_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 
20 /**
21  * @brief TwoDSlidingFitResult class
22  */
24 {
25 public:
26  /**
27  * @brief Constructor using internal definition of primary axis
28  *
29  * @param pT describing the positions to be fitted
30  * @param layerFitHalfWindow the layer fit half window
31  * @param layerPitch the layer pitch, units cm
32  * @param axisDeviationLimitForHitDivision the value of the cosine of the opening angle between the principal axis and xAxis,
33  * above which cluster hits are broken into their constituent hits - only used with cluster input
34  */
35  template <typename T>
36  TwoDSlidingFitResult(const T *const pT, const unsigned int layerFitHalfWindow, const float layerPitch,
37  const float axisDeviationLimitForHitDivision = 0.95f);
38 
39  /**
40  * @brief Constructor using specified primary axis. The orthogonal axis must be perpendicular to the primary axis.
41  *
42  * @param pT describing the positions to be fitted
43  * @param layerFitHalfWindow the layer fit half window
44  * @param layerPitch the layer pitch, units cm
45  * @param axisIntercept the axis intercept position
46  * @param axisDirection the axis direction vector
47  * @param orthoDirection the orthogonal direction vector
48  * @param axisDeviationLimitForHitDivision the value of the cosine of the opening angle between the principal axis and xAxis,
49  * above which cluster hits are broken into their constituent hits - only used with cluster input
50  */
51  template <typename T>
52  TwoDSlidingFitResult(const T *const pT, const unsigned int layerFitHalfWindow, const float layerPitch,
53  const pandora::CartesianVector &axisIntercept, const pandora::CartesianVector &axisDirection,
54  const pandora::CartesianVector &orthoDirection, const float axisDeviationLimitForHitDivision = 0.95f);
55 
56  /**
57  * @brief Constructor using specified primary axis and layer fit contribution map. User is responsible for ensuring that
58  * z-pitch, axis intercept and axis direction agree with calculations used to fill the layer fit contribution map.
59  * The orthogonal axis must be perpendicular to the primary axis.
60  *
61  * @param layerFitHalfWindow the layer fit half window
62  * @param layerPitch the layer pitch, units cm
63  * @param axisIntercept the axis intercept position
64  * @param axisDirection the axis direction vector
65  * @param orthoDirection the orthogonal direction vector
66  * @param layerFitContributionMap the layer fit contribution map
67  */
68  TwoDSlidingFitResult(const unsigned int layerFitHalfWindow, const float layerPitch, const pandora::CartesianVector &axisIntercept,
69  const pandora::CartesianVector &axisDirection, const pandora::CartesianVector &orthoDirection,
70  const LayerFitContributionMap &layerFitContributionMap);
71 
72  /**
73  * @brief Get the address of the cluster, if originally provided
74  *
75  * @return the address of the cluster
76  *
77  * @throw StatusCodeException
78  */
79  const pandora::Cluster *GetCluster() const;
80 
81  /**
82  * @brief Get the layer fit half window
83  *
84  * @return the layer fit half window
85  */
86  unsigned int GetLayerFitHalfWindow() const;
87 
88  /**
89  * @brief Get the layer pitch, units cm
90  *
91  * @return the layer pitch
92  */
93  float GetLayerPitch() const;
94 
95  /**
96  * @brief Get the axis intercept position
97  *
98  * @return the axis intercept position
99  */
100  const pandora::CartesianVector &GetAxisIntercept() const;
101 
102  /**
103  * @brief Get the axis direction vector
104  *
105  * @return the axis direction vector
106  */
107  const pandora::CartesianVector &GetAxisDirection() const;
108 
109  /**
110  * @brief Get the orthogonal direction vector
111  *
112  * @return the orthogonal direction vector
113  */
114  const pandora::CartesianVector &GetOrthoDirection() const;
115 
116  /**
117  * @brief Get the layer fit result map
118  *
119  * @return the layer fit result map
120  */
122 
123  /**
124  * @brief Get the layer fit contribution map
125  *
126  * @return the layer fit contribution map
127  */
129 
130  /**
131  * @brief Get the fit segment list
132  *
133  * @return the fit segment list
134  */
135  const FitSegmentList &GetFitSegmentList() const;
136 
137  /**
138  * @brief Get the layer fit half window length
139  *
140  * @return the layer fit half window length
141  */
142  float GetLayerFitHalfWindowLength() const;
143 
144  /**
145  * @brief Get the minimum occupied layer in the sliding fit
146  *
147  * @param the minimum occupied layer in the sliding fit
148  */
149  int GetMinLayer() const;
150 
151  /**
152  * @brief Get the maximum occupied layer in the sliding fit
153  *
154  * @param the maximum occupied layer in the sliding fit
155  */
156  int GetMaxLayer() const;
157 
158  /**
159  * @brief Get the minimum and maximum x coordinates associated with the sliding fit
160  *
161  * @param to receive the min x value
162  * @param to receive the max x value
163  */
164  void GetMinAndMaxX(float &minX, float &maxX) const;
165 
166  /**
167  * @brief Get the minimum and maximum z coordinates associated with the sliding fit
168  *
169  * @param to receive the min z value
170  * @param to receive the max z value
171  */
172  void GetMinAndMaxZ(float &minZ, float &maxZ) const;
173 
174  /**
175  * @brief Get layer number for given sliding linear fit longitudinal coordinate
176  *
177  * @param rL the longitudinal coordinate
178  */
179  int GetLayer(const float rL) const;
180 
181  /**
182  * @brief Get longitudinal coordinate for a given sliding linear fit layer number
183  *
184  * @param layer the layer number
185  */
186  float GetL(const int layer) const;
187 
188  /**
189  * @brief Get local sliding fit coordinates for a given global position
190  *
191  * @param position the position cartesian vector
192  * @param rL to receive the longitudinal coordinate
193  * @param rT to receive the transverse coordinate
194  */
195  void GetLocalPosition(const pandora::CartesianVector &position, float &rL, float &rT) const;
196 
197  /**
198  * @brief Get local sliding fit gradient for a given global direction
199  *
200  * @param direction the direction cartesian vector
201  * @param dTdL to receive the local gradient
202  */
203  void GetLocalDirection(const pandora::CartesianVector &direction, float &dTdL) const;
204 
205  /**
206  * @brief Get global coordinates for given sliding linear fit coordinates
207  *
208  * @param rL the longitudinal coordinate
209  * @param rT the transverse coordinate
210  * @param position to receive the position cartesian vector
211  */
212  void GetGlobalPosition(const float rL, const float rT, pandora::CartesianVector &position) const;
213 
214  /**
215  * @brief Get global direction coordinates for given sliding linear fit gradient
216  *
217  * @param dTdL the transverse coordinate
218  * @param direction to receive the direction cartesian vector
219  */
220  void GetGlobalDirection(const float dTdL, pandora::CartesianVector &direction) const;
221 
222  /**
223  * @brief Get global position corresponding to the fit result in minimum fit layer
224  *
225  * @return the position
226  */
227  pandora::CartesianVector GetGlobalMinLayerPosition() const;
228 
229  /**
230  * @brief Get global position corresponding to the fit result in maximum fit layer
231  *
232  * @return the position
233  */
234  pandora::CartesianVector GetGlobalMaxLayerPosition() const;
235 
236  /**
237  * @brief Get global direction corresponding to the fit result in minimum fit layer
238  *
239  * @return the position
240  */
241  pandora::CartesianVector GetGlobalMinLayerDirection() const;
242 
243  /**
244  * @brief Get global direction corresponding to the fit result in maximum fit layer
245  *
246  * @return the position
247  */
248  pandora::CartesianVector GetGlobalMaxLayerDirection() const;
249 
250  /**
251  * @brief Get rms at minimum layer
252  *
253  * @return the rms
254  */
255  float GetMinLayerRms() const;
256 
257  /**
258  * @brief Get rms at maximum layer
259  *
260  * @return the rms
261  */
262  float GetMaxLayerRms() const;
263 
264  /**
265  * @brief Get fit rms for a given longitudinal coordinate
266  *
267  * @param rL the longitudinal coordinate
268  *
269  * @return the fit rms
270  */
271  float GetFitRms(const float rL) const;
272 
273  /**
274  * @brief Get scattering angle for a given longitudinal coordinate
275  *
276  * @param rL the longitudinal coordinate
277  */
278  float GetCosScatteringAngle(const float rL) const;
279 
280  /**
281  * @brief Get global fit position for a given longitudinal coordinate
282  *
283  * @param rL the longitudinal coordinate
284  * @param position the fitted position at these coordinates
285  *
286  * @return status code, faster than throwing in regular use-cases
287  */
288  pandora::StatusCode GetGlobalFitPosition(const float rL, pandora::CartesianVector &position) const;
289 
290  /**
291  * @brief Get global fit direction for a given longitudinal coordinate
292  *
293  * @param rL the longitudinal coordinate
294  * @param direction the fitted direction at these coordinates
295  *
296  * @return status code, faster than throwing in regular use-cases
297  */
298  pandora::StatusCode GetGlobalFitDirection(const float rL, pandora::CartesianVector &direction) const;
299 
300  /**
301  * @brief Get global fit position for a given input x coordinate
302  *
303  * @param x the input coordinate
304  * @param position the fitted position at these coordinates
305  *
306  * @return status code, faster than throwing in regular use-cases
307  */
308  pandora::StatusCode GetGlobalFitPositionAtX(const float x, pandora::CartesianVector &position) const;
309 
310  /**
311  * @brief Get global fit direction for a given input x coordinate
312  *
313  * @param x the input coordinate
314  * @param direction the fitted direction at these coordinates
315  *
316  * @return status code, faster than throwing in regular use-cases
317  */
318  pandora::StatusCode GetGlobalFitDirectionAtX(const float x, pandora::CartesianVector &direction) const;
319 
320  /**
321  * @brief Get projected position on global fit for a given position vector
322  *
323  * @param inputPosition the input coordinate
324  * @param projectedPosition the projected position on the global fit for these coordinates
325  *
326  * @return status code, faster than throwing in regular use-cases
327  */
328  pandora::StatusCode GetGlobalFitProjection(const pandora::CartesianVector &inputPosition, pandora::CartesianVector &projectedPosition) const;
329 
330  /**
331  * @brief Get a list of projected positions for a given input x coordinate
332  *
333  * @param x the input x coordinate
334  * @param positionList the output list of positions
335  *
336  * @return status code, faster than throwing in regular use-cases
337  */
338  pandora::StatusCode GetGlobalFitPositionListAtX(const float x, pandora::CartesianPointVector &positionList) const;
339 
340  /**
341  * @brief Get projected position for a given input x coordinate and fit segment
342  *
343  * @param x the input x coordinate
344  * @param fitSegment the portion of sliding linear fit
345  * @param position the output position
346  *
347  * @return status code, faster than throwing in regular use-cases
348  */
349  pandora::StatusCode GetTransverseProjection(const float x, const FitSegment &fitSegment, pandora::CartesianVector &position) const;
350 
351  /**
352  * @brief Get projected position and direction for a given input x coordinate and fit segment
353  *
354  * @param x the input x coordinate
355  * @param fitSegment the portion of sliding linear fit
356  * @param position the output position
357  * @param position the output direction
358  *
359  * @return status code, faster than throwing in regular use-cases
360  */
361  pandora::StatusCode GetTransverseProjection(
362  const float x, const FitSegment &fitSegment, pandora::CartesianVector &position, pandora::CartesianVector &direction) const;
363 
364  /**
365  * @brief Get extrapolated position (beyond span) for a given input coordinate
366  *
367  * @param rL the input coordinate
368  * @param position the extrapolated position at these coordinates
369  *
370  * @return status code, faster than throwing in regular use-cases
371  */
372  pandora::StatusCode GetExtrapolatedPosition(const float rL, pandora::CartesianVector &position) const;
373 
374  /**
375  * @brief Get extrapolated direction (beyond span) for a given input coordinate
376  *
377  * @param rL the input coordinate
378  * @param position the extrapolated direction at these coordinates
379  *
380  * @return status code, faster than throwing in regular use-cases
381  */
382  pandora::StatusCode GetExtrapolatedDirection(const float rL, pandora::CartesianVector &direction) const;
383 
384  /**
385  * @brief Get extrapolated position (beyond span) for a given input x coordinate
386  *
387  * @param x the input coordinate
388  * @param position the extrapolated position at these coordinates
389  *
390  * @return status code, faster than throwing in regular use-cases
391  */
392  pandora::StatusCode GetExtrapolatedPositionAtX(const float x, pandora::CartesianVector &position) const;
393 
394  /**
395  * @brief Get fit segment for a given longitudinal coordinate
396  *
397  * @param rL the longitudinal coordinate
398  */
399  const FitSegment &GetFitSegment(const float rL) const;
400 
401 private:
402  /**
403  * @brief Calculate the longitudinal and transverse axes
404  */
405  void CalculateAxes(const pandora::CartesianPointVector &coordinateVector, const float layerPitch);
406 
407  /**
408  * @brief Fill the layer fit contribution map
409  */
410  void FillLayerFitContributionMap(const pandora::CartesianPointVector &coordinateVector);
411 
412  /**
413  * @brief Perform the sliding linear fit
414  */
416 
417  /**
418  * @brief Find sliding fit segments; sections with tramsverse direction
419  */
420  void FindSlidingFitSegments();
421 
422  /**
423  * @brief Get the minimum and maximum x or z coordinates associated with the sliding fit
424  *
425  * @param isX whether to provide extremal x or z coordinates
426  * @param to receive the min coordinate value
427  * @param to receive the max coordinate value
428  */
429  void GetMinAndMaxCoordinate(const bool isX, float &min, float &max) const;
430 
431  /**
432  * @brief Interpolate a position between two layers
433  *
434  * @param layerInterpolation the pair of surrounding layers
435  *
436  * @return the interpolated position
437  */
438  pandora::CartesianVector GetGlobalFitPosition(const LayerInterpolation &layerInterpolation) const;
439 
440  /**
441  * @brief Interpolate a direction between two layers
442  *
443  * @param layerInterpolation the pair of surrounding layers
444  *
445  * @return the interpolated direction
446  */
447  pandora::CartesianVector GetGlobalFitDirection(const LayerInterpolation &layerInterpolation) const;
448 
449  /**
450  * @brief Interpolate a rms between two layers
451  *
452  * @param layerInterpolation the pair of surrounding layers
453  *
454  * @return the interpolated rms
455  */
456  float GetFitRms(const LayerInterpolation &layerInterpolation) const;
457 
458  /**
459  * @brief Get the pair of layers surrounding a specified longitudinal position
460  *
461  * @param rL the longitudinal coordinate
462  * @param layerInterpolation to receive the populated layer interpolation object
463  *
464  * @return status code, faster than throwing in regular use-cases
465  */
466  pandora::StatusCode LongitudinalInterpolation(const float rL, LayerInterpolation &layerInterpolation) const;
467 
468  /**
469  * @brief Get the surrounding pair of layers for a specified transverse position and fit segment
470  *
471  * @param x the input coordinate
472  * @param fitSegment the fit segment
473  * @param layerInterpolation to receive the populated layer interpolation object
474  *
475  * @return status code, faster than throwing in regular use-cases
476  */
477  pandora::StatusCode TransverseInterpolation(const float x, const FitSegment &fitSegment, LayerInterpolation &layerInterpolation) const;
478 
479  /**
480  * @brief Get the a list of surrounding layer pairs for a specified transverse position
481  *
482  * @param x the input coordinate
483  * @param layerInterpolationList the output list of layer interpolation objects
484  *
485  * @return status code, faster than throwing in regular use-cases
486  */
487  pandora::StatusCode TransverseInterpolation(const float x, LayerInterpolationList &layerInterpolationList) const;
488 
489  /**
490  * @brief Get iterators for layers surrounding the specified longitudinal position
491  *
492  * @param rL the longitudinal coordinate
493  * @param firstLayerIter to receive the iterator for the layer just below the input coordinate
494  * @param secondLayerIter to receive the iterator for the layer just above the input coordinate
495  *
496  * @return status code, faster than throwing in regular use-cases
497  */
498  pandora::StatusCode GetLongitudinalSurroundingLayers(
499  const float rL, LayerFitResultMap::const_iterator &firstLayerIter, LayerFitResultMap::const_iterator &secondLayerIter) const;
500 
501  /**
502  * @brief Get iterators for layers surrounding a specified transverse position
503  *
504  * @param x the transverse coordinate
505  * @param minLayer the minimum allowed layer
506  * @param maxLayer the maximum allowed layer
507  * @param firstLayerIter to receive the iterator for the layer just below the input coordinate
508  * @param secondLayerIter to receive the iterator for the layer just above the input coordinate
509  *
510  * @return status code, faster than throwing in regular use-cases
511  */
512  pandora::StatusCode GetTransverseSurroundingLayers(const float x, const int minLayer, const int maxLayer,
513  LayerFitResultMap::const_iterator &firstLayerIter, LayerFitResultMap::const_iterator &secondLayerIter) const;
514 
515  /**
516  * @brief Get interpolation weights for layers surrounding a specified longitudinal position
517  *
518  * @param rL the longitudinal coordinate
519  * @param firstLayerIter the iterator for the layer below the input coordinate
520  * @param secondLayerIter the iterator for the layer above the input coordinate
521  * @param firstWeight the weight assigned to the layer below the input coordinate
522  * @param secondWeight the weight assigned to the layer above the input coordinate
523  */
524  void GetLongitudinalInterpolationWeights(const float rL, const LayerFitResultMap::const_iterator &firstLayerIter,
525  const LayerFitResultMap::const_iterator &secondLayerIter, double &firstWeight, double &secondWeight) const;
526 
527  /**
528  * @brief Get interpolation weights for layers surrounding a specified transverse position
529  *
530  * @param x the transverse coordinate
531  * @param firstLayerIter the iterator for the layer below the input coordinate
532  * @param secondLayerIter the iterator for the layer above the input coordinate
533  * @param firstWeight the weight assigned to the layer below the input coordinate
534  * @param firstWeight the weight assigned to the layer above the input coordinate
535  */
536  void GetTransverseInterpolationWeights(const float x, const LayerFitResultMap::const_iterator &firstLayerIter,
537  const LayerFitResultMap::const_iterator &secondLayerIter, double &firstWeight, double &secondWeight) const;
538 
539  const pandora::Cluster *m_pCluster; ///< The address of the cluster
540  unsigned int m_layerFitHalfWindow; ///< The layer fit half window
541  float m_layerPitch; ///< The layer pitch, units cm
542  pandora::CartesianVector m_axisIntercept; ///< The axis intercept position
543  pandora::CartesianVector m_axisDirection; ///< The axis direction vector
544  pandora::CartesianVector m_orthoDirection; ///< The orthogonal direction vector
545  LayerFitResultMap m_layerFitResultMap; ///< The layer fit result map
546  LayerFitContributionMap m_layerFitContributionMap; ///< The layer fit contribution map
547  FitSegmentList m_fitSegmentList; ///< The fit segment list
548 };
549 
550 typedef std::vector<TwoDSlidingFitResult> TwoDSlidingFitResultList;
551 typedef std::unordered_map<const pandora::Cluster *, TwoDSlidingFitResult> TwoDSlidingFitResultMap;
552 
553 //------------------------------------------------------------------------------------------------------------------------------------------
554 //------------------------------------------------------------------------------------------------------------------------------------------
555 
557 {
558  return m_layerFitHalfWindow;
559 }
560 
561 //------------------------------------------------------------------------------------------------------------------------------------------
562 
564 {
565  return m_layerPitch;
566 }
567 
568 //------------------------------------------------------------------------------------------------------------------------------------------
569 
570 inline const pandora::CartesianVector &TwoDSlidingFitResult::GetAxisIntercept() const
571 {
572  return m_axisIntercept;
573 }
574 
575 //------------------------------------------------------------------------------------------------------------------------------------------
576 
577 inline const pandora::CartesianVector &TwoDSlidingFitResult::GetAxisDirection() const
578 {
579  return m_axisDirection;
580 }
581 
582 //------------------------------------------------------------------------------------------------------------------------------------------
583 
584 inline const pandora::CartesianVector &TwoDSlidingFitResult::GetOrthoDirection() const
585 {
586  return m_orthoDirection;
587 }
588 
589 //------------------------------------------------------------------------------------------------------------------------------------------
590 
592 {
593  return m_layerFitResultMap;
594 }
595 
596 //------------------------------------------------------------------------------------------------------------------------------------------
597 
599 {
601 }
602 
603 //------------------------------------------------------------------------------------------------------------------------------------------
604 
606 {
607  return m_fitSegmentList;
608 }
609 
610 //------------------------------------------------------------------------------------------------------------------------------------------
611 
612 inline void TwoDSlidingFitResult::GetMinAndMaxX(float &minX, float &maxX) const
613 {
614  return this->GetMinAndMaxCoordinate(true, minX, maxX);
615 }
616 
617 //------------------------------------------------------------------------------------------------------------------------------------------
618 
619 inline void TwoDSlidingFitResult::GetMinAndMaxZ(float &minZ, float &maxZ) const
620 {
621  return this->GetMinAndMaxCoordinate(false, minZ, maxZ);
622 }
623 
624 } // namespace lar_content
625 
626 #endif // #ifndef LAR_TWO_D_SLIDING_FIT_RESULT_H
void FillLayerFitContributionMap(const pandora::CartesianPointVector &coordinateVector)
Fill the layer fit contribution map.
unsigned int GetLayerFitHalfWindow() const
Get the layer fit half window.
void GetMinAndMaxCoordinate(const bool isX, float &min, float &max) const
Get the minimum and maximum x or z coordinates associated with the sliding fit.
TwoDSlidingFitResult(const T *const pT, const unsigned int layerFitHalfWindow, const float layerPitch, const float axisDeviationLimitForHitDivision=0.95f)
Constructor using internal definition of primary axis.
pandora::CartesianVector m_axisIntercept
The axis intercept position.
void GetTransverseInterpolationWeights(const float x, const LayerFitResultMap::const_iterator &firstLayerIter, const LayerFitResultMap::const_iterator &secondLayerIter, double &firstWeight, double &secondWeight) const
Get interpolation weights for layers surrounding a specified transverse position. ...
pandora::StatusCode GetTransverseSurroundingLayers(const float x, const int minLayer, const int maxLayer, LayerFitResultMap::const_iterator &firstLayerIter, LayerFitResultMap::const_iterator &secondLayerIter) const
Get iterators for layers surrounding a specified transverse position.
const pandora::Cluster * m_pCluster
The address of the cluster.
void GetMinAndMaxX(float &minX, float &maxX) const
Get the minimum and maximum x coordinates associated with the sliding fit.
process_name opflash particleana ie x
void FindSlidingFitSegments()
Find sliding fit segments; sections with tramsverse direction.
pandora::StatusCode GetExtrapolatedPositionAtX(const float x, pandora::CartesianVector &position) const
Get extrapolated position (beyond span) for a given input x coordinate.
void GetLocalDirection(const pandora::CartesianVector &direction, float &dTdL) const
Get local sliding fit gradient for a given global direction.
float GetMaxLayerRms() const
Get rms at maximum layer.
pandora::CartesianVector m_axisDirection
The axis direction vector.
void GetLongitudinalInterpolationWeights(const float rL, const LayerFitResultMap::const_iterator &firstLayerIter, const LayerFitResultMap::const_iterator &secondLayerIter, double &firstWeight, double &secondWeight) const
Get interpolation weights for layers surrounding a specified longitudinal position.
std::vector< FitSegment > FitSegmentList
float GetLayerFitHalfWindowLength() const
Get the layer fit half window length.
pandora::StatusCode LongitudinalInterpolation(const float rL, LayerInterpolation &layerInterpolation) const
Get the pair of layers surrounding a specified longitudinal position.
const pandora::CartesianVector & GetAxisDirection() const
Get the axis direction vector.
pandora::CartesianVector GetGlobalMinLayerDirection() const
Get global direction corresponding to the fit result in minimum fit layer.
pandora::StatusCode GetLongitudinalSurroundingLayers(const float rL, LayerFitResultMap::const_iterator &firstLayerIter, LayerFitResultMap::const_iterator &secondLayerIter) const
Get iterators for layers surrounding the specified longitudinal position.
std::map< int, LayerFitContribution > LayerFitContributionMap
const pandora::CartesianVector & GetAxisIntercept() const
Get the axis intercept position.
float GetCosScatteringAngle(const float rL) const
Get scattering angle for a given longitudinal coordinate.
void GetMinAndMaxZ(float &minZ, float &maxZ) const
Get the minimum and maximum z coordinates associated with the sliding fit.
unsigned int m_layerFitHalfWindow
The layer fit half window.
int GetMaxLayer() const
Get the maximum occupied layer in the sliding fit.
int GetMinLayer() const
Get the minimum occupied layer in the sliding fit.
float GetFitRms(const float rL) const
Get fit rms for a given longitudinal coordinate.
pandora::StatusCode GetGlobalFitPosition(const float rL, pandora::CartesianVector &position) const
Get global fit position for a given longitudinal coordinate.
pandora::StatusCode TransverseInterpolation(const float x, const FitSegment &fitSegment, LayerInterpolation &layerInterpolation) const
Get the surrounding pair of layers for a specified transverse position and fit segment.
pandora::StatusCode GetExtrapolatedPosition(const float rL, pandora::CartesianVector &position) const
Get extrapolated position (beyond span) for a given input coordinate.
const pandora::CartesianVector & GetOrthoDirection() const
Get the orthogonal direction vector.
std::map< int, LayerFitResult > LayerFitResultMap
std::vector< TwoDSlidingFitResult > TwoDSlidingFitResultList
float GetLayerPitch() const
Get the layer pitch, units cm.
void CalculateAxes(const pandora::CartesianPointVector &coordinateVector, const float layerPitch)
Calculate the longitudinal and transverse axes.
const FitSegment & GetFitSegment(const float rL) const
Get fit segment for a given longitudinal coordinate.
pandora::CartesianVector GetGlobalMinLayerPosition() const
Get global position corresponding to the fit result in minimum fit layer.
process_name west layer
Definition: crt_ana.fcl:40
const FitSegmentList & GetFitSegmentList() const
Get the fit segment list.
pandora::StatusCode GetExtrapolatedDirection(const float rL, pandora::CartesianVector &direction) const
Get extrapolated direction (beyond span) for a given input coordinate.
std::vector< LayerInterpolation > LayerInterpolationList
void GetGlobalDirection(const float dTdL, pandora::CartesianVector &direction) const
Get global direction coordinates for given sliding linear fit gradient.
const LayerFitResultMap & GetLayerFitResultMap() const
Get the layer fit result map.
float GetMinLayerRms() const
Get rms at minimum layer.
std::unordered_map< const pandora::Cluster *, TwoDSlidingFitResult > TwoDSlidingFitResultMap
const pandora::Cluster * GetCluster() const
Get the address of the cluster, if originally provided.
pandora::StatusCode GetGlobalFitPositionAtX(const float x, pandora::CartesianVector &position) const
Get global fit position for a given input x coordinate.
pandora::StatusCode GetGlobalFitDirection(const float rL, pandora::CartesianVector &direction) const
Get global fit direction for a given longitudinal coordinate.
pandora::StatusCode GetGlobalFitProjection(const pandora::CartesianVector &inputPosition, pandora::CartesianVector &projectedPosition) const
Get projected position on global fit for a given position vector.
void PerformSlidingLinearFit()
Perform the sliding linear fit.
void GetGlobalPosition(const float rL, const float rT, pandora::CartesianVector &position) const
Get global coordinates for given sliding linear fit coordinates.
FitSegmentList m_fitSegmentList
The fit segment list.
pandora::CartesianVector GetGlobalMaxLayerDirection() const
Get global direction corresponding to the fit result in maximum fit layer.
float GetL(const int layer) const
Get longitudinal coordinate for a given sliding linear fit layer number.
LayerFitContributionMap m_layerFitContributionMap
The layer fit contribution map.
pandora::StatusCode GetGlobalFitDirectionAtX(const float x, pandora::CartesianVector &direction) const
Get global fit direction for a given input x coordinate.
pandora::StatusCode GetTransverseProjection(const float x, const FitSegment &fitSegment, pandora::CartesianVector &position) const
Get projected position for a given input x coordinate and fit segment.
Header file for the lar two dimensional sliding fit objects.
float m_layerPitch
The layer pitch, units cm.
pandora::StatusCode GetGlobalFitPositionListAtX(const float x, pandora::CartesianPointVector &positionList) const
Get a list of projected positions for a given input x coordinate.
const LayerFitContributionMap & GetLayerFitContributionMap() const
Get the layer fit contribution map.
LayerFitResultMap m_layerFitResultMap
The layer fit result map.
void GetLocalPosition(const pandora::CartesianVector &position, float &rL, float &rT) const
Get local sliding fit coordinates for a given global position.
pandora::CartesianVector m_orthoDirection
The orthogonal direction vector.
pandora::CartesianVector GetGlobalMaxLayerPosition() const
Get global position corresponding to the fit result in maximum fit layer.
int GetLayer(const float rL) const
Get layer number for given sliding linear fit longitudinal coordinate.