17 #include "GaudiKernel/SystemOfUnits.h"
23 m_extrapolator(
"Trk::Extrapolator/AtlasExtrapolator"),
33 m_outerBoundary(nullptr),
34 m_trackingGeometry(nullptr),
66 msg(MSG::INFO) <<
" initialize()" <<
endmsg;
69 if (m_extrapolator.retrieve().isFailure()) {
71 return StatusCode::FAILURE;
74 m_gaussDist =
new Rndm::Numbers(randSvc(), Rndm::Gauss(0.,1.));
75 m_flatDist =
new Rndm::Numbers(randSvc(), Rndm::Flat(0.,1.));
77 msg(MSG::INFO) <<
"initialize() successful in " <<
endmsg;
78 return StatusCode::SUCCESS;
86 return StatusCode::SUCCESS;
94 const EventContext& ctx = Gaudi::Hive::currentContext();
96 if (!m_outerBoundary) {
97 m_trackingGeometry = m_extrapolator->trackingGeometry();
98 m_outerBoundary = m_trackingGeometry->highestTrackingVolume();
99 if (!m_outerBoundary) {
100 msg(
MSG::FATAL) <<
"Could not retrieve geometry boundary from " << m_extrapolator <<
". Exiting."<<
endmsg;
101 return StatusCode::FAILURE;
103 msg(MSG::INFO) <<
" boundary retrieved " <<
endmsg;
107 double d0 = m_gaussDist->shoot() * m_sigmaD0;
108 double z0 = m_minZ0 + m_flatDist->shoot() * (m_maxZ0-m_minZ0);
111 double ctheta = -1. + 2* m_flatDist->shoot();
112 double theta = acos(ctheta);
113 double p = m_minP + m_flatDist->shoot()*(m_maxP-m_minP);
114 double charge = (m_flatDist->shoot() > 0.5 ) ? -1. : 1.;
132 if (!destParameters || !m_extrapolator->trackingGeometry()->atVolumeBoundary(destParameters->
position(),m_outerBoundary,0.001) ) {
133 msg(MSG::ERROR) <<
" extrapolation to outer boundary failed for input parameters: " << initialPerigee.parameters() <<
endmsg;
137 msg(MSG::INFO) <<
" outer boundary reached at: " << destParameters->
position().perp() <<
","<<destParameters->
position().z() <<
endmsg;
138 msg(MSG::INFO) <<
"cov matrix:"<< destParameters->covariance() <<
endmsg;
148 msg(MSG::INFO) <<
" extrapolation to perigee:input: " << initialPerigee.parameters() <<
endmsg;
149 msg(MSG::INFO) <<
" extrapolation to perigee:output: " << peri->parameters() <<
endmsg;
150 msg(MSG::INFO) <<
"cov matrix:"<< peri->covariance() <<
endmsg;
152 msg(MSG::ERROR) <<
" extrapolation to perigee failed for input parameters: " << destParameters->parameters() <<
endmsg;
157 delete destParameters;
159 return StatusCode::SUCCESS;