#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=nullptr) | |
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 31 of file HistoAxis.h.
npstat::HistoAxis::HistoAxis | ( | unsigned | nBins, |
double | min, | ||
double | max, | ||
const char * | label = nullptr |
||
) |
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_, edm::swap(), and mitigatedMETSequence_cff::U.
|
inlineprivate |
|
inline |
Return the coordinate of the given bin center
Definition at line 52 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 61 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 37 of file HistoAxis.cc.
References bw_, max_, min_, nBins_, mitigatedMETSequence_cff::U, and x.
Referenced by npstat::DualHistoAxis::binNumber(), overflowIndex(), and overflowIndexWeighted().
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 67 of file HistoAxis.cc.
References edmMakeDummyCfis::base, bw_, and min_.
|
inline |
Definition at line 46 of file HistoAxis.h.
References bw_.
Referenced by npstat::DualHistoAxis::binWidth().
|
inline |
Method related to "geners" I/O
Definition at line 117 of file HistoAxis.h.
Referenced by npstat::DualHistoAxis::write().
|
inlinestatic |
Definition at line 121 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 56 of file HistoAxis.cc.
References bw_, max_, min_, nBins_, mitigatedMETSequence_cff::U, and x.
Referenced by npstat::DualHistoAxis::closestValidBin().
|
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 94 of file HistoAxis.h.
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 26 of file HistoAxis.cc.
References npstat::closeWithinTolerance(), label_, max_, min_, and nBins_.
Referenced by npstat::DualHistoAxis::isClose().
|
inline |
Definition at line 48 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 76 of file HistoAxis.cc.
References bw_, max_, min_, and FastTimerService_cff::range.
|
inline |
Definition at line 47 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 55 of file HistoAxis.h.
Referenced by npstat::DualHistoAxis::leftBinEdge().
|
inline |
|
inline |
Definition at line 42 of file HistoAxis.h.
References max_.
Referenced by npstat::DualHistoAxis::max(), and read().
|
inline |
Examine axis properties
Definition at line 41 of file HistoAxis.h.
References min_.
Referenced by npstat::DualHistoAxis::min(), and read().
|
inline |
Definition at line 45 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 35 of file HistoAxis.cc.
bool npstat::HistoAxis::operator== | ( | const HistoAxis & | r | ) | const |
|
inlineprivate |
Definition at line 136 of file HistoAxis.h.
References newFWLiteAna::bin, binNumber(), bw_, max_, min_, nBins_, mitigatedMETSequence_cff::U, and x.
Referenced by npstat::DualHistoAxis::overflowIndex().
|
private |
Definition at line 87 of file HistoAxis.cc.
References newFWLiteAna::bin, binNumber(), bw_, max_, min_, nBins_, mitigatedMETSequence_cff::U, and x.
|
static |
Definition at line 121 of file HistoAxis.cc.
References HistoAxis(), recoMuon::in, label(), max(), min(), nBins(), and AlCaHLTBitMon_QueryRunRegistry::string.
Referenced by edmIntegrityCheck.PublishToFileSystem::get(), and npstat::DualHistoAxis::read().
HistoAxis npstat::HistoAxis::rebin | ( | unsigned | newBins | ) | const |
Return rebinned axis
Definition at line 24 of file HistoAxis.cc.
References HistoAxis(), label_, max_, min_, and LaserClient_cfi::nbins.
|
inline |
Return the coordinate of the given bin right edge
Definition at line 58 of file HistoAxis.h.
Referenced by npstat::DualHistoAxis::rightBinEdge().
|
inline |
Change the axis label
Definition at line 66 of file HistoAxis.h.
References label_.
Referenced by npstat::DualHistoAxis::setLabel().
|
inlinestatic |
Definition at line 122 of file HistoAxis.h.
Referenced by validation.Sample::datasetpattern(), and validation.Sample::filename().
bool npstat::HistoAxis::write | ( | std::ostream & | of | ) | const |
Definition at line 113 of file HistoAxis.cc.
References label_, max_, min_, nBins_, and haddnano::of.
Referenced by npstat::DualHistoAxis::write().
|
friend |
Definition at line 134 of file HistoAxis.h.
|
friend |
Definition at line 133 of file HistoAxis.h.
|
private |
Definition at line 128 of file HistoAxis.h.
Referenced by binCenter(), binInterval(), binNumber(), binNumberMapper(), binWidth(), closestValidBin(), fltBinNumber(), HistoAxis(), kernelScanMapper(), leftBinEdge(), overflowIndex(), overflowIndexWeighted(), and rightBinEdge().
|
private |
Definition at line 129 of file HistoAxis.h.
Referenced by Modules.SwitchProducer::__addParameter(), SequenceTypes.DummyModule::__repr__(), Modules.SwitchProducer::__setattr__(), Mixins._Labelable::_findDependencies(), isClose(), label(), operator==(), rebin(), setLabel(), Mixins._Labelable::setLabel(), and write().
|
private |
Definition at line 127 of file HistoAxis.h.
Referenced by binNumber(), closestValidBin(), HistoAxis(), interval(), isClose(), kernelScanMapper(), length(), max(), operator==(), overflowIndex(), overflowIndexWeighted(), rebin(), and write().
|
private |
Definition at line 126 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 130 of file HistoAxis.h.
Referenced by binNumber(), closestValidBin(), HistoAxis(), isClose(), nBins(), operator==(), overflowIndex(), overflowIndexWeighted(), and write().