49using std::endl, std::ostream, std::istream;
 
   62  RooSentinel::activate();
 
 
   92   constexpr auto max_precision{std::numeric_limits<double>::digits10 + 1};
 
 
  121             double value, 
const char *unit) :
 
 
  193  _error(
other._error),
 
  194  _asymErrLo(
other._asymErrLo),
 
  195  _asymErrHi(
other._asymErrHi)
 
  198  if (
other._binning) {
 
  204  for (
const auto& item : 
other._altNonSharedBinning) {
 
  205    std::unique_ptr<RooAbsBinning> 
abc( item.second->clone() );
 
  206    abc->insertHook(*
this) ;
 
 
  327    coutW(InputArguments) << 
"Asking variable " << 
GetName() << 
"for binning '" << 
name 
  328        << 
"', but comma in binning names is not supported." << std::endl;
 
  334    return *item->second;
 
  340    return *
item2->second;
 
  352    coutI(Eval) << 
"RooRealVar::getBinning(" << 
GetName() << 
") new range named '" 
  353      << 
name << 
"' created with default bounds" << endl ;
 
 
  374  for (
const auto& item : 
sharedProp()->_altBinning) {
 
 
  419      item->second->removeHook(*
this);
 
  427      item2->second->removeHook(*
this);
 
 
  456    coutW(InputArguments) << 
"RooRealVar::setMin(" << 
GetName()
 
  457           << 
"): Proposed new fit min. larger than max., setting min. to max." << endl ;
 
 
  486    coutW(InputArguments) << 
"RooRealVar::setMax(" << 
GetName()
 
  487           << 
"): Proposed new fit max. smaller than min., setting max. to min." << endl ;
 
 
  523    coutW(InputArguments) << 
"RooRealVar::setRange(" << 
GetName()
 
  524           << 
"): Proposed new fit max. smaller than min., setting max. to min." << endl ;
 
  532      << 
") new range named '" << 
name << 
"' created with bounds [" 
  533      << min << 
"," << max << 
"]" << endl ;
 
 
  591      if (!
token.CompareTo(
"+")) {
 
  601   if (tmp.CompareTo(
"(")) {
 
  619      } 
else if (!
token.CompareTo(
"C")) {
 
  625      } 
else if (!
token.CompareTo(
"P")) {
 
  639   coutW(Eval) << 
"RooRealVar::readFromStream(" << 
GetName()
 
  640        << 
") WARNING: plot range deprecated, removed P(...) token" << endl ;
 
  642      } 
else if (!
token.CompareTo(
"F")) {
 
  657   coutW(Eval) << 
"RooRealVar::readFromStream(" << 
GetName()
 
  658        << 
") WARNING: F(lo-hi:bins) token deprecated, use L(lo-hi) B(bins)" << endl ;
 
  661      } 
else if (!
token.CompareTo(
"L")) {
 
  675      } 
else if (!
token.CompareTo(
"B")) {
 
 
  713      if (
_value>=0) os << 
" " ;
 
  750      os << 
"B(" << 
getBins() << 
") " ;
 
  755      os << 
"// [" << 
getUnit() << 
"]" ;
 
 
  804    os << 
"B(" << 
getBins() << 
") " ;
 
  809    os << 
"// [" << 
getUnit() << 
"]" ;
 
 
  822  if (opt && 
TString(opt)==
"I") {
 
 
  835  os << 
indent << 
"--- RooRealVar ---" << endl;
 
 
  852  tmp.setProcessRecArgs(
true) ;
 
  856  pc.
defineInt(
"autop",
"FormatArgs::AutoPrecision",0,2) ;
 
  857  pc.
defineInt(
"fixedp",
"FormatArgs::FixedPrecision",0,2) ;
 
  858  pc.
defineInt(
"tlatex",
"FormatArgs::TLatexStyle",0,0) ;
 
  859  pc.
defineInt(
"latex",
"FormatArgs::LatexStyle",0,0) ;
 
  860  pc.
defineInt(
"latext",
"FormatArgs::LatexTableStyle",0,0) ;
 
  861  pc.
defineInt(
"verbn",
"FormatArgs::VerbatimName",0,0) ;
 
  862  pc.
defineMutex(
"FormatArgs::TLatexStyle",
"FormatArgs::LatexStyle",
"FormatArgs::LatexTableStyle") ;
 
  863  pc.
defineMutex(
"FormatArgs::AutoPrecision",
"FormatArgs::FixedPrecision") ;
 
  875  if (pc.
getInt(
"tlatex")) {
 
  877  } 
else if (pc.
getInt(
"latex")) {
 
  879  } 
else if (pc.
getInt(
"latext")) {
 
  883  if (pc.
getInt(
"verbn")) options += 
"V" ;
 
  888  } 
else if (pc.
hasProcessed(
"FormatArgs::FixedPrecision")) {
 
 
  968      text->Append(
"\\verb+") ;
 
  976      text->Append(
" $ & $ ");
 
  988    text->Append(buffer);
 
  994      text->Append(
" #pm ");
 
  997      text->Append(
"\\pm ");
 
 1000      text->Append(
" +/- ");
 
 1003    text->Append(buffer);
 
 1008      text->Append(
" #pm ");
 
 1009      text->Append(
"_{") ;
 
 1011      text->Append(buffer);
 
 1012      text->Append(
"}^{+") ;
 
 1014      text->Append(buffer);
 
 1018      text->Append(
"\\pm ");
 
 1019      text->Append(
"_{") ;
 
 1021      text->Append(buffer);
 
 1022      text->Append(
"}^{+") ;
 
 1024      text->Append(buffer);
 
 1028      text->Append(
" +/- ");
 
 1029      text->Append(
" (") ;
 
 1031      text->Append(buffer);
 
 1032      text->Append(
", ") ;
 
 1034      text->Append(buffer);
 
 
 1059  return (
double)trunc*
scale;
 
 
 1126    loName.Append(
"_aerr_lo") ;
 
 1137    hiName.Append(
"_aerr_hi") ;
 
 
 1161    coutE(Eval) << 
"RooAbsReal::fillTreeBranch(" << 
GetName() << 
") ERROR: not attached to tree" << endl ;
 
 1175    loName.Append(
"_aerr_lo") ;
 
 1180    hiName.Append(
"_aerr_hi") ;
 
 
 1223  if (
R__b.IsReading()) {
 
 1228      coutI(Eval) << 
"RooRealVar::Streamer(" << 
GetName() << 
") converting version 1 data format" << endl ;
 
 1253      auto tmpProp = std::make_shared<RooRealVarSharedProperties>();
 
 
 1302  std::shared_ptr<RooRealVarSharedProperties> 
existingProp;
 
 1307    prop->disownBinnings();
 
 
 1338  if(iter->second.expired()) {
 
 
static bool staticSharedPropListCleanedUp
 
static void indent(ostringstream &buf, int indent_level)
 
ROOT::Detail::TRangeCast< T, true > TRangeDynCast
TRangeDynCast is an adapter class that allows the typed iteration through a TCollection.
 
Option_t Option_t TPoint TPoint const char GetTextMagnitude GetFillStyle GetLineColor GetLineWidth GetMarkerStyle GetTextAlign GetTextColor GetTextSize void char Point_t Rectangle_t WindowAttributes_t Float_t Float_t Float_t Int_t Int_t UInt_t UInt_t Rectangle_t Int_t Int_t Window_t TString Int_t GCValues_t GetPrimarySelectionOwner GetDisplay GetScreen GetColormap GetNativeEvent const char const char dpyName wid window const char font_name cursor keysym reg const char only_if_exist regb h Point_t winding char text const char depth char const char Int_t count const char ColorStruct_t color const char Pixmap_t Pixmap_t PictureAttributes_t attr const char char ret_data h unsigned char height h prop
 
Option_t Option_t TPoint TPoint const char GetTextMagnitude GetFillStyle GetLineColor GetLineWidth GetMarkerStyle GetTextAlign GetTextColor GetTextSize void value
 
Option_t Option_t TPoint TPoint const char GetTextMagnitude GetFillStyle GetLineColor GetLineWidth GetMarkerStyle GetTextAlign GetTextColor GetTextSize void char Point_t Rectangle_t WindowAttributes_t Float_t Float_t Float_t Int_t Int_t UInt_t UInt_t Rectangle_t Int_t Int_t Window_t TString Int_t GCValues_t GetPrimarySelectionOwner GetDisplay GetScreen GetColormap GetNativeEvent const char const char dpyName wid window const char font_name cursor keysym reg const char only_if_exist regb h Point_t winding char text const char depth char const char Int_t count const char ColorStruct_t color const char Pixmap_t Pixmap_t PictureAttributes_t attr const char char ret_data h unsigned char height h Atom_t Int_t ULong_t ULong_t unsigned char prop_list Atom_t Atom_t Atom_t Time_t format
 
Option_t Option_t TPoint TPoint const char text
 
char * Form(const char *fmt,...)
Formats a string in a circular formatting buffer.
 
const_iterator end() const
 
Common abstract base class for objects that represent a value and a "shape" in RooFit.
 
void setShapeDirty()
Notify that a shape-like property (e.g. binning) has changed.
 
bool isConstant() const
Check if the "Constant" attribute is set.
 
friend void RooRefArray::Streamer(TBuffer &)
 
void setValueDirty()
Mark the element dirty. This forces a re-evaluation when a value is requested.
 
bool getAttribute(const Text_t *name) const
Check if a named attribute is set. By default, all attributes are unset.
 
TString cleanBranchName() const
Construct a mangled name from the actual name that is free of any math symbols that might be interpre...
 
Abstract base class for RooRealVar binning definitions.
 
virtual void setRange(double xlo, double xhi)=0
 
virtual void setMin(double xlo)
Change lower bound to xlo.
 
virtual void setMax(double xhi)
Change upper bound to xhi.
 
virtual RooAbsBinning * clone(const char *name=nullptr) const =0
 
Abstract base class for objects that represent a real value that may appear on the left hand side of ...
 
virtual Int_t getBins(const char *name=nullptr) const
Get number of bins of currently defined range.
 
bool isValidReal(double value, bool printError=false) const override
Check if given value is valid.
 
void setConstant(bool value=true)
 
virtual double getMax(const char *name=nullptr) const
Get maximum of currently defined range.
 
bool hasMax(const char *name=nullptr) const
Check if variable has an upper bound.
 
virtual double getMin(const char *name=nullptr) const
Get minimum of currently defined range.
 
bool inRange(const char *name) const override
Check if current value is inside range with given name.
 
void printMultiline(std::ostream &os, Int_t contents, bool verbose=false, TString indent="") const override
Structure printing.
 
bool hasMin(const char *name=nullptr) const
Check if variable has a lower bound.
 
Abstract base class for objects that represent a real value and implements functionality common to al...
 
double getVal(const RooArgSet *normalisationSet=nullptr) const
Evaluate object.
 
TString _unit
Unit for objects value.
 
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.
 
double _value
Cache for current value of object.
 
void attachToTree(TTree &t, Int_t bufSize=32000) override
Attach object to a branch of given TTree.
 
const char * getPlotLabel() const
Get the label associated with the variable.
 
const Text_t * getUnit() const
 
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...
 
Configurable parser for RooCmdArg named arguments.
 
void defineMutex(const char *head, Args_t &&... tail)
Define arguments where any pair is mutually exclusive.
 
bool process(const RooCmdArg &arg)
Process given RooCmdArg.
 
bool hasProcessed(const char *cmdName) const
Return true if RooCmdArg with name 'cmdName' has been processed.
 
bool ok(bool verbose) const
Return true of parsing was successful.
 
const char * getString(const char *name, const char *defaultValue="", bool convEmptyToNull=false) const
Return string property registered with name 'name'.
 
bool defineString(const char *name, const char *argName, int stringNum, const char *defValue="", bool appendMode=false)
Define double property name 'name' mapped to double in slot 'stringNum' in RooCmdArg with name argNam...
 
bool defineInt(const char *name, const char *argName, int intNum, int defValue=0)
Define integer property name 'name' mapped to integer in slot 'intNum' in RooCmdArg with name argName...
 
int getInt(const char *name, int defaultValue=0) const
Return integer property registered with name 'name'.
 
Auxiliary class that represents the error of a RooRealVar as a separate object.
 
A class to maintain the context for squashing of RooFit models into code.
 
void addResult(RooAbsArg const *key, std::string const &value)
A function to save an expression that includes/depends on the result of the input node.
 
static constexpr double infinity()
Return internal infinity representation.
 
static constexpr int isInfinite(double x)
Return true if x is infinite by RooNumber internal specification.
 
static std::string toString(double x)
Returns an std::to_string compatible number (i.e.
 
Implementation of RooAbsBinning that constructs a binning with a range definition that depends on ext...
 
Binning/range definition that only defines a range but no binning.
 
Implementation of RooSharedProperties that stores the properties of a RooRealVar that are shared amon...
 
Variable that can be changed from the outside.
 
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.
 
void removeRange(const char *name=nullptr)
Remove range limits for binning with given name. Empty name means default range.
 
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.
 
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.
 
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 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
 
void setMin(const char *name, double value)
Set minimum of name range to given value.
 
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.
 
static bool _printScientific
 
std::shared_ptr< RooRealVarSharedProperties > _sharedProp
! Shared binnings associated with this instance
 
void setAsymError(double lo, double hi)
 
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 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
 
const RooAbsBinning & getBinning(const char *name=nullptr, bool verbose=true, bool createOnTheFly=false) const override
Return binning definition with name.
 
static void cleanup()
Explicitly deletes the shared properties list on exit to avoid problems with the initialization order...
 
Int_t defaultPrintContents(Option_t *opt) const override
Mapping of Print() option string to RooPrintable contents specifications.
 
void setBinning(const RooAbsBinning &binning, const char *name=nullptr)
Add given binning under name 'name' with this variable.
 
bool hasError(bool allowZero=true) const
 
static SharedPropertiesMap * sharedPropList()
List of properties shared among clones of a variable.
 
void deleteSharedProperties()
Stop sharing properties.
 
void writeToStream(std::ostream &os, bool compact) const override
Write object contents to given stream.
 
bool hasAsymError(bool allowZero=true) const
 
void translate(RooFit::Detail::CodeSquashContext &ctx) const override
This function defines a translation for each RooAbsReal based object that can be used to express the ...
 
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 chopAt(double what, Int_t where) const
Utility to calculate number of decimals to show based on magnitude of error.
 
TString * format(const RooCmdArg &formatArg) const
Format contents of RooRealVar for pretty printing on RooPlot parameter boxes.
 
double getAsymErrorHi() const
 
void setRange(const char *name, double min, double max)
Set a fit or plotting range.
 
void setBins(Int_t nBins, const char *name=nullptr)
Create a uniform binning under name 'name' for this variable.
 
RooRealVar()
Default constructor.
 
void removeMax(const char *name=nullptr)
Remove upper range limit for binning with given name. Empty name means default range.
 
void setMax(const char *name, double value)
Set maximum of name range to given value.
 
TClass * IsA() const override
 
double getAsymErrorLo() const
 
bool expectToken(const TString &expected, bool zapOnError=false)
Read the next token and return true if it is identical to the given 'expected' token.
 
bool convertToDouble(const TString &token, double &value)
Convert given string to a double. Return true if the conversion fails.
 
bool atEOL()
If true, parser is at end of line in stream.
 
bool readDouble(double &value, bool zapOnError=false)
Read the next token and convert it to a double.
 
TString readToken()
Read one token separated by any of the know punctuation characters This function recognizes and handl...
 
bool readInteger(Int_t &value, bool zapOnError=false)
Read a token and convert it to an Int_t.
 
void zapToEnd(bool inclContLines=false)
Eat all characters up to and including then end of the current line.
 
Uses std::vector to store data columns.
 
A TTree is a list of TBranches.
 
Buffer base class used for serializing objects.
 
const char * GetName() const override
Returns name of object.
 
const char * GetTitle() const override
Returns title of object.
 
TString & Prepend(const char *cs)
 
TString & Append(const char *cs)
 
A TTree represents a columnar dataset.
 
virtual TBranch * GetBranch(const char *name)
Return pointer to the branch with the given name in this tree or its friends.
 
virtual Int_t SetBranchAddress(const char *bname, void *add, TBranch **ptr=nullptr)
Change branch address, dealing with clone trees properly.
 
TBranch * Branch(const char *name, T *obj, Int_t bufsize=32000, Int_t splitlevel=99)
Add a new branch, and infer the data type from the type of obj being passed.