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 417 of file FPGATrackSimHoughTransformTool.cxx.

418{
419 return static_cast<int>((val - min) / (max - min) * nSteps);
420}
#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 429 of file FPGATrackSimHoughTransformTool.cxx.

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

◆ unquant()

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

Definition at line 423 of file FPGATrackSimHoughTransformTool.cxx.

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