8#include "GaudiKernel/MsgStream.h"
25 std::vector<Amg::Vector3D> points(3);
26 std::vector<Amg::Vector3D> errors(3);
57 std::vector<Amg::Vector3D> errors(points.size(),
Amg::Vector3D(1.0, 1.0, 0.0));
85 double loc_x{0.0}, loc_y{0.0};
92 loc_x +=
m_coeff_xz[k] * std::legendre(k, loc_z);
96 loc_y +=
m_coeff_yz[k] * std::legendre(k, loc_z);
127 return MTStraightLine(point_1, point_2 - point_1, null_vec, null_vec);
136void CurvedLine::init(std::vector<Amg::Vector3D>& points, std::vector<Amg::Vector3D>& x_and_y_errors) {
141 if (points.size() < 3) {
143 log << MSG::ERROR <<
"Class CurvedLine, method init: Not enough points given, must be at least 3 points!" <<
endmsg;
153 std::vector<SamplePoint> sample_points(points.size());
161 for (
unsigned int k = 0; k < points.size(); k++) {
162 sample_points[k].set_x1(points[k].
z());
163 sample_points[k].set_x2(points[k].
x());
164 sample_points[k].set_error(x_and_y_errors[k].
x());
166 fitter.set_number_of_coefficients(2);
167 fitter.fit_parameters(sample_points, 1, sample_points.size(), legendre);
171 for (
unsigned int k = 0; k < points.size(); k++) {
172 sample_points[k].set_x1(points[k].
z());
173 sample_points[k].set_x2(points[k].
y());
174 sample_points[k].set_error(x_and_y_errors[k].
y());
176 fitter.set_number_of_coefficients(3);
177 fitter.fit_parameters(sample_points, 1, sample_points.size(), legendre);
This class performs a fit of a linear combination of base functions to a set of sample points.
unsigned int m_numTrkHits
void setChi2(double chi2)
Cache the chi2.
double chi2PerDegreesOfFreedom() const
Return chi2 / number of TrackHits - 3.
const MdtHitVec & trackHits() const
MTStraightLine getTangent(const double loc_z) const
get the tangent to the line a the local z coordinate "loc_z"
unsigned int numberOfTrackHits() const
MuonCalibSegment::MdtHitVec MdtHitVec
void init(std::vector< Amg::Vector3D > &points, std::vector< Amg::Vector3D > &x_and_y_errors)
Amg::Vector3D getPointOnLine(const double loc_z) const
get the point on the line a the local z coordinate "loc_z"
void setUsedHits(const MdtHitVec &hits)
CurvedLine()
Default constructor: a straight line through (0,0,0) pointing in in the local x direction of the cham...
void setNumberOfTrackHits(unsigned int n_hits)
cache the number of track hits
This class provides a legendre polynomial of order k.
singleton-like access to IMessageSvc via open function and helper
Eigen::Matrix< double, 3, 1 > Vector3D
IMessageSvc * getMessageSvc(bool quiet=false)
CscCalcPed - algorithm that finds the Cathode Strip Chamber pedestals from an RDO.