#include <CAxis.h> class CAxis { public: CAxis (UInt_t nChannels, std::string sUnits = std::string("")); CAxis (Float_t fLow, Float_t fHigh, UInt_t nChannels, std::string sUnits = std::string("")); public: // Selectors for member data. float getLow() const; float getHigh() const; int getChannels() const; Float_t ParameterToAxis (Float_t fParameter); Float_t AxisToParameter (UInt_t nAxisValue) ; };
CAxis
incorporates an axis description
as well as a set of methods to do transforms from parameter
space to bin space on an axis and back. A parameter is defined
as an interval in parameter coordinates that is divided up into
a number of equal-sized bins.
CAxis(UInt_t nChannels, std::string sUnits = std::string(""));
Initializes an axis for a simple integer parameter.
The axis is a 1:1 mapping over the range:
[0, nChannels
)
The optional sUnits
parameter
provides the axis units of measure and defaults to an
empty string.
CAxis(Float_t fLow, Float_t fHigh, UInt_t nChannels, std::string sUnits = std::string(""));
Creates an axis for a floating point parameter.
The axis covers the range
[fLow
, fHigh
)
and has nChannels
bins.
The optional parameter sUnits
is the axis units of measure and defaults to an
empty string if not supplied
const float getLow();
Return the axis low limit. The axis range is inclusive of this value.
const float getHigh();
Returns the axis high limit. The axis range is exclusive of this value.
const int getChannels();
Returns the number of bins on the axis. In SpecTcl, all bins are equal sized.
Float_t ParameterToAxis(Float_t fParameter);
Given a parameter value, converts it to an axis value (bins).
Float_t AxisToParameter(UInt_t nAxisValue);
Given an axis bin number converts the value to a parameter value.