#include <LWBinUtils.h>
|
static unsigned | valueToBin (const double &x, const float *varBinnings, const double &invDelta, const double &xmin, const double &xmax, unsigned nbinsplus1) |
|
static double | getBinCenter (int bin, const float *varBinnings, const double &invDelta, const double &xmin, unsigned nbinsplus1) |
|
static unsigned | internal_bin (unsigned binx, unsigned biny, unsigned nbinsxPlus2) |
|
static void | unpack_internal_bin (unsigned internalbin, unsigned &binx, unsigned &biny, unsigned nbinsxPlus2) |
|
Definition at line 30 of file LWBinUtils.h.
◆ LWBinUtils()
LWBinUtils::LWBinUtils |
( |
| ) |
|
|
private |
◆ ~LWBinUtils()
LWBinUtils::~LWBinUtils |
( |
| ) |
|
|
private |
◆ getBinCenter()
double LWBinUtils::getBinCenter |
( |
int |
bin, |
|
|
const float * |
varBinnings, |
|
|
const double & |
invDelta, |
|
|
const double & |
xmin, |
|
|
unsigned |
nbinsplus1 |
|
) |
| |
|
inlinestatic |
Definition at line 85 of file LWBinUtils.h.
90 return xmin + (
bin-0.5)/invDelta;
92 return 0.5*(varBinnings[
bin-1] + varBinnings[
bin]);
◆ internal_bin()
unsigned LWBinUtils::internal_bin |
( |
unsigned |
binx, |
|
|
unsigned |
biny, |
|
|
unsigned |
nbinsxPlus2 |
|
) |
| |
|
inlinestatic |
Definition at line 95 of file LWBinUtils.h.
100 assert(binx<nbinsxPlus2);
101 return biny * (nbinsxPlus2) + binx;
◆ unpack_internal_bin()
void LWBinUtils::unpack_internal_bin |
( |
unsigned |
internalbin, |
|
|
unsigned & |
binx, |
|
|
unsigned & |
biny, |
|
|
unsigned |
nbinsxPlus2 |
|
) |
| |
|
inlinestatic |
Definition at line 104 of file LWBinUtils.h.
109 binx = internalbin % nbinsxPlus2;
110 biny = (internalbin-binx) / nbinsxPlus2;
111 assert(
internal_bin(binx,biny,nbinsxPlus2)==internalbin);
◆ valueToBin()
unsigned LWBinUtils::valueToBin |
( |
const double & |
x, |
|
|
const float * |
varBinnings, |
|
|
const double & |
invDelta, |
|
|
const double & |
xmin, |
|
|
const double & |
xmax, |
|
|
unsigned |
nbinsplus1 |
|
) |
| |
|
inlinestatic |
Definition at line 60 of file LWBinUtils.h.
63 #ifdef LW_STRICT_ROOT_BEHAVIOUR
70 std::cout<<
"LWHisto ERROR: Saw NaN in input axis position"<<std::endl;
◆ valueToVarBin()
unsigned LWBinUtils::valueToVarBin |
( |
const double & |
x, |
|
|
const float * |
varBinnings, |
|
|
unsigned |
nbinsplus1 |
|
) |
| |
|
staticprivate |
Definition at line 19 of file LWBinUtils.cxx.
26 assert(nbinsplus1>=2);
29 if (
x>varBinnings[nbinsplus1-1])
31 const unsigned result = std::upper_bound(varBinnings,&(varBinnings[nbinsplus1]),
x)-varBinnings;
32 assert(
result<=nbinsplus1);
The documentation for this class was generated from the following files: