95 {
97 const double invCovTheta = Acts::square(1. /
m_scatterer.sigma());
98 const double sinThetaLoc = std::sin(
theta);
99 const double invCovPhi = invCovTheta * Acts::square(sinThetaLoc);
100
101
102 extendedSystem.aMatrix()(stateIdx, stateIdx) += invCovPhi;
103 extendedSystem.bVector()(stateIdx, 0) -= invCovPhi *
deltaPhi();
104 extendedSystem.chi2() += invCovPhi * Acts::square(
deltaPhi());
105
106
107 extendedSystem.aMatrix()(stateIdx + 1, stateIdx + 1) += invCovTheta;
108 extendedSystem.bVector()(stateIdx + 1, 0) -= invCovTheta *
deltaTheta();
109 extendedSystem.chi2() += invCovTheta * Acts::square(
deltaTheta());
110 ACTS_VERBOSE("Scattering contributions in contributionToGx2fSums:\n"
111 << " index: " << stateIdx << "-" << (stateIdx + 1) << " \n"
112 << " invCov: " << invCovPhi << "\n"
113 << " sinThetaLoc: " << sinThetaLoc << "\n"
114 << " Phi:\n"
115 <<
" scattering angle: " <<
deltaPhi() <<
"\n"
116 << " aMatrix contribution: " << invCovPhi << "\n"
117 <<
" bVector contribution: " << invCovPhi *
deltaPhi()
118 << "\n"
119 << " chi2sum contribution: "
120 << invCovPhi * Acts::square(
deltaPhi()) <<
"\n"
121 << " Theta:\n"
122 <<
" scattering angle: " <<
deltaTheta() <<
"\n"
123 << " aMatrix contribution: " << invCovTheta << "\n"
124 << " bVector contribution: "
126 << " chi2sum contribution: "
128 }
129
131 const std::size_t eLossIdx = stateIdx + (
nDim() - 1ul);
132 extendedSystem.aMatrix()(eLossIdx, eLossIdx) +=
133 Acts::square(1. /
m_eloss.lostSigma());
134 extendedSystem.bVector()(eLossIdx, 0) -=
135 Acts::square(1. /
m_eloss.lostSigma()) *
137 extendedSystem.chi2() += Acts::square(
139
140
141 constexpr double Nepsilon = Acts::square(1. / 10._keV);
143 ACTS_VERBOSE(
144 "Add penalty term to the chi2 to push the energy loss above zero");
145 extendedSystem.chi2() += Nepsilon * Acts::square(
m_lostEnergy);
146 extendedSystem.bVector()(eLossIdx, 0) -= Nepsilon *
m_lostEnergy;
147 extendedSystem.aMatrix()(eLossIdx, eLossIdx) += Nepsilon;
148 }
149 ACTS_VERBOSE("Energy loss contributions in contributionToGx2fSums:\n"
150 << " index: " << eLossIdx << " \n"
151 <<
" measured loss: " <<
m_eloss.lostEnergy() <<
"+-"
152 << (
m_eloss.lostSigma()) <<
", \n"
153 <<
" currently estimated loss: " <<
m_lostEnergy <<
"\n"
154 << " --> chi2 contribution: "
157 << "\n"
158 << " --> aMatrix contribution: "
159 << Acts::square(1. /
m_eloss.lostSigma()) <<
"\n"
160 << " --> bVector contribution: "
161 << Acts::square(1. /
m_eloss.lostSigma()) *
163 }
164}
Scalar theta() const
theta method
constexpr std::size_t nDim() const
Number of dimensions from the material scatterer.
constexpr double deltaPhi() const
constexpr double deltaTheta() const