 |
ATLAS Offline Software
|
Go to the documentation of this file.
4 #if defined(FLATTEN) && defined(__GNUC__)
6 #pragma GCC optimize "-fno-var-tracking-assignments"
12 #include "Acts/Seeding/SeedFilterConfig.hpp"
13 #include "Acts/Seeding/BinnedGroup.hpp"
14 #include "Acts/Seeding/SeedFilter.hpp"
15 #include "Acts/Seeding/SeedFinder.hpp"
16 #include "Acts/Seeding/SeedFinderConfig.hpp"
17 #include "Acts/Definitions/Units.hpp"
18 #include "Acts/Seeding/SeedConfirmationRangeConfig.hpp"
21 using namespace Acts::HashedStringLiteral;
24 SeedingTool::SeedingTool(
const std::string&
type,
25 const std::string&
name,
151 return StatusCode::FAILURE;
158 return StatusCode::FAILURE;
165 return StatusCode::FAILURE;
172 return StatusCode::FAILURE;
180 ATH_MSG_ERROR(
"Inconsistent config zBinsCustomLooping contains bins that are not in zBinEdges");
181 return StatusCode::FAILURE;
189 ATH_MSG_ERROR(
"Inconsistent config rBinsCustomLooping contains bins that are not in rBinEdges");
190 return StatusCode::FAILURE;
210 return StatusCode::FAILURE;
213 return StatusCode::SUCCESS;
219 const Acts::SpacePointContainer<ActsTrk::SpacePointCollector, Acts::detail::RefHolder>& spContainer,
220 const Acts::Vector3& beamSpotPos,
221 const Acts::Vector3& bField,
232 return StatusCode::SUCCESS;
235 template<
typename external_iterator_t >
238 external_iterator_t spEnd,
239 const Acts::Vector3& beamSpotPos,
240 const Acts::Vector3& bField,
244 "Inconsistent type");
246 if (spBegin == spEnd)
247 return StatusCode::SUCCESS;
250 for (
auto sp = spBegin; sp != spEnd; ++sp) {
251 seedContainer.
spacePoints().push_back(&(*sp).externalSpacePoint());
253 std::vector< seed_type > seeds;
256 Acts::CylindricalSpacePointGridOptions gridOpts;
257 gridOpts.bFieldInZ = bField[2];
258 gridOpts = gridOpts.toInternalUnits();
261 Acts::SeedFinderOptions finderOpts;
262 finderOpts.beamPos = Acts::Vector2(beamSpotPos[
Amg::x],
264 finderOpts.bFieldInZ = bField[2];
265 finderOpts = finderOpts.toInternalUnits().calculateDerivedQuantities(
m_finderCfg);
270 Acts::CylindricalSpacePointGrid< value_type > grid =
271 Acts::CylindricalSpacePointGridCreator::createGrid< value_type >(
m_gridCfg, gridOpts,
logger());
273 Acts::CylindricalSpacePointGridCreator::fillGrid(
m_finderCfg, finderOpts, grid,
274 spBegin, spEnd,
logger());
280 float maxRange = std::numeric_limits<float>::lowest();
281 for (
const auto& coll : grid) {
285 const auto* firstEl = coll.front();
286 const auto* lastEl = coll.back();
287 minRange =
std::min(firstEl->radius(), minRange);
288 maxRange =
std::max(lastEl->radius(), maxRange);
291 Acts::CylindricalBinnedGroup< value_type > spacePointsGrouping(std::move(grid), *
m_bottomBinFinder,
295 const Acts::Range1D<float> rMiddleSPRange(std::floor(minRange/2)*2 +
m_finderCfg.deltaRMiddleMinSPRange,
296 std::floor(maxRange/2)*2 -
m_finderCfg.deltaRMiddleMaxSPRange);
299 typename decltype(
m_finder)::SeedingState state;
310 state.spacePointMutableData.resize(
std::distance(spBegin, spEnd));
312 for (
const auto& [bottom, middle,
top] : spacePointsGrouping) {
313 m_finder.createSeedsForGroup(finderOpts, state, spacePointsGrouping.grid(),
314 seeds, bottom, middle,
top, rMiddleSPRange);
321 auto selectionFunction = [&state] (
const seed_type& seed) ->
bool
323 float seed_quality = seed.seedQuality();
324 float bottom_quality = state.spacePointMutableData.quality(seed.sp()[0]->index());
325 float middle_quality = state.spacePointMutableData.quality(seed.sp()[1]->index());
326 float top_quality = state.spacePointMutableData.quality(seed.sp()[2]->index());
328 if (bottom_quality > seed_quality and
329 middle_quality > seed_quality and
330 top_quality > seed_quality) {
338 std::size_t acceptedSeeds = 0;
339 for (std::size_t
i(0);
i<seeds.size(); ++
i) {
340 const auto& seed = seeds[
i];
341 if (not selectionFunction(seed)) {
347 if (acceptedSeeds !=
i)
348 seeds[acceptedSeeds] = std::move(seeds[
i]);
353 seeds.erase(seeds.begin() + acceptedSeeds, seeds.end());
358 seedContainer.reserve(seeds.size());
359 for(
const auto& seed: seeds) {
363 return StatusCode::SUCCESS;
430 std::vector<float> convertedVec;
431 convertedVec.reserve(
vec.size());
432 for (
const auto&
val :
vec) {
433 convertedVec.push_back(
static_cast<float>(
val));
436 m_finderCfg.rRangeMiddleSP.push_back(std::move(convertedVec));
453 Acts::SeedFilterConfig filterCfg;
460 filterCfg.centralSeedConfirmationRange =
m_finderCfg.centralSeedConfirmationRange;
461 filterCfg.forwardSeedConfirmationRange =
m_finderCfg.forwardSeedConfirmationRange;
469 m_finderCfg.seedFilter = std::make_unique<Acts::SeedFilter< value_type > >(filterCfg.toInternalUnits(),
logger().cloneWithSuffix(
"Filter"));
492 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.
const SpacePointContainer & spacePoints() const noexcept
Acts::MutableSeedProxy2 push_back(Acts::MutableSeedProxy2 seed)
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