class RooWorkspace: public TNamed



The RooWorkspace is a persistable container for RooFit projects. A workspace can contain and own variables, p.d.f.s, functions and datasets. All objects that live in the workspace are owned by the workspace. The import() method enforces consistency of objects upon insertion into the workspace (e.g. no duplicate object with the same name are allowed) and makes sure all objects in the workspace are connected to each other. Easy accessor methods like pdf(), var() and data() allow to refer to the contents of the workspace by object name. The entire RooWorkspace can be saved into a ROOT TFile and organises the consistent streaming of its contents without duplication.

If a RooWorkspace contains custom classes, i.e. classes not in the ROOT distribution, portability of workspaces can be enhanced by storing the source code of those classes in the workspace as well. This process is also organized by the workspace through the importClassCode() method.


Function Members (Methods)

public:
RooWorkspace()
RooWorkspace(const RooWorkspace& other)
RooWorkspace(const char* name, const char* title = 0)
virtual~RooWorkspace()
voidTObject::AbstractMethod(const char* method) const
static voidaddClassDeclImportDir(const char* dir)
static voidaddClassImplImportDir(const char* dir)
virtual voidTObject::AppendPad(Option_t* option = "")
RooAbsArg*arg(const char* name)
static voidautoImportClassCode(Bool_t flag)
virtual voidTObject::Browse(TBrowser* b)
RooCategory*cat(const char* name)
RooAbsCategory*catfunc(const char* name)
static TClass*Class()
virtual const char*TObject::ClassName() const
virtual voidTNamed::Clear(Option_t* option = "")
virtual TObject*TNamed::Clone(const char* newname = "") const
virtual Int_tTNamed::Compare(const TObject* obj) const
TIterator*componentIterator()
const RooArgSet&components() const
virtual voidTNamed::Copy(TObject& named) const
RooAbsData*data(const char* name)
virtual voidTObject::Delete(Option_t* option = "")MENU
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
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 voidTNamed::FillBuffer(char*& buffer)
virtual TObject*TObject::FindObject(const char* name) const
virtual TObject*TObject::FindObject(const TObject* obj) const
RooAbsReal*function(const char* name)
RooAbsArg*fundArg(const char* name)
virtual Option_t*TObject::GetDrawOption() const
static Long_tTObject::GetDtorOnly()
virtual const char*TObject::GetIconName() const
virtual const char*TNamed::GetName() const
virtual char*TObject::GetObjectInfo(Int_t px, Int_t py) const
static Bool_tTObject::GetObjectStat()
virtual Option_t*TObject::GetOption() const
virtual const char*TNamed::GetTitle() const
virtual UInt_tTObject::GetUniqueID() const
virtual Bool_tTObject::HandleTimer(TTimer* timer)
virtual ULong_tTNamed::Hash() const
Bool_timport(const RooAbsArg& arg, const RooCmdArg& arg1 = RooCmdArg(), const RooCmdArg& arg2 = RooCmdArg(), const RooCmdArg& arg3 = RooCmdArg())
Bool_timport(const RooArgSet& args, const RooCmdArg& arg1 = RooCmdArg(), const RooCmdArg& arg2 = RooCmdArg(), const RooCmdArg& arg3 = RooCmdArg())
Bool_timport(RooAbsData& data, const RooCmdArg& arg1 = RooCmdArg(), const RooCmdArg& arg2 = RooCmdArg(), const RooCmdArg& arg3 = RooCmdArg())
Bool_timportClassCode(const char* pat = "*", Bool_t doReplace = kFALSE)
Bool_timportClassCode(TClass* theClass, Bool_t doReplace = kFALSE)
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
voidTObject::InvertBit(UInt_t f)
virtual TClass*IsA() const
virtual Bool_tTObject::IsEqual(const TObject* obj) const
virtual Bool_tTObject::IsFolder() const
Bool_tTObject::IsOnHeap() const
virtual Bool_tTNamed::IsSortable() const
Bool_tTObject::IsZombie() const
Bool_tjoin(const RooWorkspace& other)
Bool_tloadSnapshot(const char* name)
virtual voidTNamed::ls(Option_t* option = "") const
Bool_tmakeDir()
voidTObject::MayNotUse(const char* method) const
Bool_tmerge(const RooWorkspace& other)
virtual Bool_tTObject::Notify()
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)
RooWorkspace&operator=(const RooWorkspace&)
virtual voidTObject::Paint(Option_t* option = "")
RooAbsPdf*pdf(const char* name)
virtual voidTObject::Pop()
virtual voidPrint(Option_t* opts = 0) const
virtual Int_tTObject::Read(const char* name)
virtual voidTObject::RecursiveRemove(TObject* obj)
voidTObject::ResetBit(UInt_t f)
virtual voidTObject::SaveAs(const char* filename = "", Option_t* option = "") constMENU
virtual voidTObject::SavePrimitive(basic_ostream<char,char_traits<char> >& out, Option_t* option = "")
Bool_tsaveSnapshot(const char* name, const RooArgSet& params, Bool_t importValues = kFALSE)
voidTObject::SetBit(UInt_t f)
voidTObject::SetBit(UInt_t f, Bool_t set)
static voidsetClassFileExportDir(const char* dir = 0)
virtual voidTObject::SetDrawOption(Option_t* option = "")MENU
static voidTObject::SetDtorOnly(void* obj)
virtual voidTNamed::SetName(const char* name)MENU
virtual voidTNamed::SetNameTitle(const char* name, const char* title)
static voidTObject::SetObjectStat(Bool_t stat)
virtual voidTNamed::SetTitle(const char* title = "")MENU
virtual voidTObject::SetUniqueID(UInt_t uid)
virtual voidShowMembers(TMemberInspector& insp, char* parent)
virtual Int_tTNamed::Sizeof() 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()
RooRealVar*var(const char* name)
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:
virtual voidTObject::DoError(int level, const char* location, const char* fmt, va_list va) const
voidTObject::MakeZombie()

Data Members

public:
enum TObject::EStatusBits { kCanDelete
kMustCleanup
kObjInCanvas
kIsReferenced
kHasUUID
kCannotPick
kNoContextMenu
kInvalidObject
};
enum TObject::[unnamed] { kIsOnHeap
kNotDeleted
kZombie
kBitMask
kSingleKey
kOverwrite
kWriteDelete
};
protected:
TStringTNamed::fNameobject identifier
TStringTNamed::fTitleobject title
private:
RooArgSet_allOwnedNodesList of owned pdfs and components
static Bool_t_autoClassAutomatic import of non-distribution class code
static list<std::string>_classDeclDirList
static string_classFileExportDir
static list<std::string>_classImplDirList
RooWorkspace::CodeRepo_classesRepository of embedded class code. This data member _must_ be first
RooLinkedList_dataListList of owned datasets
RooWorkspace::WSDir*_dir! Transient ROOT directory representation of workspace
RooExpensiveObjectCache_eocacheCache for expensive objects
RooLinkedList_snapshotsList of parameter snapshots
RooLinkedList_viewsList of model views

Class Charts

Inheritance Inherited Members Includes Libraries
Class Charts

Function documentation

void addClassDeclImportDir(const char* dir)
 Add 'dir' to search path for class declaration (header) files, when
 attempting to import class code with importClassClode()
void addClassImplImportDir(const char* dir)
 Add 'dir' to search path for class implementation (.cxx) files, when
 attempting to import class code with importClassClode()
void setClassFileExportDir(const char* dir = 0)
 Specify the name of the directory in which embedded source
 code is unpacked and compiled. The specified string may contain
 one '%s' token which will be substituted by the workspace name
void autoImportClassCode(Bool_t flag)
 If flag is true, source code of classes not the the ROOT distribution
 is automatically imported if on object of such a class is imported
 in the workspace
RooWorkspace(const RooWorkspace& other)
 Default constructor
RooWorkspace(const char* name, const char* title = 0)
 Construct empty workspace with given name and title
RooWorkspace(const RooWorkspace& other)
 Workspace copy constructor
~RooWorkspace()
 Workspace destructor
Bool_t import(const RooArgSet& args, const RooCmdArg& arg1, const RooCmdArg& arg2, const RooCmdArg& arg3)
 Import multiple RooAbsArg objects into workspace. For details on arguments see documentation
 of import() method for single RooAbsArg
Bool_t import(const RooAbsArg& inArg, const RooCmdArg& arg1, const RooCmdArg& arg2, const RooCmdArg& arg3)
  Import a RooAbsArg object, e.g. function, p.d.f or variable into the workspace. This import function clones the input argument and will
  own the clone. If a composite object is offered for import, e.g. a p.d.f with parameters and observables, the
  complete tree of objects is imported. If any of the _variables_ of a composite object (parameters/observables) are already
  in the workspace the imported p.d.f. is connected to the already existing variables. If any of the _function_ objects (p.d.f, formulas)
  to be imported already exists in the workspace an error message is printed and the import of the entire tree of objects is cancelled.
  Several optional arguments can be provided to modify the import procedure.

  Accepted arguments

  RenameConflictNodes(const char* suffix) -- Add suffix to branch node name if name conflicts with existing node in workspace
  RenameAllNodes(const char* suffix) -- Add suffix to all branch node names including top level node
  RenameAllVariables(const char* suffix) -- Add suffix to all variables names
  RenameVariable(const char* inputName, const char* outputName) -- Rename variable as specified upon import.
  RecycleConflictNodes() -- If any of the function objects to be imported already exist in the name space, connect the
                            imported expression to the already existing nodes. WARNING: use with care! If function definitions
                            do not match, this alters the definition of your function upon import

  The RenameConflictNodes, RenameNodes and RecycleConflictNodes arguments are mutually exclusive. The RenameVariable argument can be repeated
  as often as necessary to rename multiple variables. Alternatively, a single RenameVariable argument can be given with
  two comma separated lists.
Bool_t import(RooAbsData& inData, const RooCmdArg& arg1, const RooCmdArg& arg2, const RooCmdArg& arg3)
  Import a dataset (RooDataSet or RooDataHist) into the work space. The workspace will contain a copy of the data
  The dataset and its variables can be renamed upon insertion with the options below

  Accepted arguments

  RenameDataset(const char* suffix) -- Rename dataset upon insertion
  RenameVariable(const char* inputName, const char* outputName) -- Change names of observables in dataset upon insertion
Bool_t importClassCode(TClass* theClass, Bool_t doReplace)
Bool_t importClassCode(const char* pat, Bool_t doReplace)
 Inport code of all classes in the workspace that have a class name
 that matches pattern 'pat' and which are not found to be part of
 the standard ROOT distribution. If doReplace is true any existing
 class code saved in the workspace is replaced
Bool_t saveSnapshot(const char* name, const RooArgSet& params, Bool_t importValues = kFALSE)
 Save snapshot of values and attributes (including "Constant") of parameters 'params'
 If importValues is FALSE, the present values from the object in the workspace are
 saved. If importValues is TRUE, the values of the objects passed in the 'params'
 argument are saved
Bool_t loadSnapshot(const char* name)
 Load the values and attributes of the parameters in the snapshot saved with
 the given name
Bool_t merge(const RooWorkspace& other)
 Stub for merge function with another workspace (not implemented yet)
Bool_t join(const RooWorkspace& other)
 Stub for join function with another workspace (not implemented yet)
RooAbsPdf* pdf(const char* name)
 Retrieve p.d.f (RooAbsPdf) with given name. A null pointer is returned if not found
RooAbsReal* function(const char* name)
 Retrieve function (RooAbsReal) with given name. Note that all RooAbsPdfs are also RooAbsReals. A null pointer is returned if not found.
RooRealVar* var(const char* name)
 Retrieve real-valued variable (RooRealVar) with given name. A null pointer is returned if not found
RooCategory* cat(const char* name)
 Retrieve discrete variable (RooCategory) with given name. A null pointer is returned if not found
RooAbsCategory* catfunc(const char* name)
 Retrieve discrete function (RooAbsCategory) with given name. A null pointer is returned if not found
RooAbsArg* arg(const char* name)
 Return RooAbsArg with given name. A null pointer is returned if none is found.
RooAbsArg* fundArg(const char* name)
 Return fundamental (i.e. non-derived) RooAbsArg with given name. Fundamental types
 are e.g. RooRealVar, RooCategory. A null pointer is returned if none is found.
RooAbsData* data(const char* name)
 Retrieve dataset (binned or unbinned) with given name. A null pointer is returned if not found
Bool_t makeDir()
 Create transient TDirectory representation of this workspace. This directory
 will appear as a subdirectory of the directory that contains the workspace
 and will have the name of the workspace suffixed with "Dir". The TDirectory
 interface is read-only. Any attempt to insert objects into the workspace
 directory representation will result in an error message. Note that some
 ROOT object like TH1 automatically insert themselves into the current directory
 when constructed. This will give error messages when done in a workspace
 directory.
void Print(Option_t* opts = 0) const
 Print contents of the workspace
TIterator* componentIterator()
{ return _allOwnedNodes.createIterator() ; }
const RooArgSet& components()
{ return _allOwnedNodes ; }

Last change: Fri Nov 14 16:34:10 2008
Last generated: 2008-11-14 16:34
Copyright (c) 2000-2005, Regents of the University of California *

This page has been automatically generated. If you have any comments or suggestions about the page layout send a mail to ROOT support, or contact the developers with any questions or problems regarding ROOT.