![Logo](../../ATLAS-Logo-Square-Blue-RGB.png) |
ATLAS Offline Software
|
Go to the documentation of this file.
8 #include "GaudiKernel/MsgStream.h"
33 if (
N < 2) {
return false; }
40 for (
int i = 0;
i <
N; ++
i) {
45 log << MSG::WARNING <<
"TO FEW HITS SELECTED" <<
endmsg;
53 double S(0), Sz(0), Sy(0);
56 std::vector<double>
y(
N),
z(
N),
r(
N),
w(
N);
62 y[ii] =
getY(
h.localPosition());
63 z[ii] =
getZ(
h.localPosition());
64 r[ii] = std::abs(
h.driftRadius());
65 if (
h.sigma2DriftRadius() > 0)
66 w[ii] = 1. / (
h.sigma2DriftRadius());
72 log << MSG::WARNING <<
"<Negative r> " <<
r[ii] <<
endmsg;
101 double Szz(0), Syy(0), Szy(0), Syyzz(0);
102 std::vector<double>
rw(
N);
103 std::vector<double> ryw(
N);
104 std::vector<double> rzw(
N);
106 for (
int i = 0;
i <
N; ++
i) {
116 Szz +=
z[
i] *
z[
i] *
w[
i];
117 Syy +=
y[
i] *
y[
i] *
w[
i];
118 Szy +=
y[
i] *
z[
i] *
w[
i];
119 Syyzz += (
y[
i] -
z[
i]) * (
y[
i] +
z[
i]) *
w[
i];
124 log <<
MSG::DEBUG <<
" Szz " << Szz <<
" Syy " << Syy <<
" Szy " << Szy <<
" Syyzz " << Syyzz <<
endmsg;
128 double R(0), Ry(0), Rz(0);
152 }
else if (sinus == 0.0 && cosin < 0.0) {
163 double theta = std::acos(cosin);
170 while (
count < 100) {
178 for (
int i = 0;
i <
N; ++
i) {
181 double dist =
y[
i] * cosin -
z[
i] * sinus;
200 Att = Syy + cosin * (2 * sinus * Szy - cosin * Syyzz);
201 Bt = -Szy + cosin * (sinus * Syyzz + 2 * cosin * Szy + Rz) + sinus * Ry;
205 log << MSG::WARNING <<
"NewtonSLDCFitter ZERO Determinant" <<
endmsg;
212 sinus = std::sqrt(1 - cosin * cosin);
220 if (std::abs(Bt / Att) < 0.001 && std::abs(Bd /
Add) < 0.001) {
221 Stt = std::sqrt(1 / Att);
222 Sd = std::sqrt(1 /
Add);
242 std::vector<double> yl(
N);
243 std::vector<double> dyl(
N);
244 std::vector<double>
res(
N);
252 for (
int i = 0;
i <
N; ++
i) {
253 yl[
i] = cosin *
y[
i] - sinus *
z[
i] -
d;
254 double dth = -(sinus *
y[
i] + cosin *
z[
i]) * Stt;
255 dyl[
i] = std::hypot(dth, Sd);
256 res[
i] = std::abs(yl[
i]) -
r[
i];
259 log <<
MSG::DEBUG <<
" r_track " << yl[
i] <<
" dr " << dyl[
i] <<
" r_rt " <<
r[
i] <<
" res " <<
res[
i] <<
" pull "
272 if (
chi2 / (
N - 2) > 5) {
292 seg.
set(
chi2 / (
N - 2), npos, ndir);
296 mdt_hit->setDistanceToTrack(yl[
i], dyl[
i]);
305 return (std::isfinite(ndir.y()) && std::isfinite(ndir.z()) && std::isfinite(npos.y()) && std::isfinite(npos.z()));
singleton-like access to IMessageSvc via open function and helper
double getZ(const Amg::Vector3D &p) const
Scalar theta() const
theta method
bool fit(MuonCalibSegment &seg) const
fit using all hits
void printLevel(int level)
set print level
const Amg::Vector3D & position() const
retrieve local position of segment (on station level)
IMessageSvc * getMessageSvc(bool quiet=false)
const Amg::Vector3D & direction() const
retrieve local direction of segment (on station level) retrieve the transformation from local chamber...
double getY(const Amg::Vector3D &p) const
std::pair< std::vector< unsigned int >, bool > res
double chi2(TH1 *h0, TH1 *h1)
CscCalcPed - algorithm that finds the Cathode Strip Chamber pedestals from an RDO.
unsigned int mdtHitsOnTrack() const
retrieve the number of MdtCalibHitBase s assigned to this segment
Eigen::Matrix< double, 3, 1 > Vector3D
void set(double chi2, const Amg::Vector3D &pos, const Amg::Vector3D &dir)
Amg::Vector3D getVec(double x, double y, double z) const
void setErrors(double error_dy0, double error_dtheta)
sets Local errors on MuonCalibSegment parameters
const MdtHitVec & mdtHOT() const
retrieve the full set of MdtCalibHitBase s assigned to this segment
std::shared_ptr< MdtCalibHitBase > MdtHitPtr
typedef for a collection of MdtCalibHitBase s
std::vector< unsigned int > HitSelection