114 if (clippedValPtr) *clippedValPtr=clippedValue ;
128 coutI(InputArguments) <<
"RooRealVar::isValid(" <<
GetName() <<
"): value " << value
129 <<
" out of range (" <<
getMin() <<
" - " <<
getMax() <<
")" << endl ;
163 inRange(newValue,0,&clipValue) ;
208 return frame(cmdList) ;
226 pc.
defineMutex(
"Range",
"RangeWithName",
"AutoRange") ;
229 pc.
defineInt(
"rangeSym",
"AutoRange",0,0) ;
257 if (pc.
getInt(
"rangeSym")==0) {
269 xmin = dmean-ddelta ;
270 xmax = dmean+ddelta ;
305 return new RooPlot(*
this,xlo,xhi,nbins);
335 coutE(InputArguments) <<
"RooAbsRealLValue::frame(" <<
GetName() <<
") ERROR: empty fit range, must specify plot range" << endl ;
339 coutE(InputArguments) <<
"RooAbsRealLValue::frame(" <<
GetName() <<
") ERROR: open ended fit range, must specify plot range" << endl ;
360 coutE(InputArguments) <<
"RooAbsRealLValue::frame(" <<
GetName() <<
") ERROR: empty fit range, must specify plot range" << endl ;
364 coutE(InputArguments) <<
"RooAbsRealLValue::frame(" <<
GetName() <<
") ERROR: open ended fit range, must specify plot range" << endl ;
389 os <<
indent <<
"--- RooAbsRealLValue ---" << endl;
392 os <<
indent <<
" Fit range is [ ";
394 os <<
getMin() << unit <<
" , ";
400 os <<
getMax() << unit <<
" ]" << endl;
403 os <<
"+INF ]" << endl;
423 coutE(Generation) <<
fName <<
"::" <<
ClassName() <<
":randomize: fails with unbounded fit range" << endl;
436 if (ibin<0 || ibin>=
numBins(rangeName)) {
437 coutE(InputArguments) <<
"RooAbsRealLValue::setBin(" <<
GetName() <<
") ERROR: bin index " << ibin
438 <<
" is out of range (0," <<
getBins(rangeName)-1 <<
")" << endl ;
506 const double val =
getVal() ;
507 const double epsilon = 1
e-8 * fabs(val) ;
509 const auto minMax =
getRange(
nullptr);
510 return minMax.first -
epsilon <= val && val <= minMax.second +
epsilon;
514 return std::any_of(ranges.begin(), ranges.end(), [val,
epsilon,
this](
const std::string& range){
515 const auto minMax = this->getRange(range.c_str());
516 return minMax.first - epsilon <= val && val <= minMax.second + epsilon;
554 return createHistogram(
name,
l) ;
581 pc.
defineString(
"ybinningName",
"YVar::BinningName",0,
"") ;
582 pc.
defineInt(
"nybins",
"YVar::BinningSpec",0) ;
588 pc.
defineString(
"zbinningName",
"ZVar::BinningName",0,
"") ;
589 pc.
defineInt(
"nzbins",
"ZVar::BinningSpec",0) ;
604 const char* axisLabel = pc.
getString(
"axisLabel") ;
619 ownBinning[0] =
kTRUE ;
635 ownBinning[1] =
kTRUE ;
652 ownBinning[2] =
kTRUE ;
661 if (ownBinning[0])
delete binning[0] ;
662 if (ownBinning[1])
delete binning[1] ;
663 if (ownBinning[2])
delete binning[2] ;
681 coutE(InputArguments) <<
"RooAbsRealLValue::createHistogram(" <<
GetName()
682 <<
") ERROR: fit range empty or open ended, must explicitly specify range" << endl ;
738 if ((!xlo && xhi) || (xlo && !xhi)) {
739 coutE(InputArguments) <<
"RooAbsRealLValue::createHistogram(" <<
GetName()
740 <<
") ERROR must specify either no range, or both limits" << endl ;
750 Int_t *nBins2 = nBins;
755 coutE(InputArguments) <<
"RooAbsRealLValue::createHistogram(" <<
GetName()
756 <<
") ERROR: fit range empty or open ended, must explicitly specify range" << endl ;
760 coutE(InputArguments) <<
"RooAbsRealLValue::createHistogram(" <<
GetName()
761 <<
") ERROR: fit range of " << yvar.
GetName() <<
" empty or open ended, must explicitly specify range" << endl ;
768 xlo_fit[1] = yvar.
getMin() ;
769 xhi_fit[1] = yvar.
getMax() ;
777 nbins_fit[1] = yvar.
getBins() ;
812 if ((!xlo && xhi) || (xlo && !xhi)) {
813 coutE(InputArguments) <<
"RooAbsRealLValue::createHistogram(" <<
GetName()
814 <<
") ERROR must specify either no range, or both limits" << endl ;
824 Int_t* nBins2 = nBins;
828 coutE(InputArguments) <<
"RooAbsRealLValue::createHistogram(" <<
GetName()
829 <<
") ERROR: fit range empty or open ended, must explicitly specify range" << endl ;
833 coutE(InputArguments) <<
"RooAbsRealLValue::createHistogram(" <<
GetName()
834 <<
") ERROR: fit range of " << yvar.
GetName() <<
" empty or open ended, must explicitly specify range" << endl ;
838 coutE(InputArguments) <<
"RooAbsRealLValue::createHistogram(" <<
GetName()
839 <<
") ERROR: fit range of " << zvar.
GetName() <<
" empty or open ended, must explicitly specify range" << endl ;
846 xlo_fit[1] = yvar.
getMin() ;
847 xhi_fit[1] = yvar.
getMax() ;
849 xlo_fit[2] = zvar.
getMin() ;
850 xhi_fit[2] = zvar.
getMax() ;
858 nbins_fit[1] = yvar.
getBins() ;
859 nbins_fit[2] = zvar.
getBins() ;
898 if (bin[0])
delete bin[0] ;
899 if (bin[1])
delete bin[1] ;
900 if (bin[2])
delete bin[2] ;
917 if(dim < 1 || dim > 3) {
918 oocoutE((
TObject*)0,InputArguments) <<
"RooAbsReal::createHistogram: dimension not supported: " << dim << endl;
928 for(index= 0; index < dim; index++) {
932 oocoutE((
TObject*)0,InputArguments) <<
"RooAbsRealLValue::createHistogram: variable is not real lvalue: " << arg->
GetName() << endl;
939 histTitle.
Prepend(
"Histogram of ");
945 if (bins[0]->isUniform()) {
954 if (bins[0]->isUniform() && bins[1]->isUniform()) {
965 if (bins[0]->isUniform() && bins[1]->isUniform() && bins[2]->isUniform()) {
979 oocoutE((
TObject*)0,InputArguments) <<
"RooAbsReal::createHistogram: unable to create a new histogram" << endl;
984 for(index= 0; index < dim; index++) {
1003 if((0 != tAxisLabel) && (0 != strlen(tAxisLabel))) {
1004 TString axisTitle(tAxisLabel);
1005 axisTitle.
Append(
" / ( ");
1006 for(
Int_t index2= 0; index2 < dim; index2++) {
1008 if(index2 > 0) axisTitle.
Append(
" x ");
1010 if(strlen(xyz[index2]->
getUnit())) {
static void indent(ostringstream &buf, int indent_level)
char * Form(const char *fmt,...)
RooAbsArg is the common abstract base class for objects that represent a value and a "shape" in RooFi...
RooAbsBinning is the abstract base class for RooRealVar binning definitions.
virtual Double_t * array() const =0
Int_t numBins() const
Return number of bins.
virtual Double_t highBound() const =0
virtual Double_t binCenter(Int_t bin) const =0
virtual Double_t lowBound() const =0
virtual Double_t averageBinWidth() const =0
virtual Bool_t add(const RooAbsArg &var, Bool_t silent=kFALSE)
Add the specified argument to list.
RooAbsData is the common abstract base class for binned and unbinned datasets.
Bool_t getRange(const RooAbsRealLValue &var, Double_t &lowest, Double_t &highest, Double_t marginFrac=0, Bool_t symMode=kFALSE) const
Fill Doubles 'lowest' and 'highest' with the lowest and highest value of observable 'var' in this dat...
Abstract base class for objects that are lvalues, i.e.
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.
void copyCache(const RooAbsArg *source, Bool_t valueOnly=kFALSE, Bool_t setValDirty=kTRUE)
Copy cache of another RooAbsArg to our cache.
virtual const RooAbsBinning & getBinning(const char *name=0, Bool_t verbose=kTRUE, Bool_t createOnTheFly=kFALSE) const =0
Retrive binning configuration with given name or default binning.
std::pair< double, double > getRange(const char *name=0) const
Get low and high bound of the variable.
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 void setBin(Int_t ibin, const char *rangeName=0)
Set value to center of bin 'ibin' of binning 'rangeName' (or of default binning if no range is specif...
virtual void setVal(Double_t value)=0
Set the current value of the object. Needs to be overridden by implementations.
virtual Int_t numBins(const char *rangeName=0) const
virtual Bool_t readFromStream(std::istream &is, Bool_t compact, Bool_t verbose=kFALSE)
Read object contents from given stream.
virtual void randomize(const char *rangeName=0)
Set a new value sampled from a uniform distribution over the fit range.
RooPlot * frame() const
Create a new RooPlot on the heap with a drawing frame initialized for this object,...
RooPlot * frame(const RooCmdArg &arg1, const RooCmdArg &arg2=RooCmdArg::none(), const RooCmdArg &arg3=RooCmdArg::none(), const RooCmdArg &arg4=RooCmdArg::none(), const RooCmdArg &arg5=RooCmdArg::none(), const RooCmdArg &arg6=RooCmdArg::none(), const RooCmdArg &arg7=RooCmdArg::none(), const RooCmdArg &arg8=RooCmdArg::none()) const
Create a new RooPlot on the heap with a drawing frame initialized for this object,...
TH1 * createHistogram(const char *name, const RooCmdArg &arg1=RooCmdArg::none(), const RooCmdArg &arg2=RooCmdArg::none(), const RooCmdArg &arg3=RooCmdArg::none(), const RooCmdArg &arg4=RooCmdArg::none(), const RooCmdArg &arg5=RooCmdArg::none(), const RooCmdArg &arg6=RooCmdArg::none(), const RooCmdArg &arg7=RooCmdArg::none(), const RooCmdArg &arg8=RooCmdArg::none()) const
virtual void writeToStream(std::ostream &os, Bool_t compact) const
Write object contents to given stream.
virtual Bool_t inRange(const char *name) const
Check if current value is inside range with given name.
virtual Bool_t isJacobianOK(const RooArgSet &depList) const
virtual Int_t getBins(const char *name=0) const
Get number of bins of currently defined range.
virtual void setValFast(Double_t value)
RooAbsRealLValue & operator=(const RooAbsRealLValue &)=default
Bool_t hasMin(const char *name=0) const
Check if variable has a lower bound.
virtual ~RooAbsRealLValue()
Destructor.
virtual Double_t getMin(const char *name=0) const
Get miniminum of currently defined range.
Bool_t fitRangeOKForPlotting() const
Check if fit range is usable as plot range, i.e.
virtual void setBinFast(Int_t ibin, const RooAbsBinning &binning)
Set value to center of bin 'ibin' of binning 'rangeName' (or of default binning if no range is specif...
RooAbsReal is the common abstract base class for objects that represent a real value and implements f...
TString getTitle(Bool_t appendUnit=kFALSE) const
Return this variable's title string.
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 printMultiline(std::ostream &os, Int_t contents, Bool_t verbose=kFALSE, TString indent="") const
Structure printing.
Double_t getVal(const RooArgSet *normalisationSet=nullptr) const
Evaluate object.
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.
RooCmdArg is a named container for two doubles, two integers two object points and three string point...
Class RooCmdConfig is a configurable parser for RooCmdArg named arguments.
TObject * getObject(const char *name, TObject *obj=0)
Return TObject property registered with name 'name'.
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...
void defineMutex(const char *argName1, const char *argName2)
Define arguments named argName1 and argName2 mutually exclusive.
Bool_t defineObject(const char *name, const char *argName, Int_t setNum, const TObject *obj=0, Bool_t isArray=kFALSE)
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_t convEmptyToNull=kFALSE)
Return string property registered with name 'name'.
Int_t getInt(const char *name, Int_t defaultValue=0)
Return integer property registered with name 'name'.
Bool_t defineDouble(const char *name, const char *argName, Int_t doubleNum, Double_t defValue=0.)
Define Double_t property name 'name' mapped to Double_t in slot 'doubleNum' in RooCmdArg with name ar...
void defineDependency(const char *refArgName, const char *neededArgName)
Define that processing argument name refArgName requires processing of argument named neededArgName t...
Double_t getDouble(const char *name, Double_t defaultValue=0)
Return Double_t property registered with name 'name'.
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...
Bool_t ok(Bool_t verbose) const
Return true of parsing was successful.
Bool_t process(const RooCmdArg &arg)
Process given RooCmdArg.
Bool_t hasProcessed(const char *cmdName) const
Return true if RooCmdArg with name 'cmdName' has been processed.
RooLinkedList is an collection class for internal use, storing a collection of RooAbsArg pointers in ...
virtual void Add(TObject *arg)
static Int_t isInfinite(Double_t x)
Return true if x is infinite by RooNumBer internal specification.
A RooPlot is a plot frame and a container for graphics objects within that frame.
void SetTitle(const char *name)
Set the title of the RooPlot to 'title'.
void SetName(const char *name)
Set the name of the RooPlot to 'name'.
static Double_t uniform(TRandom *generator=randomGenerator())
Return a number uniformly distributed from (0,1)
RooRealVar represents a 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.
virtual void SetXTitle(const char *title)
virtual void SetZTitle(const char *title)
virtual void SetYTitle(const char *title)
2-D histogram with a float per channel (see TH1 documentation)}
3-D histogram with a float per channel (see TH1 documentation)}
virtual const char * GetName() const
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 > tokenise(const std::string &str, const std::string &delims, bool returnEmptyToken=true)
Tokenise the string by splitting at the characters in delims.