ROOT logo
ROOT » ROOFIT » ROOFITCORE » RooMsgService

class RooMsgService: public TObject



The RooMsgService class is a singleton class that organizes informational, debugging, warning and errors messages generated by the RooFit core code.

Each message generated by the core has a message level (DEBUG,INFO,PROGRESS,WARNING,ERROR or FATAL), an originating object, and a 'topic'. Currently implemented topics are "Generation","Plotting", "Integration", "Minimization" and "Workspace" and "ChangeTracking".

The RooMsgService class allows to filter and redirect messages into 'streams' according to message level, topic, (base) class of originating object, name of originating object and based on attribute labels attached to individual objects.

The current default configuration creates streams for all messages at WARNING level or higher (e.g. ERROR and FATAL) and for all INFO message on topics Generation,Plotting, Integration and Minimization and redirects them to stdout. Users can create additional streams for logging of e.g. DEBUG messages on particular topics or objects and or redirect streams to C++ streams or files.

The singleton instance is accessible through RooMsgService::instance() ;


Function Members (Methods)

public:
virtual~RooMsgService()
voidTObject::AbstractMethod(const char* method) const
Int_taddStream(RooFit::MsgLevel level, const RooCmdArg& arg1 = RooCmdArg(), const RooCmdArg& arg2 = RooCmdArg(), const RooCmdArg& arg3 = RooCmdArg(), const RooCmdArg& arg4 = RooCmdArg(), const RooCmdArg& arg5 = RooCmdArg(), const RooCmdArg& arg6 = RooCmdArg())
static Bool_tanyDebug()
virtual voidTObject::AppendPad(Option_t* option = "")
virtual voidTObject::Browse(TBrowser* b)
static TClass*Class()
virtual const char*TObject::ClassName() const
static voidcleanup()
virtual voidTObject::Clear(Option_t* = "")
voidclearErrorCount()
virtual TObject*TObject::Clone(const char* newname = "") const
virtual Int_tTObject::Compare(const TObject* obj) const
virtual voidTObject::Copy(TObject& object) const
Int_t&debugCode()
RooWorkspace*debugWorkspace()
virtual voidTObject::Delete(Option_t* option = "")MENU
voiddeleteStream(Int_t id)
virtual Int_tTObject::DistancetoPrimitive(Int_t px, Int_t py)
virtual voidTObject::Draw(Option_t* option = "")
virtual voidTObject::DrawClass() constMENU
virtual TObject*TObject::DrawClone(Option_t* option = "") constMENU
virtual voidTObject::Dump() constMENU
virtual voidTObject::Error(const char* method, const char* msgfmt) const
Int_terrorCount() const
virtual voidTObject::Execute(const char* method, const char* params, Int_t* error = 0)
virtual voidTObject::Execute(TMethod* method, TObjArray* params, Int_t* error = 0)
virtual voidTObject::ExecuteEvent(Int_t event, Int_t px, Int_t py)
virtual voidTObject::Fatal(const char* method, const char* msgfmt) const
virtual TObject*TObject::FindObject(const char* name) const
virtual TObject*TObject::FindObject(const TObject* obj) const
virtual Option_t*TObject::GetDrawOption() const
static Long_tTObject::GetDtorOnly()
virtual const char*TObject::GetIconName() const
virtual const char*TObject::GetName() const
virtual char*TObject::GetObjectInfo(Int_t px, Int_t py) const
static Bool_tTObject::GetObjectStat()
virtual Option_t*TObject::GetOption() const
RooMsgService::StreamConfig&getStream(Int_t id)
Bool_tgetStreamStatus(Int_t id) const
virtual const char*TObject::GetTitle() const
virtual UInt_tTObject::GetUniqueID() const
RooFit::MsgLevelglobalKillBelow() const
virtual Bool_tTObject::HandleTimer(TTimer* timer)
virtual ULong_tTObject::Hash() const
virtual voidTObject::Info(const char* method, const char* msgfmt) const
virtual Bool_tTObject::InheritsFrom(const char* classname) const
virtual Bool_tTObject::InheritsFrom(const TClass* cl) const
virtual voidTObject::Inspect() constMENU
static RooMsgService&instance()
voidTObject::InvertBit(UInt_t f)
virtual TClass*IsA() const
Bool_tisActive(const RooAbsArg* self, RooFit::MsgTopic facility, RooFit::MsgLevel level)
Bool_tisActive(const TObject* self, RooFit::MsgTopic facility, RooFit::MsgLevel level)
virtual Bool_tTObject::IsEqual(const TObject* obj) const
virtual Bool_tTObject::IsFolder() const
Bool_tTObject::IsOnHeap() const
virtual Bool_tTObject::IsSortable() const
Bool_tTObject::IsZombie() const
ostream&log(const RooAbsArg* self, RooFit::MsgLevel level, RooFit::MsgTopic facility, Bool_t forceSkipPrefix = kFALSE)
ostream&log(const TObject* self, RooFit::MsgLevel level, RooFit::MsgTopic facility, Bool_t forceSkipPrefix = kFALSE)
virtual voidTObject::ls(Option_t* option = "") const
voidTObject::MayNotUse(const char* method) const
virtual Bool_tTObject::Notify()
Int_tnumStreams() const
voidTObject::Obsolete(const char* method, const char* asOfVers, const char* removedFromVers) const
static voidTObject::operator delete(void* ptr)
static voidTObject::operator delete(void* ptr, void* vp)
static voidTObject::operator delete[](void* ptr)
static voidTObject::operator delete[](void* ptr, void* vp)
void*TObject::operator new(size_t sz)
void*TObject::operator new(size_t sz, void* vp)
void*TObject::operator new[](size_t sz)
void*TObject::operator new[](size_t sz, void* vp)
RooMsgService&operator=(const RooMsgService&)
virtual voidTObject::Paint(Option_t* option = "")
virtual voidTObject::Pop()
virtual voidPrint(Option_t* options = 0) const
virtual Int_tTObject::Read(const char* name)
virtual voidTObject::RecursiveRemove(TObject* obj)
voidreset()
voidTObject::ResetBit(UInt_t f)
voidrestoreState()
virtual voidTObject::SaveAs(const char* filename = "", Option_t* option = "") constMENU
virtual voidTObject::SavePrimitive(ostream& out, Option_t* option = "")
voidsaveState()
voidTObject::SetBit(UInt_t f)
voidTObject::SetBit(UInt_t f, Bool_t set)
virtual voidTObject::SetDrawOption(Option_t* option = "")MENU
static voidTObject::SetDtorOnly(void* obj)
voidsetGlobalKillBelow(RooFit::MsgLevel level)
static voidTObject::SetObjectStat(Bool_t stat)
voidsetSilentMode(Bool_t flag)
voidsetStreamStatus(Int_t id, Bool_t active)
virtual voidTObject::SetUniqueID(UInt_t uid)
virtual voidShowMembers(TMemberInspector& insp)
voidshowPid(Bool_t flag)
Bool_tsilentMode() const
virtual voidStreamer(TBuffer& b)
voidStreamerNVirtual(TBuffer& b)
virtual voidTObject::SysError(const char* method, const char* msgfmt) const
Bool_tTObject::TestBit(UInt_t f) const
Int_tTObject::TestBits(UInt_t f) const
virtual voidTObject::UseCurrentStyle()
virtual voidTObject::Warning(const char* method, const char* msgfmt) const
virtual Int_tTObject::Write(const char* name = 0, Int_t option = 0, Int_t bufsize = 0)
virtual Int_tTObject::Write(const char* name = 0, Int_t option = 0, Int_t bufsize = 0) const
protected:
RooMsgService()
RooMsgService(const RooMsgService&)
Int_tactiveStream(const RooAbsArg* self, RooFit::MsgTopic facility, RooFit::MsgLevel level)
Int_tactiveStream(const TObject* self, RooFit::MsgTopic facility, RooFit::MsgLevel level)
virtual voidTObject::DoError(int level, const char* location, const char* fmt, va_list va) const
voidTObject::MakeZombie()

Data Members

public:
static Int_t_debugCount
map<int,std::string>_levelNames
map<int,std::string>_topicNames
protected:
Int_t_debugCode
RooWorkspace*_debugWorkspace
ostream*_devnull
Int_t_errorCount
map<std::string,std::ostream*>_files
RooFit::MsgLevel_globMinLevel
static RooMsgService*_instance
RooFit::MsgLevel_lastMsgLevel
Bool_t_showPid
Bool_t_silentMode
vector<StreamConfig>_streams
stack<std::vector<StreamConfig> >_streamsSaved

Class Charts

Inheritance Inherited Members Includes Libraries
Class Charts

Function documentation

void cleanup()
 Cleanup function called by atexit() handler installed by RooSentinel
 to delete all global object upon program termination
RooMsgService()
 Constructor. Defines names of message levels
 and mapping of topic codes to topic names
 Install default message streams.
~RooMsgService()
 Destructor
Bool_t anyDebug()
 Returns true if any debug level stream is active
RooWorkspace* debugWorkspace()
Int_t addStream(RooFit::MsgLevel level, const RooCmdArg& arg1 = RooCmdArg(), const RooCmdArg& arg2 = RooCmdArg(), const RooCmdArg& arg3 = RooCmdArg(), const RooCmdArg& arg4 = RooCmdArg(), const RooCmdArg& arg5 = RooCmdArg(), const RooCmdArg& arg6 = RooCmdArg())
 Add a message logging stream for message with given RooFit::MsgLevel or higher (i.e. more severe)
 This method accepts the following arguments to configure the stream

 Output Style options

 Prefix(Bool_t flag=kTRUE) -- Prefix all messages in this stream with Topic/Originator information

 Filtering options

 Topic(const char*)        -- Restrict stream to messages on given topic
 ObjectName(const char*)   -- Restrict stream to messages from object with given name
 ClassName(const char*)    -- Restrict stream to messages from objects with given class name
 BaseClassName(const char*)-- Restrict stream to messages from objects with given base class name
 LabelName(const chat*)    -- Restrict stream to messages from objects setAtrribute(const char*) tag with given name

 Output redirection options

 OutputFile(const char*)  -- Send output to file with given name. Multiple streams can write to same file.
 OutputStream(ostream&)   -- Send output to given C++ stream. Multiple message streams can write to same c++ stream

 The return value is the unique ID code of the defined stream
void deleteStream(Int_t id)
 Delete stream with given unique ID code
void setStreamStatus(Int_t id, Bool_t active)
 (De)Activate stream with given unique ID
Bool_t getStreamStatus(Int_t id) const
 Get activation status of stream with given unique ID
RooMsgService& instance()
 Return reference to singleton instance
void saveState()
 Save current state of message service
void restoreState()
 Restore last saved state of message service
Bool_t isActive(const RooAbsArg* self, RooFit::MsgTopic facility, RooFit::MsgLevel level)
 Check if logging is active for given object/topic/RooFit::MsgLevel combination
Bool_t isActive(const TObject* self, RooFit::MsgTopic facility, RooFit::MsgLevel level)
 Check if logging is active for given object/topic/RooFit::MsgLevel combination
Int_t activeStream(const RooAbsArg* self, RooFit::MsgTopic facility, RooFit::MsgLevel level)
 Find appropriate logging stream for message from given object with given topic and message level
Int_t activeStream(const TObject* self, RooFit::MsgTopic facility, RooFit::MsgLevel level)
 Find appropriate logging stream for message from given object with given topic and message level
ostream& log(const RooAbsArg* self, RooFit::MsgLevel level, RooFit::MsgTopic facility, Bool_t forceSkipPrefix = kFALSE)
 Log error message associated with RooAbsArg object self at given level and topic. If skipPrefix
 is true the standard RooMsgService prefix is not added.
ostream& log(const TObject* self, RooFit::MsgLevel level, RooFit::MsgTopic facility, Bool_t forceSkipPrefix = kFALSE)
 Log error message associated with TObject object self at given level and topic. If skipPrefix
 is true the standard RooMsgService prefix is not added.
void Print(Option_t* options = 0) const
 Print configuration of message service. If "v" option is given also
 inactive streams are listed
StreamConfig& getStream(Int_t id)
{ return _streams[id] ; }
Int_t numStreams() const
{ return _streams.size() ; }
void reset()
{ cleanup() ; }
void setGlobalKillBelow(RooFit::MsgLevel level)
{ _globMinLevel = level ; }
RooFit::MsgLevel globalKillBelow() const
{ return _globMinLevel ; }
void showPid(Bool_t flag)
{ _showPid = flag ; }
Bool_t silentMode() const
 Print level support for RooFit-related messages that are not routed through RooMsgService (such as Minuit printouts)
{ return _silentMode ; }
void setSilentMode(Bool_t flag)
{ _silentMode = flag ; }
Int_t errorCount() const
{ return _errorCount ; }
void clearErrorCount()
{ _errorCount = 0 ; }
Int_t& debugCode()
{ return _debugCode ; }
RooMsgService()
 Private ctor -- singleton class