LArSoft  v06_85_00
Liquid Argon Software toolkit - http://larsoft.org/
LArTrackOverlapResult.h
Go to the documentation of this file.
1 
8 #ifndef LAR_TRACK_OVERLAP_RESULT_H
9 #define LAR_TRACK_OVERLAP_RESULT_H 1
10 
11 #include "Pandora/PandoraInputTypes.h"
12 #include "Pandora/StatusCodes.h"
13 
15 
16 #include <cmath>
17 #include <vector>
18 
19 namespace lar_content
20 {
21 
26 {
27 public:
32 
40  TrackOverlapResult(const unsigned int nMatchedSamplingPoints, const unsigned int nSamplingPoints, const float chi2);
41 
48 
52  virtual ~TrackOverlapResult();
53 
59  bool IsInitialized() const;
60 
66  unsigned int GetNMatchedSamplingPoints() const;
67 
73  unsigned int GetNSamplingPoints() const;
74 
80  float GetMatchedFraction() const;
81 
87  float GetChi2() const;
88 
94  float GetReducedChi2() const;
95 
101  bool operator<(const TrackOverlapResult &rhs) const;
102 
108  bool operator>(const TrackOverlapResult &rhs) const;
109 
116 
117 protected:
120  unsigned int m_nSamplingPoints;
122  float m_chi2;
124 };
125 
126 //------------------------------------------------------------------------------------------------------------------------------------------
127 
132 {
133 public:
138 
147  TransverseOverlapResult(const unsigned int nMatchedSamplingPoints, const unsigned int nSamplingPoints, const float chi2,
148  const XOverlap &xOverlap);
149 
156 
161 
167  const XOverlap &GetXOverlap() const;
168 
175 
176 private:
178 };
179 
180 typedef std::vector<TransverseOverlapResult> TransverseOverlapResultVector;
181 
189 
190 //------------------------------------------------------------------------------------------------------------------------------------------
191 
196 {
197 public:
202 
210  LongitudinalOverlapResult(const TrackOverlapResult trackOverlapResult, const float innerChi2, const float outerChi2);
211 
221  LongitudinalOverlapResult(const unsigned int nMatchedSamplingPoints, const unsigned int nSamplingPoints, const float chi2,
222  const float innerChi2, const float outerChi2);
223 
230 
235 
241  float GetInnerChi2() const;
242 
248  float GetOuterChi2() const;
249 
256 
257 private:
258  float m_innerChi2;
259  float m_outerChi2;
260 };
261 
262 typedef std::vector<LongitudinalOverlapResult> LongitudinalOverlapResultVector;
263 
264 //------------------------------------------------------------------------------------------------------------------------------------------
265 
270 {
271 public:
276 
284  FragmentOverlapResult(const TrackOverlapResult trackOverlapResult, const pandora::CaloHitList &caloHitList,
285  const pandora::ClusterList &clusterList);
286 
296  FragmentOverlapResult(const unsigned int nMatchedSamplingPoints, const unsigned int nSamplingPoints, const float chi2,
297  const pandora::CaloHitList &caloHitList, const pandora::ClusterList &clusterList);
298 
305 
310 
316  const pandora::CaloHitList &GetFragmentCaloHitList() const;
317 
323  const pandora::ClusterList &GetFragmentClusterList() const;
324 
330  pandora::HitType GetFragmentHitType() const;
331 
338 
339 private:
340  pandora::CaloHitList m_caloHitList;
341  pandora::ClusterList m_clusterList;
342 };
343 
344 typedef std::vector<FragmentOverlapResult> FragmentOverlapResultVector;
345 
346 //------------------------------------------------------------------------------------------------------------------------------------------
347 //------------------------------------------------------------------------------------------------------------------------------------------
348 
350 {
351  return m_isInitialized;
352 }
353 
354 //------------------------------------------------------------------------------------------------------------------------------------------
355 
357 {
358  if (m_isInitialized)
360 
361  throw pandora::StatusCodeException(pandora::STATUS_CODE_NOT_INITIALIZED);
362 }
363 
364 //------------------------------------------------------------------------------------------------------------------------------------------
365 
366 inline unsigned int TrackOverlapResult::GetNSamplingPoints() const
367 {
368  if (m_isInitialized)
369  return m_nSamplingPoints;
370 
371  throw pandora::StatusCodeException(pandora::STATUS_CODE_NOT_INITIALIZED);
372 }
373 
374 //------------------------------------------------------------------------------------------------------------------------------------------
375 
377 {
378  if (m_isInitialized)
379  return m_matchedFraction;
380 
381  throw pandora::StatusCodeException(pandora::STATUS_CODE_NOT_INITIALIZED);
382 }
383 
384 //------------------------------------------------------------------------------------------------------------------------------------------
385 
386 inline float TrackOverlapResult::GetChi2() const
387 {
388  if (m_isInitialized)
389  return m_chi2;
390 
391  throw pandora::StatusCodeException(pandora::STATUS_CODE_NOT_INITIALIZED);
392 }
393 
394 //------------------------------------------------------------------------------------------------------------------------------------------
395 
397 {
398  if (m_isInitialized)
399  return m_reducedChi2;
400 
401  throw pandora::StatusCodeException(pandora::STATUS_CODE_NOT_INITIALIZED);
402 }
403 
404 //------------------------------------------------------------------------------------------------------------------------------------------
405 //------------------------------------------------------------------------------------------------------------------------------------------
406 
408 {
409  if (m_isInitialized)
410  return m_xOverlap;
411 
412  throw pandora::StatusCodeException(pandora::STATUS_CODE_NOT_INITIALIZED);
413 }
414 
415 //------------------------------------------------------------------------------------------------------------------------------------------
416 //------------------------------------------------------------------------------------------------------------------------------------------
417 
419 {
420  return m_innerChi2;
421 }
422 
423 //------------------------------------------------------------------------------------------------------------------------------------------
424 
426 {
427  return m_outerChi2;
428 }
429 
430 //------------------------------------------------------------------------------------------------------------------------------------------
431 //------------------------------------------------------------------------------------------------------------------------------------------
432 
433 inline const pandora::CaloHitList &FragmentOverlapResult::GetFragmentCaloHitList() const
434 {
435  return m_caloHitList;
436 }
437 
438 //------------------------------------------------------------------------------------------------------------------------------------------
439 
440 inline const pandora::ClusterList &FragmentOverlapResult::GetFragmentClusterList() const
441 {
442  return m_clusterList;
443 }
444 
445 } // namespace lar_content
446 
447 #endif // #ifndef LAR_TRACK_OVERLAP_RESULT_H
LongitudinalOverlapResult class.
pandora::ClusterList m_clusterList
The list of fragment-associated clusters.
float m_chi2
The absolute chi2 value.
FragmentOverlapResult class.
unsigned int GetNMatchedSamplingPoints() const
Get the number of matched sampling points.
bool IsInitialized() const
Whether the track overlap result has been initialized.
std::vector< FragmentOverlapResult > FragmentOverlapResultVector
virtual ~TrackOverlapResult()
Destructor.
TrackOverlapResult()
Default constructor.
unsigned int m_nMatchedSamplingPoints
The number of matched sampling points.
bool m_isInitialized
Whether the track overlap result has been initialized.
float m_outerChi2
The outer chi squared.
std::vector< TransverseOverlapResult > TransverseOverlapResultVector
float m_innerChi2
The inner chi squared.
bool operator<(const TrackOverlapResult &rhs) const
Track overlap result less than operator.
const XOverlap & GetXOverlap() const
Get the x overlap object.
TransverseOverlapResult operator+(const TransverseOverlapResult &lhs, const TransverseOverlapResult &rhs)
Transverse overlap result + operator.
const pandora::CaloHitList & GetFragmentCaloHitList() const
Get the list of fragment-associated hits.
unsigned int GetNSamplingPoints() const
Get the number of sampling points.
float GetMatchedFraction() const
Get the fraction of sampling points resulting in a match.
TransverseOverlapResult class.
float GetReducedChi2() const
Get the chi2 per samping point value.
TrackOverlapResult class.
TrackOverlapResult & operator=(const TrackOverlapResult &rhs)
Track overlap result assigment operator.
std::vector< LongitudinalOverlapResult > LongitudinalOverlapResultVector
Header file for the lar x overlap class.
bool operator>(const TrackOverlapResult &rhs) const
Track overlap result greater than operator.
float m_reducedChi2
The chi2 per samping point value.
unsigned int m_nSamplingPoints
The number of sampling points.
float m_matchedFraction
The fraction of sampling points resulting in a match.
XOverlap class.
Definition: LArXOverlap.h:17
const pandora::ClusterList & GetFragmentClusterList() const
Get the list of fragment-associated clusters.
float GetChi2() const
Get the absolute chi2 value.
pandora::CaloHitList m_caloHitList
The list of fragment-associated hits.
XOverlap m_xOverlap
The x overlap object.