ATLAS Offline Software
Loading...
Searching...
No Matches
FPGATrackSimHoughTransform_d0phi0_Tool.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 (std::vector< T > v)
static std::string instance_name (std::string const &s)

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 FPGATrackSimHoughTransform_d0phi0_Tool.cxx.

Function Documentation

◆ instance_name()

std::string instance_name ( std::string const & s)
inlinestatic

Definition at line 326 of file FPGATrackSimHoughTransform_d0phi0_Tool.cxx.

327{
328 size_t pos = s.find_last_of('.');
329 if (pos != std::string::npos)
330 return s.substr(pos + 1);
331 return s;
332}

◆ quant()

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

Definition at line 302 of file FPGATrackSimHoughTransform_d0phi0_Tool.cxx.

303{
304 return static_cast<int>((val - min) / (max - min) * nSteps);
305}
#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 ( std::vector< T > v)
inlinestatic

Definition at line 314 of file FPGATrackSimHoughTransform_d0phi0_Tool.cxx.

315{
316 std::ostringstream oss;
317 oss << "[";
318 if (!v.empty()) {
319 std::copy(v.begin(), v.end()-1, std::ostream_iterator<T>(oss, ", "));
320 oss << v.back();
321 }
322 oss << "]";
323 return oss.str();
324}

◆ unquant()

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

Definition at line 308 of file FPGATrackSimHoughTransform_d0phi0_Tool.cxx.

309{
310 return min + (max - min) * step / nSteps;
311}