28#include <unordered_map>
42 double value,
const char *unit=
"") ;
44 double maxValue,
const char *unit=
"");
46 double minValue,
double maxValue,
const char *unit=
"") ;
56 void setVal(
double value)
override;
57 void setVal(
double value,
const char* rangeName)
override;
74 void setMin(
const char*
name,
double value,
bool shared=
true) ;
75 void setMax(
const char*
name,
double value,
bool shared=
true) ;
76 void setRange(
const char*
name,
double min,
double max,
bool shared=
true) ;
90 const RooAbsBinning&
getBinning(
const char*
name=
nullptr,
bool verbose=
true,
bool createOnTheFly=
false,
bool shared=
true)
const override ;
104 bool readFromStream(std::istream& is,
bool compact,
bool verbose=
false)
override ;
105 void writeToStream(std::ostream& os,
bool compact)
const override ;
117 void printValue(std::ostream& os)
const override ;
118 void printExtras(std::ostream& os)
const override ;
124 std::string
format(
Int_t sigDigits,
const char *options)
const ;
129 using RooAbsRealLValue::operator= ;
152 void copyCache(
const RooAbsArg* source,
bool valueOnly=
false,
bool setValDirty=
true)
override ;
163 std::shared_ptr<RooRealVarSharedProperties>
sharedProp()
const;
169 using SharedPropertiesMap = std::map<RooSharedProperties::UUID,std::weak_ptr<RooRealVarSharedProperties>>;
int Int_t
Signed integer 4 bytes (int).
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.
RefCountList_t _serverList
Abstract base class for RooRealVar binning definitions.
Abstract base class for objects that represent a real value and implements functionality common to al...
RooAbsReal()
coverity[UNINIT_CTOR] Default constructor
double _value
Cache for current value of object.
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...
Auxiliary class that represents the error of a RooRealVar as a separate object.
Singleton class that serves as repository for objects that are expensive to calculate.
Implementation of RooSharedProperties that stores the properties of a RooRealVar that are shared amon...
void fillTreeBranch(TTree &t) override
Overload RooAbsReal::fillTreeBranch to also fill tree branches with (asymmetric) errors if requested.
static void printScientific(bool flag=false)
If true, contents of RooRealVars will be printed in scientific notation.
void removeMin(const char *name=nullptr)
Remove lower range limit for binning with given name. Empty name means default range.
void setVal(double value) override
Set value of variable to 'value'.
double _error
Symmetric error associated with current value.
TObject * clone(const char *newname=nullptr) const override
void removeBinning(const char *name)
remove a named binning (or a named range, which are stored internally as binnings)
static void printSigDigits(Int_t ndig=5)
Set number of digits to show when printing RooRealVars.
void setError(double value)
std::unordered_map< std::string, std::unique_ptr< RooAbsBinning > > _altNonSharedBinning
! Non-shareable alternative binnings
static RooRealVarSharedProperties & _nullProp()
Null property.
double getErrorLo() const
void copyCache(const RooAbsArg *source, bool valueOnly=false, bool setValDirty=true) override
Copy the cached value of another RooAbsArg to our cache Warning: This function copies the cached valu...
std::map< RooSharedProperties::UUID, std::weak_ptr< RooRealVarSharedProperties > > SharedPropertiesMap
std::shared_ptr< RooRealVarSharedProperties > sharedProp() const
Hand out our shared property, create on the fly and register in shared map if necessary.
double evaluate() const override
Evaluate this PDF / function / constant. Needs to be overridden by all derived classes.
void attachToTree(TTree &t, Int_t bufSize=32000) override
Overload RooAbsReal::attachToTree to also attach branches for errors and/or asymmetric errors attribu...
void attachToVStore(RooVectorDataStore &vstore) override
Overload RooAbsReal::attachToTree to also attach branches for errors and/or asymmetric errors attribu...
void setValFast(double value) override
void setMax(double value)
void printValue(std::ostream &os) const override
Print value of variable.
void printExtras(std::ostream &os) const override
Print extras of variable: (asymmetric) error, constant flag, limits and binning.
std::unique_ptr< RooAbsBinning > _binning
bool hasBinning(const char *name) const override
Returns true if variable has a binning named 'name'.
double _asymErrLo
Low side of asymmetric error associated with current value.
void installSharedProp(std::shared_ptr< RooRealVarSharedProperties > &&prop)
Install the shared property into the member _sharedProp.
void setMin(const char *name, double value, bool shared=true)
Set minimum of name range to given value.
static bool _printScientific
bool isFundamental() const override
Is this object a fundamental type that can be added to a dataset?
std::shared_ptr< RooRealVarSharedProperties > _sharedProp
! Shared binnings associated with this instance
void setAsymError(double lo, double hi)
static bool & isSilentClippingEnabled()
double getValV(const RooArgSet *nset=nullptr) const override
Return value of variable.
std::list< std::string > getBinningNames() const override
Get a list of all binning names.
void setExpensiveObjectCache(RooExpensiveObjectCache &) override
variables don't need caches
double getErrorHi() const
void printMultiline(std::ostream &os, Int_t contents, bool verbose=false, TString indent="") const override
Detailed printing interface.
std::size_t _valueResetCounter
! How many times the value of this variable was reset
~RooRealVar() override
Destructor.
double _asymErrHi
High side of asymmetric error associated with current value.
static Int_t _printSigDigits
static void cleanup()
Explicitly deletes the shared properties list on exit to avoid problems with the initialization order...
void setRange(const char *name, double min, double max, bool shared=true)
Set a fit or plotting range.
void setBins(Int_t nBins, const char *name=nullptr, bool shared=true)
Create a uniform binning under name 'name' for this variable.
Int_t defaultPrintContents(Option_t *opt) const override
Mapping of Print() option string to RooPrintable contents specifications.
void setRange(RooAbsReal &min, RooAbsReal &max)
Set parameterised limits of the default range. See setRange(const char*, RooAbsReal&,...
bool hasError(bool allowZero=true) const
static SharedPropertiesMap * sharedPropList()
List of properties shared among clones of a variable.
void deleteSharedProperties()
Stop sharing properties.
static void enableSilentClipping(bool flag=true)
Enable or disable the silent clipping behavior of RooRealVar::setVal() that was the default in ROOT v...
std::size_t valueResetCounter() const
Returns how many times the value of this RooRealVar was reset.
void writeToStream(std::ostream &os, bool compact) const override
Write object contents to given stream.
bool hasAsymError(bool allowZero=true) const
void setBinning(const RooAbsBinning &binning, const char *name=nullptr, bool shared=true)
Add given binning under name 'name' with this variable.
RooErrorVar * errorVar() const
Return a RooAbsRealLValue representing the error associated with this variable.
bool readFromStream(std::istream &is, bool compact, bool verbose=false) override
Read object contents from given stream.
double getAsymErrorHi() const
void setMax(const char *name, double value, bool shared=true)
Set maximum of name range to given value.
RooRealVar()
Default constructor.
void removeMax(const char *name=nullptr)
Remove upper range limit for binning with given name. Empty name means default range.
std::string format(const RooCmdArg &formatArg) const
Format contents of RooRealVar for pretty printing on RooPlot parameter boxes.
void copyCacheFast(const RooRealVar &other, bool setValDirty=true)
const RooAbsBinning & getBinning(const char *name=nullptr, bool verbose=true, bool createOnTheFly=false, bool shared=true) const override
Return binning definition with name.
void setMin(double value)
double getAsymErrorLo() const
bool isDerived() const override
Does value or shape of this arg depend on any other arg?
void setRange(double min, double max)
Set the limits of the default range.
Uses std::vector to store data columns.
Mother of all ROOT objects.
A TTree represents a columnar dataset.