116 if (clippedValPtr) *clippedValPtr=clippedValue ;
131 <<
" out of range (" <<
getMin() <<
" - " <<
getMax() <<
")" << endl ;
165 inRange(newValue,0,&clipValue) ;
210 return frame(cmdList) ;
222 pc.defineDouble(
"min",
"Range",0,
getMin()) ;
223 pc.defineDouble(
"max",
"Range",1,
getMax()) ;
224 pc.defineInt(
"nbins",
"Bins",0,
getBins()) ;
225 pc.defineString(
"rangeName",
"RangeWithName",0,
"") ;
226 pc.defineString(
"name",
"Name",0,
"") ;
227 pc.defineString(
"title",
"Title",0,
"") ;
228 pc.defineMutex(
"Range",
"RangeWithName",
"AutoRange") ;
229 pc.defineObject(
"rangeData",
"AutoRange",0,0) ;
230 pc.defineDouble(
"rangeMargin",
"AutoRange",0,0.1) ;
231 pc.defineInt(
"rangeSym",
"AutoRange",0,0) ;
234 pc.process(cmdList) ;
241 if (
pc.hasProcessed(
"Range")) {
242 xmin =
pc.getDouble(
"min") ;
243 xmax =
pc.getDouble(
"max") ;
248 }
else if (
pc.hasProcessed(
"RangeWithName")) {
249 const char* rangeName=
pc.getString(
"rangeName",0,
kTRUE) ;
252 }
else if (
pc.hasProcessed(
"AutoRange")) {
253 auto rangeData =
static_cast<RooAbsData*
>(
pc.getObject(
"rangeData")) ;
259 if (
pc.getInt(
"rangeSym")==0) {
271 xmin = dmean-ddelta ;
272 xmax = dmean+ddelta ;
281 Int_t nbins =
pc.getInt(
"nbins") ;
283 const char* title =
pc.getString(
"title",0,
kTRUE) ;
307 return new RooPlot(*
this,xlo,xhi,nbins);
337 coutE(
InputArguments) <<
"RooAbsRealLValue::frame(" <<
GetName() <<
") ERROR: empty fit range, must specify plot range" << endl ;
341 coutE(
InputArguments) <<
"RooAbsRealLValue::frame(" <<
GetName() <<
") ERROR: open ended fit range, must specify plot range" << endl ;
362 coutE(
InputArguments) <<
"RooAbsRealLValue::frame(" <<
GetName() <<
") ERROR: empty fit range, must specify plot range" << endl ;
366 coutE(
InputArguments) <<
"RooAbsRealLValue::frame(" <<
GetName() <<
") ERROR: open ended fit range, must specify plot range" << endl ;
391 os <<
indent <<
"--- RooAbsRealLValue ---" << endl;
394 os <<
indent <<
" Fit range is [ ";
396 os <<
getMin() << unit <<
" , ";
402 os <<
getMax() << unit <<
" ]" << endl;
405 os <<
"+INF ]" << endl;
438 if (ibin<0 || ibin>=
numBins(rangeName)) {
440 <<
" is out of range (0," <<
getBins(rangeName)-1 <<
")" << endl ;
508 const double val =
getVal() ;
511 const auto minMax =
getRange(
nullptr);
512 return minMax.first -
epsilon <= val && val <= minMax.second +
epsilon;
516 return std::any_of(ranges.begin(), ranges.end(), [val,
epsilon,
this](
const std::string& range){
517 const auto minMax = this->getRange(range.c_str());
518 return minMax.first - epsilon <= val && val <= minMax.second + epsilon;
556 return createHistogram(
name,
l) ;
575 pc.defineObject(
"xbinning",
"Binning",0,0) ;
576 pc.defineString(
"xbinningName",
"BinningName",0,
"") ;
577 pc.defineInt(
"nxbins",
"BinningSpec",0) ;
578 pc.defineDouble(
"xlo",
"BinningSpec",0,0) ;
579 pc.defineDouble(
"xhi",
"BinningSpec",1,0) ;
581 pc.defineObject(
"yvar",
"YVar",0,0) ;
582 pc.defineObject(
"ybinning",
"YVar::Binning",0,0) ;
583 pc.defineString(
"ybinningName",
"YVar::BinningName",0,
"") ;
584 pc.defineInt(
"nybins",
"YVar::BinningSpec",0) ;
585 pc.defineDouble(
"ylo",
"YVar::BinningSpec",0,0) ;
586 pc.defineDouble(
"yhi",
"YVar::BinningSpec",1,0) ;
588 pc.defineObject(
"zvar",
"ZVar",0,0) ;
589 pc.defineObject(
"zbinning",
"ZVar::Binning",0,0) ;
590 pc.defineString(
"zbinningName",
"ZVar::BinningName",0,
"") ;
591 pc.defineInt(
"nzbins",
"ZVar::BinningSpec",0) ;
592 pc.defineDouble(
"zlo",
"ZVar::BinningSpec",0,0) ;
593 pc.defineDouble(
"zhi",
"ZVar::BinningSpec",1,0) ;
595 pc.defineString(
"axisLabel",
"AxisLabel",0,
"Events") ;
597 pc.defineDependency(
"ZVar",
"YVar") ;
600 pc.process(cmdList) ;
606 const char* axisLabel =
pc.getString(
"axisLabel") ;
613 if (
pc.hasProcessed(
"Binning")) {
615 }
else if (
pc.hasProcessed(
"BinningName")) {
617 }
else if (
pc.hasProcessed(
"BinningSpec")) {
621 ownBinning[0] =
kTRUE ;
626 if (
pc.hasProcessed(
"YVar")) {
629 if (
pc.hasProcessed(
"YVar::Binning")) {
631 }
else if (
pc.hasProcessed(
"YVar::BinningName")) {
633 }
else if (
pc.hasProcessed(
"YVar::BinningSpec")) {
637 ownBinning[1] =
kTRUE ;
643 if (
pc.hasProcessed(
"ZVar")) {
646 if (
pc.hasProcessed(
"ZVar::Binning")) {
648 }
else if (
pc.hasProcessed(
"ZVar::BinningName")) {
650 }
else if (
pc.hasProcessed(
"ZVar::BinningSpec")) {
654 ownBinning[2] =
kTRUE ;
663 if (ownBinning[0])
delete binning[0] ;
664 if (ownBinning[1])
delete binning[1] ;
665 if (ownBinning[2])
delete binning[2] ;
684 <<
") ERROR: fit range empty or open ended, must explicitly specify range" << endl ;
740 if ((!xlo && xhi) || (xlo && !xhi)) {
742 <<
") ERROR must specify either no range, or both limits" << endl ;
752 Int_t *nBins2 = nBins;
758 <<
") ERROR: fit range empty or open ended, must explicitly specify range" << endl ;
763 <<
") ERROR: fit range of " << yvar.
GetName() <<
" empty or open ended, must explicitly specify range" << endl ;
770 xlo_fit[1] = yvar.
getMin() ;
771 xhi_fit[1] = yvar.
getMax() ;
779 nbins_fit[1] = yvar.
getBins() ;
814 if ((!xlo && xhi) || (xlo && !xhi)) {
816 <<
") ERROR must specify either no range, or both limits" << endl ;
826 Int_t* nBins2 = nBins;
831 <<
") ERROR: fit range empty or open ended, must explicitly specify range" << endl ;
836 <<
") ERROR: fit range of " << yvar.
GetName() <<
" empty or open ended, must explicitly specify range" << endl ;
841 <<
") ERROR: fit range of " << zvar.
GetName() <<
" empty or open ended, must explicitly specify range" << endl ;
848 xlo_fit[1] = yvar.
getMin() ;
849 xhi_fit[1] = yvar.
getMax() ;
851 xlo_fit[2] = zvar.
getMin() ;
852 xhi_fit[2] = zvar.
getMax() ;
860 nbins_fit[1] = yvar.
getBins() ;
861 nbins_fit[2] = zvar.
getBins() ;
900 if (bin[0])
delete bin[0] ;
901 if (bin[1])
delete bin[1] ;
902 if (bin[2])
delete bin[2] ;
919 if(dim < 1 || dim > 3) {
930 for(index= 0; index < dim; index++) {
941 histTitle.
Prepend(
"Histogram of ");
947 if (bins[0]->isUniform()) {
956 if (bins[0]->isUniform() && bins[1]->isUniform()) {
967 if (bins[0]->isUniform() && bins[1]->isUniform() && bins[2]->isUniform()) {
986 for(index= 0; index < dim; index++) {
1005 if((0 != tAxisLabel) && (0 != strlen(tAxisLabel))) {
1006 TString axisTitle(tAxisLabel);
1007 axisTitle.
Append(
" / ( ");
1008 for(
Int_t index2= 0; index2 < dim; index2++) {
1010 if(index2 > 0) axisTitle.
Append(
" x ");
1012 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 (of arbitrary type) an...
RooAbsBinning is the abstract base class for RooRealVar binning definitions This class defines the in...
virtual Double_t * array() const =0
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
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,...
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.
TString _unit
Value storage for batches of events.
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.
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)}
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)
VecExpr< UnaryOp< Fabs< T >, VecExpr< A, T, D >, T >, T, D > fabs(const VecExpr< A, T, D > &rhs)
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.
static constexpr double pc