15 ATH_CHECK(m_trackContainerKey.initialize());
22 ATH_CHECK(m_detectorElementToGeometryIdMapKey.initialize());
23 ATH_CHECK(m_trackingGeometryTool.retrieve());
24 ATH_CHECK(m_extrapolationTool.retrieve());
26 return StatusCode::SUCCESS;
34 if (!thePixelClusters.
isValid()){
36 return StatusCode::FAILURE;
40 if (!theStripClusters.
isValid()){
42 return StatusCode::FAILURE;
47 auto trackContainerHandle =
SG::makeHandle(m_trackContainerKey, ctx);
50 auto myProtoTracks = std::make_unique<ActsTrk::ProtoTrackCollection>();
51 ATH_CHECK(m_patternBuilder->findProtoTracks(ctx,
55 ATH_MSG_INFO(
"I received " << myProtoTracks->size() <<
" proto-tracks");
68 detectorElementToGeometryIdMap{m_detectorElementToGeometryIdMapKey, ctx};
69 ATH_CHECK(detectorElementToGeometryIdMap.isValid());
71 Acts::GeometryContext tgContext = m_trackingGeometryTool->getGeometryContext(ctx).context();
72 Acts::MagneticFieldContext mfContext = m_extrapolationTool->getMagneticFieldContext(ctx);
74 Acts::CalibrationContext calContext = Acts::CalibrationContext();
81 for (
auto & proto : *myProtoTracks){
82 auto res = m_actsFitter->fit(ctx, proto.measurements,*proto.parameters,
83 m_trackingGeometryTool->getGeometryContext(ctx).context(),
84 m_extrapolationTool->getMagneticFieldContext(ctx),
85 Acts::CalibrationContext(),
86 **detectorElementToGeometryIdMap);
89 if (
res->size() == 0 )
continue;
90 if(not proto.measurements.size())
continue;
91 ATH_MSG_DEBUG(
".......Done track with size "<< proto.measurements.size());
92 const auto trackProxy =
res->getTrack(0);
93 if (not trackProxy.hasReferenceSurface()) {
94 ATH_MSG_INFO(
"There is not reference surface for this track");
97 auto destProxy = trackContainer.getTrack(trackContainer.addTrack());
98 destProxy.copyFrom(trackProxy,
true);
99 if ( m_copyParametersFromFit ) {
102 std::make_unique<Acts::BoundTrackParameters>( trackProxy.referenceSurface().getSharedPtr(),
103 trackProxy.parameters(),
104 trackProxy.covariance(),
105 trackProxy.particleHypothesis());
110 std::unique_ptr<ActsTrk::TrackContainer> constTracksContainer = m_tracksBackendHandlesHelper.moveToConst(std::move(trackContainer),
111 m_trackingGeometryTool->getGeometryContext(ctx).context(), ctx);
112 ATH_CHECK(trackContainerHandle.record(std::move(constTracksContainer)));
114 if (not m_protoTrackCollectionKey.empty()) {
116 ATH_CHECK(handle.record(std::move(myProtoTracks)));
119 return StatusCode::SUCCESS;