Logo ROOT  
Reference Guide
 
All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Modules Pages
Loading...
Searching...
No Matches
RooHelpers Namespace Reference

Classes

struct  BinnedLOutput
 
class  ChangeOperModeRAII
 Struct to temporarily change the operation mode of a RooAbsArg until it goes out of scope. More...
 
struct  DisableCachingRAII
 Disable all caches for sub-branches in an expression tree. More...
 
class  HijackMessageStream
 Hijacks all messages with given level and topic (and optionally object name) while alive. More...
 
class  LocalChangeMsgLevel
 Switches the message service to a different level while the instance is alive. More...
 
struct  WrapIntoTObject
 Wrap an object into a TObject. Sometimes needed to avoid reinterpret_cast or enable RTTI. More...
 

Functions

bool checkIfRangesOverlap (RooArgSet const &observables, std::vector< std::string > const &rangeNames)
 Check if there is any overlap when a list of ranges is applied to a set of observables.
 
void checkRangeOfParameters (const RooAbsReal *callingClass, std::initializer_list< const RooAbsReal * > pars, double min=-std::numeric_limits< double >::max(), double max=std::numeric_limits< double >::max(), bool limitsInAllowedRange=false, std::string const &extraMessage="")
 Check if the parameters have a range, and warn if the range extends below / above the set limits.
 
template<class T >
std::unique_ptr< T > cloneTreeWithSameParameters (T const &arg, RooArgSet const *observables=nullptr)
 Clone RooAbsArg object and reattach to original parameters.
 
BinnedLOutput getBinnedL (RooAbsPdf const &pdf)
 
std::string getColonSeparatedNameString (RooArgSet const &argSet)
 Create a string with all sorted names of RooArgSet elements separated by colons.
 
std::string getRangeNameForSimComponent (std::string const &rangeName, bool splitRange, std::string const &catName)
 
std::pair< double, doublegetRangeOrBinningInterval (RooAbsArg const *arg, const char *rangeName)
 Get the lower and upper bound of parameter range if arg can be casted to RooAbsRealLValue.
 
void getSortedComputationGraph (RooAbsReal const &func, RooArgSet &out)
 Get the topologically-sorted list of all nodes in the computation graph.
 
RooArgSet selectFromArgSet (RooArgSet const &argSet, std::string const &names)
 Construct a RooArgSet of objects in a RooArgSet whose names match to those in the names string.
 

Function Documentation

◆ checkIfRangesOverlap()

bool RooHelpers::checkIfRangesOverlap ( RooArgSet const &  observables,
std::vector< std::string > const &  rangeNames 
)

Check if there is any overlap when a list of ranges is applied to a set of observables.

Parameters
[in]observablesThe observables to check for overlap
[in]rangeNamesThe names of the ranges.

Definition at line 188 of file RooHelpers.cxx.

◆ checkRangeOfParameters()

void RooHelpers::checkRangeOfParameters ( const RooAbsReal callingClass,
std::initializer_list< const RooAbsReal * >  pars,
double  min,
double  max,
bool  limitsInAllowedRange,
std::string const &  extraMessage 
)

Check if the parameters have a range, and warn if the range extends below / above the set limits.

Parameters
[in]callingClassClass that's calling. Needed to include name and type name of the class in error message.
[in]parsList of all parameters to be checked.
[in]minMinimum of allowed range. min itself counts as disallowed.
[in]maxMaximum of allowed range. max itself counts as disallowed.
[in]limitsInAllowedRangeIf true, the limits passed as parameters are part of the allowed range.
[in]extraMessageMessage that should be appended to the warning.

Definition at line 123 of file RooHelpers.cxx.

◆ cloneTreeWithSameParameters()

template<class T >
std::unique_ptr< T > RooHelpers::cloneTreeWithSameParameters ( T const &  arg,
RooArgSet const *  observables = nullptr 
)

Clone RooAbsArg object and reattach to original parameters.

Definition at line 143 of file RooHelpers.h.

◆ getBinnedL()

BinnedLOutput RooHelpers::getBinnedL ( RooAbsPdf const &  pdf)

Definition at line 278 of file RooHelpers.cxx.

◆ getColonSeparatedNameString()

std::string RooHelpers::getColonSeparatedNameString ( RooArgSet const &  argSet)

Create a string with all sorted names of RooArgSet elements separated by colons.

Parameters
[in]argSetThe input RooArgSet.

Definition at line 233 of file RooHelpers.cxx.

◆ getRangeNameForSimComponent()

std::string RooHelpers::getRangeNameForSimComponent ( std::string const &  rangeName,
bool  splitRange,
std::string const &  catName 
)

Definition at line 263 of file RooHelpers.cxx.

◆ getRangeOrBinningInterval()

std::pair< double, double > RooHelpers::getRangeOrBinningInterval ( RooAbsArg const *  arg,
const char *  rangeName 
)

Get the lower and upper bound of parameter range if arg can be casted to RooAbsRealLValue.

If no range with rangeName is defined for the argument, this will check if a binning of the same name exists and return the interval covered by the binning. Returns {-infinity, infinity} if agument can't be casted to RooAbsRealLValue* or if no range or binning with the requested name exists.

Parameters
[in]argRooAbsArg for which to get the range.
[in]rangeNameThe name of the range.

Definition at line 172 of file RooHelpers.cxx.

◆ getSortedComputationGraph()

void RooHelpers::getSortedComputationGraph ( RooAbsReal const &  func,
RooArgSet out 
)

Get the topologically-sorted list of all nodes in the computation graph.

Definition at line 300 of file RooHelpers.cxx.

◆ selectFromArgSet()

RooArgSet RooHelpers::selectFromArgSet ( RooArgSet const &  argSet,
std::string const &  names 
)

Construct a RooArgSet of objects in a RooArgSet whose names match to those in the names string.

Parameters
[in]argSetThe input RooArgSet.
[in]namesThe names of the objects to select in a colon-separated string.

Definition at line 254 of file RooHelpers.cxx.