ATLAS Offline Software
Loading...
Searching...
No Matches
FPGATrackSimHoughTransformTool.cxx File Reference

See header file. More...

Go to the source code of this file.

Functions

static int quant (double min, double max, unsigned nSteps, double val)
static double unquant (double min, double max, unsigned nSteps, int step)
template<typename T>
static std::string to_string (const std::vector< T > &v)

Detailed Description

See header file.

Author
Riley Xu - riley.nosp@m..xu@.nosp@m.cern..nosp@m.ch
Date
October 31st, 2020

Definition in file FPGATrackSimHoughTransformTool.cxx.

Function Documentation

◆ quant()

int quant ( double min,
double max,
unsigned nSteps,
double val )
inlinestatic

Definition at line 418 of file FPGATrackSimHoughTransformTool.cxx.

419{
420 return static_cast<int>((val - min) / (max - min) * nSteps);
421}
#define min(a, b)
Definition cfImp.cxx:40
#define max(a, b)
Definition cfImp.cxx:41

◆ to_string()

template<typename T>
std::string to_string ( const std::vector< T > & v)
inlinestatic

Definition at line 430 of file FPGATrackSimHoughTransformTool.cxx.

431{
432 std::ostringstream oss;
433 oss << "[";
434 if (!v.empty())
435 {
436 std::copy(v.begin(), v.end()-1, std::ostream_iterator<T>(oss, ", "));
437 oss << v.back();
438 }
439 oss << "]";
440 return oss.str();
441}

◆ unquant()

double unquant ( double min,
double max,
unsigned nSteps,
int step )
inlinestatic

Definition at line 424 of file FPGATrackSimHoughTransformTool.cxx.

425{
426 return min + (max - min) * step / nSteps;
427}