8 #include "Acts/Definitions/Units.hpp"
9 #include "Acts/MagneticField/MagneticFieldContext.hpp"
11 #include "Acts/Seeding/BinnedGroup.hpp"
12 #include "Acts/Seeding/SeedFilter.hpp"
13 #include "Acts/Seeding/SeedFinder.hpp"
28 ISvcLocator *pSvcLocator )
55 return StatusCode::SUCCESS;
60 std::array<std::string, kNStat>{
65 return StatusCode::SUCCESS;
83 ATH_CHECK( seedHandle.
record( std::make_unique< ActsTrk::SeedContainer >() ) );
88 ATH_CHECK( boundTrackParamsHandle.
record( std::make_unique< ActsTrk::BoundTrackParametersContainer >() ) );
98 if (beamSpotHandle.cptr() ==
nullptr) {
99 ATH_MSG_ERROR(
"Retrieved Beam Spot Handle contains a nullptr");
100 return StatusCode::FAILURE;
102 auto beamSpotData = beamSpotHandle.cptr();
110 std::vector<const xAOD::SpacePointContainer *> all_input_collections;
113 std::size_t number_input_space_points = 0;
115 ATH_MSG_DEBUG(
"Retrieving from Input Collection '" << spacePointKey.key() <<
"' ..." );
118 all_input_collections.push_back(handle.
cptr());
120 number_input_space_points += handle->
size();
124 std::vector<const xAOD::SpacePoint*> selectedSpacePoints;
125 selectedSpacePoints.reserve(number_input_space_points);
127 for (
const auto* collection : all_input_collections) {
128 selectedSpacePoints.insert(selectedSpacePoints.end(), collection->begin(), collection->end());
131 ATH_MSG_DEBUG(
" \\__ Total input space points: " << selectedSpacePoints.size());
135 if (selectedSpacePoints.empty()) {
136 ATH_MSG_DEBUG(
"No input space points found, we stop seeding");
137 return StatusCode::SUCCESS;
149 if (fieldCondObj ==
nullptr) {
151 return StatusCode::FAILURE;
156 Acts::MagneticFieldContext magFieldContext(fieldCondObj);
158 Acts::MagneticFieldProvider::Cache magFieldCache = magneticField.
makeCache( magFieldContext );
159 Acts::Vector3 bField = *magneticField.
getField( Acts::Vector3(beamPos.x(), beamPos.y(), 0),
165 if ( detEle ==
nullptr ) {
167 return StatusCode::FAILURE;
177 Acts::SpacePointContainerConfig spConfig;
178 spConfig.useDetailedDoubleMeasurementInfo = not
m_usePixel;
180 Acts::SpacePointContainerOptions spOptions;
181 spOptions.beamPos = Acts::Vector2(beamPos.x(), beamPos.y());
186 time_seedCreation.start();
192 time_seedCreation.stop();
200 ATH_MSG_DEBUG(
"Estimating Track Parameters from seed ..." );
203 auto retrieveSurfaceFunction =
204 [
this, &detEle] (
const ActsTrk::Seed& seed) ->
const Acts::Surface&
216 time_parameterEstimation.start();
218 std::optional<Acts::BoundTrackParameters> optTrackParams =
221 geo_context.context(),
223 retrieveSurfaceFunction);
225 if ( optTrackParams.has_value() ) {
226 Acts::BoundTrackParameters *
toAdd =
227 new Acts::BoundTrackParameters( optTrackParams.value() );
232 time_parameterEstimation.stop();
234 mon_nSeeds = seedPtrs->size();
236 return StatusCode::SUCCESS;