Logo ROOT  
Reference Guide
 
Loading...
Searching...
No Matches
RooHelpers Namespace Reference

Namespaces

namespace  Detail
 

Classes

struct  BinnedLOutput
 
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

std::list< double > * binBoundariesInRange (std::span< const double > boundaries, double xlo, double xhi)
 Return a newly allocated list with the subset of boundaries that lies strictly inside [xlo, xhi], with xlo and xhi added as the first and last entries.
 
bool checkIfRangesOverlap (RooArgSet const &observables, std::vector< std::string > const &rangeNames)
 
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, char delim=':')
 
std::string getRangeNameForSimComponent (std::string const &rangeName, bool splitRange, std::string const &catName)
 
std::pair< double, doublegetRangeOrBinningInterval (RooAbsArg const *arg, const char *rangeName)
 
void getSortedComputationGraph (RooAbsArg const &func, RooArgSet &out)
 
bool isFunctionFlatInBins (const RooAbsReal &function, RooAbsRealLValue &obs, std::span< const double > boundaries, double relTol=1e-9)
 Check that function is constant (flat) inside each bin defined by the sorted boundaries when scanning the observable obs.
 
RooArgSet selectFromArgSet (RooArgSet const &, std::string const &names)
 
bool setAllConstant (const RooAbsCollection &coll, bool constant=true)
 set all RooRealVars to constants. return true if at least one changed status
 

Function Documentation

◆ binBoundariesInRange()

std::list< double > * RooHelpers::binBoundariesInRange ( std::span< const double > boundaries,
double xlo,
double xhi )

Return a newly allocated list with the subset of boundaries that lies strictly inside [xlo, xhi], with xlo and xhi added as the first and last entries.

This is the form expected by RooFit's binBoundaries() interface, so the bin integrator covers exactly the integration range. The caller takes ownership of the returned list.

Definition at line 209 of file RooHelpers.cxx.

◆ checkIfRangesOverlap()

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

◆ 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 114 of file RooFitImplHelpers.h.

◆ getBinnedL()

BinnedLOutput RooHelpers::getBinnedL ( RooAbsPdf const & pdf)

◆ getColonSeparatedNameString()

std::string RooHelpers::getColonSeparatedNameString ( RooArgSet const & argSet,
char delim = ':' )

◆ getRangeNameForSimComponent()

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

◆ getRangeOrBinningInterval()

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

◆ getSortedComputationGraph()

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

◆ isFunctionFlatInBins()

bool RooHelpers::isFunctionFlatInBins ( const RooAbsReal & function,
RooAbsRealLValue & obs,
std::span< const double > boundaries,
double relTol = 1e-9 )

Check that function is constant (flat) inside each bin defined by the sorted boundaries when scanning the observable obs.

Several interior points are sampled per bin and compared to the bin's first sample; if any of them deviates by more than relTol (relative to the value scale), the function is not flat and false is returned. The value of obs is restored on return.

Definition at line 173 of file RooHelpers.cxx.

◆ selectFromArgSet()

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

◆ setAllConstant()

bool RooHelpers::setAllConstant ( const RooAbsCollection & coll,
bool constant = true )

set all RooRealVars to constants. return true if at least one changed status

Definition at line 156 of file RooHelpers.cxx.