17#ifndef ROOFIT_ROOFITCORE_INC_ROOHELPERS_H_
18#define ROOFIT_ROOFITCORE_INC_ROOHELPERS_H_
38 msg.setGlobalKillBelow(lvl);
41 msg.getStream(0).addTopic(extraTopics);
42 msg.setStreamStatus(0,
true);
67 std::vector<RooMsgService::StreamConfig>
_oldConf;
72std::vector<std::string>
tokenise(
const std::string &str,
const std::string &delims);
92 const char*
what() const noexcept
override {
93 std::stringstream out;
94 out <<
"**Caching Error** in\n";
98 std::string message = *it;
99 auto pos = message.find(
'\n', 0);
100 while (pos != std::string::npos) {
101 message.insert(pos+1,
indent);
102 pos = (message.find(
'\n', pos+1));
105 out <<
indent << message <<
"\n";
111 std::string* ret =
new std::string(out.str());
125 typename std::enable_if<std::is_base_of<RooAbsArg, T>::value>
::type* =
nullptr >
127 _stream << arg.ClassName() <<
"::" << arg.GetName() <<
" " << &arg <<
" ";
133 typename std::enable_if< ! std::is_base_of<RooAbsArg, T>::value>
::type* =
nullptr >
139 operator std::string()
const {
154 double min = -std::numeric_limits<double>::max(),
double max = std::numeric_limits<double>::max(),
155 bool limitsInAllowedRange =
false, std::string extraMessage =
"");
166 const RooArgSet* normSet =
nullptr,
double relAccuracy = 1.E-13) {
static void indent(ostringstream &buf, int indent_level)
RooAbsReal is the common abstract base class for objects that represent a real value and implements f...
void checkBatchComputation(std::size_t evtNo, const RooArgSet *normSet=nullptr, double relAccuracy=1.E-13) const
RooArgSet is a container object that can hold multiple RooAbsArg objects.
Helper class to access a batch-related part of RooAbsReal's interface, which should not leak to the o...
static void clearBatchMemory(RooAbsReal &theReal)
static void checkBatchComputation(const RooAbsReal &theReal, std::size_t evtNo, const RooArgSet *normSet=nullptr, double relAccuracy=1.E-13)
CachingError(const std::string &newMessage)
CachingError(CachingError &&previous, const std::string &newMessage)
std::vector< std::string > _messages
const char * what() const noexcept override
Hijacks all messages with given level and topic (and optionally object name) while alive.
RooFit::MsgLevel _oldKillBelow
HijackMessageStream(RooFit::MsgLevel level, RooFit::MsgTopic topics, const char *objectName=nullptr)
std::vector< RooMsgService::StreamConfig > _oldConf
virtual ~HijackMessageStream()
Switches the message service to verbose while the instance alive.
RooMsgService::StreamConfig fOldConf
RooFit::MsgLevel fOldKillBelow
LocalChangeMsgLevel(RooFit::MsgLevel lvl=RooFit::DEBUG, RooFit::MsgTopic extraTopics=static_cast< RooFit::MsgTopic >(0u))
Change message level (and topics) while this object is alive, reset when it goes out of scope.
static RooMsgService & instance()
Return reference to singleton instance.
MsgLevel
Verbosity level for RooMsgService::StreamConfig in RooMsgService.
MsgTopic
Topics for a RooMsgService::StreamConfig in RooMsgService.
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 extraMessage="")
Check if the parameters have a range, and warn if the range extends below / above the set limits.
std::vector< std::string > tokenise(const std::string &str, const std::string &delims)
Tokenise the string by splitting at the characters in delims.
RooFit::MsgLevel minLevel