ATLAS Offline Software
Loading...
Searching...
No Matches
MTStraightLine.h
Go to the documentation of this file.
1/*
2 Copyright (C) 2002-2021 CERN for the benefit of the ATLAS collaboration
3*/
4
5#ifndef MTStraightLineH
6#define MTStraightLineH
9
13
14namespace MuonCalib {
15
17 public:
20
21 // Constructors //
25
26 MTStraightLine(const Amg::Vector3D& r_position, const Amg::Vector3D& r_direction, const Amg::Vector3D& r_position_error,
27 const Amg::Vector3D& r_direction_error) {
28 init(r_position, r_direction, r_position_error, r_direction_error);
29 }
35
36 MTStraightLine(const double r_a_x1, const double r_b_x1, const double r_a_x2, const double r_b_x2, const double r_a_x1_err,
37 const double r_b_x1_err, const double r_a_x2_err, const double r_b_x2_err) {
38 init(r_a_x1, r_b_x1, r_a_x2, r_b_x2, r_a_x1_err, r_b_x1_err, r_a_x2_err, r_b_x2_err);
39 }
48
49 // Methods //
50 // get-methods //
63 double a_x1() const;
66 double a_x1_error() const;
69 double b_x1() const;
72 double b_x1_error() const;
76 double a_x2() const;
79 double a_x2_error() const;
82 double b_x2() const;
85 double b_x2_error() const;
89 Amg::Vector3D pointOnLine(const double lambda) const;
93 double signDistFrom(const MTStraightLine& h) const;
97 double distFromLine(const Amg::Vector3D& point) const;
100
102 void setChi2(double chi2);
103 double chi2() const;
104
106 void setNumberOfTrackHits(unsigned int n_hits);
107 unsigned int numberOfTrackHits() const;
109 double chi2PerDegreesOfFreedom() const;
110
111 void setUsedHits(const MdtHitVec& hits);
112 const MdtHitVec& trackHits() const;
113
114 private:
115 // internal representation of the straight line //
116 Amg::Vector3D m_position{0., 0., 0.}; // position vector of the straight line
117 Amg::Vector3D m_direction{0., 0., 0.}; // direction vector of the straight line
118
119 // errors on the position and direction vector //
120 Amg::Vector3D m_position_error{0., 0., 0.}; // error on the position vector
121 Amg::Vector3D m_direction_error{0., 0., 0.}; // error on the direction vector
122
123 double m_chi2{-1};
124 unsigned int m_numTrkHits{0};
126
127 // initializtion methods //
128 void init(); // default initialization method
129
130 void init(const Amg::Vector3D& r_position, const Amg::Vector3D& r_direction, const Amg::Vector3D& r_position_error,
131 const Amg::Vector3D& r_direction_error);
132 // r_position: position vector of the straight line;
133 // r_direction: direction vector of the straight line;
134 // r_position_error: error on the position vector;
135 // r_direction_error: error on the direction vector
136
137 void init(const double r_a_x1, const double r_b_x1, const double r_a_x2, const double r_b_x2, const double r_a_x1_err,
138 const double r_b_x1_err, const double r_a_x2_err, const double r_b_x2_err);
139 // Coordinates: x1, x2, x3.
140 // Parametrization of the straight line: x1 = r_a_x1*x3 + r_b_x1;
141 // x2 = r_a_x2*x3 + r_b_x2;
142 // x3 arbitrary.
143 // r_a_x1_err: error on r_a_x1.
144 // r_b_x1_err: error on r_b_x1.
145 // r_a_x2_err: error on r_a_x2.
146 // r_b_x2_err: error on r_b_x2.
147 };
148
149} // namespace MuonCalib
150
151#endif
Header file for AthHistogramAlgorithm.
Amg::Vector3D directionVector() const
get the direction vector of the straight line
MTStraightLine()
Default constructor: all internal parameters of the straight line are set to 0.
double distFromLine(const Amg::Vector3D &point) const
get the distance of point point from straight line
MuonCalibSegment::MdtHitPtr MdtHitPtr
double b_x2() const
get the intercept of the straight line in the x2-x3 plane
double b_x1_error() const
get the error on the intercept of the straight line in the x1-x3 plane
const MdtHitVec & trackHits() const
Amg::Vector3D pointOnLine(const double lambda) const
get the point on the line for the given scale factor lambda, point=position_vector+lambda*direction_v...
double a_x2() const
get the slope of the straight line in the x2-x3 plane
Amg::Vector3D directionError() const
get the error on the direction vector of the straight line
double b_x1() const
get the intercept of the straight line in the x1-x3 plane
Amg::Vector3D positionVector() const
get the position vector of the straight line
Amg::Vector3D positionError() const
get the error on the position vector of the straight line
double chi2PerDegreesOfFreedom() const
Return chi2 / number of TrackHits - 2.
double a_x1() const
get the slope of the straight line in the x1-x3 plane
double b_x2_error() const
get the slope of the intercept of the straight line in the x2-x3 plane
MuonCalibSegment::MdtHitVec MdtHitVec
MTStraightLine(const Amg::Vector3D &r_position, const Amg::Vector3D &r_direction, const Amg::Vector3D &r_position_error, const Amg::Vector3D &r_direction_error)
Constructor: r_position: position vector of the straight line; r_direction: direction vector of the s...
double a_x1_error() const
get the error on the slope of the straight line in the x1-x3 plane
void setUsedHits(const MdtHitVec &hits)
double signDistFrom(const MTStraightLine &h) const
get the signed distance of two lines (if both are parallel, dist>0)
double a_x2_error() const
get the error on the slope of the straight line in the x2-x3 plane
unsigned int numberOfTrackHits() const
void setChi2(double chi2)
Cache the chi2.
MTStraightLine(const double r_a_x1, const double r_b_x1, const double r_a_x2, const double r_b_x2, const double r_a_x1_err, const double r_b_x1_err, const double r_a_x2_err, const double r_b_x2_err)
Coordinates: x1, x2, x3.
void setNumberOfTrackHits(unsigned int n_hits)
cache the number of track hits
std::shared_ptr< MdtCalibHitBase > MdtHitPtr
typedef for a collection of MdtCalibHitBase s
std::vector< MdtHitPtr > MdtHitVec
double chi2(TH1 *h0, TH1 *h1)
Eigen::Matrix< double, 3, 1 > Vector3D
CscCalcPed - algorithm that finds the Cathode Strip Chamber pedestals from an RDO.