// Implementation of BlindTools' offset blinding method
// A RooUnblindOffset object is a real valued function
// object, constructed from a blind value holder and a
// set of unblinding parameters. When supplied to a PDF
// in lieu of a regular parameter, the blind value holder
// supplied to the unblinder objects will in a fit be minimized
// to blind value corresponding to the actual minimum of the
// parameter. The transformation is chosen such that the
// the error on the blind parameters is indentical to that
// of the unblind parameter
// END_HTML
#include "RooFit.h"
#include "RooArgSet.h"
#include "RooArgSet.h"
#include "RooUnblindOffset.h"
using namespace std;
ClassImp(RooUnblindOffset)
;
RooUnblindOffset::RooUnblindOffset()
{
}
RooUnblindOffset::RooUnblindOffset(const char *name, const char *title,
const char *blindString, Double_t scale, RooAbsReal& cpasym)
: RooAbsHiddenReal(name,title),
_value("value","Offset blinded value",this,cpasym),
_blindEngine(blindString,RooBlindTools::full,0.,scale)
{
}
RooUnblindOffset::RooUnblindOffset(const char *name, const char *title,
const char *blindString, Double_t scale, RooAbsReal& cpasym,
RooAbsCategory& blindState)
: RooAbsHiddenReal(name,title,blindState),
_value("value","Offset blinded value",this,cpasym),
_blindEngine(blindString,RooBlindTools::full,0.,scale)
{
}
RooUnblindOffset::RooUnblindOffset(const RooUnblindOffset& other, const char* name) :
RooAbsHiddenReal(other, name),
_value("asym",this,other._value),
_blindEngine(other._blindEngine)
{
}
RooUnblindOffset::~RooUnblindOffset()
{
}
Double_t RooUnblindOffset::evaluate() const
{
if (isHidden()) {
return _blindEngine.UnHideOffset(_value);
} else {
return _value ;
}
}