LArSoft  v09_90_00
Liquid Argon Software toolkit - https://larsoft.org/
MCSFitResult.h
Go to the documentation of this file.
1 #ifndef MCSFitResult_h
2 #define MCSFitResult_h
3 
4 namespace recob {
19  class MCSFitResult {
20  public:
21  MCSFitResult() = default;
23  float momFwd,
24  float momFwdUnc,
25  float llhdFwd,
26  float momBwd,
27  float momBwdUnc,
28  float llhdBwd,
29  const std::vector<float>& radlengths,
30  const std::vector<float>& angles)
31  : pid_(pid)
32  , momFwd_(momFwd)
33  , momFwdUnc_(momFwdUnc)
34  , llhdFwd_(llhdFwd)
35  , momBwd_(momBwd)
36  , momBwdUnc_(momBwdUnc)
37  , llhdBwd_(llhdBwd)
38  , radlengths_(radlengths)
39  , angles_(angles)
40  {}
41 
43  int particleIdHyp() const { return pid_; }
44 
46  float fwdMomentum() const { return momFwd_; }
47 
49  float fwdMomUncertainty() const { return momFwdUnc_; }
50 
52  float fwdLogLikelihood() const { return llhdFwd_; }
53 
55  float bwdMomentum() const { return momBwd_; }
56 
58  float bwdMomUncertainty() const { return momBwdUnc_; }
59 
61  float bwdLogLikelihood() const { return llhdBwd_; }
62 
64  const std::vector<float>& segmentRadLengths() const { return radlengths_; }
65 
67  const std::vector<float>& scatterAngles() const { return angles_; }
68 
70  bool isBestFwd() const { return llhdFwd_ < llhdBwd_; }
71 
73  float bestMomentum() const { return isBestFwd() ? momFwd_ : momBwd_; }
74 
76  float bestMomUncertainty() const { return isBestFwd() ? momFwdUnc_ : momBwdUnc_; }
77 
79  float bestLogLikelihood() const { return isBestFwd() ? llhdFwd_ : llhdBwd_; }
80 
82  float deltaLogLikelihood() const { return std::abs(llhdFwd_ - llhdBwd_); }
83  //
84  private:
85  int pid_;
86  float momFwd_;
87  float momFwdUnc_;
88  float
90  float momBwd_;
91  float momBwdUnc_;
92  float
94  std::vector<float> radlengths_;
95  std::vector<float> angles_;
96  };
97 }
98 
99 #endif
float bestMomUncertainty() const
momentum uncertainty for best direction fit
Definition: MCSFitResult.h:76
std::vector< float > radlengths_
vector of radiation lengths of the segments used in the fit
Definition: MCSFitResult.h:94
Reconstruction base classes.
float bwdLogLikelihood() const
minimum negative log likelihood value from fit assuming a backward track direction ...
Definition: MCSFitResult.h:61
float momFwdUnc_
momentum uncertainty from fit assuming a forward track direction
Definition: MCSFitResult.h:87
float bwdMomentum() const
momentum value from fit assuming a backward track direction
Definition: MCSFitResult.h:55
float fwdMomUncertainty() const
momentum uncertainty from fit assuming a forward track direction
Definition: MCSFitResult.h:49
int particleIdHyp() const
particle id hypothesis used in the fit
Definition: MCSFitResult.h:43
constexpr auto abs(T v)
Returns the absolute value of the argument.
std::vector< float > angles_
vector of angles between the segments used in the fit
Definition: MCSFitResult.h:95
const std::vector< float > & scatterAngles() const
vector of angles between the segments used in the fit
Definition: MCSFitResult.h:67
float bestLogLikelihood() const
negative log likelihood for best direction fit
Definition: MCSFitResult.h:79
MCSFitResult()=default
bool isBestFwd() const
determines best fit direction based on minumum log likelihood between forward and backward fit ...
Definition: MCSFitResult.h:70
float bestMomentum() const
momentum for best direction fit
Definition: MCSFitResult.h:73
float momBwdUnc_
momentum uncertainty from fit assuming a backward track direction
Definition: MCSFitResult.h:91
int pid_
particle id hypothesis used in the fit
Definition: MCSFitResult.h:85
float deltaLogLikelihood() const
difference in log likelihood between forward and backward fit (absolute value)
Definition: MCSFitResult.h:82
Class storing the result of the Maximum Likelihood fit of Multiple Coulomb Scattering angles between ...
Definition: MCSFitResult.h:19
float llhdFwd_
minimum negative log likelihood value from fit assuming a forward track direction ...
Definition: MCSFitResult.h:89
float momFwd_
momentum value from fit assuming a forward track direction
Definition: MCSFitResult.h:86
float bwdMomUncertainty() const
momentum uncertainty from fit assuming a backward track direction
Definition: MCSFitResult.h:58
float llhdBwd_
minimum negative log likelihood value from fit assuming a backward track direction ...
Definition: MCSFitResult.h:93
float momBwd_
momentum value from fit assuming a backward track direction
Definition: MCSFitResult.h:90
float fwdLogLikelihood() const
minimum negative log likelihood value from fit assuming a forward track direction ...
Definition: MCSFitResult.h:52
float fwdMomentum() const
momentum value from fit assuming a forward track direction
Definition: MCSFitResult.h:46
const std::vector< float > & segmentRadLengths() const
vector of radiation lengths of the segments used in the fit
Definition: MCSFitResult.h:64
MCSFitResult(int pid, float momFwd, float momFwdUnc, float llhdFwd, float momBwd, float momBwdUnc, float llhdBwd, const std::vector< float > &radlengths, const std::vector< float > &angles)
Definition: MCSFitResult.h:22