72 bool checkVariables) :
74 _actualVars(
"actualVars",
"Variables used by formula expression",this),
96 bool checkVariables) :
98 _actualVars(
"actualVars",
"Variables used by formula expression",this),
118 _actualVars(
"actualVars",this,other._actualVars),
119 _formExpr(other._formExpr)
136 const_cast<std::unique_ptr<RooFormula>&
>(
_formula).reset(theFormula);
160 std::cerr <<
"Formula " <<
GetName() <<
" " <<
GetTitle() <<
"\n\tBeing evaluated with normSet " << normSet <<
"\n";
162 std::cerr <<
"\tHowever, _lastNSet = " <<
_lastNSet <<
"\n";
165 throw std::logic_error(
"Got conflicting norm sets. This shouldn't happen.");
205 os <<
"formula=\"" <<
_formExpr <<
"\" " ;
216 coutE(InputArguments) <<
"RooFormulaVar::readFromStream(" <<
GetName() <<
"): can't read" << endl ;
228 cout <<
getVal() << endl ;
242 auto func =
static_cast<const RooAbsReal*
>(par);
243 list<double>* binb =
nullptr;
245 if (func && (binb = func->binBoundaries(obs,xlo,xhi)) ) {
261 auto func =
dynamic_cast<const RooAbsReal*
>(par);
262 list<double>* hint =
nullptr;
264 if (func && (hint = func->plotSamplingHint(obs,xlo,xhi)) ) {
297 if (nllArg && !chi2Arg) {
298 coutI(Minimization) <<
"RooFormulaVar::defaultErrorLevel(" <<
GetName()
299 <<
") Formula contains a RooNLLVar, using its error level" << endl ;
301 }
else if (chi2Arg && !nllArg) {
302 coutI(Minimization) <<
"RooFormulaVar::defaultErrorLevel(" <<
GetName()
303 <<
") Formula contains a RooChi2Var, using its error level" << endl ;
305 }
else if (!nllArg && !chi2Arg) {
306 coutI(Minimization) <<
"RooFormulaVar::defaultErrorLevel(" <<
GetName() <<
") WARNING: "
307 <<
"Formula contains neither RooNLLVar nor RooChi2Var server, using default level of 1.0" << endl ;
309 coutI(Minimization) <<
"RooFormulaVar::defaultErrorLevel(" <<
GetName() <<
") WARNING: "
310 <<
"Formula contains BOTH RooNLLVar and RooChi2Var server, using default level of 1.0" << endl ;
static void indent(ostringstream &buf, int indent_level)
RooAbsCollection is an abstract container object that can hold multiple RooAbsArg objects.
void Print(Option_t *options=nullptr) const override
This method must be overridden when a class wants to print itself.
const RooArgSet * nset() const
RooAbsRealLValue is the common abstract base class for objects that represent a real value that may a...
RooAbsReal is the common abstract base class for objects that represent a real value and implements f...
double getVal(const RooArgSet *normalisationSet=nullptr) const
Evaluate object.
virtual double defaultErrorLevel() const
void printMultiline(std::ostream &os, Int_t contents, bool verbose=false, TString indent="") const override
Structure printing.
bool redirectServersHook(const RooAbsCollection &newServerList, bool mustReplaceAll, bool nameChange, bool isRecursiveStep) override
A buffer for reading values from trees.
double _value
Cache for current value of object.
double traceEval(const RooArgSet *set) const
Calculate current value of object, with error tracing wrapper.
RooArgList is a container object that can hold multiple RooAbsArg objects.
RooArgSet is a container object that can hold multiple RooAbsArg objects.
RooChi2Var implements a simple calculation from a binned dataset and a PDF.
bool add(const RooAbsArg &var, bool valueServer, bool shapeServer, bool silent)
Overloaded RooCollection_t::add() method insert object into set and registers object as server to own...
Class RooNLLVar implements a -log(likelihood) calculation from a dataset and a PDF.
A simple container to hold a batch of data values.
const char * GetName() const override
Returns name of object.
const char * GetTitle() const override
Returns title of object.
This struct enables passing computation data around between elements of a computation graph.