#include <NUHistoAxis.h>
Public Member Functions | |
double | binCenter (const int binNum) const |
Interval< double > | binInterval (const int binNum) const |
int | binNumber (double x) const |
double | binWidth (const int binNum) const |
gs::ClassId | classId () const |
unsigned | closestValidBin (double x) const |
double | fltBinNumber (double x, bool mapLeftEdgeTo0=true) const |
Interval< double > | interval () const |
bool | isClose (const NUHistoAxis &, double tol) const |
bool | isUniform () const |
const std::string & | label () const |
double | leftBinEdge (const int binNum) const |
double | length () const |
double | max () const |
double | min () const |
unsigned | nBins () const |
NUHistoAxis (const std::vector< double > &binEdges, const char *label=nullptr) | |
bool | operator!= (const NUHistoAxis &) const |
bool | operator== (const NUHistoAxis &) const |
NUHistoAxis | rebin (unsigned newBins) const |
double | rightBinEdge (const int binNum) const |
void | setLabel (const char *newlabel) |
bool | write (std::ostream &of) const |
Static Public Member Functions | |
static const char * | classname () |
static NUHistoAxis * | read (const gs::ClassId &id, std::istream &in) |
static unsigned | version () |
Private Member Functions | |
NUHistoAxis () | |
NUHistoAxis (unsigned nBins, double min, double max, const char *label=nullptr) | |
unsigned | overflowIndex (const double x, unsigned *binNum) const |
Private Attributes | |
std::vector< double > | binEdges_ |
std::string | label_ |
double | max_ |
double | min_ |
unsigned | nBins_ |
bool | uniform_ |
Friends | |
class | DualHistoAxis |
template<typename Numeric , class Axis > | |
class | HistoND |
This class can be used to create histograms with non-uniform binning
Definition at line 28 of file NUHistoAxis.h.
npstat::NUHistoAxis::NUHistoAxis | ( | const std::vector< double > & | binEdges, |
const char * | label = nullptr |
||
) |
The number of bin edges provided must be at least 2. Edge coordinates will be sorted internally in the increasing order. The number of bins will be less by 1 than the number of edges.
Definition at line 15 of file NUHistoAxis.cc.
References binEdges_, label(), label_, max_, min_, nBins_, jetUpdater_cfi::sort, AlCaHLTBitMon_QueryRunRegistry::string, and mitigatedMETSequence_cff::U.
|
private |
Definition at line 28 of file NUHistoAxis.cc.
References binEdges_, label(), label_, max_, min_, nBins(), nBins_, AlCaHLTBitMon_QueryRunRegistry::string, std::swap(), and mitigatedMETSequence_cff::U.
|
inlineprivate |
|
inline |
Return the coordinate of the given bin center
Definition at line 56 of file NUHistoAxis.h.
References binEdges_.
Referenced by npstat::DualHistoAxis::binCenter(), and npstat::convertToGridAxis().
|
inline |
Return the coordinate interval occupied by the given bin
Definition at line 59 of file NUHistoAxis.h.
References binEdges_.
Referenced by npstat::DualHistoAxis::binInterval().
int npstat::NUHistoAxis::binNumber | ( | double | x | ) | const |
This method returns -1 for values below the lower limit and "nBins()" for values equal to or above the upper limit
Definition at line 62 of file NUHistoAxis.cc.
References binEdges_, dumpMFGeometry_cfg::delta, and pfDeepBoostedJetPreprocessParams_cfi::upper_bound.
Referenced by npstat::DualHistoAxis::binNumber(), and overflowIndex().
|
inline |
Definition at line 44 of file NUHistoAxis.h.
References binEdges_.
Referenced by npstat::DualHistoAxis::binWidth().
|
inline |
Method related to "geners" I/O
Definition at line 95 of file NUHistoAxis.h.
Referenced by npstat::DualHistoAxis::write().
|
inlinestatic |
Definition at line 99 of file NUHistoAxis.h.
unsigned npstat::NUHistoAxis::closestValidBin | ( | double | x | ) | const |
This method returns the closest valid bin number (above 0 and below nBins() )
Definition at line 124 of file NUHistoAxis.cc.
References binEdges_, dumpMFGeometry_cfg::delta, nBins_, mitigatedMETSequence_cff::U, and pfDeepBoostedJetPreprocessParams_cfi::upper_bound.
Referenced by npstat::DualHistoAxis::closestValidBin().
double npstat::NUHistoAxis::fltBinNumber | ( | double | x, |
bool | mapLeftEdgeTo0 = true |
||
) | const |
Floating point bin number given the coordinate. Useful for interpolation methods and such.
Definition at line 67 of file NUHistoAxis.cc.
References binEdges_, dumpMFGeometry_cfg::delta, nBins_, mitigatedMETSequence_cff::U, and pfDeepBoostedJetPreprocessParams_cfi::upper_bound.
Referenced by npstat::DualHistoAxis::fltBinNumber().
|
inline |
Definition at line 41 of file NUHistoAxis.h.
Referenced by npstat::DualHistoAxis::interval().
bool npstat::NUHistoAxis::isClose | ( | const NUHistoAxis & | r, |
double | tol | ||
) | const |
Comparison of axis coordinates within given tolerance
Definition at line 45 of file NUHistoAxis.cc.
References binEdges_, npstat::closeWithinTolerance(), mps_fire::i, label_, max_, min_, nBins_, alignCSCRings::r, and uniform_.
Referenced by npstat::DualHistoAxis::isClose().
|
inline |
|
inline |
Definition at line 45 of file NUHistoAxis.h.
References label_.
Referenced by npstat::convertToGridAxis(), npstat::DualHistoAxis::label(), NUHistoAxis(), and read().
|
inline |
Return the coordinate of the given bin left edge
Definition at line 50 of file NUHistoAxis.h.
References binEdges_.
Referenced by npstat::DualHistoAxis::leftBinEdge().
|
inline |
Definition at line 42 of file NUHistoAxis.h.
Referenced by npstat::DualHistoAxis::length().
|
inline |
Definition at line 40 of file NUHistoAxis.h.
References max_.
Referenced by npstat::DualHistoAxis::max().
|
inline |
Examine axis properties
Definition at line 39 of file NUHistoAxis.h.
References min_.
Referenced by npstat::DualHistoAxis::min().
|
inline |
Definition at line 43 of file NUHistoAxis.h.
References nBins_.
Referenced by npstat::convertToGridAxis(), npstat::DualHistoAxis::nBins(), and NUHistoAxis().
bool npstat::NUHistoAxis::operator!= | ( | const NUHistoAxis & | r | ) | const |
bool npstat::NUHistoAxis::operator== | ( | const NUHistoAxis & | r | ) | const |
|
inlineprivate |
Definition at line 117 of file NUHistoAxis.h.
References binNumber(), max_, min_, mitigatedMETSequence_cff::U, and x.
Referenced by npstat::DualHistoAxis::overflowIndex().
|
static |
Definition at line 142 of file NUHistoAxis.cc.
References recoMuon::in, label(), NUHistoAxis(), mps_fire::result, and AlCaHLTBitMon_QueryRunRegistry::string.
Referenced by edmIntegrityCheck.PublishToFileSystem::get(), and npstat::DualHistoAxis::read().
NUHistoAxis npstat::NUHistoAxis::rebin | ( | unsigned | newBins | ) | const |
Return uniformly rebinned axis
Definition at line 41 of file NUHistoAxis.cc.
References label_, max_, min_, and NUHistoAxis().
|
inline |
Return the coordinate of the given bin right edge
Definition at line 53 of file NUHistoAxis.h.
References binEdges_.
Referenced by npstat::DualHistoAxis::rightBinEdge().
|
inline |
Change the axis label
Definition at line 64 of file NUHistoAxis.h.
References label_.
Referenced by npstat::DualHistoAxis::setLabel().
|
inlinestatic |
Definition at line 100 of file NUHistoAxis.h.
Referenced by validation.Sample::datasetpattern(), and validation.Sample::filename().
bool npstat::NUHistoAxis::write | ( | std::ostream & | of | ) | const |
Definition at line 134 of file NUHistoAxis.cc.
References binEdges_, c, label_, and uniform_.
Referenced by npstat::DualHistoAxis::write().
|
friend |
Definition at line 115 of file NUHistoAxis.h.
|
friend |
Definition at line 114 of file NUHistoAxis.h.
|
private |
Definition at line 108 of file NUHistoAxis.h.
Referenced by binCenter(), binInterval(), binNumber(), binWidth(), closestValidBin(), fltBinNumber(), isClose(), leftBinEdge(), NUHistoAxis(), operator==(), rightBinEdge(), and write().
|
private |
Definition at line 109 of file NUHistoAxis.h.
Referenced by SequenceTypes.DummyModule::__repr__(), Mixins._Labelable::_findDependencies(), isClose(), label(), NUHistoAxis(), operator==(), rebin(), setLabel(), Mixins._Labelable::setLabel(), and write().
|
private |
Definition at line 107 of file NUHistoAxis.h.
Referenced by interval(), isClose(), length(), max(), NUHistoAxis(), operator==(), overflowIndex(), and rebin().
|
private |
Definition at line 106 of file NUHistoAxis.h.
Referenced by interval(), isClose(), length(), min(), NUHistoAxis(), operator==(), overflowIndex(), and rebin().
|
private |
Definition at line 110 of file NUHistoAxis.h.
Referenced by closestValidBin(), fltBinNumber(), isClose(), nBins(), NUHistoAxis(), and operator==().
|
private |
Definition at line 111 of file NUHistoAxis.h.
Referenced by isClose(), isUniform(), operator==(), and write().