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 327 of file FPGATrackSimHoughTransform_d0phi0_Tool.cxx.

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

◆ quant()

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

Definition at line 303 of file FPGATrackSimHoughTransform_d0phi0_Tool.cxx.

304{
305 return static_cast<int>((val - min) / (max - min) * nSteps);
306}
#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 315 of file FPGATrackSimHoughTransform_d0phi0_Tool.cxx.

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

◆ unquant()

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

Definition at line 309 of file FPGATrackSimHoughTransform_d0phi0_Tool.cxx.

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