#include <HistoAxis.h>
Public Member Functions | |
double | binCenter (const int binNum) const |
Interval< double > | binInterval (const int binNum) const |
int | binNumber (double x) const |
LinearMapper1d | binNumberMapper (bool mapLeftEdgeTo0=true) const |
unsigned | closestValidBin (double x) const |
double | fltBinNumber (const double x, const bool mapLeftEdgeTo0=true) const |
HistoAxis (unsigned nBins, double min, double max, const char *label=0) | |
bool | isClose (const HistoAxis &, double tol) const |
CircularMapper1d | kernelScanMapper (bool doubleRange) const |
double | leftBinEdge (const int binNum) const |
bool | operator!= (const HistoAxis &) const |
bool | operator== (const HistoAxis &) const |
HistoAxis | rebin (unsigned newBins) const |
double | rightBinEdge (const int binNum) const |
void | setLabel (const char *newlabel) |
double | min () const |
double | max () const |
Interval< double > | interval () const |
double | length () const |
unsigned | nBins () const |
double | binWidth (const int=0) const |
const std::string & | label () const |
bool | isUniform () const |
gs::ClassId | classId () const |
bool | write (std::ostream &of) const |
Static Public Member Functions | |
static const char * | classname () |
static HistoAxis * | read (const gs::ClassId &id, std::istream &in) |
static unsigned | version () |
Private Member Functions | |
HistoAxis () | |
unsigned | overflowIndex (const double x, unsigned *binNumber) const |
unsigned | overflowIndexWeighted (double x, unsigned *binNumber, double *weight) const |
Private Attributes | |
double | bw_ |
std::string | label_ |
double | max_ |
double | min_ |
unsigned | nBins_ |
Friends | |
class | DualHistoAxis |
template<typename Numeric , class Axis > | |
class | HistoND |
Class which contain the information needed to define a histogram axis. All bins will have the same width. See NUHistoAxis and DualHistoAxis classes for non-uniform binning.
Definition at line 30 of file HistoAxis.h.
npstat::HistoAxis::HistoAxis | ( | unsigned | nBins, |
double | min, | ||
double | max, | ||
const char * | label = 0 |
||
) |
Minimum and maximum will be internally swapped if the minimum parameter is larger than the maximum
Definition at line 13 of file HistoAxis.cc.
References bw_, max_, min_, nBins_, std::swap(), and mitigatedMETSequence_cff::U.
|
inlineprivate |
|
inline |
Return the coordinate of the given bin center
Definition at line 54 of file HistoAxis.h.
Referenced by npstat::DualHistoAxis::binCenter(), and npstat::convertToGridAxis().
|
inline |
Return the coordinate interval occupied by the given bin
Definition at line 66 of file HistoAxis.h.
Referenced by npstat::DualHistoAxis::binInterval().
int npstat::HistoAxis::binNumber | ( | double | x | ) | const |
This method returns arbitrary integer bin number, including negative numbers and numbers which can exceed nBins()-1
Definition at line 51 of file HistoAxis.cc.
References bw_, max_, min_, nBins_, and mitigatedMETSequence_cff::U.
Referenced by npstat::DualHistoAxis::binNumber(), overflowIndexWeighted(), and setLabel().
LinearMapper1d npstat::HistoAxis::binNumberMapper | ( | bool | mapLeftEdgeTo0 = true | ) | const |
Return the mapper which calculates floating point bin number given the coordinate. The resulting bin number can go above and below the axis range. If "mapLeftEdgeTo0" is specified as "false", it is the center of the first bin which gets mapped to 0.
Definition at line 90 of file HistoAxis.cc.
References runEdmFileComparison::base, bw_, and min_.
Referenced by setLabel().
|
inline |
Definition at line 48 of file HistoAxis.h.
References bw_.
Referenced by npstat::DualHistoAxis::binWidth().
|
inline |
Method related to "geners" I/O
Definition at line 122 of file HistoAxis.h.
References write().
Referenced by npstat::DualHistoAxis::write().
|
inlinestatic |
Definition at line 126 of file HistoAxis.h.
unsigned npstat::HistoAxis::closestValidBin | ( | double | x | ) | const |
This method returns the closest valid bin number (above 0 and below nBins() )
Definition at line 77 of file HistoAxis.cc.
References bw_, max_, min_, nBins_, and mitigatedMETSequence_cff::U.
Referenced by npstat::DualHistoAxis::closestValidBin(), and setLabel().
|
inline |
Floating point bin number given the coordinate (no bin number truncation of any kind is performed). Works in exactly the same way as the mapper returned by the previous method.
Definition at line 99 of file HistoAxis.h.
References bw_, isClose(), kernelScanMapper(), min_, operator!=(), operator==(), and rebin().
Referenced by npstat::DualHistoAxis::fltBinNumber().
|
inline |
bool npstat::HistoAxis::isClose | ( | const HistoAxis & | r, |
double | tol | ||
) | const |
Comparison of axis coordinates within given tolerance
Definition at line 30 of file HistoAxis.cc.
References npstat::closeWithinTolerance(), label_, max_, min_, and nBins_.
Referenced by fltBinNumber(), and npstat::DualHistoAxis::isClose().
|
inline |
Definition at line 50 of file HistoAxis.h.
CircularMapper1d npstat::HistoAxis::kernelScanMapper | ( | bool | doubleRange | ) | const |
The following function returns a mapper that can be helpful in scanning a kernel (a density function) for subsequent convolution with the histogram which contains this axis.
Definition at line 99 of file HistoAxis.cc.
References bw_, max_, and min_.
Referenced by fltBinNumber().
|
inline |
Definition at line 49 of file HistoAxis.h.
References label_.
Referenced by npstat::convertToGridAxis(), npstat::DualHistoAxis::label(), and read().
|
inline |
Return the coordinate of the given bin left edge
Definition at line 58 of file HistoAxis.h.
Referenced by npstat::DualHistoAxis::leftBinEdge().
|
inline |
|
inline |
Definition at line 43 of file HistoAxis.h.
References max_.
Referenced by npstat::DualHistoAxis::max(), and read().
|
inline |
Examine axis properties
Definition at line 42 of file HistoAxis.h.
References min_.
Referenced by npstat::DualHistoAxis::min(), and read().
|
inline |
Definition at line 47 of file HistoAxis.h.
References nBins_.
Referenced by npstat::convertToGridAxis(), npstat::DualHistoAxis::nBins(), and read().
bool npstat::HistoAxis::operator!= | ( | const HistoAxis & | r | ) | const |
Definition at line 46 of file HistoAxis.cc.
References alignCSCRings::r.
Referenced by fltBinNumber().
bool npstat::HistoAxis::operator== | ( | const HistoAxis & | r | ) | const |
Definition at line 38 of file HistoAxis.cc.
References label_, max_, min_, and nBins_.
Referenced by fltBinNumber().
|
inlineprivate |
Definition at line 140 of file HistoAxis.h.
References stringResolutionProvider_cfi::bin, min_, overflowIndexWeighted(), and mitigatedMETSequence_cff::U.
Referenced by npstat::DualHistoAxis::overflowIndex().
|
private |
Definition at line 110 of file HistoAxis.cc.
References stringResolutionProvider_cfi::bin, binNumber(), bw_, max_, min_, nBins_, and mitigatedMETSequence_cff::U.
Referenced by overflowIndex().
|
static |
Definition at line 152 of file HistoAxis.cc.
References HistoAxis(), label(), max(), min(), nBins(), and AlCaHLTBitMon_QueryRunRegistry::string.
Referenced by edmIntegrityCheck.PublishToFileSystem::get(), npstat::DualHistoAxis::read(), and version().
HistoAxis npstat::HistoAxis::rebin | ( | unsigned | newBins | ) | const |
Return rebinned axis
Definition at line 25 of file HistoAxis.cc.
References HistoAxis(), label_, max_, and min_.
Referenced by fltBinNumber().
|
inline |
Return the coordinate of the given bin right edge
Definition at line 62 of file HistoAxis.h.
Referenced by npstat::DualHistoAxis::rightBinEdge().
|
inline |
Change the axis label
Definition at line 70 of file HistoAxis.h.
References binNumber(), binNumberMapper(), closestValidBin(), label_, and x().
Referenced by npstat::DualHistoAxis::setLabel().
|
inlinestatic |
Definition at line 127 of file HistoAxis.h.
References recoMuon::in, and read().
Referenced by validation.Sample::datasetpattern(), and validation.Sample::filename().
bool npstat::HistoAxis::write | ( | std::ostream & | of | ) | const |
Definition at line 143 of file HistoAxis.cc.
References label_, max_, min_, and nBins_.
Referenced by classId(), and npstat::DualHistoAxis::write().
|
friend |
Definition at line 138 of file HistoAxis.h.
|
friend |
Definition at line 137 of file HistoAxis.h.
|
private |
Definition at line 133 of file HistoAxis.h.
Referenced by binCenter(), binInterval(), binNumber(), binNumberMapper(), binWidth(), closestValidBin(), fltBinNumber(), HistoAxis(), kernelScanMapper(), leftBinEdge(), overflowIndexWeighted(), and rightBinEdge().
|
private |
Definition at line 134 of file HistoAxis.h.
Referenced by SequenceTypes.DummyModule::__repr__(), Mixins._Labelable::_findDependencies(), isClose(), label(), operator==(), rebin(), setLabel(), Mixins._Labelable::setLabel(), and write().
|
private |
Definition at line 132 of file HistoAxis.h.
Referenced by binNumber(), closestValidBin(), HistoAxis(), interval(), isClose(), kernelScanMapper(), length(), max(), operator==(), overflowIndexWeighted(), rebin(), and write().
|
private |
Definition at line 131 of file HistoAxis.h.
Referenced by binCenter(), binInterval(), binNumber(), binNumberMapper(), closestValidBin(), fltBinNumber(), HistoAxis(), interval(), isClose(), kernelScanMapper(), leftBinEdge(), length(), min(), operator==(), overflowIndex(), overflowIndexWeighted(), rebin(), rightBinEdge(), and write().
|
private |
Definition at line 135 of file HistoAxis.h.
Referenced by binNumber(), closestValidBin(), HistoAxis(), isClose(), nBins(), operator==(), overflowIndexWeighted(), and write().