#include <GridAxis.h>
Public Member Functions | |
std::pair< unsigned, double > | getInterval (double coordinate) const |
bool | isClose (const GridAxis &r, double tol) const |
std::pair< unsigned, double > | linearInterval (double coordinate) const |
bool | operator!= (const GridAxis &r) const |
bool | operator== (const GridAxis &r) const |
void | setLabel (const char *newlabel) |
GridAxis (const std::vector< double > &coords, bool useLogSpace=false) | |
GridAxis (const std::vector< double > &coords, const char *label, bool useLogSpace=false) | |
const std::vector< double > & | coords () const |
const std::string & | label () const |
bool | usesLogSpace () const |
unsigned | nCoords () const |
double | coordinate (const unsigned i) const |
double | min () const |
double | max () const |
double | length () const |
bool | isUniform () const |
unsigned | nIntervals () const |
double | intervalWidth (const unsigned i=0) const |
gs::ClassId | classId () const |
bool | write (std::ostream &of) const |
Static Public Member Functions | |
static const char * | classname () |
static GridAxis * | read (const gs::ClassId &id, std::istream &in) |
static unsigned | version () |
Private Member Functions | |
GridAxis () | |
void | initialize () |
Private Attributes | |
std::vector< double > | coords_ |
std::string | label_ |
std::vector< double > | logs_ |
unsigned | npt_ |
bool | useLogSpace_ |
Information needed to define an axis of a rectangular grid. The distance between grid points can change from point to point.
The UniformAxis class will be more efficient in representing equidistant grids.
Definition at line 30 of file GridAxis.h.
|
explicit |
The number of grid coordinates provided must be at least 2. Coordinates will be sorted internally in the increasing order.
Definition at line 38 of file GridAxis.cc.
References initialize().
npstat::GridAxis::GridAxis | ( | const std::vector< double > & | coords, |
const char * | label, | ||
bool | useLogSpace = false |
||
) |
|
inlineprivate |
|
inline |
Method related to "geners" I/O
Definition at line 108 of file GridAxis.h.
Referenced by npstat::DualAxis::write().
|
inlinestatic |
Definition at line 112 of file GridAxis.h.
|
inline |
Definition at line 82 of file GridAxis.h.
References coords_, and mps_fire::i.
Referenced by npstat::convertToHistoAxis(), and npstat::DualAxis::coordinate().
|
inline |
Basic accessor returning a parameter provided in the constructor
Definition at line 43 of file GridAxis.h.
References coords_.
Referenced by npstat::DualAxis::coords(), and read().
std::pair< unsigned, double > npstat::GridAxis::getInterval | ( | double | coordinate | ) | const |
This method returns the grid interval number and the weight of the point at the left side of the interval. The weight will be set to 1 if the given coordinate coincides with the grid point and will decay to 0 linearly as the coordinate moves towards the next point on the right.
The coordinates below the leftmost grid point are mapped into the 0th interval with weight 1. The coordinates above the rightmost grid point are mapped into the last interval with weight 0 for the left point (it is expected that weight 1 will then be assigned to the right point).
Definition at line 48 of file GridAxis.cc.
References HltBtagPostValidation_cff::c, coords_, MainPageGenerator::l, dqm-mbProfile::log, logs_, pfDeepBoostedJetPreprocessParams_cfi::lower_bound, npt_, mitigatedMETSequence_cff::U, useLogSpace_, w(), and x.
Referenced by npstat::DualAxis::getInterval().
|
private |
Definition at line 12 of file GridAxis.cc.
References HltBtagPostValidation_cff::c, coords_, mps_fire::i, dqm-mbProfile::log, logs_, npt_, jetUpdater_cfi::sort, mitigatedMETSequence_cff::U, and useLogSpace_.
Referenced by GridAxis().
|
inline |
Definition at line 88 of file GridAxis.h.
References coords_, and mps_fire::i.
Referenced by npstat::DualAxis::intervalWidth().
bool npstat::GridAxis::isClose | ( | const GridAxis & | r, |
double | tol | ||
) | const |
Check for closeness of coordinates with another axis within the given relative tolerance
Definition at line 141 of file GridAxis.cc.
References npstat::closeWithinTolerance(), coords_, mps_fire::i, label_, dqmiodumpmetadata::n, and useLogSpace_.
|
inline |
Definition at line 86 of file GridAxis.h.
|
inline |
Definition at line 44 of file GridAxis.h.
References label_.
Referenced by npstat::convertToHistoAxis(), npstat::DualAxis::label(), and read().
|
inline |
Definition at line 85 of file GridAxis.h.
References coords_.
Referenced by npstat::DualAxis::length().
std::pair< unsigned, double > npstat::GridAxis::linearInterval | ( | double | coordinate | ) | const |
This method returns the grid interval number and the weight of the point at the left side of the interval. The weight will be set to 1 if the given coordinate coincides with the grid point and will decay to 0 linearly as the coordinate moves towards the next point on the right. The weight for the point on the right should be set to one minus the weight on the left.
The coordinates outside of grid boundaries will result in weights which are less than zero or more than one. They will be calculated by linear extrapolation from the closest interval in the grid (i.e., leftmost or rightmost).
Definition at line 71 of file GridAxis.cc.
References HltBtagPostValidation_cff::c, coords_, MainPageGenerator::l, dqm-mbProfile::log, logs_, pfDeepBoostedJetPreprocessParams_cfi::lower_bound, npt_, mitigatedMETSequence_cff::U, useLogSpace_, w(), and x.
Referenced by npstat::DualAxis::linearInterval().
|
inline |
Definition at line 84 of file GridAxis.h.
References coords_.
Referenced by npstat::DualAxis::max().
|
inline |
Definition at line 83 of file GridAxis.h.
References coords_.
Referenced by npstat::DualAxis::min().
|
inline |
Convenience accessor
Definition at line 81 of file GridAxis.h.
References npt_.
Referenced by npstat::convertToHistoAxis(), and npstat::DualAxis::nCoords().
|
inline |
Definition at line 87 of file GridAxis.h.
References coords_.
Referenced by npstat::DualAxis::nIntervals().
|
inline |
bool npstat::GridAxis::operator== | ( | const GridAxis & | r | ) | const |
Compare two grids for equality
Definition at line 137 of file GridAxis.cc.
References coords_, label_, and useLogSpace_.
|
static |
Definition at line 117 of file GridAxis.cc.
References coords(), GridAxis(), recoMuon::in, label(), and AlCaHLTBitMon_QueryRunRegistry::string.
Referenced by edmIntegrityCheck.PublishToFileSystem::get(), and npstat::DualAxis::read().
|
inline |
Modify the axis label
Definition at line 104 of file GridAxis.h.
References label_.
Referenced by npstat::DualAxis::setLabel().
|
inline |
Definition at line 45 of file GridAxis.h.
References useLogSpace_.
Referenced by npstat::DualAxis::usesLogSpace().
|
inlinestatic |
Definition at line 113 of file GridAxis.h.
Referenced by validation.Sample::datasetpattern(), and validation.Sample::filename().
bool npstat::GridAxis::write | ( | std::ostream & | of | ) | const |
Definition at line 108 of file GridAxis.cc.
References coords_, label_, haddnano::of, and useLogSpace_.
Referenced by npstat::DualAxis::write().
|
private |
Definition at line 119 of file GridAxis.h.
Referenced by coordinate(), coords(), getInterval(), initialize(), intervalWidth(), isClose(), length(), linearInterval(), max(), min(), nIntervals(), operator==(), and write().
|
private |
Definition at line 121 of file GridAxis.h.
Referenced by Modules.SwitchProducer::__addParameter(), SequenceTypes.DummyModule::__repr__(), Modules.SwitchProducer::__setattr__(), Mixins._Labelable::_findDependencies(), isClose(), label(), operator==(), setLabel(), Mixins._Labelable::setLabel(), and write().
|
private |
Definition at line 120 of file GridAxis.h.
Referenced by getInterval(), initialize(), and linearInterval().
|
private |
Definition at line 122 of file GridAxis.h.
Referenced by getInterval(), initialize(), linearInterval(), and nCoords().
|
private |
Definition at line 123 of file GridAxis.h.
Referenced by getInterval(), initialize(), isClose(), linearInterval(), operator==(), usesLogSpace(), and write().