Belle II Software  release-05-02-19
UncertainParameterLine2D.h
1 /**************************************************************************
2  * BASF2 (Belle Analysis Framework 2) *
3  * Copyright(C) 2016 - Belle II Collaboration *
4  * *
5  * Author: The Belle II Collaboration *
6  * Contributors: Oliver Frost *
7  * *
8  * This software is provided "as is" without any warranty. *
9  **************************************************************************/
10 #pragma once
11 
12 #include <tracking/trackFindingCDC/geometry/LineParameters.h>
13 #include <tracking/trackFindingCDC/geometry/ParameterLine2D.h>
14 #include <tracking/trackFindingCDC/geometry/Vector2D.h>
15 #include <cstddef>
16 
17 namespace Belle2 {
22  namespace TrackFindingCDC {
23 
26  class UncertainParameterLine2D {
27 
28  public:
31  {
32  }
33 
35  explicit UncertainParameterLine2D(const ParameterLine2D& parameterLine2D,
36  const LineCovariance& lineCovariance = LineUtil::identity(),
37  const double chi2 = 0.0,
38  const size_t ndf = 0)
39  : m_parameterLine2D(parameterLine2D)
41  , m_chi2(chi2)
42  , m_ndf(ndf)
43  {
44  }
45 
55  const ParameterLine2D* operator->() const
56  {
57  return &m_parameterLine2D;
58  }
59 
61  operator ParameterLine2D() const
62  {
64  }
65 
66  public:
69  {
70  using namespace NLineParameterIndices;
71  LineParameters result;
72  result(c_Phi0) = m_parameterLine2D.tangential().phi();
73  result(c_I) = 0;
74  return result;
75  }
76 
79  {
81  }
82 
84  const LineCovariance& lineCovariance() const
85  {
87  }
88 
90  double covariance(const ELineParameter& iRow, const ELineParameter& iCol) const
91  {
92  return lineCovariance()(iRow, iCol);
93  }
94 
96  double variance(const ELineParameter& i) const
97  {
98  return lineCovariance()(i, i);
99  }
100 
102  double chi2() const
103  {
104  return m_chi2;
105  }
106 
108  void setChi2(const double chi2)
109  {
111  }
112 
114  std::size_t ndf() const
115  {
116  return m_ndf;
117  }
118 
120  void setNDF(std::size_t ndf)
121  {
123  }
124 
126  void invalidate()
127  {
130  m_chi2 = 0.0;
131  m_ndf = 0;
132  }
133 
134  public:
136  void reverse()
137  {
140  }
141 
144  {
147  m_chi2,
148  m_ndf);
149  }
150 
151  public:
157  void passiveMoveBy(const Vector2D& by)
158  {
160  }
161 
163  LineJacobian moveSupportByJacobian(double byAt) const
164  {
165  using namespace NLineParameterIndices;
166  LineJacobian result = LineUtil::identity();
167  result(c_I, c_Phi0) = -byAt * m_parameterLine2D.tangential().norm();
168  return result;
169  }
170 
173  void moveSupportBy(double byAt)
174  {
175  // Move the covariance matrix first to have access to the original parameters
176  LineJacobian jacobian = moveSupportByJacobian(byAt);
179  }
180 
182  LineCovariance movedSupportCovarianceBy(double byAt) const
183  {
184  LineJacobian jacobian = moveSupportByJacobian(byAt);
185  return LineUtil::transported(jacobian, lineCovariance());
186  }
187 
188  private:
191 
195 
197  double m_chi2 = 0.0;
198 
200  size_t m_ndf = 0;
201 
202  };
203 
204  }
206 }
Belle2::TrackFindingCDC::UncertainParameterLine2D::invalidate
void invalidate()
Sets all line parameters to zero including the covariance matrix.
Definition: UncertainParameterLine2D.h:134
Belle2::TrackFindingCDC::UncertainParameterLine2D::m_chi2
double m_chi2
Memory for the chi square value of the fit of this line.
Definition: UncertainParameterLine2D.h:205
Belle2::TrackFindingCDC::ParameterLine2D::reverse
void reverse()
Reverses the tangential vector inplace.
Definition: ParameterLine2D.h:196
Belle2::TrackFindingCDC::Vector2D
A two dimensional vector which is equipped with functions for correct handeling of orientation relat...
Definition: Vector2D.h:37
Belle2::TrackFindingCDC::UncertainParametersUtil< LineUtil, ELineParameter >::transport
static void transport(const JacobianMatrix &jacobian, CovarianceMatrix &cov)
Transport the covariance matrix inplace with the given jacobian matrix.
Definition: UncertainParameters.icc.h:34
Belle2::TrackFindingCDC::UncertainParameterLine2D::moveSupportByJacobian
LineJacobian moveSupportByJacobian(double byAt) const
Computes the Jacobi matrix for a move of the coordinate system by the given vector.
Definition: UncertainParameterLine2D.h:171
Belle2::TrackFindingCDC::UncertainParameterLine2D::setLineCovariance
void setLineCovariance(const LineCovariance &lineCovariance)
Setter for the whole covariance matrix of the line parameters.
Definition: UncertainParameterLine2D.h:86
Belle2::TrackFindingCDC::ParameterLine2D::passiveMoveBy
void passiveMoveBy(const Vector2D &by)
Moves the coordinate system in the given direction in place.
Definition: ParameterLine2D.h:360
Belle2::TrackFindingCDC::UncertainParameterLine2D::UncertainParameterLine2D
UncertainParameterLine2D()
Default constructor for ROOT compatibility.
Definition: UncertainParameterLine2D.h:38
Belle2::TrackFindingCDC::ParameterLine2D
A line with a support point and tangential vector.
Definition: ParameterLine2D.h:48
Belle2::TrackFindingCDC::UncertainParametersUtil< LineUtil, ELineParameter >::identity
static CovarianceMatrix identity()
Returns an identity matrix.
Definition: UncertainParameters.icc.h:65
Belle2::TrackFindingCDC::UncertainParameterLine2D::setNDF
void setNDF(std::size_t ndf)
Setter for the number of degrees of freediom used in the line fit.
Definition: UncertainParameterLine2D.h:128
Belle2::TrackFindingCDC::Vector2D::phi
double phi() const
Gives the azimuth angle being the angle to the x axes ( range -M_PI to M_PI )
Definition: Vector2D.h:583
Belle2::TrackFindingCDC::UncertainParameterLine2D::reversed
UncertainParameterLine2D reversed() const
Returns a copy of the line corresponding to the reverse direction of travel.
Definition: UncertainParameterLine2D.h:151
Belle2::TrackFindingCDC::UncertainParameterLine2D::lineParameters
LineParameters lineParameters() const
Getter for the three perigee parameters in the order defined by EPerigeeParameter....
Definition: UncertainParameterLine2D.h:76
Belle2::TrackFindingCDC::UncertainParameterLine2D::covariance
double covariance(const ELineParameter &iRow, const ELineParameter &iCol) const
Getter for individual elements of the covariance matrix.
Definition: UncertainParameterLine2D.h:98
Belle2::TrackFindingCDC::UncertainParameterLine2D::chi2
double chi2() const
Getter for the chi square value of the line fit.
Definition: UncertainParameterLine2D.h:110
Belle2::TrackFindingCDC::UncertainParametersUtil< LineUtil, ELineParameter >::transported
static CovarianceMatrix transported(const JacobianMatrix &jacobian, const CovarianceMatrix &cov)
Return a copy of the covariance matrix transported with the given jacobian matrix.
Definition: UncertainParameters.icc.h:41
Belle2::TrackFindingCDC::UncertainParameterLine2D::passiveMoveBy
void passiveMoveBy(const Vector2D &by)
Moves the coordinate system by the vector by.
Definition: UncertainParameterLine2D.h:165
Belle2::TrackFindingCDC::ParameterLine2D::invalidate
void invalidate()
Clear all information from the line.
Definition: ParameterLine2D.h:183
Belle2::TrackFindingCDC::UncertainParameterLine2D::m_parameterLine2D
ParameterLine2D m_parameterLine2D
Memory for the underlying parameter line.
Definition: UncertainParameterLine2D.h:198
Belle2
Abstract base class for different kinds of events.
Definition: MillepedeAlgorithm.h:19
Belle2::TrackFindingCDC::ParameterLine2D::reversed
ParameterLine2D reversed() const
Makes a copy line which has the opposite tangential vector but same support point.
Definition: ParameterLine2D.h:202
Belle2::TrackFindingCDC::UncertainParameterLine2D::setChi2
void setChi2(const double chi2)
Setter for the chi square value of the line fit.
Definition: UncertainParameterLine2D.h:116
Belle2::TrackFindingCDC::UncertainParameterLine2D::m_ndf
size_t m_ndf
Memory for the number of degrees of freedim of the fit of this line.
Definition: UncertainParameterLine2D.h:208
Belle2::TrackFindingCDC::UncertainParameterLine2D::movedSupportCovarianceBy
LineCovariance movedSupportCovarianceBy(double byAt) const
Getter for the covariance as if he coordinate system was moved by the given vector.
Definition: UncertainParameterLine2D.h:190
Belle2::TrackFindingCDC::ParameterLine2D::tangential
const Vector2D & tangential() const
Gives the tangential vector of the line.
Definition: ParameterLine2D.h:135
Belle2::TrackFindingCDC::UncertainParameterLine2D::variance
double variance(const ELineParameter &i) const
Getter for individual diagonal elements of the covariance matrix.
Definition: UncertainParameterLine2D.h:104
Belle2::TrackFindingCDC::Vector2D::norm
double norm() const
Calculates the length of the vector.
Definition: Vector2D.h:189
Belle2::TrackFindingCDC::ParameterLine2D::passiveMoveAtBy
void passiveMoveAtBy(const double delta)
Moves the support point by the given amount of the parameter in the forward direction.
Definition: ParameterLine2D.h:333
Belle2::TrackFindingCDC::UncertainParameterLine2D::moveSupportBy
void moveSupportBy(double byAt)
Moves the coordinate system by the vector by and calculates the new line and its covariance matrix.
Definition: UncertainParameterLine2D.h:181
Belle2::TrackFindingCDC::UncertainParameterLine2D::reverse
void reverse()
Reverses the direction of flight represented by this line.
Definition: UncertainParameterLine2D.h:144
Belle2::TrackFindingCDC::PlainMatrix
A matrix implementation to be used as an interface typ through out the track finder.
Definition: PlainMatrix.h:50
Belle2::TrackFindingCDC::UncertainParameterLine2D
A parameter line including including an line covariance matrix which is interpreted as located in the...
Definition: UncertainParameterLine2D.h:34
Belle2::TrackFindingCDC::UncertainParametersUtil< LineUtil, ELineParameter >::reversed
static CovarianceMatrix reversed(const CovarianceMatrix &cov)
Return a copy of the reversed covariance matrix.
Definition: UncertainParameters.icc.h:59
Belle2::TrackFindingCDC::UncertainParameterLine2D::m_lineCovariance
LineCovariance m_lineCovariance
Memory for the 2x2 covariance matrix of the line phi0 and impact parameter relative to the support po...
Definition: UncertainParameterLine2D.h:202
Belle2::TrackFindingCDC::UncertainParameterLine2D::lineCovariance
const LineCovariance & lineCovariance() const
Getter for the whole covariance matrix of the line parameters.
Definition: UncertainParameterLine2D.h:92
Belle2::TrackFindingCDC::NLineParameterIndices::ELineParameter
ELineParameter
Enumeration to address the individual helix parameters in a vector or matrix.
Definition: LineParameters.h:34
Belle2::TrackFindingCDC::UncertainParameterLine2D::operator->
const ParameterLine2D * operator->() const
Access to the constant interface of the underlying parameter line Allows the user of this "super" cla...
Definition: UncertainParameterLine2D.h:63
Belle2::TrackFindingCDC::UncertainParametersUtil< LineUtil, ELineParameter >::reverse
static void reverse(CovarianceMatrix &cov)
Reverse the covariance matrix inplace.
Definition: UncertainParameters.icc.h:53
Belle2::TrackFindingCDC::UncertainParameterLine2D::ndf
std::size_t ndf() const
Getter for the number of degrees of freediom used in the line fit.
Definition: UncertainParameterLine2D.h:122