26 m_extrapolator(
"Trk::Extrapolator/AtlasExtrapolator")
28 declareInterface<ITruthToTrack>(
this);
41 return StatusCode::SUCCESS;
47 if (
part ==
nullptr)
return nullptr;
51 prodVertexVector.setZero();
58 if (trackRecordCollection.
isValid()) {
62 ATH_MSG_DEBUG(
"reading from track record, size=" << trackRecordCollection->
size());
64 if (trackRecordCollection->
empty())
ATH_MSG_WARNING (
"action required but TrackRecordCollection size is 0");
66 for (
const auto & trackRecord : *trackRecordCollection) {
70 id = trackRecord.GetPDGCode();
72 CLHEP::Hep3Vector tv = trackRecord.GetPosition();
74 globalPos = prodVertexVector;
76 Amg::Vector3D hv2(trackRecord.GetMomentum().x(), trackRecord.GetMomentum().y(),
77 trackRecord.GetMomentum().z());
80 ATH_MSG_DEBUG(
"Found particle " <<
part <<
", momentum " << hv2 <<
" production " << globalPos);
90 prodVertexVector.z() );
92 Amg::Transform3D tmpTransf = prodSurfaceCentre * Amg::RotationMatrix3D::Identity();
107 if (
part ==
nullptr)
return nullptr;
118 if (trackRecordCollection.
isValid()) {
123 ATH_MSG_DEBUG(
"reading from track record, size=" << trackRecordCollection->
size());
125 if (trackRecordCollection->
empty())
ATH_MSG_WARNING (
"action required but TrackRecordCollection size is 0");
127 for (
const auto & trackRecord : *trackRecordCollection) {
129 id = trackRecord.GetPDGCode();
131 CLHEP::Hep3Vector tv = trackRecord.GetPosition();
133 globalPos = prodVertexVector;
134 Amg::Vector3D hv2(trackRecord.GetMomentum().x(), trackRecord.GetMomentum().y(), trackRecord.GetMomentum().z());
136 ATH_MSG_DEBUG(
"found particle " <<
part <<
", momentum " << hv2 <<
" production " << globalPos);
144 prodVertexVector.y(),
145 prodVertexVector.z() );
147 Amg::Transform3D tmpTransf = prodSurfaceCentre * Amg::RotationMatrix3D::Identity();
164 if(
part &&
part->production_vertex() && m_extrapolator) {
168 std::unique_ptr<const Trk::TrackParameters> productionVertexTrackParams( makeProdVertexParameters(
part) );
169 if(productionVertexTrackParams) {
173 generatedTrackPerigee =
174 m_extrapolator->extrapolateDirectly(Gaudi::Hive::currentContext(),
175 *productionVertexTrackParams,
183 return generatedTrackPerigee;
190 if(
part &&
part->hasProdVtx() && m_extrapolator) {
194 std::unique_ptr<const Trk::TrackParameters> productionVertexTrackParams( makeProdVertexParameters(
part) );
195 if(productionVertexTrackParams) {
199 generatedTrackPerigee =
200 m_extrapolator->extrapolateDirectly(Gaudi::Hive::currentContext(),
201 *productionVertexTrackParams,
209 return generatedTrackPerigee;