#include <MuCCaFitter.h>
Interface to the straight line fitter for drift circles used by Calib
- Author
- Fabri.nosp@m.zio..nosp@m.Petru.nosp@m.cci@.nosp@m.cern..nosp@m.ch
Definition at line 29 of file MuCCaFitter.h.
◆ HitSelection
◆ 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 MuCCaFitter.cxx.
29 int N = seg.mdtHitsOnTrack();
31 if (
N < 2) {
return false; }
38 for (
int i = 0;
i <
N; ++
i) {
42 log << MSG::WARNING <<
"fit() TO FEW HITS SELECTED" <<
endmsg;
49 double S(0), Sy(0), Sz(0), Zc{0}, Yc{0};
50 std::vector<double>
y(
N),
x(
N),
z(
N);
55 const MdtCalibHitBase&
h = *hit;
56 y[ii] =
getY(
h.localPosition());
57 z[ii] =
getZ(
h.localPosition());
58 r[ii] = std::abs(
h.driftRadius());
60 if (
h.sigma2DriftRadius() > 0) {
61 w[ii] = 1. / (
h.sigma2DriftRadius());
62 sr[ii] = std::sqrt(
h.sigma2DriftRadius());
68 log <<
MSG::DEBUG <<
"fit() MuCCaFitter: (" <<
x[ii] <<
"," <<
y[ii] <<
") R = " <<
r[ii] <<
" W " <<
w[ii] <<
endmsg;
69 rw[ii] =
r[ii] *
w[ii];
84 std::unique_ptr<MuCCaFitterImplementation> Fitter = std::make_unique<MuCCaFitterImplementation>();
86 for (
int i = 0;
i != ii;
i++) {
87 log <<
MSG::DEBUG <<
"fit() MuCCaFitter hits passed to computepam Z=" <<
x[
i] <<
" phi=" <<
y[
i] <<
" zzz=" <<
z[
i]
88 <<
" drift=" <<
r[
i] <<
" error=" <<
w[
i] <<
endmsg;
91 Fitter->Computeparam3(ii,
z,
y,
r,
sr);
93 log <<
MSG::DEBUG <<
"fit() MuCCaFitter computed track a=" << Fitter->get_a() <<
" da= " << Fitter->get_da()
94 <<
" b= " << Fitter->get_b() <<
" db= " << Fitter->get_db() <<
" corrab= " << Fitter->get_corrab()
95 <<
" chi2f= " << Fitter->get_chi2f() <<
endmsg;
98 double afit = Fitter->get_a();
99 double chi2f = Fitter->get_chi2f();
101 std::vector<double> dist(
N), ddist(
N);
109 log <<
MSG::DEBUG <<
"fit() MuCCaFitter>>> theta= " <<
theta <<
" sinus= " << sinus <<
" cosin= " << cosin <<
endmsg;
111 <<
" Yc= " << Yc <<
endmsg;
113 double Syy(0), Szy(0), Syyzz(0), Att(0);
115 for (
int i = 0;
i <
N; ++
i) {
117 Syy += (
y[
i] - Yc) * (
y[
i] - Yc) *
w[
i];
118 Szy += (
y[
i] - Yc) * (
z[
i] - Zc) *
w[
i];
119 Syyzz += ((
y[
i] - Yc) - (
z[
i] - Zc)) * ((
y[
i] - Yc) + (
z[
i] - Zc)) *
w[
i];
120 dis = (
y[
i] - Yc) * cosin - (
z[
i] - Zc) * sinus;
127 Att = Syy + cosin * (2 * sinus * Szy - cosin * Syyzz);
130 log <<
MSG::DEBUG <<
"fit() MuCCaFitter>>> d= " <<
d <<
" R= " << R <<
" S= " <<
S <<
" Att= " << Att <<
endmsg;
131 for (
int i = 0;
i <
N; ++
i) {
133 dist[
i] = cosin * (
y[
i] - Yc) - sinus * (
z[
i] - Zc) -
d;
134 double dth = -(sinus * (
y[
i] - Yc) + cosin * (
z[
i] - Zc)) * (std::sqrt(1. / Att));
135 ddist[
i] = std::sqrt(dth * dth + (1. /
S));
142 log <<
MSG::DEBUG <<
"fit() New line: position " << npos <<
" direction " << ndir <<
" chi2f " << chi2f <<
endmsg;
144 seg.set(chi2f / (
N - 2), npos, ndir);
148 hit_ptr->setDistanceToTrack(dist[
i], ddist[
i]);
◆ getVec()
Amg::Vector3D MuonCalib::MuCCaFitter::getVec |
( |
double |
x, |
|
|
double |
y, |
|
|
double |
z |
|
) |
| const |
|
inlineprivate |
◆ getX()
◆ getY()
these methods are needed to change the reference frame between the local one of the hit and one used by the fitter: apparently the 2 frames are the same ...
TO BE CHECKED!!!
Definition at line 56 of file MuCCaFitter.h.
◆ getZ()
◆ printLevel()
void MuonCalib::MuCCaFitter::printLevel |
( |
int |
level | ) |
|
|
virtual |
◆ m_debug
bool MuonCalib::MuCCaFitter::m_debug |
|
private |
The documentation for this class was generated from the following files: