#include <DCSLFitter.h>
◆ HitSelection
◆ DCSLFitter()
MuonCalib::DCSLFitter::DCSLFitter |
( |
| ) |
|
|
inline |
◆ fit() [1/2]
◆ fit() [2/2]
fit subset of the hits.
If the HitSelection vector contains a 0 for a given hit the hit is used else the hit is not included in the fit. The size of the HitSelection vector should be equal to the number of hits on track else no fit is performed.
Implements MuonCalib::IMdtSegmentFitter.
Definition at line 25 of file MuonSpectrometer/MuonCalib/MdtCalib/MdtCalibFitters/src/DCSLFitter.cxx.
31 int N = seg.mdtHitsOnTrack();
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);
60 const MdtCalibHitBase&
h = *hit_ptr;
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);
217 log <<
MSG::DEBUG <<
"Att " << Att <<
" Add " << Add <<
" Bt " << Bt <<
" Bd " << Bd <<
endmsg;
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);
231 seg.setErrors(Sd, Stt);
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()));
◆ getVec()
Amg::Vector3D MuonCalib::DCSLFitter::getVec |
( |
double |
x, |
|
|
double |
y, |
|
|
double |
z |
|
) |
| const |
|
inlineprivate |
◆ getY()
◆ getZ()
◆ printLevel()
void MuonCalib::DCSLFitter::printLevel |
( |
int |
level | ) |
|
|
virtual |
◆ m_debug
bool MuonCalib::DCSLFitter::m_debug |
|
private |
The documentation for this class was generated from the following files: