58using std::endl, std::istream, std::ostream;
86 bool isInRange(
true) ;
117 const double min = binning.
lowBound() ;
123 for(std::size_t i = 0; i < values.size(); ++i) {
137 coutI(InputArguments) <<
"RooRealVar::isValid(" <<
GetName() <<
"): value " <<
value <<
" out of range ("
226 pc.
defineMutex(
"Range",
"RangeWithName",
"AutoRange") ;
229 pc.
defineInt(
"rangeSym",
"AutoRange",0,0) ;
258 if (pc.
getInt(
"rangeSym")==0) {
282 const char* title = pc.
getString(
"title",
nullptr,
true) ;
306 return new RooPlot(*
this,xlo,xhi,nbins);
336 coutE(InputArguments) <<
"RooAbsRealLValue::frame(" <<
GetName() <<
") ERROR: empty fit range, must specify plot range" << std::endl ;
340 coutE(InputArguments) <<
"RooAbsRealLValue::frame(" <<
GetName() <<
") ERROR: open ended fit range, must specify plot range" << std::endl ;
361 coutE(InputArguments) <<
"RooAbsRealLValue::frame(" <<
GetName() <<
") ERROR: empty fit range, must specify plot range" << std::endl ;
365 coutE(InputArguments) <<
"RooAbsRealLValue::frame(" <<
GetName() <<
") ERROR: open ended fit range, must specify plot range" << std::endl ;
390 os <<
indent <<
"--- RooAbsRealLValue ---" << std::endl;
393 os <<
indent <<
" Fit range is [ ";
395 os <<
getMin() << unit <<
" , ";
401 os <<
getMax() << unit <<
" ]" << std::endl;
404 os <<
"+INF ]" << std::endl;
424 coutE(Generation) <<
fName <<
"::" <<
ClassName() <<
":randomize: fails with unbounded fit range" << std::endl;
438 coutE(InputArguments) <<
"RooAbsRealLValue::setBin(" <<
GetName() <<
") ERROR: bin index " <<
ibin
489 const double val =
getVal() ;
496 return std::any_of(ranges.begin(), ranges.end(), [val,
this](
const std::string&
range){
497 const auto minMax = this->getRange(range.c_str());
498 return minMax.first <= val && val <= minMax.second;
536 return createHistogram(
name,
l) ;
563 pc.
defineString(
"ybinningName",
"YVar::BinningName",0,
"") ;
564 pc.
defineInt(
"nybins",
"YVar::BinningSpec",0) ;
570 pc.
defineString(
"zbinningName",
"ZVar::BinningName",0,
"") ;
571 pc.
defineInt(
"nzbins",
"ZVar::BinningSpec",0) ;
588 bool ownBinning[3] = {
false,
false,
false } ;
612 binning[1] = &
yvar.getBinning(pc.
getString(
"ybinningName",
nullptr,
true)) ;
619 binning[1] = &
yvar.getBinning() ;
629 binning[2] = &
zvar.getBinning(pc.
getString(
"zbinningName",
nullptr,
true)) ;
636 binning[2] = &
zvar.getBinning() ;
663 coutE(InputArguments) <<
"RooAbsRealLValue::createHistogram(" <<
GetName()
664 <<
") ERROR: fit range empty or open ended, must explicitly specify range" << std::endl ;
718 double* xlo,
double* xhi,
Int_t* nBins)
const
720 if ((!xlo && xhi) || (xlo && !xhi)) {
721 coutE(InputArguments) <<
"RooAbsRealLValue::createHistogram(" <<
GetName()
722 <<
") ERROR must specify either no range, or both limits" << std::endl ;
737 coutE(InputArguments) <<
"RooAbsRealLValue::createHistogram(" <<
GetName()
738 <<
") ERROR: fit range empty or open ended, must explicitly specify range" << std::endl ;
741 if (!
yvar.fitRangeOKForPlotting()) {
742 coutE(InputArguments) <<
"RooAbsRealLValue::createHistogram(" <<
GetName()
743 <<
") ERROR: fit range of " <<
yvar.GetName() <<
" empty or open ended, must explicitly specify range" << std::endl ;
794 if ((!xlo && xhi) || (xlo && !xhi)) {
795 coutE(InputArguments) <<
"RooAbsRealLValue::createHistogram(" <<
GetName()
796 <<
") ERROR must specify either no range, or both limits" << std::endl ;
810 coutE(InputArguments) <<
"RooAbsRealLValue::createHistogram(" <<
GetName()
811 <<
") ERROR: fit range empty or open ended, must explicitly specify range" << std::endl ;
814 if (!
yvar.fitRangeOKForPlotting()) {
815 coutE(InputArguments) <<
"RooAbsRealLValue::createHistogram(" <<
GetName()
816 <<
") ERROR: fit range of " <<
yvar.GetName() <<
" empty or open ended, must explicitly specify range" << std::endl ;
819 if (!
zvar.fitRangeOKForPlotting()) {
820 coutE(InputArguments) <<
"RooAbsRealLValue::createHistogram(" <<
GetName()
821 <<
") ERROR: fit range of " <<
zvar.GetName() <<
" empty or open ended, must explicitly specify range" << std::endl ;
870 double* xlo,
double* xhi,
Int_t* nBins)
880 if (bin[0])
delete bin[0] ;
881 if (bin[1])
delete bin[1] ;
882 if (bin[2])
delete bin[2] ;
900 oocoutE(
nullptr,InputArguments) <<
"RooAbsReal::createHistogram: dimension not supported: " << dim << std::endl;
914 oocoutE(
nullptr,InputArguments) <<
"RooAbsRealLValue::createHistogram: variable is not real lvalue: " << arg->
GetName() << std::endl;
927 if (bins[0]->isUniform()) {
936 if (bins[0]->isUniform() && bins[1]->isUniform()) {
947 if (bins[0]->isUniform() && bins[1]->isUniform() && bins[2]->isUniform()) {
961 oocoutE(
nullptr,InputArguments) <<
"RooAbsReal::createHistogram: unable to create a new histogram" << std::endl;
1032 <<
"\", but integrating a RooAbsRealLValue is not allowed!";
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 index
Option_t Option_t TPoint TPoint const char GetTextMagnitude GetFillStyle GetLineColor GetLineWidth GetMarkerStyle GetTextAlign GetTextColor GetTextSize void value
char * Form(const char *fmt,...)
Formats a string in a circular formatting buffer.
Common abstract base class for objects that represent a value and a "shape" in RooFit.
Abstract base class for RooRealVar binning definitions.
virtual double binCenter(Int_t bin) const =0
Int_t numBins() const
Return number of bins.
virtual double averageBinWidth() const =0
virtual double highBound() const =0
virtual double lowBound() const =0
virtual double * array() const =0
virtual bool add(const RooAbsArg &var, bool silent=false)
Add the specified argument to list.
Storage_t::size_type size() const
Abstract base class for binned and unbinned datasets.
Abstract base class for objects that are lvalues, i.e.
Abstract base class for objects that represent a real value that may appear on the left hand side of ...
Int_t numBins(const char *rangeName=nullptr) const override
virtual Int_t getBins(const char *name=nullptr) const
Get number of bins of currently defined range.
RooFit::OwningPtr< RooAbsReal > createIntegral(const RooArgSet &iset, const RooArgSet *nset=nullptr, const RooNumIntConfig *cfg=nullptr, const char *rangeName=nullptr) const override
Create an object that represents the integral of the function over one or more observables listed in ...
virtual void setValFast(double value)
RooPlot * frame(const RooCmdArg &arg1, const RooCmdArg &arg2={}, const RooCmdArg &arg3={}, const RooCmdArg &arg4={}, const RooCmdArg &arg5={}, const RooCmdArg &arg6={}, const RooCmdArg &arg7={}, const RooCmdArg &arg8={}) const
Create a new RooPlot on the heap with a drawing frame initialized for this object,...
bool isValidReal(double value, bool printError=false) const override
Check if given value is valid.
virtual const RooAbsBinning & getBinning(const char *name=nullptr, bool verbose=true, bool createOnTheFly=false) const =0
Retrieve binning configuration with given name or default binning.
TH1 * createHistogram(const char *name, const RooCmdArg &arg1={}, const RooCmdArg &arg2={}, const RooCmdArg &arg3={}, const RooCmdArg &arg4={}, const RooCmdArg &arg5={}, const RooCmdArg &arg6={}, const RooCmdArg &arg7={}, const RooCmdArg &arg8={}) const
virtual bool isJacobianOK(const RooArgSet &depList) const
virtual double getMax(const char *name=nullptr) const
Get maximum of currently defined range.
RooPlot * frame() const
Create a new RooPlot on the heap with a drawing frame initialized for this object,...
bool hasMax(const char *name=nullptr) const
Check if variable has an upper bound.
void copyCache(const RooAbsArg *source, bool valueOnly=false, bool setValDirty=true) override
Copy cache of another RooAbsArg to our cache.
bool fitRangeOKForPlotting() const
Check if fit range is usable as plot range, i.e.
void setBin(Int_t ibin, const char *rangeName=nullptr) override
Set value to center of bin 'ibin' of binning 'rangeName' (or of default binning if no range is specif...
void writeToStream(std::ostream &os, bool compact) const override
Write object contents to given stream.
void randomize(const char *rangeName=nullptr) override
Set a new value sampled from a uniform distribution over the fit range.
virtual void setVal(double value)=0
Set the current value of the object. Needs to be overridden by implementations.
virtual double getMin(const char *name=nullptr) const
Get minimum of currently defined range.
bool readFromStream(std::istream &is, bool compact, bool verbose=false) override
Read object contents from given stream.
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.
std::pair< double, double > getRange(const char *name=nullptr) const
Get low and high bound of the variable.
virtual RooAbsArg & operator=(double newValue)
Assignment operator from a double.
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 printMultiline(std::ostream &os, Int_t contents, bool verbose=false, TString indent="") const override
Structure printing.
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.
TString getTitle(bool appendUnit=false) const
Return this variable's title string.
const Text_t * getUnit() const
RooArgList is a container object that can hold multiple RooAbsArg objects.
RooAbsArg * at(Int_t idx) const
Return object at given index, or nullptr if index is out of range.
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.
double getDouble(const char *name, double defaultValue=0.0) const
Return double property registered with name 'name'.
void defineDependency(const char *refArgName, const char *neededArgName)
Define that processing argument name refArgName requires processing of argument named neededArgName t...
bool defineDouble(const char *name, const char *argName, int doubleNum, double defValue=0.0)
Define double property name 'name' mapped to double in slot 'doubleNum' in RooCmdArg with name argNam...
bool ok(bool verbose) const
Return true of parsing was successful.
bool defineObject(const char *name, const char *argName, int setNum, const TObject *obj=nullptr, bool isArray=false)
Define TObject property name 'name' mapped to object in slot 'setNum' in RooCmdArg with name argName ...
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'.
TObject * getObject(const char *name, TObject *obj=nullptr) const
Return TObject property registered with name 'name'.
Collection class for internal use, storing a collection of RooAbsArg pointers in a doubly linked list...
Holds the configuration parameters of the various numeric integrators used by RooRealIntegral.
static constexpr int isInfinite(double x)
Return true if x is infinite by RooNumber internal specification.
Plot frame and a container for graphics objects within that frame.
static double uniform(TRandom *generator=randomGenerator())
Return a number uniformly distributed from (0,1)
Variable that can be changed from the outside.
1-D histogram with a float per channel (see TH1 documentation)
TH1 is the base class of all histogram classes in ROOT.
2-D histogram with a float per channel (see TH1 documentation)
3-D histogram with a float per channel (see TH1 documentation)
const char * GetName() const override
Returns name of object.
Mother of all ROOT objects.
virtual const char * ClassName() const
Returns name of class to which the object belongs.
const char * Data() const
TString & Prepend(const char *cs)
TString & Append(const char *cs)
std::vector< std::string > Split(std::string_view str, std::string_view delims, bool skipEmpty=false)
Splits a string at each character in delims.
T * OwningPtr
An alias for raw pointers for indicating that the return type of a RooFit function is an owning point...