|
ATLAS Offline Software
|
Go to the documentation of this file.
7 #include "Acts/Seeding/SeedFilterConfig.hpp"
8 #include "Acts/Seeding/BinnedGroup.hpp"
9 #include "Acts/Seeding/SeedFilter.hpp"
10 #include "Acts/Seeding/SeedFinder.hpp"
11 #include "Acts/Seeding/SeedFinderConfig.hpp"
12 #include "Acts/Definitions/Units.hpp"
13 #include "Acts/Seeding/SeedConfirmationRangeConfig.hpp"
15 using namespace Acts::HashedStringLiteral;
18 SeedingTool::SeedingTool(
const std::string&
type,
19 const std::string&
name,
145 return StatusCode::FAILURE;
152 return StatusCode::FAILURE;
159 return StatusCode::FAILURE;
166 return StatusCode::FAILURE;
174 ATH_MSG_ERROR(
"Inconsistent config zBinsCustomLooping contains bins that are not in zBinEdges");
175 return StatusCode::FAILURE;
183 ATH_MSG_ERROR(
"Inconsistent config rBinsCustomLooping contains bins that are not in rBinEdges");
184 return StatusCode::FAILURE;
202 return StatusCode::SUCCESS;
207 const Acts::SpacePointContainer<ActsTrk::SpacePointCollector, Acts::detail::RefHolder>& spContainer,
208 const Acts::Vector3& beamSpotPos,
209 const Acts::Vector3& bField,
220 return StatusCode::SUCCESS;
223 template<
typename external_iterator_t >
226 external_iterator_t spEnd,
227 const Acts::Vector3& beamSpotPos,
228 const Acts::Vector3& bField,
229 DataVector< Acts::Seed< typename SeedingTool::external_type, 3ul > >& seedContainer)
const
232 "Inconsistent type");
234 if (spBegin == spEnd)
235 return StatusCode::SUCCESS;
237 std::vector< seed_type > seeds;
240 Acts::CylindricalSpacePointGridOptions gridOpts;
241 gridOpts.bFieldInZ = bField[2];
242 gridOpts = gridOpts.toInternalUnits();
245 Acts::SeedFinderOptions finderOpts;
246 finderOpts.beamPos = Acts::Vector2(beamSpotPos[
Amg::x],
248 finderOpts.bFieldInZ = bField[2];
249 finderOpts = finderOpts.toInternalUnits().calculateDerivedQuantities(
m_finderCfg);
254 Acts::CylindricalSpacePointGrid< value_type > grid =
255 Acts::CylindricalSpacePointGridCreator::createGrid< value_type >(
m_gridCfg, gridOpts,
logger());
257 Acts::CylindricalSpacePointGridCreator::fillGrid(
m_finderCfg, finderOpts, grid,
258 spBegin, spEnd,
logger());
264 float maxRange = std::numeric_limits<float>::lowest();
265 for (
const auto& coll : grid) {
269 const auto* firstEl = coll.front();
270 const auto* lastEl = coll.back();
271 minRange =
std::min(firstEl->radius(), minRange);
272 maxRange =
std::max(lastEl->radius(), maxRange);
275 Acts::CylindricalBinnedGroup< value_type > spacePointsGrouping(std::move(grid), *
m_bottomBinFinder,
279 const Acts::Range1D<float> rMiddleSPRange(std::floor(minRange/2)*2 +
m_finderCfg.deltaRMiddleMinSPRange,
280 std::floor(maxRange/2)*2 -
m_finderCfg.deltaRMiddleMaxSPRange);
283 typename decltype(
m_finder)::SeedingState state;
284 state.spacePointMutableData.resize(
std::distance(spBegin, spEnd));
286 for (
const auto [bottom, middle,
top] : spacePointsGrouping) {
287 m_finder.createSeedsForGroup(finderOpts, state, spacePointsGrouping.grid(),
288 seeds, bottom, middle,
top, rMiddleSPRange);
295 auto selectionFunction = [&state] (
const seed_type& seed) ->
bool
297 float seed_quality = seed.seedQuality();
298 float bottom_quality = state.spacePointMutableData.quality(seed.sp()[0]->index());
299 float middle_quality = state.spacePointMutableData.quality(seed.sp()[1]->index());
300 float top_quality = state.spacePointMutableData.quality(seed.sp()[2]->index());
302 if (bottom_quality > seed_quality and
303 middle_quality > seed_quality and
304 top_quality > seed_quality) {
312 std::size_t acceptedSeeds = 0;
313 for (std::size_t
i(0);
i<seeds.size(); ++
i) {
314 const auto& seed = seeds[
i];
315 if (not selectionFunction(seed)) {
321 if (acceptedSeeds !=
i)
322 seeds[acceptedSeeds] = std::move(seeds[
i]);
327 seeds.erase(seeds.begin() + acceptedSeeds, seeds.end());
332 seedContainer.reserve(seeds.size());
333 for(
const auto& seed: seeds) {
334 const auto [bottom, middle,
top] = seed.sp();
336 std::unique_ptr< ActsTrk::Seed >
toAdd =
337 std::make_unique< ActsTrk::Seed >(bottom->externalSpacePoint(),
338 middle->externalSpacePoint(),
339 top->externalSpacePoint());
340 toAdd->setVertexZ(seed.z());
341 toAdd->setQuality(seed.seedQuality());
342 seedContainer.push_back(std::move(
toAdd));
345 return StatusCode::SUCCESS;
412 std::vector<float> convertedVec;
414 for (
const auto&
val :
vec) {
415 convertedVec.push_back(
static_cast<float>(
val));
418 m_finderCfg.rRangeMiddleSP.push_back(convertedVec);
434 Acts::SeedFilterConfig filterCfg;
441 filterCfg.centralSeedConfirmationRange =
m_finderCfg.centralSeedConfirmationRange;
442 filterCfg.forwardSeedConfirmationRange =
m_finderCfg.forwardSeedConfirmationRange;
450 m_finderCfg.seedFilter = std::make_unique<Acts::SeedFilter< value_type > >(filterCfg.toInternalUnits(),
logger().cloneWithSuffix(
"Filter"));
473 return StatusCode::SUCCESS;
std::vector< size_t > vec
std::unique_ptr< const Acts::Logger > makeActsAthenaLogger(IMessageSvc *svc, const std::string &name, int level, std::optional< std::string > parent_name)
::StatusCode StatusCode
StatusCode definition for legacy code.
The AlignStoreProviderAlg loads the rigid alignment corrections and pipes them through the readout ge...
float distance(const Amg::Vector3D &p1, const Amg::Vector3D &p2)
calculates the distance between two point in 3D space