// RooLinTransBinning is a special binning implementation for RooLinearVar
// that transforms the binning of the RooLinearVar input variable in the same
// way that RooLinearVar does
// END_HTML
#include "RooFit.h"
#include "RooLinTransBinning.h"
#include "RooLinTransBinning.h"
ClassImp(RooLinTransBinning)
;
RooLinTransBinning::RooLinTransBinning(const RooAbsBinning& input, Double_t slope, Double_t offset, const char* name) :
RooAbsBinning(name),
_array(0)
{
updateInput(input,slope,offset) ;
}
RooLinTransBinning::RooLinTransBinning(const RooLinTransBinning& other, const char* name) :
RooAbsBinning(name),
_array(0)
{
_input = other._input ;
_slope = other._slope ;
_offset = other._offset ;
}
RooLinTransBinning::~RooLinTransBinning()
{
if (_array) delete[] _array ;
}
void RooLinTransBinning::setRange(Double_t , Double_t )
{
}
Double_t* RooLinTransBinning::array() const
{
Int_t n = numBoundaries() ;
if (_array) delete[] _array ;
_array = new Double_t[n] ;
Double_t* inputArray = _input->array() ;
Int_t i ;
if (_slope>0) {
for (i=0 ; i<n ; i++) {
_array[i] = trans(inputArray[i]) ;
}
} else {
for (i=0 ; i<n ; i++) {
_array[i] = trans(inputArray[n-i-1]) ;
}
}
return _array ;
}
void RooLinTransBinning::updateInput(const RooAbsBinning& input, Double_t slope, Double_t offset)
{
_input = (RooAbsBinning*) &input ;
_slope = slope ;
_offset = offset ;
}
Last change: Wed Jun 25 08:33:17 2008
Last generated: 2008-06-25 08:33
This page has been automatically generated. If you have any comments or suggestions about the page layout send a mail to ROOT support, or contact the developers with any questions or problems regarding ROOT.