123 fieldCondObj->getInitializedCache (fieldCache);
125 double magnFieldVect[3];
127 if(magnFieldVect[2] == 0 ){
128 ATH_MSG_DEBUG(
"Magnetic field in the Z direction is 0 -- propagate like a straight line");
133 if (thePerigee==
nullptr)
136 " ImpactPoint3dEstimator didn't get a Perigee* as ParametersBase*: "
137 "cast not possible. Need to EXTRAPOLATE...");
139 std::unique_ptr<const Trk::TrackParameters>
tmp =
141 Gaudi::Hive::currentContext(), *trackPerigee, perigeeSurface);
145 if (thePerigee ==
nullptr){
150 ATH_MSG_VERBOSE(
" Now running ImpactPoint3dEstimator::Estimate3dIP" );
156 double d0=thePerigee->parameters()[
Trk::d0];
159 double Bz=magnFieldVect[2]*299.792;
166 if (thePerigee!=trackPerigee) {
171 double xc=theVertex->x();
172 double yc=theVertex->y();
173 double zc=theVertex->z();
175 double phiActual=
phi0;
176 double dCosPhiActual=-
std::sin(phiActual);
177 double dSinPhiActual=
std::cos(phiActual);
179 double secderivative=0.;
187 #ifdef IMPACTPOINT3DESTIMATOR_DEBUG
188 std::cout << std::setprecision(25) <<
"actual distance before cycle is: " << std::hypot(x0-xc+Rt*dCosPhiActual,
189 y0-yc+Rt*dSinPhiActual,
195 #ifdef IMPACTPOINT3DESTIMATOR_DEBUG
196 ATH_MSG_VERBOSE(
"Cycle number: " << ncycle <<
" old phi: " << phiActual );
202 #ifdef IMPACTPOINT3DESTIMATOR_DEBUG
208 #ifdef IMPACTPOINT3DESTIMATOR_DEBUG
209 std::cout << std::setprecision(25) <<
"deltaphi: " << deltaphi << std::endl;
216 #ifdef IMPACTPOINT3DESTIMATOR_DEBUG
218 std::cout << std::setprecision(25) << std::hypot(x0-xc+Rt*dCosPhiActual, y0-yc+Rt*dSinPhiActual,
220 ATH_MSG_VERBOSE(
"actual distance is: " << std::hypot(x0-xc+Rt*dCosPhiActual,
221 y0-yc+Rt*dSinPhiActual,
231 #ifdef IMPACTPOINT3DESTIMATOR_DEBUG
245 ATH_MSG_WARNING(
"DeltaR is zero in ImpactPoint3dEstimator::Estimate3dIP, returning nullptr");
255 if ((
DeltaR-DeltaRcorrected).mag()>1
e-4)
266 ATH_MSG_VERBOSE(
"final minimal distance is: " << std::hypot(x0-xc+Rt*dCosPhiActual,
267 y0-yc+Rt*dSinPhiActual,
274 ATH_MSG_VERBOSE(
"plane to which to extrapolate X " << DeltaRcorrected <<
" Y " << YDir <<
" Z " << MomentumDir );
278 #ifdef IMPACTPOINT3DESTIMATOR_DEBUG
279 std::cout <<
"the translation is, directly from Transform3d: " << thePlane.getTranslation() <<
endmsg;
281 return std::make_unique<PlaneSurface>(thePlane);