Skip to content

Commit

Permalink
use float instead of double
Browse files Browse the repository at this point in the history
  • Loading branch information
cvarni committed Oct 4, 2024
1 parent b1e09dc commit f695daf
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 16 deletions.
12 changes: 4 additions & 8 deletions Examples/Algorithms/TrackFinding/src/SeedingAlgorithm.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -253,8 +253,8 @@ ActsExamples::ProcessCode ActsExamples::SeedingAlgorithm::execute(
// Compute radius Range
// we rely on the fact the grid is storing the proxies
// with a sorting in the radius
double minRange = std::numeric_limits<double>::max();
double maxRange = std::numeric_limits<double>::lowest();
float minRange = std::numeric_limits<float>::max();
float maxRange = std::numeric_limits<float>::lowest();
for (const auto& coll : grid) {
if (coll.empty()) {
continue;
Expand All @@ -272,14 +272,10 @@ ActsExamples::ProcessCode ActsExamples::SeedingAlgorithm::execute(
std::move(grid), *m_bottomBinFinder, *m_topBinFinder,
std::move(navigation));

// safely clamp double to float
float up = Acts::clampValue<float>(std::floor(maxRange / 2) * 2);

/// variable middle SP radial region of interest
const Acts::Range1D<float> rMiddleSPRange(
std::floor(minRange / 2) * 2 +
m_cfg.seedFinderConfig.deltaRMiddleMinSPRange,
up - m_cfg.seedFinderConfig.deltaRMiddleMaxSPRange);
minRange + m_cfg.seedFinderConfig.deltaRMiddleMinSPRange,
maxRange - m_cfg.seedFinderConfig.deltaRMiddleMaxSPRange);

// run the seeding
static thread_local std::vector<seed_type> seeds;
Expand Down
12 changes: 4 additions & 8 deletions Examples/Algorithms/TrackFinding/src/SeedingAlgorithmHashing.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -279,8 +279,8 @@ ActsExamples::ProcessCode ActsExamples::SeedingAlgorithmHashing::execute(
// Compute radius Range
// we rely on the fact the grid is storing the proxies
// with a sorting in the radius
double minRange = std::numeric_limits<double>::max();
double maxRange = std::numeric_limits<double>::lowest();
float minRange = std::numeric_limits<float>::max();
float maxRange = std::numeric_limits<float>::lowest();
for (const auto& coll : grid) {
if (coll.empty()) {
continue;
Expand All @@ -299,14 +299,10 @@ ActsExamples::ProcessCode ActsExamples::SeedingAlgorithmHashing::execute(
std::move(grid), *m_bottomBinFinder, *m_topBinFinder,
std::move(navigation));

// safely clamp double to float
float up = Acts::clampValue<float>(std::floor(maxRange / 2) * 2);

/// variable middle SP radial region of interest
const Acts::Range1D<float> rMiddleSPRange(
std::floor(minRange / 2) * 2 +
m_cfg.seedFinderConfig.deltaRMiddleMinSPRange,
up - m_cfg.seedFinderConfig.deltaRMiddleMaxSPRange);
minRange + m_cfg.seedFinderConfig.deltaRMiddleMinSPRange,
maxRange - m_cfg.seedFinderConfig.deltaRMiddleMaxSPRange);

// this creates seeds of proxy, we need to convert it to seed of space
// points
Expand Down

0 comments on commit f695daf

Please sign in to comment.