110 _value= 0.5*(minValue + maxValue);
145 _error(other._error),
146 _asymErrLo(other._asymErrLo),
147 _asymErrHi(other._asymErrHi)
238 if (clipValue !=
_value) {
253 inRange(value,rangeName,&clipValue) ;
255 if (clipValue !=
_value) {
329 if (!createOnTheFly) {
336 coutI(
Eval) <<
"RooRealVar::getBinning(" <<
GetName() <<
") new range named '"
337 <<
name <<
"' created with default bounds" << endl ;
350 std::list<std::string> binningNames;
352 binningNames.push_back(
"");
357 while((binning = iter.
next())) {
359 binningNames.push_back(
string(
name));
363 while((binning = iter.
next())) {
365 binningNames.push_back(
string(
name));
394 altBinning->
Remove(oldBinning) ;
403 altBinning->
Add(newBinning) ;
424 <<
"): Proposed new fit min. larger than max., setting min. to max." << endl ;
454 <<
"): Proposed new fit max. smaller than min., setting max. to min." << endl ;
487 <<
"): Proposed new fit max. smaller than min., setting max. to min." << endl ;
488 binning.setRange(min,min) ;
490 binning.setRange(min,max) ;
495 <<
") new range named '" <<
name <<
"' created with bounds ["
496 << min <<
"," << max <<
"]" << endl ;
521 TString token,errorPrefix(
"RooRealVar::readFromStream(") ;
548 if (!reprocessToken) {
572 Double_t asymErrLo=0., asymErrHi=0.;
584 haveConstant =
kTRUE ;
600 <<
") WARNING: plot range deprecated, removed P(...) token" << endl ;
617 <<
") WARNING: F(lo-hi:bins) token deprecated, use L(lo-hi) B(bins)" << endl ;
623 Double_t fitMin = 0.0, fitMax = 0.0;
649 if (haveValue)
setVal(value) ;
667 char fmtVal[16], fmtErr[16] ;
670 if (
_value>=0) os <<
" " ;
683 os << tmp->
Data() <<
" " ;
709 os <<
"B(" <<
getBins() <<
") " ;
714 os <<
"// [" <<
getUnit() <<
"]" ;
763 os <<
"B(" <<
getBins() <<
") " ;
768 os <<
"// [" <<
getUnit() <<
"]" ;
781 if (opt &&
TString(opt)==
"I") {
794 os <<
indent <<
"--- RooRealVar ---" << endl;
814 pc.defineString(
"what",
"FormatArgs",0,
"") ;
815 pc.defineInt(
"autop",
"FormatArgs::AutoPrecision",0,2) ;
816 pc.defineInt(
"fixedp",
"FormatArgs::FixedPrecision",0,2) ;
817 pc.defineInt(
"tlatex",
"FormatArgs::TLatexStyle",0,0) ;
818 pc.defineInt(
"latex",
"FormatArgs::LatexStyle",0,0) ;
819 pc.defineInt(
"latext",
"FormatArgs::LatexTableStyle",0,0) ;
820 pc.defineInt(
"verbn",
"FormatArgs::VerbatimName",0,0) ;
821 pc.defineMutex(
"FormatArgs::TLatexStyle",
"FormatArgs::LatexStyle",
"FormatArgs::LatexTableStyle") ;
822 pc.defineMutex(
"FormatArgs::AutoPrecision",
"FormatArgs::FixedPrecision") ;
832 options =
pc.getString(
"what") ;
834 if (
pc.getInt(
"tlatex")) {
836 }
else if (
pc.getInt(
"latex")) {
838 }
else if (
pc.getInt(
"latext")) {
842 if (
pc.getInt(
"verbn")) options +=
"V" ;
843 Int_t sigDigits = 2 ;
844 if (
pc.hasProcessed(
"FormatArgs::AutoPrecision")) {
846 sigDigits =
pc.getInt(
"autop") ;
847 }
else if (
pc.hasProcessed(
"FormatArgs::FixedPrecision")) {
849 sigDigits =
pc.getInt(
"fixedp") ;
852 return format(sigDigits,options) ;
893 if (latexTableMode) latexMode =
kTRUE ;
897 if(sigDigits < 1) sigDigits= 1;
898 Int_t leadingDigitVal = 0;
899 if (useErrorForPrecision) {
904 if (
_value==0) leadingDigitVal=0 ;
907 Int_t whereVal= leadingDigitVal - sigDigits + 1;
908 Int_t whereErr= leadingDigitErr - sigDigits + 1;
909 char fmtVal[16], fmtErr[16];
911 if (
_value<0) whereVal -= 1 ;
912 snprintf(fmtVal,16,
"%%.%df", whereVal < 0 ? -whereVal : 0);
913 snprintf(fmtErr,16,
"%%.%df", whereErr < 0 ? -whereErr : 0);
915 if(latexMode)
text->Append(
"$");
918 if (latexTableMode && latexVerbatimName) {
919 text->Append(
"\\verb+") ;
922 if (latexVerbatimName)
text->Append(
"+") ;
924 if (!latexTableMode) {
927 text->Append(
" $ & $ ");
939 text->Append(buffer);
945 text->Append(
" #pm ");
948 text->Append(
"\\pm ");
951 text->Append(
" +/- ");
954 text->Append(buffer);
959 text->Append(
" #pm ");
962 text->Append(buffer);
963 text->Append(
"}^{+") ;
965 text->Append(buffer);
969 text->Append(
"\\pm ");
972 text->Append(buffer);
973 text->Append(
"}^{+") ;
975 text->Append(buffer);
979 text->Append(
" +/- ");
982 text->Append(buffer);
985 text->Append(buffer);
996 if(latexMode)
text->Append(
"$");
1077 loName.
Append(
"_aerr_lo") ;
1088 hiName.
Append(
"_aerr_hi") ;
1112 coutE(
Eval) <<
"RooAbsReal::fillTreeBranch(" <<
GetName() <<
") ERROR: not attached to tree" << endl ;
1121 if (errBranch) errBranch->
Fill() ;
1126 loName.
Append(
"_aerr_lo") ;
1128 if (loBranch) loBranch->
Fill() ;
1131 hiName.
Append(
"_aerr_hi") ;
1133 if (hiBranch) hiBranch->
Fill() ;
1149 if (valueOnly) return ;
1166void RooRealVar::Streamer(
TBuffer &R__b)
1172 RooAbsRealLValue::Streamer(R__b);
1174 coutI(
Eval) <<
"RooRealVar::Streamer(" <<
GetName() <<
") converting version 1 data format" << endl ;
1194 tmpSharedProp->Streamer(R__b) ;
1198 delete tmpSharedProp ;
1208 RooAbsRealLValue::Streamer(R__b);
static void indent(ostringstream &buf, int indent_level)
double pow(double, double)
char * Form(const char *fmt,...)
RooAbsArg is the common abstract base class for objects that represent a value (of arbitrary type) an...
TString cleanBranchName() const
Construct a mangled name from the actual name that is free of any math symbols that might be interpre...
void setShapeDirty() const
Bool_t getAttribute(const Text_t *name) const
Check if a named attribute is set. By default, all attributes are unset.
Bool_t isConstant() const
void setValueDirty() const
RooAbsBinning is the abstract base class for RooRealVar binning definitions This class defines the in...
virtual void removeHook(RooAbsRealLValue &) const
virtual RooAbsBinning * clone(const char *name=0) const =0
virtual Bool_t isShareable() const
virtual void insertHook(RooAbsRealLValue &) const
virtual void setMin(Double_t xlo)
virtual void setMax(Double_t xhi)
RooAbsRealLValue is the common abstract base class for objects that represent a real value that may a...
virtual Double_t getMax(const char *name=0) const
Get maximum of currently defined range.
Bool_t hasMax(const char *name=0) const
Check if variable has an upper bound.
virtual Bool_t isValidReal(Double_t value, Bool_t printError=kFALSE) const
Check if given value is valid.
virtual void printMultiline(std::ostream &os, Int_t contents, Bool_t verbose=kFALSE, TString indent="") const
Structure printing.
virtual Bool_t inRange(const char *name) const
Check if current value is inside range with given name.
virtual Int_t getBins(const char *name=0) const
Get number of bins of currently defined range.
RooAbsRealLValue & operator=(const RooAbsRealLValue &)=default
void setConstant(Bool_t value=kTRUE)
Bool_t hasMin(const char *name=0) const
Check if variable has a lower bound.
virtual Double_t getMin(const char *name=0) const
Get miniminum of currently defined range.
RooAbsReal is the common abstract base class for objects that represent a real value and implements f...
virtual void copyCache(const RooAbsArg *source, Bool_t valueOnly=kFALSE, Bool_t setValDirty=kTRUE)
Copy the cached value of another RooAbsArg to our cache.
virtual void attachToVStore(RooVectorDataStore &vstore)
virtual void attachToTree(TTree &t, Int_t bufSize=32000)
Attach object to a branch of given TTree.
Double_t getVal(const RooArgSet *normalisationSet=nullptr) const
Evaluate object.
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.
RooCmdArg is a named container for two doubles, two integers two object points and three string point...
void setProcessRecArgs(Bool_t flag, Bool_t prefix=kTRUE)
Class RooCmdConfig is a configurable parser for RooCmdArg named arguments.
RooErrorVar is an auxilary class that represents the error of a RooRealVar as a seperate object.
A one-time forward iterator working on RooLinkedList or RooAbsCollection.
RooAbsArg * next()
Return next element or nullptr if at end.
RooLinkedList is an collection class for internal use, storing a collection of RooAbsArg pointers in ...
TObject * FindObject(const char *name) const
Return pointer to obejct with given name.
RooFIter fwdIterator() const
Create a one-time-use forward iterator for this list.
TIterator * MakeIterator(Bool_t forward=kTRUE) const
Create a TIterator for this list.
void Delete(Option_t *o=0)
Remove all elements in collection and delete all elements NB: Collection does not own elements,...
virtual void Add(TObject *arg)
void Clear(Option_t *o=0)
Remove all elements from collection.
virtual Bool_t Remove(TObject *arg)
Remove object from collection.
static Int_t isInfinite(Double_t x)
Return true if x is infinite by RooNumBer internal specification.
Class RooParamBinning is an implementation of RooAbsBinning that constructs a binning with a range de...
RooRangeBinning is binning/range definition that only defines a range but no binning.
Class RooRealVarSharedProperties is an implementation of RooSharedProperties that stores the properti...
RooLinkedList _altBinning
RooRealVar represents a fundamental (non-derived) real valued object.
Double_t getAsymErrorLo() const
static RooSharedPropertiesList _sharedPropList
RooRealVarSharedProperties * sharedProp() const
static void printSigDigits(Int_t ndig=5)
Set number of digits to show when printing RooRealVars.
Bool_t hasBinning(const char *name) const
Returns true if variable has a binning with 'name'.
Bool_t hasAsymError(Bool_t allowZero=kTRUE) const
virtual void printValue(std::ostream &os) const
Print value of variable.
static void printScientific(Bool_t flag=kFALSE)
If true, contents of RooRealVars will be printed in scientific notation.
virtual Int_t defaultPrintContents(Option_t *opt) const
Mapping of Print() option string to RooPrintable contents specifications.
void setMin(const char *name, Double_t value)
Set minimum of name range to given value.
void setBins(Int_t nBins, const char *name=0)
virtual void writeToStream(std::ostream &os, Bool_t compact) const
Write object contents to given stream.
RooLinkedList _altNonSharedBinning
void setError(Double_t value)
virtual void printMultiline(std::ostream &os, Int_t contents, Bool_t verbose=kFALSE, TString indent="") const
Detailed printing interface.
virtual void printExtras(std::ostream &os) const
Print extras of variable: (asymmetric) error, constant flag, limits and binning.
Double_t chopAt(Double_t what, Int_t where) const
Utility to calculate number of decimals to show based on magnitude of error.
static Int_t _printSigDigits
void setRange(const char *name, Double_t min, Double_t max)
Set range named 'name to [min,max].
std::list< std::string > getBinningNames() const
Get a list of all binning names.
virtual void attachToVStore(RooVectorDataStore &vstore)
Overload RooAbsReal::attachToTree to also attach branches for errors and/or asymmetric errors attribu...
void removeRange(const char *name=0)
Double_t getAsymErrorHi() const
void setMax(const char *name, Double_t value)
Set maximum of name range to given value.
static RooRealVarSharedProperties _nullProp
virtual Double_t getValV(const RooArgSet *nset=0) const
Return value of variable.
void setAsymError(Double_t lo, Double_t hi)
RooRealVarSharedProperties * _sharedProp
void deleteSharedProperties()
No longer used?
virtual void fillTreeBranch(TTree &t)
Overload RooAbsReal::fillTreeBranch to also fill tree branches with (asymmetric) errors if requested.
Bool_t hasError(Bool_t allowZero=kTRUE) const
virtual ~RooRealVar()
Destructor.
RooErrorVar * errorVar() const
Return a RooAbsRealLValue representing the error associated with this variable.
Double_t getError() const
virtual void copyCache(const RooAbsArg *source, Bool_t valueOnly=kFALSE, Bool_t setValDirty=kTRUE)
Copy the cached value of another RooAbsArg to our cache Warning: This function copies the cached valu...
virtual Bool_t readFromStream(std::istream &is, Bool_t compact, Bool_t verbose=kFALSE)
Read object contents from given stream.
static Bool_t _printScientific
TString * format(const RooCmdArg &formatArg) const
Format contents of RooRealVar for pretty printing on RooPlot parameter boxes.
const RooAbsBinning & getBinning(const char *name=0, Bool_t verbose=kTRUE, Bool_t createOnTheFly=kFALSE) const
Return binning definition with name.
RooRealVar()
Default constructor.
virtual void attachToTree(TTree &t, Int_t bufSize=32000)
Overload RooAbsReal::attachToTree to also attach branches for errors and/or asymmetric errors attribu...
void setBinning(const RooAbsBinning &binning, const char *name=0)
Add given binning under name 'name' with this variable.
virtual void setVal(Double_t value)
Set value of variable to 'value'.
RooRealVar & operator=(const RooRealVar &other)
Assign the values of another RooRealVar to this instance.
Class RooSharedPropertiesList maintains the properties of RooRealVars and RooCategories that are clon...
void unregisterProperties(RooSharedProperties *)
Decrease reference count of property.
RooSharedProperties * registerProperties(RooSharedProperties *, Bool_t canDeleteIncoming=kTRUE)
Register property into list and take ownership.
Bool_t atEOL()
If true, parser is at end of line in stream.
Bool_t readInteger(Int_t &value, Bool_t zapOnError=kFALSE)
Read a token and convert it to an Int_t.
Bool_t readDouble(Double_t &value, Bool_t zapOnError=kFALSE)
Read the next token and convert it to a Double_t.
Bool_t convertToDouble(const TString &token, Double_t &value)
Convert given string to a double. Return true if the conversion fails.
void zapToEnd(Bool_t inclContLines=kFALSE)
Eat all characters up to and including then end of the current line.
Bool_t expectToken(const TString &expected, Bool_t zapOnError=kFALSE)
Read the next token and return kTRUE if it is identical to the given 'expected' token.
TString readToken()
Read one token separated by any of the know punctuation characters This function recognizes and handl...
void setAsymErrorBuffer(Double_t *newBufL, Double_t *newBufH)
void setErrorBuffer(Double_t *newBuf)
void setBuffer(RooAbsReal *real, Double_t *newBuf)
RooVectorDataStore is the abstract base class for data collection that use a TTree as internal storag...
Bool_t hasAsymError(RooAbsReal *real)
Bool_t isFullReal(RooAbsReal *real)
RealFullVector * addRealFull(RooAbsReal *real)
Bool_t hasError(RooAbsReal *real)
A TTree is a list of TBranches.
Buffer base class used for serializing objects.
virtual void SetByteCount(UInt_t cntpos, Bool_t packInVersion=kFALSE)=0
virtual Version_t ReadVersion(UInt_t *start=0, UInt_t *bcnt=0, const TClass *cl=0)=0
virtual Int_t CheckByteCount(UInt_t startpos, UInt_t bcnt, const TClass *clss)=0
virtual UInt_t WriteVersion(const TClass *cl, Bool_t useBcnt=kFALSE)=0
Iterator abstract base class.
virtual TObject * Next()=0
virtual void SetTitle(const char *title="")
Set the title of the TNamed.
virtual void SetName(const char *name)
Set the name of the TNamed.
virtual const char * GetTitle() const
Returns title of object.
virtual const char * GetName() const
Returns name of object.
virtual TObject * FindObject(const char *name) const
Must be redefined in derived classes.
void ToLower()
Change string to lower-case.
int CompareTo(const char *cs, ECaseCompare cmp=kExact) const
Compare a string to char *cs2.
const char * Data() const
TString & Prepend(const char *cs)
TString & Append(const char *cs)
Bool_t Contains(const char *pat, ECaseCompare cmp=kExact) const
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=0)
Change branch address, dealing with clone trees properly.
virtual Int_t Branch(TCollection *list, Int_t bufsize=32000, Int_t splitlevel=99, const char *name="")
Create one branch for each element in the collection.
VecExpr< UnaryOp< Fabs< T >, VecExpr< A, T, D >, T >, T, D > fabs(const VecExpr< A, T, D > &rhs)
static constexpr double pc