15 #include "GaudiKernel/MsgStream.h"
16 #include "GaudiKernel/SystemOfUnits.h"
31 m_extremeMomentum(
false),
32 m_finalCovariance(
nullptr),
33 m_firstAlignmentParameter(0),
34 m_firstScatteringParameter(0),
35 m_fitEnergyDeposit(
false),
37 m_fullCovariance(
nullptr),
38 m_minEnergyDeposit(0.),
39 m_numberAlignments(0),
40 m_numberOscillations(0),
41 m_numberParameters(0),
42 m_numberScatterers(0),
45 m_phiInstability(
false),
49 m_surface(&perigee.associatedSurface()),
50 m_vertex(perigee.associatedSurface().center()),
51 m_z0(perigee.position().z()) {
53 double ptInv0 = 1. /
momentum.perp();
57 m_sinTheta = 1. / std::sqrt(1. + m_cotTheta * m_cotTheta);
58 m_cosTheta = m_cotTheta * m_sinTheta;
59 m_qOverP = perigee.charge() * ptInv0 * m_sinTheta;
61 m_vertex.y() + m_d0 * m_cosPhi, m_z0);
72 m_extremeMomentum(false),
73 m_finalCovariance(nullptr),
74 m_firstAlignmentParameter(0),
75 m_firstScatteringParameter(0),
76 m_fitEnergyDeposit(false),
78 m_fullCovariance(nullptr),
79 m_minEnergyDeposit(0.),
80 m_numberAlignments(0),
81 m_numberOscillations(0),
82 m_numberParameters(0),
83 m_numberScatterers(0),
86 m_phiInstability(false),
92 m_vertex(surface.center()),
204 cutDifferences *= (cutStep - 1.);
206 oldDifferences *= cutStep;
210 cutDifferences(2) = 0.;
247 log << std::setiosflags(std::ios::fixed | std::ios::right) << std::setw(16)
248 << std::setprecision(1) <<
m_position.perp() <<
" perigee radius"
249 << std::setw(10) << std::setprecision(3) <<
m_d0 <<
" d0" << std::setw(11)
250 << std::setprecision(3) <<
m_position.z() <<
" z0" << std::setw(11)
252 << std::setw(11) << std::setprecision(6) << std::acos(
m_cosTheta)
253 <<
" theta" << std::setw(13) << std::setprecision(3)
261 error00 = std::sqrt(
cov(0, 0));
264 error11 = std::sqrt(
cov(1, 1));
267 error22 = std::sqrt(
cov(2, 2));
270 error33 = std::sqrt(
cov(3, 3));
273 error44 = std::sqrt(
cov(4, 4));
274 double correl02 = 0.;
275 double denom02 =
cov(0, 0) *
cov(2, 2);
277 correl02 =
cov(0, 2) / std::sqrt(denom02);
278 double correl13 = 0.;
279 double denom13 =
cov(1, 1) *
cov(3, 3);
281 correl13 =
cov(1, 3) / std::sqrt(denom13);
282 log << std::setiosflags(std::ios::fixed | std::ios::right) << std::setw(10)
283 << std::setprecision(3) << error00 << std::setw(14)
284 << std::setprecision(3) << error11 << std::setw(14)
285 << std::setprecision(6) << error22 << std::setw(15)
286 << std::setprecision(6) << error33 << std::setw(19)
287 << std::setprecision(3)
289 <<
" (covariance)" << std::setw(9) << std::setprecision(3) << correl02
290 <<
" Cd0phi" << std::setw(8) << std::setprecision(3) << correl13
291 <<
" Cz0theta" << std::endl;
299 log <<
" dParams ====" << std::setiosflags(std::ios::fixed)
300 << std::setw(10) << std::setprecision(4) <<
differences(0) <<
" (0) "
301 << std::setw(10) << std::setprecision(4) <<
differences(1) <<
" (1) "
302 << std::setw(10) << std::setprecision(5) <<
differences(2) <<
" (2) "
303 << std::setw(10) << std::setprecision(5) <<
differences(3) <<
" (3) "
304 << std::setw(13) << std::setprecision(9)
307 log << std::setiosflags(std::ios::fixed) << std::setw(13)
308 << std::setprecision(9)
313 log <<
" dAlign ==== ";
317 if (scat % 5 == 0 && scat > 0)
318 log << std::endl <<
" ";
319 log << std::setiosflags(std::ios::fixed) << std::setw(10)
322 log << std::setiosflags(std::ios::fixed) << std::setw(10)
323 << std::setprecision(6) <<
differences(param) <<
" ("
324 << std::setw(2) << scat <<
"A) ";
330 log <<
" dScat ==== ";
334 if (scat % 5 == 0 && scat > 0)
335 log << std::endl <<
" ";
336 log << std::setiosflags(std::ios::fixed) << std::setw(10)
339 log << std::setiosflags(std::ios::fixed) << std::setw(10)
340 << std::setprecision(6) <<
differences(param) <<
" ("
341 << std::setw(2) << scat <<
"S) ";
347 log << std::setiosflags(std::ios::fixed | std::ios::right)
348 <<
" parameters: " << std::setw(12) << std::setprecision(4) <<
m_d0
349 <<
" transverse impact " << std::setw(10) << std::setprecision(4)
350 <<
m_position.z() <<
" z0 " << std::setw(10) << std::setprecision(6)
352 <<
m_cotTheta <<
" phi,cotTheta " << std::setw(13)
354 << std::setw(12) << std::setprecision(6)
359 <<
" E before/after energy deposit" << std::setw(12)
361 << std::setw(12) << std::setprecision(3)
365 log << std::endl <<
" alignment number, angle, offset: ";
367 log << std::setiosflags(std::ios::fixed) << std::setw(6) << align
370 if ((align + 1) % 5 == 0)
371 log << std::endl <<
" ";
375 log << std::endl <<
" scatterer number, delta(phi), delta(theta): ";
377 log << std::setiosflags(std::ios::fixed) << std::setw(6) << scat
380 if ((scat + 1) % 5 == 0)
381 log << std::endl <<
" ";
453 const FitMeasurement& fitMeasurement,
int scatterer)
const {
455 double scattererSigmaTheta = 1. / fitMeasurement.weight();
456 double scattererSigmaPhi =
457 scattererSigmaTheta /
460 return {0., 0., scattererSigmaPhi, scattererSigmaTheta};
463 scattererSigmaPhi, scattererSigmaTheta};
488 <<
"FitParameters::trackParameters - measurement lacks Surface"
496 <<
"FitParameters::trackParameters - invalid measurement" <<
endmsg;
507 <<
"FitParameters::trackParameters - globalToLocal failure" <<
endmsg;
526 double sigma2 = 1. / measurement.
weight2();
529 for (
int i = 0;
i != lastParameter; ++
i) {
538 while (++
i < lastParameter) {
555 jacobian(3, 5) = deltaTheta / measurement.
qOverP();
565 jacobian(3, 4) = deltaTheta / measurement.
qOverP();
575 jacobian.transpose());
591 <<
"FitParameters::trackParameters - unrecognized surface" <<
endmsg;
649 if (std::abs(sinDPhi) < 1.0) {
650 cosDPhi = std::sqrt(1. - sinDPhi * sinDPhi);
689 for (
int i = 0;
i != 5; ++
i) {
690 for (
int j = 0; j != 5; ++j) {
691 (*m_finalCovariance)(
i, j) += leadingCovariance(
i, j);