84 RooAbsReal(
const char *
name,
const char *title,
const char *unit=
"") ;
86 const char *unit=
"") ;
113 if(normalisationSet && normalisationSet->empty()) {
114 normalisationSet =
nullptr;
116#ifdef ROOFIT_CHECK_CACHED_VALUES
183 template <
typename... CmdArgs_t>
189 template <
typename... CmdArgs_t>
199 const RooCmdArg& arg3={},
const RooCmdArg& arg4={},
200 const RooCmdArg& arg5={},
const RooCmdArg& arg6={},
201 const RooCmdArg& arg7={},
const RooCmdArg& arg8={})
const ;
228 const RooCmdArg& arg3={},
const RooCmdArg& arg4={},
229 const RooCmdArg& arg5={},
const RooCmdArg& arg6={},
230 const RooCmdArg& arg7={},
const RooCmdArg& arg8={}) ;
259 virtual void fixAddCoefRange(
const char* rangeName=
nullptr,
bool force=
true) ;
265 const RooCmdArg& arg1={},
const RooCmdArg& arg2={},
266 const RooCmdArg& arg3={},
const RooCmdArg& arg4={},
267 const RooCmdArg& arg5={},
const RooCmdArg& arg6={},
268 const RooCmdArg& arg7={},
const RooCmdArg& arg8={},
269 const RooCmdArg& arg9={},
const RooCmdArg& arg10={}
277 double scaleFactor= 1,
const RooArgSet *projectedVars=
nullptr,
bool scaling=
true,
278 const RooArgSet* condObs=
nullptr,
bool setError=
true)
const;
284 const RooCmdArg& arg1={},
const RooCmdArg& arg2={},
285 const RooCmdArg& arg3={},
const RooCmdArg& arg4={},
286 const RooCmdArg& arg5={},
const RooCmdArg& arg6={},
287 const RooCmdArg& arg7={},
const RooCmdArg& arg8={})
const ;
290 RooDataHist*
fillDataHist(RooDataHist *hist,
const RooArgSet* nset,
double scaleFactor,
291 bool correctForBinVolume=
false,
bool showProgress=
false)
const ;
294 bool readFromStream(std::istream& is,
bool compact,
bool verbose=
false)
override ;
295 void writeToStream(std::ostream& os,
bool compact)
const override ;
298 void printValue(std::ostream& os)
const override ;
301 inline void setCachedValue(
double value,
bool notifyClients =
true) final;
333 void logEvalError(
const char* message,
const char* serverValueString=
nullptr)
const ;
334 static void logEvalError(
const RooAbsReal* originator,
const char* origName,
const char* message,
const char* serverValueString=
nullptr) ;
338 static std::map<const RooAbsArg *, std::pair<std::string, std::list<RooAbsReal::EvalError>>>::iterator
evalErrorIter();
368 virtual double offset()
const {
return 0 ; }
381 RooArgSet *&cloneSet,
const char* rangeName=
nullptr,
const RooArgSet* condObs=
nullptr)
const;
387 if(!
hasGradient())
throw std::runtime_error(
"RooAbsReal::gradient(double *) not implemented by this class!");
392 throw std::runtime_error(
"RooAbsReal::hessian(double *) not implemented by this class!");
417 RooArgSet& projectedVars,
bool silent)
const ;
424 template<
typename... Proxies>
430 (nameList.
Add(
new TObjString(proxies.absArg()->GetName())), ...);
447 virtual bool isValidReal(
double ,
bool printError =
false)
const { (void)printError;
return true; }
457 void copyCache(
const RooAbsArg* source,
bool valueOnly=
false,
bool setValDirty=
true)
override ;
502 bool nameChange,
bool isRecursiveStep)
override;
int Int_t
Signed integer 4 bytes (int).
char Text_t
General string (char).
const char Option_t
Option string (const char).
#define ClassDefOverride(name, id)
static void indent(ostringstream &buf, int indent_level)
Common abstract base class for objects that represent a value and a "shape" in RooFit.
void setValueDirty()
Mark the element dirty. This forces a re-evaluation when a value is requested.
bool inhibitDirty() const
static bool _inhibitDirty
RooAbsArg()
Default constructor.
friend class RooAbsCollection
Abstract base class for objects that represent a discrete value that can be set from the outside,...
Abstract base class for binned and unbinned datasets.
Abstract interface for evaluating a real-valued function of one real variable and performing numerica...
Abstract base class for objects that represent a real value that may appear on the left hand side of ...
EvalErrorContext(ErrorLoggingMode m)
EvalErrorContext & operator=(EvalErrorContext const &)=delete
EvalErrorContext & operator=(EvalErrorContext &&)=delete
EvalErrorContext(EvalErrorContext const &)=delete
EvalErrorContext(EvalErrorContext &&)=delete
void setServerValues(const char *tmp)
void setMessage(const char *tmp)
EvalError(const EvalError &other)
Abstract base class for objects that represent a real value and implements functionality common to al...
virtual void hessian(double *) const
RooDataHist * fillDataHist(RooDataHist *hist, const RooArgSet *nset, double scaleFactor, bool correctForBinVolume=false, bool showProgress=false) const
Fill a RooDataHist with values sampled from this function at the bin centers.
virtual void selectNormalizationRange(const char *rangeName=nullptr, bool force=false)
Interface function to force use of a given normalization range to interpret function value.
void plotOnCompSelect(RooArgSet *selNodes) const
Helper function for plotting of composite p.d.fs.
bool isSelectedComp() const
If true, the current pdf is a selected component (for use in plotting).
virtual std::list< double > * binBoundaries(RooAbsRealLValue &obs, double xlo, double xhi) const
Retrieve bin boundaries if this distribution is binned in obs.
void selectComp(bool flag)
TString _label
Plot label for objects value.
bool _selectComp
! Component selection flag for RooAbsPdf::plotCompOn
double getVal(const RooArgSet *normalisationSet=nullptr) const
Evaluate object.
double findRoot(RooRealVar &x, double xmin, double xmax, double yval)
Return value of x (in range xmin,xmax) at which function equals yval.
RooAbsMoment * mean(RooRealVar &obs)
TreeReadBuffer * _treeReadBuffer
! A buffer for reading values from trees
virtual bool isOffsetting() const
virtual double getValV(const RooArgSet *normalisationSet=nullptr) const
Return value of object.
static Int_t numEvalErrorItems()
RooAbsReal()
coverity[UNINIT_CTOR] Default constructor
friend class RooRealBinding
virtual void fixAddCoefNormalization(const RooArgSet &addNormSet=RooArgSet(), bool force=true)
Fix the interpretation of the coefficient of any RooAddPdf component in the expression tree headed by...
RooFit::OwningPtr< RooAbsReal > createChi2(RooDataHist &data, CmdArgs_t const &... cmdArgs)
Create a variable from a histogram and this function.
virtual bool hasGradient() const
virtual Int_t getAnalyticalIntegralWN(RooArgSet &allVars, RooArgSet &analVars, const RooArgSet *normSet, const char *rangeName=nullptr) const
Variant of getAnalyticalIntegral that is also passed the normalization set that should be applied to ...
bool isValid() const override
Check if current value is valid.
bool _forceNumInt
Force numerical integration if flag set.
~RooAbsReal() override
Destructor.
void setParameterizeIntegral(const RooArgSet ¶mVars)
bool matchArgsByName(const RooArgSet &allArgs, RooArgSet &matchedArgs, const TList &nameList) const
Check if allArgs contains matching elements for each name in nameList.
void setTreeBranchStatus(TTree &t, bool active) override
(De)Activate associated tree branch
TH1 * fillHistogram(TH1 *hist, const RooArgList &plotVars, double scaleFactor=1, const RooArgSet *projectedVars=nullptr, bool scaling=true, const RooArgSet *condObs=nullptr, bool setError=true) const
Fill the ROOT histogram 'hist' with values sampled from this function at the bin centers.
RooFit::OwningPtr< RooAbsReal > createScanRI(const RooArgSet &iset, const RooArgSet &nset, Int_t numScanBins, Int_t intOrder)
Utility function for createRunningIntegral that construct an object implementing the numeric scanning...
RooFit::OwningPtr< RooAbsReal > createIntegral(const RooArgSet &iset, const char *rangeName) const
Create integral over observables in iset in range named rangeName.
friend class RooVectorDataStore
virtual double defaultErrorLevel() const
double _DEBUG_getVal(const RooArgSet *normalisationSet) const
Debug version of getVal(), which is slow and does error checking.
RooFit::OwningPtr< RooAbsArg > createFundamental(const char *newname=nullptr) const override
Create a RooRealVar fundamental object with our properties.
bool plotSanityChecks(RooPlot *frame) const
Utility function for plotOn(), perform general sanity check on frame to ensure safe plotting operatio...
RooFit::OwningPtr< RooAbsFunc > bindVars(const RooArgSet &vars, const RooArgSet *nset=nullptr, bool clipInvalid=false) const
Create an interface adaptor f(vars) that binds us to the specified variables (in arbitrary order).
virtual void selectNormalization(const RooArgSet *depSet=nullptr, bool force=false)
Interface function to force use of a given set of observables to interpret function value.
friend class AddCacheElem
RooDerivative * derivative(RooRealVar &obs, Int_t order=1, double eps=0.001)
Return function representing first, second or third order derivative of this function.
friend class RooRealSumFunc
TF1 * asTF(const RooArgList &obs, const RooArgList &pars=RooArgList(), const RooArgSet &nset=RooArgSet()) const
Return a ROOT TF1,2,3 object bound to this RooAbsReal with given definition of observables and parame...
virtual bool setData(RooAbsData &, bool=true)
TString _unit
Unit for objects value.
static RooNumIntConfig * defaultIntegratorConfig()
Returns the default numeric integration configuration for all RooAbsReals.
double getVal(const RooArgSet &normalisationSet) const
Like getVal(const RooArgSet*), but always requires an argument for normalisation.
bool readFromStream(std::istream &is, bool compact, bool verbose=false) override
Read object contents from stream (dummy for now).
void fillTreeBranch(TTree &t) override
Fill the tree branch that associated with this object with its current value.
RooFit::OwningPtr< RooAbsReal > createIntegral(const RooArgSet &iset, const RooArgSet &nset, const char *rangeName=nullptr) const
Create integral over observables in iset in range named rangeName with integrand normalized over obse...
void printMultiline(std::ostream &os, Int_t contents, bool verbose=false, TString indent="") const override
Structure printing.
virtual RooPlot * plotAsymOn(RooPlot *frame, const RooAbsCategoryLValue &asymCat, PlotOpt o) const
bool operator==(double value) const
Equality operator comparing to a double.
static ErrorLoggingMode evalErrorLoggingMode()
Return current evaluation error logging mode.
bool redirectServersHook(const RooAbsCollection &newServerList, bool mustReplaceAll, bool nameChange, bool isRecursiveStep) override
Function that is called at the end of redirectServers().
virtual Int_t minTrialSamples(const RooArgSet &) const
virtual bool isValidReal(double, bool printError=false) const
Interface function to check if given value is a valid value for this object. Returns true unless over...
void setIntegratorConfig()
Remove the specialized numeric integration configuration associated with this object.
void syncCache(const RooArgSet *set=nullptr) override
RooFit::OwningPtr< RooFitResult > chi2FitTo(RooDataHist &data, CmdArgs_t const &... cmdArgs)
Calls RooAbsReal::createChi2 and returns the fit result.
void printValue(std::ostream &os) const override
Print object value.
virtual bool forceAnalyticalInt(const RooAbsArg &) const
bool isIdentical(const RooAbsArg &other, bool assumeSameType=false) const override
void setUnit(const char *unit)
friend class RooAddHelpers
bool getForceNumInt() const
virtual RooFit::OwningPtr< RooAbsReal > createProfile(const RooArgSet ¶msOfInterest)
Create a RooProfileLL object that eliminates all nuisance parameters in the present function.
static bool _hideOffset
Offset hiding flag.
void attachToVStore(RooVectorDataStore &vstore) override
void copyCache(const RooAbsArg *source, bool valueOnly=false, bool setValDirty=true) override
Copy the cached value of another RooAbsArg to our cache.
virtual void gradient(double *) const
TH1 * createHistogram(RooStringView varNameList, Int_t xbins=0, Int_t ybins=0, Int_t zbins=0) const
Create and fill a ROOT histogram TH1, TH2 or TH3 with the values of this function for the variables w...
virtual void fixAddCoefRange(const char *rangeName=nullptr, bool force=true)
Fix the interpretation of the coefficient of any RooAddPdf component in the expression tree headed by...
double _value
Cache for current value of object.
virtual double analyticalIntegral(Int_t code, const char *rangeName=nullptr) const
Implements the actual analytical integral(s) advertised by getAnalyticalIntegral.
void attachToTree(TTree &t, Int_t bufSize=32000) override
Attach object to a branch of given TTree.
friend class BatchInterfaceAccessor
RooNumIntConfig * specialIntegratorConfig() const
Returns the specialized integrator configuration for this RooAbsReal.
void writeToStream(std::ostream &os, bool compact) const override
Write object contents to stream (dummy for now).
double traceEval(const RooArgSet *set) const
Calculate current value of object, with error tracing wrapper.
double getPropagatedError(const RooFitResult &fr, const RooArgSet &nset={}) const
Propagates parameter uncertainties to an uncertainty estimate for this RooAbsReal.
static void setHideOffset(bool flag)
static void globalSelectComp(bool flag)
Global switch controlling the activation of the selectComp() functionality.
RooFit::OwningPtr< RooAbsReal > createIntegral(const RooArgSet &iset, const RooArgSet &nset, const RooNumIntConfig &cfg, const char *rangeName=nullptr) const
Create integral over observables in iset in range named rangeName with integrand normalized over obse...
RooAbsMoment * moment(RooRealVar &obs, Int_t order, bool central, bool takeRoot)
Return function representing moment of function of given order.
RooPlot * plotOnWithErrorBand(RooPlot *frame, const RooFitResult &fr, double Z, const RooArgSet *params, const RooLinkedList &argList, bool method1) const
Plot function or PDF on frame with support for visualization of the uncertainty encoded in the given ...
virtual bool hasHessian() const
RooFit::UniqueId< RooArgSet >::Value_t _lastNormSetId
!
const char * getPlotLabel() const
Get the label associated with the variable.
virtual void forceNumInt(bool flag=true)
RooFit::OwningPtr< RooAbsReal > createRunningIntegral(const RooArgSet &iset, const RooArgSet &nset={})
Calls createRunningIntegral(const RooArgSet&, const RooCmdArg&, const RooCmdArg&, const RooCmdArg&,...
RooFit::OwningPtr< RooAbsReal > createIntegral(const RooArgSet &iset, const RooNumIntConfig &cfg, const char *rangeName=nullptr) const
Create integral over observables in iset in range named rangeName using specified configuration for a...
std::unique_ptr< RooNumIntConfig > _specIntegratorConfig
std::unique_ptr< RooFitResult > chi2FitToImpl(RooDataHist &data, const RooLinkedList &cmdList)
virtual Int_t getAnalyticalIntegral(RooArgSet &allVars, RooArgSet &analVars, const char *rangeName=nullptr) const
Interface function getAnalyticalIntergral advertises the analytical integrals that are supported.
static std::map< constRooAbsArg *, std::pair< std::string, std::list< RooAbsReal::EvalError > > >::iterator evalErrorIter()
static Int_t numEvalErrors()
Return the number of logged evaluation errors since the last clearing.
static void setEvalErrorLoggingMode(ErrorLoggingMode m)
Set evaluation error logging mode.
double _plotMax
Maximum of plot range.
virtual void preferredObservableScanOrder(const RooArgSet &obs, RooArgSet &orderedObs) const
Interface method for function objects to indicate their preferred order of observables for scanning t...
virtual double maxVal(Int_t code) const
Return maximum value for set of observables identified by code assigned in getMaxVal.
void findInnerMostIntegration(const RooArgSet &allObs, RooArgSet &innerObs, const char *rangeName) const
Utility function for createIntObj() that aids in the construct of recursive integrals over functions ...
TString integralNameSuffix(const RooArgSet &iset, const RooArgSet *nset=nullptr, const char *rangeName=nullptr, bool omitEmpty=false) const
Construct string with unique suffix name to give to integral object that encodes integrated observabl...
virtual double evaluate() const =0
Evaluate this PDF / function / constant. Needs to be overridden by all derived classes.
TString getTitle(bool appendUnit=false) const
Return this variable's title string.
void logEvalError(const char *message, const char *serverValueString=nullptr) const
Log evaluation error message.
virtual double analyticalIntegralWN(Int_t code, const RooArgSet *normSet, const char *rangeName=nullptr) const
Implements the actual analytical integral(s) advertised by getAnalyticalIntegral.
friend class RooRealSumPdf
const Text_t * getUnit() const
const RooNumIntConfig * getIntegratorConfig() const
Return the numeric integration configuration used for this object.
virtual bool isBinnedDistribution(const RooArgSet &) const
Tests if the distribution is binned. Unless overridden by derived classes, this always returns false.
static void printEvalErrors(std::ostream &os=std::cout, Int_t maxPerNode=10000000)
Print all outstanding logged evaluation error on the given ostream.
RooFit::OwningPtr< RooAbsReal > createIntRI(const RooArgSet &iset, const RooArgSet &nset={})
Utility function for createRunningIntegral.
virtual void enableOffsetting(bool)
static void clearEvalErrorLog()
Clear the stack of evaluation error messages.
RooFit::OwningPtr< RooAbsReal > createIntObj(const RooArgSet &iset, const RooArgSet *nset, const RooNumIntConfig *cfg, const char *rangeName) const
Internal utility function for createIntegral() that creates the actual integral object.
RooAbsMoment * sigma(RooRealVar &obs, const RooArgSet &nset)
RooFunctor * functor(const RooArgList &obs, const RooArgList &pars=RooArgList(), const RooArgSet &nset=RooArgSet()) const
Return a RooFunctor object bound to this RooAbsReal with given definition of observables and paramete...
void setCachedValue(double value, bool notifyClients=true) final
Overwrite the value stored in this object's cache.
virtual RooPlot * plotOn(RooPlot *frame, const RooCmdArg &arg1={}, const RooCmdArg &arg2={}, const RooCmdArg &arg3={}, const RooCmdArg &arg4={}, const RooCmdArg &arg5={}, const RooCmdArg &arg6={}, const RooCmdArg &arg7={}, const RooCmdArg &arg8={}, const RooCmdArg &arg9={}, const RooCmdArg &arg10={}) const
Plot (project) PDF on specified frame.
Int_t _plotBins
Number of plot bins.
const RooAbsReal * createPlotProjection(const RooArgSet &depVars, const RooArgSet &projVars, RooArgSet *&cloneSet) const
Utility function for plotOn() that creates a projection of a function or p.d.f to be plotted on a Roo...
virtual std::list< double > * plotSamplingHint(RooAbsRealLValue &obs, double xlo, double xhi) const
Interface for returning an optional hint for initial sampling points when constructing a curve projec...
void setPlotLabel(const char *label)
Set the label associated with this variable.
RooFit::OwningPtr< RooAbsReal > createIntegral(const RooArgSet &iset, const RooCmdArg &arg1, const RooCmdArg &arg2={}, const RooCmdArg &arg3={}, const RooCmdArg &arg4={}, const RooCmdArg &arg5={}, const RooCmdArg &arg6={}, const RooCmdArg &arg7={}, const RooCmdArg &arg8={}) const
Create an object that represents the integral of the function over one or more observables listed in ...
virtual void doEval(RooFit::EvalContext &) const
Base function for computing multiple values of a RooAbsReal.
void makeProjectionSet(const RooAbsArg *plotVar, const RooArgSet *allVars, RooArgSet &projectedVars, bool silent) const
Utility function for plotOn() that constructs the set of observables to project when plotting ourselv...
virtual Int_t getMaxVal(const RooArgSet &vars) const
Advertise capability to determine maximum value of function for given set of observables.
double _plotMin
Minimum of plot range.
bool matchArgs(const RooArgSet &allDeps, RooArgSet &analDeps, const RooArgProxy &a, const Proxies &... proxies) const
RooAbsMoment * mean(RooRealVar &obs, const RooArgSet &nset)
virtual double offset() const
RooAbsMoment * sigma(RooRealVar &obs)
std::unique_ptr< RooAbsReal > createChi2Impl(RooDataHist &data, const RooLinkedList &cmdList)
static bool _globalSelectComp
RooArgList is a container object that can hold multiple RooAbsArg objects.
RooArgSet is a container object that can hold multiple RooAbsArg objects.
Named container for two doubles, two integers two object points and three string pointers that can be...
Container class to hold N-dimensional binned data.
Container class to hold unbinned data.
Represents the first, second, or third order derivative of any RooAbsReal as calculated (numerically)...
RooFitResult is a container class to hold the input and output of a PDF fit to a dataset.
Lightweight interface adaptor that exports a RooAbsPdf as a functor.
Collection class for internal use, storing a collection of RooAbsArg pointers in a doubly linked list...
Holds the configuration parameters of the various numeric integrators used by RooRealIntegral.
Plot frame and a container for graphics objects within that frame.
Variable that can be changed from the outside.
The RooStringView is a wrapper around a C-style string that can also be constructed from a std::strin...
Uses std::vector to store data columns.
1-D histogram with a float per channel (see TH1 documentation)
TH1 is the base class of all histogram classes in ROOT.
2-D histogram with a float per channel (see TH1 documentation)
3-D histogram with a float per channel (see TH1 documentation)
void Add(TObject *obj) override
void Delete(Option_t *option="") override
Remove all objects from the list AND delete all heap based objects.
Collectable string class.
A TTree represents a columnar dataset.
Namespace for dispatching RooFit computations to various backends.
std::unique_ptr< RooLinkedList > createCmdList(RooCmdArg const *arg1, Args &&...args)
T * OwningPtr
An alias for raw pointers for indicating that the return type of a RooFit function is an owning point...
OwningPtr< T > makeOwningPtr(std::unique_ptr< T > &&ptr)
Internal helper to turn a std::unique_ptr<T> into an OwningPtr.
~GlobalSelectComponentRAII()
GlobalSelectComponentRAII(bool state)
const char * normRangeName
RooFit::MPSplit interleave
const char * projectionRangeName
const RooArgSet * projDataSet
const char * curveNameSuffix
const char * addToCurveName
const RooFitResult * errorFR
const RooArgSet * projSet
const RooAbsData * projData
static constexpr Value_t nullval
The value of the nullid.