17#ifndef ROOFIT_ROOFITCORE_INC_ROOHELPERS_H_
18#define ROOFIT_ROOFITCORE_INC_ROOHELPERS_H_
43 unsigned int extraTopics = 0u,
44 unsigned int removeTopics = 0u,
45 bool overrideExternalLevel =
true);
51 std::vector<RooMsgService::StreamConfig>
fOldConf;
66 std::vector<RooMsgService::StreamConfig>
_oldConf;
71std::vector<std::string>
tokenise(
const std::string &str,
const std::string &delims,
bool returnEmptyToken =
true);
91 const char*
what() const noexcept
override {
92 std::stringstream out;
93 out <<
"**Caching Error** in\n";
97 std::string message = *it;
98 auto pos = message.find(
'\n', 0);
99 while (pos != std::string::npos) {
100 message.insert(pos+1,
indent);
101 pos = (message.find(
'\n', pos+1));
104 out <<
indent << message <<
"\n";
110 std::string* ret =
new std::string(out.str());
124 typename std::enable_if<std::is_base_of<RooAbsArg, T>::value>
::type* =
nullptr >
126 _stream << arg.ClassName() <<
"::" << arg.GetName() <<
" " << &arg <<
" ";
132 typename std::enable_if< ! std::is_base_of<RooAbsArg, T>::value>
::type* =
nullptr >
138 operator std::string()
const {
153 double min = -std::numeric_limits<double>::max(),
double max = std::numeric_limits<double>::max(),
154 bool limitsInAllowedRange =
false, std::string extraMessage =
"");
165 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)
Hijack all messages with given level and topics while this object is alive.
std::vector< RooMsgService::StreamConfig > _oldConf
virtual ~HijackMessageStream()
Switches the message service to a different level while the instance is alive.
RooFit::MsgLevel fOldKillBelow
LocalChangeMsgLevel(RooFit::MsgLevel lvl=RooFit::DEBUG, unsigned int extraTopics=0u, unsigned int removeTopics=0u, bool overrideExternalLevel=true)
Change message level (and topics) while this object is alive, reset when it goes out of scope.
std::vector< RooMsgService::StreamConfig > fOldConf
MsgLevel
Verbosity level for RooMsgService::StreamConfig in RooMsgService.
MsgTopic
Topics for a RooMsgService::StreamConfig in RooMsgService.
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.
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.