75 RooAbsRealLValue(name, title, unit), _error(-1), _asymErrLo(1), _asymErrHi(-1), _sharedProp(0)
93 RooAbsRealLValue(name, title, unit), _error(-1), _asymErrLo(1), _asymErrHi(-1), _sharedProp(0)
112 _value= 0.5*(minValue + maxValue);
128 RooAbsRealLValue(name, title, unit), _error(-1), _asymErrLo(1), _asymErrHi(-1), _sharedProp(0)
144 _error(other._error),
145 _asymErrLo(other._asymErrLo),
146 _asymErrHi(other._asymErrHi)
207 if (clipValue !=
_value) {
222 inRange(value,rangeName,&clipValue) ;
224 if (clipValue !=
_value) {
298 if (!createOnTheFly) {
305 coutI(
Eval) <<
"RooRealVar::getBinning(" <<
GetName() <<
") new range named '"
306 << name <<
"' created with default bounds" << endl ;
319 std::list<std::string> binningNames;
321 binningNames.push_back(
"");
326 while((binning = iter.
next())) {
328 binningNames.push_back(
string(name));
332 while((binning = iter.
next())) {
334 binningNames.push_back(
string(name));
353 _binning = newBinning ;
363 altBinning->
Remove(oldBinning) ;
372 altBinning->
Add(newBinning) ;
393 <<
"): Proposed new fit min. larger than max., setting min. to max." << endl ;
423 <<
"): Proposed new fit max. smaller than min., setting max. to min." << endl ;
456 <<
"): Proposed new fit max. smaller than min., setting max. to min." << endl ;
457 binning.setRange(min,min) ;
459 binning.setRange(min,max) ;
464 <<
") new range named '" << name <<
"' created with bounds ["
465 << min <<
"," << max <<
"]" << endl ;
490 TString token,errorPrefix(
"RooRealVar::readFromStream(") ;
517 if (!reprocessToken) {
541 Double_t asymErrLo=0., asymErrHi=0.;
553 haveConstant =
kTRUE ;
569 <<
") WARNING: plot range deprecated, removed P(...) token" << endl ;
586 <<
") WARNING: F(lo-hi:bins) token deprecated, use L(lo-hi) B(bins)" << endl ;
592 Double_t fitMin = 0.0, fitMax = 0.0;
618 if (haveValue)
setVal(value) ;
636 char fmtVal[16], fmtErr[16] ;
639 if (
_value>=0) os <<
" " ;
652 os << tmp->
Data() <<
" " ;
678 os <<
"B(" <<
getBins() <<
") " ;
683 os <<
"// [" <<
getUnit() <<
"]" ;
732 os <<
"B(" <<
getBins() <<
") " ;
737 os <<
"// [" <<
getUnit() <<
"]" ;
750 if (opt &&
TString(opt)==
"I") {
763 os << indent <<
"--- RooRealVar ---" << endl;
766 os << indent <<
" Error = " <<
getError() << unit << endl;
784 pc.
defineInt(
"autop",
"FormatArgs::AutoPrecision",0,2) ;
785 pc.
defineInt(
"fixedp",
"FormatArgs::FixedPrecision",0,2) ;
786 pc.
defineInt(
"tlatex",
"FormatArgs::TLatexStyle",0,0) ;
787 pc.
defineInt(
"latex",
"FormatArgs::LatexStyle",0,0) ;
788 pc.
defineInt(
"latext",
"FormatArgs::LatexTableStyle",0,0) ;
789 pc.
defineInt(
"verbn",
"FormatArgs::VerbatimName",0,0) ;
790 pc.
defineMutex(
"FormatArgs::TLatexStyle",
"FormatArgs::LatexStyle",
"FormatArgs::LatexTableStyle") ;
791 pc.
defineMutex(
"FormatArgs::AutoPrecision",
"FormatArgs::FixedPrecision") ;
803 if (pc.
getInt(
"tlatex")) {
805 }
else if (pc.
getInt(
"latex")) {
807 }
else if (pc.
getInt(
"latext")) {
811 if (pc.
getInt(
"verbn")) options +=
"V" ;
812 Int_t sigDigits = 2 ;
815 sigDigits = pc.
getInt(
"autop") ;
816 }
else if (pc.
hasProcessed(
"FormatArgs::FixedPrecision")) {
818 sigDigits = pc.
getInt(
"fixedp") ;
821 return format(sigDigits,options) ;
853 Bool_t showName= opts.Contains(
"n");
854 Bool_t hideValue= opts.Contains(
"h");
855 Bool_t showError= opts.Contains(
"e");
856 Bool_t showUnit= opts.Contains(
"u");
857 Bool_t tlatexMode= opts.Contains(
"l");
858 Bool_t latexMode= opts.Contains(
"x");
859 Bool_t latexTableMode = opts.Contains(
"y") ;
860 Bool_t latexVerbatimName = opts.Contains(
"v") ;
862 if (latexTableMode) latexMode =
kTRUE ;
863 Bool_t asymError= opts.Contains(
"a") ;
866 if(sigDigits < 1) sigDigits= 1;
867 Int_t leadingDigitVal = 0;
868 if (useErrorForPrecision) {
870 if (
_value==0&&_error==0) leadingDigitVal=0 ;
873 if (
_value==0) leadingDigitVal=0 ;
876 Int_t whereVal= leadingDigitVal - sigDigits + 1;
877 Int_t whereErr= leadingDigitErr - sigDigits + 1;
878 char fmtVal[16], fmtErr[16];
880 if (
_value<0) whereVal -= 1 ;
881 snprintf(fmtVal,16,
"%%.%df", whereVal < 0 ? -whereVal : 0);
882 snprintf(fmtErr,16,
"%%.%df", whereErr < 0 ? -whereErr : 0);
884 if(latexMode) text->
Append(
"$");
887 if (latexTableMode && latexVerbatimName) {
891 if (latexVerbatimName) text->
Append(
"+") ;
893 if (!latexTableMode) {
907 snprintf(buffer, 256,fmtVal,
_value);
922 snprintf(buffer, 256,fmtErr,
getError());
965 if(latexMode) text->
Append(
"$");
1032 errName.Append(
"_err") ;
1038 format2.Append(
"/D");
1039 t.
Branch(errName, &_error, (
const Text_t*)format2, bufSize);
1046 loName.Append(
"_aerr_lo") ;
1052 format2.Append(
"/D");
1053 t.
Branch(loName, &_asymErrLo, (
const Text_t*)format2, bufSize);
1057 hiName.Append(
"_aerr_hi") ;
1063 format2.Append(
"/D");
1064 t.
Branch(hiName, &_asymErrHi, (
const Text_t*)format2, bufSize);
1081 coutE(
Eval) <<
"RooAbsReal::fillTreeBranch(" <<
GetName() <<
") ERROR: not attached to tree" << endl ;
1088 errName.Append(
"_err") ;
1090 if (errBranch) errBranch->
Fill() ;
1095 loName.Append(
"_aerr_lo") ;
1097 if (loBranch) loBranch->
Fill() ;
1100 hiName.Append(
"_aerr_hi") ;
1102 if (hiBranch) hiBranch->
Fill() ;
1135 void RooRealVar::Streamer(
TBuffer &R__b)
1141 RooAbsRealLValue::Streamer(R__b);
1143 coutI(
Eval) <<
"RooRealVar::Streamer(" <<
GetName() <<
") converting version 1 data format" << endl ;
1163 tmpSharedProp->Streamer(R__b) ;
1167 delete tmpSharedProp ;
1177 RooAbsRealLValue::Streamer(R__b);
virtual const char * GetTitle() const
Returns title of object.
TString * format(const RooCmdArg &formatArg) const
Format contents of RooRealVar for pretty printing on RooPlot parameter boxes.
static RooRealVarSharedProperties _nullProp
Bool_t hasBinning(const char *name) const
Returns true if variable has a binning with 'name'.
RooRealVar()
Default constructor.
static void printSigDigits(Int_t ndig=5)
void setShapeDirty() const
static Vc_ALWAYS_INLINE int_v min(const int_v &x, const int_v &y)
Bool_t hasProcessed(const char *cmdName) const
Return true if RooCmdArg with name 'cmdName' has been processed.
virtual void setMin(Double_t xlo)
Bool_t hasError(Bool_t allowZero=kTRUE) const
virtual Bool_t Remove(TObject *arg)
Remove object from collection.
TString cleanBranchName() const
Construct a mangled name from the actual name that is free of any math symbols that might be interpre...
const char * getString(const char *name, const char *defaultValue="", Bool_t convEmptyToNull=kFALSE)
Return string property registered with name 'name'.
virtual void SetName(const char *name)
Change (i.e.
void setBuffer(RooAbsReal *real, Double_t *newBuf)
Buffer base class used for serializing objects.
virtual Int_t CheckByteCount(UInt_t startpos, UInt_t bcnt, const TClass *clss)=0
const RooAbsBinning & getBinning(const char *name=0, Bool_t verbose=kTRUE, Bool_t createOnTheFly=kFALSE) const
Return binning definition with name.
virtual Double_t getMin(const char *name=0) const
virtual Bool_t isValidReal(Double_t value, Bool_t printError=kFALSE) const
Check if given value is valid.
static Int_t isInfinite(Double_t x)
Return true if x is infinite by RooNumBer internal specification.
void setAsymErrorBuffer(Double_t *newBufL, Double_t *newBufH)
TString & Prepend(const char *cs)
virtual UInt_t WriteVersion(const TClass *cl, Bool_t useBcnt=kFALSE)=0
Bool_t getAttribute(const Text_t *name) const
Check if a named attribute is set. By default, all attributes are unset.
virtual RooAbsBinning * clone(const char *name=0) const =0
virtual void copyCache(const RooAbsArg *source, Bool_t valueOnly=kFALSE, Bool_t setValDirty=kTRUE)
Copy the cached value of another RooAbsArg to our cache.
Iterator abstract base class.
void setMax(const char *name, Double_t value)
Set maximum of name range to given value.
virtual void copyCache(const RooAbsArg *source, Bool_t valueOnly=kFALSE, Bool_t setValDirty=kTRUE)
Copy cache of another RooAbsArg to our cache.
static Int_t _printSigDigits
const char * Data() const
Bool_t process(const RooCmdArg &arg)
Process given RooCmdArg.
void setBinning(const RooAbsBinning &binning, const char *name=0)
Add given binning under name 'name' with this variable.
Bool_t hasMax(const char *name=0) const
virtual void printMultiline(std::ostream &os, Int_t contents, Bool_t verbose=kFALSE, TString indent="") const
Detailed printing interface.
static RooSharedPropertiesList _sharedPropList
virtual Int_t SetBranchAddress(const char *bname, void *add, TBranch **ptr=0)
Change branch address, dealing with clone trees properly.
void removeRange(const char *name=0)
RooRealVarSharedProperties * _sharedProp
const Text_t * getUnit() const
void deleteSharedProperties()
virtual Int_t getBins(const char *name=0) const
virtual Int_t defaultPrintContents(Option_t *opt) const
Mapping of Print() option string to RooPrintable contents specifications.
std::map< std::string, std::string >::const_iterator iter
void setProcessRecArgs(Bool_t flag, Bool_t prefix=kTRUE)
double pow(double, double)
Bool_t defineString(const char *name, const char *argName, Int_t stringNum, const char *defValue="", Bool_t appendMode=kFALSE)
Define Double_t property name 'name' mapped to Double_t in slot 'stringNum' in RooCmdArg with name ar...
TString & Append(const char *cs)
TIterator * MakeIterator(Bool_t dir=kTRUE) const
Return an iterator over this list.
void setAsymError(Double_t lo, Double_t hi)
Double_t getVal(const RooArgSet *set=0) const
void setBins(Int_t nBins, const char *name=0)
RooSharedProperties * registerProperties(RooSharedProperties *, Bool_t canDeleteIncoming=kTRUE)
Register property into list and take ownership.
virtual void printValue(std::ostream &os) const
Print value of variable.
const char * getPlotLabel() const
Get the label associated with the variable.
Bool_t defineInt(const char *name, const char *argName, Int_t intNum, Int_t defValue=0)
Define integer property name 'name' mapped to integer in slot 'intNum' in RooCmdArg with name argName...
Bool_t hasError(RooAbsReal *real)
virtual void fillTreeBranch(TTree &t)
Fill the tree branch that associated with this object with its current value.
virtual TBranch * GetBranch(const char *name)
Return pointer to the branch with the given name in this tree or its friends.
Bool_t convertToDouble(const TString &token, Double_t &value)
Convert given string to a double. Return true if the conversion fails.
virtual Int_t Fill()
Loop on all leaves of this branch to fill Basket buffer.
Double_t chopAt(Double_t what, Int_t where) const
virtual void setVal(Double_t value)
Set value of variable to 'value'.
virtual void Add(TObject *arg)
void unregisterProperties(RooSharedProperties *)
Decrease reference count of property.
std::list< std::string > getBinningNames() const
Get a list of all binning names.
virtual void writeToStream(std::ostream &os, Bool_t compact) const
Write object contents to given stream.
VecExpr< UnaryOp< Fabs< T >, VecExpr< A, T, D >, T >, T, D > fabs(const VecExpr< A, T, D > &rhs)
Bool_t hasAsymError(RooAbsReal *real)
void defineMutex(const char *argName1, const char *argName2)
Define arguments named argName1 and argName2 mutually exclusive.
Int_t getInt(const char *name, Int_t defaultValue=0)
Return integer property registered with name 'name'.
void setConstant(Bool_t value=kTRUE)
void setMin(const char *name, Double_t value)
Set minimum of name range to given value.
TString readToken()
Read one token separated by any of the know punctuation characters This function recognizes and handl...
Bool_t hasAsymError(Bool_t allowZero=kTRUE) const
virtual void printMultiline(std::ostream &os, Int_t contents, Bool_t verbose=kFALSE, TString indent="") const
Structure printing.
char * Form(const char *fmt,...)
void zapToEnd(Bool_t inclContLines=kFALSE)
Eat all characters up to and including then end of the current line.
virtual const char * GetName() const
Returns name of object.
virtual void SetByteCount(UInt_t cntpos, Bool_t packInVersion=kFALSE)=0
TObject * FindObject(const char *name) const
Return pointer to obejct with given name.
Bool_t readDouble(Double_t &value, Bool_t zapOnError=kFALSE)
Read the next token and convert it to a Double_t.
Bool_t ok(Bool_t verbose) const
Return true of parsing was successful.
static void indent(ostringstream &buf, int indent_level)
virtual void attachToTree(TTree &t, Int_t bufSize=32000)
Attach object to a branch of given TTree.
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.
virtual void printExtras(std::ostream &os) const
Print extras of variable: (asymmetric) error, constant flag, limits and binning.
virtual void removeHook(RooAbsRealLValue &) const
Double_t getAsymErrorHi() const
Bool_t hasMin(const char *name=0) const
Bool_t isConstant() const
void setErrorBuffer(Double_t *newBuf)
static Bool_t _printScientific
void Delete(Option_t *o=0)
Remove all elements in collection and delete all elements NB: Collection does not own elements...
virtual void attachToTree(TTree &t, Int_t bufSize=32000)
Attach object to a branch of given TTree.
RooAbsReal is the common abstract base class for objects that represent a real value and implements f...
RooFIter fwdIterator() const
virtual void attachToVStore(RooVectorDataStore &vstore)
Bool_t isFullReal(RooAbsReal *real)
virtual void attachToVStore(RooVectorDataStore &vstore)
void setValueDirty() const
RooErrorVar * errorVar() const
Return a RooAbsRealLValue representing the error associated with this variable.
static Vc_ALWAYS_INLINE int_v max(const int_v &x, const int_v &y)
void setRange(const char *name, Double_t min, Double_t max)
Set range named 'name to [min,max].
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.
virtual Double_t getMax(const char *name=0) const
Double_t getAsymErrorLo() const
virtual Bool_t inRange(const char *name) const
Check if current value is inside range with given name.
Bool_t readInteger(Int_t &value, Bool_t zapOnError=kFALSE)
Read a token and convert it to an Int_t.
RealFullVector * addRealFull(RooAbsReal *real)
virtual TObject * Next()=0
RooLinkedList _altNonSharedBinning
virtual ~RooRealVar()
Destructor cout << "RooRealVar::dtor(" << this << ")" << endl ;.
virtual Bool_t readFromStream(std::istream &is, Bool_t compact, Bool_t verbose=kFALSE)
Read object contents from given stream.
RooLinkedList _altBinning
A TTree object has a header with a name and a title.
static void printScientific(Bool_t flag=kFALSE)
RooRealVarSharedProperties * sharedProp() const
RooAbsArg is the common abstract base class for objects that represent a value (of arbitrary type) an...
virtual Bool_t isShareable() const
A TTree is a list of TBranches.
virtual void SetTitle(const char *title="")
Change (i.e. set) the title of the TNamed.
Bool_t atEOL()
If true, parser is at end of line in stream.
virtual TObject * FindObject(const char *name) const
Must be redefined in derived classes.
virtual void setMax(Double_t xhi)
int CompareTo(const char *cs, ECaseCompare cmp=kExact) const
Compare a string to char *cs2.
virtual Version_t ReadVersion(UInt_t *start=0, UInt_t *bcnt=0, const TClass *cl=0)=0
void setError(Double_t value)
Double_t getError() const
virtual Double_t getValV(const RooArgSet *nset=0) const
Return value of variable.
virtual void insertHook(RooAbsRealLValue &) const