#include <DualAxis.h>
Public Member Functions | |
double | coordinate (const unsigned i) const |
std::vector< double > | coords () const |
DualAxis (const UniformAxis &u) | |
DualAxis (const std::vector< double > &coords, const bool useLogSpace=false) | |
DualAxis (const std::vector< double > &coords, const char *label, const bool useLogSpace=false) | |
DualAxis (const GridAxis &g) | |
DualAxis (unsigned nCoords, double min, double max, const char *label=0) | |
std::pair< unsigned, double > | getInterval (const double x) const |
double | intervalWidth (const unsigned i=0) const |
bool | isUniform () const |
const std::string & | label () const |
double | length () const |
std::pair< unsigned, double > | linearInterval (const double x) const |
double | max () const |
double | min () const |
unsigned | nCoords () const |
unsigned | nIntervals () const |
bool | operator!= (const DualAxis &r) const |
bool | operator== (const DualAxis &r) const |
void | setLabel (const char *newlabel) |
bool | usesLogSpace () const |
const GridAxis * | getGridAxis () const |
const UniformAxis * | getUniformAxis () const |
gs::ClassId | classId () const |
bool | write (std::ostream &of) const |
Static Public Member Functions | |
static const char * | classname () |
static DualAxis * | read (const gs::ClassId &id, std::istream &in) |
static unsigned | version () |
Private Member Functions | |
DualAxis () | |
Static Private Member Functions | |
static std::vector< double > | dummy_vec () |
Private Attributes | |
GridAxis | a_ |
UniformAxis | u_ |
bool | uniform_ |
Rectangular grid axis which can be either uniform or non-uniform. Will work a little bit slower than either GridAxis or UniformAxis, but can be used in place of either one of them.
Definition at line 24 of file DualAxis.h.
npstat::DualAxis::DualAxis | ( | const GridAxis & | g | ) | [inline] |
npstat::DualAxis::DualAxis | ( | const UniformAxis & | u | ) | [inline] |
npstat::DualAxis::DualAxis | ( | unsigned | nCoords, |
double | min, | ||
double | max, | ||
const char * | label = 0 |
||
) | [inline] |
npstat::DualAxis::DualAxis | ( | const std::vector< double > & | coords, |
const bool | useLogSpace = false |
||
) | [inline] |
npstat::DualAxis::DualAxis | ( | const std::vector< double > & | coords, |
const char * | label, | ||
const bool | useLogSpace = false |
||
) | [inline] |
npstat::DualAxis::DualAxis | ( | ) | [inline, private] |
gs::ClassId npstat::DualAxis::classId | ( | ) | const [inline] |
Method related to "geners" I/O
Definition at line 110 of file DualAxis.h.
{return gs::ClassId(*this);}
static const char* npstat::DualAxis::classname | ( | ) | [inline, static] |
Definition at line 114 of file DualAxis.h.
{return "npstat::DualAxis";}
double npstat::DualAxis::coordinate | ( | const unsigned | i | ) | const [inline] |
Definition at line 70 of file DualAxis.h.
References a_, npstat::UniformAxis::coordinate(), npstat::GridAxis::coordinate(), u_, and uniform_.
std::vector<double> npstat::DualAxis::coords | ( | ) | const [inline] |
Definition at line 82 of file DualAxis.h.
References a_, npstat::GridAxis::coords(), npstat::UniformAxis::coords(), u_, and uniform_.
static std::vector<double> npstat::DualAxis::dummy_vec | ( | ) | [inline, static, private] |
Definition at line 126 of file DualAxis.h.
{
std::vector<double> vec(2, 0.0);
vec[1] = 1.0;
return vec;
}
const GridAxis* npstat::DualAxis::getGridAxis | ( | ) | const [inline] |
std::pair<unsigned,double> npstat::DualAxis::getInterval | ( | const double | x | ) | const [inline] |
Definition at line 64 of file DualAxis.h.
References a_, npstat::UniformAxis::getInterval(), npstat::GridAxis::getInterval(), u_, and uniform_.
const UniformAxis* npstat::DualAxis::getUniformAxis | ( | ) | const [inline] |
double npstat::DualAxis::intervalWidth | ( | const unsigned | i = 0 | ) | const [inline] |
Definition at line 79 of file DualAxis.h.
References a_, i, npstat::GridAxis::intervalWidth(), npstat::UniformAxis::intervalWidth(), u_, and uniform_.
bool npstat::DualAxis::isUniform | ( | ) | const [inline] |
const std::string& npstat::DualAxis::label | ( | ) | const [inline] |
Definition at line 58 of file DualAxis.h.
References a_, npstat::GridAxis::label(), npstat::UniformAxis::label(), u_, and uniform_.
double npstat::DualAxis::length | ( | ) | const [inline] |
Definition at line 73 of file DualAxis.h.
References a_, npstat::GridAxis::length(), npstat::UniformAxis::length(), u_, and uniform_.
std::pair<unsigned,double> npstat::DualAxis::linearInterval | ( | const double | x | ) | const [inline] |
Definition at line 67 of file DualAxis.h.
References a_, npstat::GridAxis::linearInterval(), npstat::UniformAxis::linearInterval(), u_, and uniform_.
double npstat::DualAxis::max | ( | ) | const [inline] |
Definition at line 55 of file DualAxis.h.
References a_, npstat::GridAxis::max(), npstat::UniformAxis::max(), u_, and uniform_.
double npstat::DualAxis::min | ( | ) | const [inline] |
Definition at line 52 of file DualAxis.h.
References a_, npstat::GridAxis::min(), npstat::UniformAxis::min(), u_, and uniform_.
unsigned npstat::DualAxis::nCoords | ( | ) | const [inline] |
Definition at line 49 of file DualAxis.h.
References a_, npstat::UniformAxis::nCoords(), npstat::GridAxis::nCoords(), u_, and uniform_.
unsigned npstat::DualAxis::nIntervals | ( | ) | const [inline] |
Definition at line 76 of file DualAxis.h.
References a_, npstat::GridAxis::nIntervals(), npstat::UniformAxis::nIntervals(), u_, and uniform_.
bool npstat::DualAxis::operator!= | ( | const DualAxis & | r | ) | const [inline] |
bool npstat::DualAxis::operator== | ( | const DualAxis & | r | ) | const [inline] |
DualAxis * npstat::DualAxis::read | ( | const gs::ClassId & | id, |
std::istream & | in | ||
) | [static] |
Definition at line 18 of file DualAxis.cc.
References trackerHits::c, cond::rpcobimon::current, DualAxis(), npstat::GridAxis::read(), and npstat::UniformAxis::read().
{ static const gs::ClassId current(gs::ClassId::makeId<DualAxis>()); current.ensureSameId(id); unsigned char c; gs::read_pod(in, &c); gs::ClassId clid(in, 1); if (in.fail()) throw gs::IOReadFailure("In npstat::DualAxis::read: " "input stream failure"); if (c) { CPP11_auto_ptr<UniformAxis> axis(UniformAxis::read(clid, in)); return new DualAxis(*axis); } else { CPP11_auto_ptr<GridAxis> axis(GridAxis::read(clid, in)); return new DualAxis(*axis); } }
void npstat::DualAxis::setLabel | ( | const char * | newlabel | ) | [inline] |
Modify the axis label
Definition at line 105 of file DualAxis.h.
References a_, npstat::GridAxis::setLabel(), npstat::UniformAxis::setLabel(), u_, and uniform_.
bool npstat::DualAxis::usesLogSpace | ( | ) | const [inline] |
Definition at line 61 of file DualAxis.h.
References a_, u_, uniform_, npstat::GridAxis::usesLogSpace(), and npstat::UniformAxis::usesLogSpace().
static unsigned npstat::DualAxis::version | ( | ) | [inline, static] |
Definition at line 115 of file DualAxis.h.
{return 1;}
bool npstat::DualAxis::write | ( | std::ostream & | of | ) | const |
Definition at line 8 of file DualAxis.cc.
References a_, trackerHits::c, npstat::UniformAxis::classId(), npstat::GridAxis::classId(), u_, uniform_, npstat::UniformAxis::write(), and npstat::GridAxis::write().
GridAxis npstat::DualAxis::a_ [private] |
Definition at line 122 of file DualAxis.h.
Referenced by coordinate(), coords(), getGridAxis(), getInterval(), intervalWidth(), label(), length(), linearInterval(), max(), min(), nCoords(), nIntervals(), operator==(), setLabel(), usesLogSpace(), and write().
UniformAxis npstat::DualAxis::u_ [private] |
Definition at line 123 of file DualAxis.h.
Referenced by coordinate(), coords(), getInterval(), getUniformAxis(), intervalWidth(), label(), length(), linearInterval(), max(), min(), nCoords(), nIntervals(), operator==(), setLabel(), usesLogSpace(), and write().
bool npstat::DualAxis::uniform_ [private] |
Definition at line 124 of file DualAxis.h.
Referenced by coordinate(), coords(), getGridAxis(), getInterval(), getUniformAxis(), intervalWidth(), isUniform(), label(), length(), linearInterval(), max(), min(), nCoords(), nIntervals(), operator==(), setLabel(), usesLogSpace(), and write().