// Class RooPullVar represents the pull of measurement w.r.t to true value
// using the measurement value and its error. Both the true value and
// the measured value (with error) are taken from two user supplied
// RooRealVars. If an asymmetric error is defined on a given measurement the proper
// side of that asymmetric error will be used
// END_HTML
#include "RooFit.h"
#include "Riostream.h"
#include "Riostream.h"
#include <math.h>
#include "RooPullVar.h"
#include "RooAbsReal.h"
#include "RooRealVar.h"
ClassImp(RooPullVar)
;
RooPullVar::RooPullVar()
{
}
RooPullVar::RooPullVar(const char* name, const char* title, RooRealVar& meas, RooAbsReal& truth) :
RooAbsReal(name, title),
_meas("meas","Measurement",this,meas),
_true("true","Truth",this,truth)
{
}
RooPullVar::RooPullVar(const RooPullVar& other, const char* name) :
RooAbsReal(other, name),
_meas("meas",this,other._meas),
_true("true",this,other._true)
{
}
RooPullVar::~RooPullVar()
{
}
Double_t RooPullVar::evaluate() const
{
const RooRealVar& meas = static_cast<const RooRealVar&>(_meas.arg()) ;
if (meas.hasAsymError()) {
Double_t delta = _meas-_true ;
if (delta<0) {
return delta/meas.getAsymErrorHi() ;
} else {
return -delta/meas.getAsymErrorLo() ;
}
} else if (meas.hasError()) {
return (_meas-_true)/meas.getError() ;
} else {
return 0 ;
}
}
Last change: Wed Jun 25 08:33:55 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.