31 (
const std::string &
t,
const std::string &
n,
const IInterface *
p) :
33 declareInterface<IRIO_OnTrackCreator>(
this);
45 switch (m_option_errorStrategy) {
52 default:
ATH_MSG_ERROR(
" -- NO, UNKNOWN. Pls check jobOptions!");
53 return StatusCode::FAILURE;
55 ATH_MSG_DEBUG(
" will be applied during ITkStripClusterOnTrack making");
58 switch (m_option_correctionStrategy) {
59 case -1:
ATH_MSG_DEBUG(
"keep the global position as evaluated");
62 default:
ATH_MSG_ERROR(
" -- NO, UNKNOWN. Pls check jobOptions!");
63 return StatusCode::FAILURE;
65 ATH_MSG_DEBUG(
" will be applied during ITkStripClusterOnTrack making");
69 if (!m_stripErrorScalingKey.key().empty()) {
70 ATH_CHECK(m_stripErrorScalingKey.initialize());
87 ATH_MSG_WARNING(
"Attempt to correct RIO which is not SCT_Cluster with ITk::StripClusterOnTrackTool: returning nullptr");
91 ATH_MSG_VERBOSE(
"STARTING CLUSTER ON TRACK CORRECTION... " << __func__ <<
" " << __LINE__);
101 if (!detectorElement) {
109 double cosAlpha = std::sqrt(1 - sinAlpha * sinAlpha);
111 ATH_MSG_VERBOSE(
"STRIP DIRECTION = " << localstripdir[0] <<
", " << localstripdir[1]);
119 ATH_MSG_VERBOSE(
"TRACK PAR LOCAL POS = " << loct[0] <<
", " << loct[1]);
123 double phiPitchInRad = 0.;
131 ATH_MSG_VERBOSE(
"BARREL ====>>>> DISTANCE*COSALPHA / HALF LENGTH --> " <<
distance*cosAlpha <<
" / " << boundsy);
136 ATH_MSG_VERBOSE(
"DISTANCE TO LARGE COMPARED TO BOUNDS, SETTING TO MAXIMUM");
149 double striphalflength = design->
stripLength(siCellId) / 2.0;
157 ATH_MSG_VERBOSE(
"DISTANCE TO LARGE COMPARED TO BOUNDS, SETTING TO MAXIMUM");
166 if (m_option_errorStrategy > -1) {
170 switch (m_option_errorStrategy) {
186 if (not detectorElement->
isBarrel()) {
206 double sinAlpha2 = sinAlpha * sinAlpha;
207 double cosAlpha2 = (1. - sinAlpha) * (1. + sinAlpha);;
210 double v1 =
mat(1, 1);
211 mat(0, 0) = (cosAlpha2 *
v0 + sinAlpha2 * v1);
212 mat(1, 0) = (sinAlpha * std::sqrt(cosAlpha2) * (
v0 - v1));
214 mat(1, 1) = (sinAlpha2 *
v0 + cosAlpha2 * v1);
217 ATH_MSG_VERBOSE(
"sinAlpha / sinAlpha2 / cosAlpha2 / weight = " << sinAlpha <<
" / " << sinAlpha2 <<
" / " << cosAlpha2 <<
" / " <<
weight);
236 covariance(0, 0) = prevCov(0, 0);
238 if (!m_stripErrorScalingKey.key().empty()) {
240 covariance = Trk::ErrorScalingCast<SCTRIO_OnTrackErrorScaling>(*error_scaling)
241 ->getScaledCovariance(std::move(covariance),
false, 0.0);
246 if (!m_stripErrorScalingKey.key().empty()) {
248 covariance = Trk::ErrorScalingCast<SCTRIO_OnTrackErrorScaling>(*error_scaling)
249 ->getScaledCovariance(std::move(covariance),
true,
258 double sinAlpha2 = sinAlpha * sinAlpha;
259 double cosAlpha2 = (1. - sinAlpha) * (1. + sinAlpha);
260 double sinAlphaCosAlpha = sinAlpha * std::sqrt(cosAlpha2);
263 double radiusAtLocPos = std::hypot(loct.x(), loct.y());
264 double phiPitchAtLocPos = phiPitchInRad*radiusAtLocPos;
268 double dV0 = (cosAlpha2 * covariance(0, 0) + sinAlpha2 * covariance(1, 1) +
269 2. * sinAlphaCosAlpha * covariance(1, 0)) * (
weight *
weight - 1.);
282 covariance(0, 0) += (cosAlpha2 * dV0);
283 covariance(1, 0) += (sinAlphaCosAlpha * dV0);
284 covariance(0, 1) = covariance(1, 0);
285 covariance(1, 1) += (sinAlpha2 * dV0);
288 ATH_MSG_VERBOSE(
"sinAlpha / sinAlpha2 / cosAlpha2 / weight = " << sinAlpha <<
" / " << sinAlpha2 <<
" / " << cosAlpha2 <<
" / " <<
weight );
290 << sinAlpha2 * covariance(1, 1) <<
" + "
291 << 2. * sinAlphaCosAlpha * covariance(1, 0)
294 ATH_MSG_VERBOSE(
"SCALED CLUSTER COVARIANCE = " << covariance(0, 0) <<
", "
295 << covariance(0, 1));
299 bool isbroad = m_option_errorStrategy == 0;
301 detectorElement->
identifyHash(), globalPosition, isbroad);