110 _value= 0.5*(minValue + maxValue);
145 _error(other._error),
146 _asymErrLo(other._asymErrLo),
147 _asymErrHi(other._asymErrHi)
209 if (clipValue !=
_value) {
224 inRange(value,rangeName,&clipValue) ;
226 if (clipValue !=
_value) {
243 title.Append(
" Error") ;
300 if (!createOnTheFly) {
307 coutI(
Eval) <<
"RooRealVar::getBinning(" <<
GetName() <<
") new range named '"
308 <<
name <<
"' created with default bounds" << endl ;
321 std::list<std::string> binningNames;
323 binningNames.push_back(
"");
328 while((binning = iter.
next())) {
330 binningNames.push_back(
string(
name));
334 while((binning = iter.
next())) {
336 binningNames.push_back(
string(
name));
365 altBinning->
Remove(oldBinning) ;
374 altBinning->
Add(newBinning) ;
395 <<
"): Proposed new fit min. larger than max., setting min. to max." << endl ;
425 <<
"): Proposed new fit max. smaller than min., setting max. to min." << endl ;
458 <<
"): Proposed new fit max. smaller than min., setting max. to min." << endl ;
459 binning.setRange(min,min) ;
461 binning.setRange(min,max) ;
466 <<
") new range named '" <<
name <<
"' created with bounds ["
467 << min <<
"," << max <<
"]" << endl ;
492 TString token,errorPrefix(
"RooRealVar::readFromStream(") ;
493 errorPrefix.Append(
GetName()) ;
494 errorPrefix.Append(
")") ;
519 if (!reprocessToken) {
524 if (!token.CompareTo(
"+")) {
534 if (tmp.CompareTo(
"(")) {
543 Double_t asymErrLo=0., asymErrHi=0.;
551 }
else if (!token.CompareTo(
"C")) {
555 haveConstant =
kTRUE ;
557 }
else if (!token.CompareTo(
"P")) {
571 <<
") WARNING: plot range deprecated, removed P(...) token" << endl ;
573 }
else if (!token.CompareTo(
"F")) {
588 <<
") WARNING: F(lo-hi:bins) token deprecated, use L(lo-hi) B(bins)" << endl ;
591 }
else if (!token.CompareTo(
"L")) {
594 Double_t fitMin = 0.0, fitMax = 0.0;
604 }
else if (!token.CompareTo(
"B")) {
620 if (haveValue)
setVal(value) ;
638 char fmtVal[16], fmtErr[16] ;
641 if (
_value>=0) os <<
" " ;
654 os << tmp->Data() <<
" " ;
680 os <<
"B(" <<
getBins() <<
") " ;
685 os <<
"// [" <<
getUnit() <<
"]" ;
734 os <<
"B(" <<
getBins() <<
") " ;
739 os <<
"// [" <<
getUnit() <<
"]" ;
752 if (opt && TString(opt)==
"I") {
765 os << indent <<
"--- RooRealVar ---" << endl;
767 if(!unit.IsNull()) unit.Prepend(
' ');
768 os << indent <<
" Error = " <<
getError() << unit << endl;
785 pc.defineString(
"what",
"FormatArgs",0,
"") ;
786 pc.defineInt(
"autop",
"FormatArgs::AutoPrecision",0,2) ;
787 pc.defineInt(
"fixedp",
"FormatArgs::FixedPrecision",0,2) ;
788 pc.defineInt(
"tlatex",
"FormatArgs::TLatexStyle",0,0) ;
789 pc.defineInt(
"latex",
"FormatArgs::LatexStyle",0,0) ;
790 pc.defineInt(
"latext",
"FormatArgs::LatexTableStyle",0,0) ;
791 pc.defineInt(
"verbn",
"FormatArgs::VerbatimName",0,0) ;
792 pc.defineMutex(
"FormatArgs::TLatexStyle",
"FormatArgs::LatexStyle",
"FormatArgs::LatexTableStyle") ;
793 pc.defineMutex(
"FormatArgs::AutoPrecision",
"FormatArgs::FixedPrecision") ;
803 options =
pc.getString(
"what") ;
805 if (
pc.getInt(
"tlatex")) {
807 }
else if (
pc.getInt(
"latex")) {
809 }
else if (
pc.getInt(
"latext")) {
813 if (
pc.getInt(
"verbn")) options +=
"V" ;
814 Int_t sigDigits = 2 ;
815 if (
pc.hasProcessed(
"FormatArgs::AutoPrecision")) {
817 sigDigits =
pc.getInt(
"autop") ;
818 }
else if (
pc.hasProcessed(
"FormatArgs::FixedPrecision")) {
820 sigDigits =
pc.getInt(
"fixedp") ;
823 return format(sigDigits,options) ;
853 TString opts(options);
855 Bool_t showName= opts.Contains(
"n");
856 Bool_t hideValue= opts.Contains(
"h");
857 Bool_t showError= opts.Contains(
"e");
858 Bool_t showUnit= opts.Contains(
"u");
859 Bool_t tlatexMode= opts.Contains(
"l");
860 Bool_t latexMode= opts.Contains(
"x");
861 Bool_t latexTableMode = opts.Contains(
"y") ;
862 Bool_t latexVerbatimName = opts.Contains(
"v") ;
864 if (latexTableMode) latexMode =
kTRUE ;
865 Bool_t asymError= opts.Contains(
"a") ;
868 if(sigDigits < 1) sigDigits= 1;
869 Int_t leadingDigitVal = 0;
870 if (useErrorForPrecision) {
875 if (
_value==0) leadingDigitVal=0 ;
878 Int_t whereVal= leadingDigitVal - sigDigits + 1;
879 Int_t whereErr= leadingDigitErr - sigDigits + 1;
880 char fmtVal[16], fmtErr[16];
882 if (
_value<0) whereVal -= 1 ;
883 snprintf(fmtVal,16,
"%%.%df", whereVal < 0 ? -whereVal : 0);
884 snprintf(fmtErr,16,
"%%.%df", whereErr < 0 ? -whereErr : 0);
885 TString *
text=
new TString();
886 if(latexMode)
text->Append(
"$");
889 if (latexTableMode && latexVerbatimName) {
890 text->Append(
"\\verb+") ;
893 if (latexVerbatimName)
text->Append(
"+") ;
895 if (!latexTableMode) {
898 text->Append(
" $ & $ ");
910 text->Append(buffer);
916 text->Append(
" #pm ");
919 text->Append(
"\\pm ");
922 text->Append(
" +/- ");
925 text->Append(buffer);
930 text->Append(
" #pm ");
933 text->Append(buffer);
934 text->Append(
"}^{+") ;
936 text->Append(buffer);
940 text->Append(
"\\pm ");
943 text->Append(buffer);
944 text->Append(
"}^{+") ;
946 text->Append(buffer);
950 text->Append(
" +/- ");
953 text->Append(buffer);
956 text->Append(buffer);
963 if(!
_unit.IsNull() && showUnit) {
967 if(latexMode)
text->Append(
"$");
1034 errName.Append(
"_err") ;
1035 TBranch* branch = t.GetBranch(errName) ;
1037 t.SetBranchAddress(errName,&
_error) ;
1039 TString format2(errName);
1040 format2.Append(
"/D");
1041 t.Branch(errName, &
_error, (
const Text_t*)format2, bufSize);
1048 loName.Append(
"_aerr_lo") ;
1049 TBranch* lobranch = t.GetBranch(loName) ;
1053 TString format2(loName);
1054 format2.Append(
"/D");
1059 hiName.Append(
"_aerr_hi") ;
1060 TBranch* hibranch = t.GetBranch(hiName) ;
1064 TString format2(hiName);
1065 format2.Append(
"/D");
1081 TBranch* valBranch = t.GetBranch(cleanName) ;
1083 coutE(
Eval) <<
"RooAbsReal::fillTreeBranch(" <<
GetName() <<
") ERROR: not attached to tree" << endl ;
1090 errName.Append(
"_err") ;
1091 TBranch* errBranch = t.GetBranch(errName) ;
1092 if (errBranch) errBranch->
Fill() ;
1097 loName.Append(
"_aerr_lo") ;
1098 TBranch* loBranch = t.GetBranch(loName) ;
1099 if (loBranch) loBranch->
Fill() ;
1102 hiName.Append(
"_aerr_hi") ;
1103 TBranch* hiBranch = t.GetBranch(hiName) ;
1104 if (hiBranch) hiBranch->
Fill() ;
1120 if (valueOnly) return ;
1137void RooRealVar::Streamer(
TBuffer &R__b)
1143 RooAbsRealLValue::Streamer(R__b);
1145 coutI(
Eval) <<
"RooRealVar::Streamer(" <<
GetName() <<
") converting version 1 data format" << endl ;
1165 tmpSharedProp->Streamer(R__b) ;
1169 delete tmpSharedProp ;
1179 RooAbsRealLValue::Streamer(R__b);
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
Bool_t hasMax(const char *name=0) const
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
void setConstant(Bool_t value=kTRUE)
Bool_t hasMin(const char *name=0) const
virtual Double_t getMin(const char *name=0) const
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 *set=0) const
Evaluate object. Returns either cached value or triggers a recalculation.
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.
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.
TIterator * MakeIterator(Bool_t dir=kTRUE) const
Return an iterator over this list.
RooFIter fwdIterator() const
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)
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'.
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.
VecExpr< UnaryOp< Fabs< T >, VecExpr< A, T, D >, T >, T, D > fabs(const VecExpr< A, T, D > &rhs)
static constexpr double pc