ModelConfig is a simple class that holds configuration information specifying how a model should be used in the context of various RooStats tools.
A single model can be used in different ways, and this class should carry all that is needed to specify how it should be used. ModelConfig requires a workspace to be set.
A ModelConfig holds sets of parameters of the likelihood function that have different interpretations:
rf306_condpereventerrors
in the RooFit tutorials.\[ \mathrm{Constraint}_b = \mathrm{Gauss}(b_0 \, | \, b, 0.2) \]
Definition at line 30 of file ModelConfig.h.
Public Member Functions | |
ModelConfig (const char *name, const char *title, RooWorkspace *ws=0) | |
ModelConfig (const char *name, RooWorkspace *ws=0) | |
ModelConfig (RooWorkspace *ws=0) | |
virtual ModelConfig * | Clone (const char *name="") const override |
clone More... | |
const RooArgSet * | GetConditionalObservables () const |
get RooArgSet for conditional observables (return NULL if not existing) More... | |
const RooArgSet * | GetConstraintParameters () const |
get RooArgSet containing the constraint parameters (return NULL if not existing) More... | |
const RooArgSet * | GetGlobalObservables () const |
get RooArgSet for global observables (return NULL if not existing) More... | |
const RooArgSet * | GetNuisanceParameters () const |
get RooArgSet containing the nuisance parameters (return NULL if not existing) More... | |
const RooArgSet * | GetObservables () const |
get RooArgSet for observables (return NULL if not existing) More... | |
const RooArgSet * | GetParametersOfInterest () const |
get RooArgSet containing the parameter of interest (return NULL if not existing) More... | |
RooAbsPdf * | GetPdf () const |
get model PDF (return NULL if pdf has not been specified or does not exist) More... | |
RooAbsPdf * | GetPriorPdf () const |
get parameters prior pdf (return NULL if not existing) More... | |
RooAbsData * | GetProtoData () const |
get Proto data set (return NULL if not existing) More... | |
const RooArgSet * | GetSnapshot () const |
get RooArgSet for parameters for a particular hypothesis (return NULL if not existing) More... | |
RooWorkspace * | GetWorkspace () const |
alias for GetWS() More... | |
RooWorkspace * | GetWS () const override |
get from TRef More... | |
void | GuessObsAndNuisance (const RooAbsData &data) |
Makes sensible guesses of observables, parameters of interest and nuisance parameters if one or multiple have been set by the creator of this ModelConfig. More... | |
void | LoadSnapshot () const |
load the snapshot from ws if it exists More... | |
virtual void | Print (Option_t *option="") const override |
overload the print method More... | |
virtual void | ReplaceWS (RooWorkspace *ws) override |
Remove the existing reference to a workspace and replace it with this new one. More... | |
virtual void | SetConditionalObservables (const char *argList) |
Specify the conditional observables through a comma-separated list of arguments already in the workspace. More... | |
virtual void | SetConditionalObservables (const RooArgSet &set) |
Specify the conditional observables. More... | |
virtual void | SetConstraintParameters (const char *argList) |
Specify the constraint parameters through a comma-separated list of arguments already in the workspace. More... | |
virtual void | SetConstraintParameters (const RooArgSet &set) |
Specify the constraint parameters. More... | |
virtual void | SetGlobalObservables (const char *argList) |
Specify the global observables through a comma-separated list of arguments already in the workspace. More... | |
virtual void | SetGlobalObservables (const RooArgSet &set) |
Specify the global observables. More... | |
virtual void | SetNuisanceParameters (const char *argList) |
Specify the nuisance parameters using a comma-separated list of arguments already in the workspace. More... | |
virtual void | SetNuisanceParameters (const RooArgSet &set) |
Specify the nuisance parameters (parameters that are not POI). More... | |
virtual void | SetObservables (const char *argList) |
specify the observables through a comma-separated list of arguments already in the workspace. More... | |
virtual void | SetObservables (const RooArgSet &set) |
Specify the observables. More... | |
virtual void | SetParameters (const char *argList) |
Specify parameters using a list of comma-separated list of arguments already in the workspace. More... | |
virtual void | SetParameters (const RooArgSet &set) |
Specify parameters of the PDF. More... | |
virtual void | SetParametersOfInterest (const char *argList) |
Specify parameters of interest using a comma-separated list of arguments already in the workspace. More... | |
virtual void | SetParametersOfInterest (const RooArgSet &set) |
Specify parameters of interest. More... | |
virtual void | SetPdf (const char *name) |
Specify the name of the PDF in the workspace to be used. More... | |
virtual void | SetPdf (const RooAbsPdf &pdf) |
Set the Pdf, add to the the workspace if not already there. More... | |
virtual void | SetPriorPdf (const char *name) |
Specify the name of the PDF in the workspace to be used. More... | |
virtual void | SetPriorPdf (const RooAbsPdf &pdf) |
Set the Prior Pdf, add to the the workspace if not already there. More... | |
virtual void | SetProtoData (const char *name) |
Specify the name of the dataset in the workspace to be used. More... | |
virtual void | SetProtoData (RooAbsData &data) |
Set the proto DataSet, add to the the workspace if not already there. More... | |
virtual void | SetSnapshot (const RooArgSet &set) |
Set parameter values for a particular hypothesis if using a common PDF by saving a snapshot in the workspace. More... | |
virtual void | SetWorkspace (RooWorkspace &ws) |
virtual void | SetWS (RooWorkspace &ws) override |
Set a workspace that owns all the necessary components for the analysis. More... | |
Public Member Functions inherited from TNamed | |
TNamed () | |
TNamed (const char *name, const char *title) | |
TNamed (const TNamed &named) | |
TNamed copy ctor. More... | |
TNamed (const TString &name, const TString &title) | |
virtual | ~TNamed () |
TNamed destructor. More... | |
virtual void | Clear (Option_t *option="") |
Set name and title to empty strings (""). More... | |
virtual TObject * | Clone (const char *newname="") const |
Make a clone of an object using the Streamer facility. More... | |
virtual Int_t | Compare (const TObject *obj) const |
Compare two TNamed objects. More... | |
virtual void | Copy (TObject &named) const |
Copy this to obj. More... | |
virtual void | FillBuffer (char *&buffer) |
Encode TNamed into output buffer. More... | |
virtual const char * | GetName () const |
Returns name of object. More... | |
virtual const char * | GetTitle () const |
Returns title of object. More... | |
virtual ULong_t | Hash () const |
Return hash value for this object. More... | |
virtual Bool_t | IsSortable () const |
virtual void | ls (Option_t *option="") const |
List TNamed name and title. More... | |
TNamed & | operator= (const TNamed &rhs) |
TNamed assignment operator. More... | |
virtual void | Print (Option_t *option="") const |
Print TNamed name and title. More... | |
virtual void | SetName (const char *name) |
Set the name of the TNamed. More... | |
virtual void | SetNameTitle (const char *name, const char *title) |
Set all the TNamed parameters (name and title). More... | |
virtual void | SetTitle (const char *title="") |
Set the title of the TNamed. More... | |
virtual Int_t | Sizeof () const |
Return size of the TNamed part of the TObject. More... | |
Public Member Functions inherited from TObject | |
TObject () | |
TObject constructor. More... | |
TObject (const TObject &object) | |
TObject copy ctor. More... | |
virtual | ~TObject () |
TObject destructor. More... | |
void | AbstractMethod (const char *method) const |
Use this method to implement an "abstract" method that you don't want to leave purely abstract. More... | |
virtual void | AppendPad (Option_t *option="") |
Append graphics object to current pad. More... | |
virtual void | Browse (TBrowser *b) |
Browse object. May be overridden for another default action. More... | |
ULong_t | CheckedHash () |
Check and record whether this class has a consistent Hash/RecursiveRemove setup (*) and then return the regular Hash value for this object. More... | |
virtual const char * | ClassName () const |
Returns name of class to which the object belongs. More... | |
virtual void | Clear (Option_t *="") |
virtual TObject * | Clone (const char *newname="") const |
Make a clone of an object using the Streamer facility. More... | |
virtual Int_t | Compare (const TObject *obj) const |
Compare abstract method. More... | |
virtual void | Copy (TObject &object) const |
Copy this to obj. More... | |
virtual void | Delete (Option_t *option="") |
Delete this object. More... | |
virtual Int_t | DistancetoPrimitive (Int_t px, Int_t py) |
Computes distance from point (px,py) to the object. More... | |
virtual void | Draw (Option_t *option="") |
Default Draw method for all objects. More... | |
virtual void | DrawClass () const |
Draw class inheritance tree of the class to which this object belongs. More... | |
virtual TObject * | DrawClone (Option_t *option="") const |
Draw a clone of this object in the current selected pad for instance with: gROOT->SetSelectedPad(gPad) . More... | |
virtual void | Dump () const |
Dump contents of object on stdout. More... | |
virtual void | Error (const char *method, const char *msgfmt,...) const |
Issue error message. More... | |
virtual void | Execute (const char *method, const char *params, Int_t *error=0) |
Execute method on this object with the given parameter string, e.g. More... | |
virtual void | Execute (TMethod *method, TObjArray *params, Int_t *error=0) |
Execute method on this object with parameters stored in the TObjArray. More... | |
virtual void | ExecuteEvent (Int_t event, Int_t px, Int_t py) |
Execute action corresponding to an event at (px,py). More... | |
virtual void | Fatal (const char *method, const char *msgfmt,...) const |
Issue fatal error message. More... | |
virtual TObject * | FindObject (const char *name) const |
Must be redefined in derived classes. More... | |
virtual TObject * | FindObject (const TObject *obj) const |
Must be redefined in derived classes. More... | |
virtual Option_t * | GetDrawOption () const |
Get option used by the graphics system to draw this object. More... | |
virtual const char * | GetIconName () const |
Returns mime type name of object. More... | |
virtual const char * | GetName () const |
Returns name of object. More... | |
virtual char * | GetObjectInfo (Int_t px, Int_t py) const |
Returns string containing info about the object at position (px,py). More... | |
virtual Option_t * | GetOption () const |
virtual const char * | GetTitle () const |
Returns title of object. More... | |
virtual UInt_t | GetUniqueID () const |
Return the unique object id. More... | |
virtual Bool_t | HandleTimer (TTimer *timer) |
Execute action in response of a timer timing out. More... | |
virtual ULong_t | Hash () const |
Return hash value for this object. More... | |
Bool_t | HasInconsistentHash () const |
Return true is the type of this object is known to have an inconsistent setup for Hash and RecursiveRemove (i.e. More... | |
virtual void | Info (const char *method, const char *msgfmt,...) const |
Issue info message. More... | |
virtual Bool_t | InheritsFrom (const char *classname) const |
Returns kTRUE if object inherits from class "classname". More... | |
virtual Bool_t | InheritsFrom (const TClass *cl) const |
Returns kTRUE if object inherits from TClass cl. More... | |
virtual void | Inspect () const |
Dump contents of this object in a graphics canvas. More... | |
void | InvertBit (UInt_t f) |
virtual Bool_t | IsEqual (const TObject *obj) const |
Default equal comparison (objects are equal if they have the same address in memory). More... | |
virtual Bool_t | IsFolder () const |
Returns kTRUE in case object contains browsable objects (like containers or lists of other objects). More... | |
R__ALWAYS_INLINE Bool_t | IsOnHeap () const |
virtual Bool_t | IsSortable () const |
R__ALWAYS_INLINE Bool_t | IsZombie () const |
virtual void | ls (Option_t *option="") const |
The ls function lists the contents of a class on stdout. More... | |
void | MayNotUse (const char *method) const |
Use this method to signal that a method (defined in a base class) may not be called in a derived class (in principle against good design since a child class should not provide less functionality than its parent, however, sometimes it is necessary). More... | |
virtual Bool_t | Notify () |
This method must be overridden to handle object notification. More... | |
void | Obsolete (const char *method, const char *asOfVers, const char *removedFromVers) const |
Use this method to declare a method obsolete. More... | |
void | operator delete (void *ptr) |
Operator delete. More... | |
void | operator delete[] (void *ptr) |
Operator delete []. More... | |
void * | operator new (size_t sz) |
void * | operator new (size_t sz, void *vp) |
void * | operator new[] (size_t sz) |
void * | operator new[] (size_t sz, void *vp) |
TObject & | operator= (const TObject &rhs) |
TObject assignment operator. More... | |
virtual void | Paint (Option_t *option="") |
This method must be overridden if a class wants to paint itself. More... | |
virtual void | Pop () |
Pop on object drawn in a pad to the top of the display list. More... | |
virtual void | Print (Option_t *option="") const |
This method must be overridden when a class wants to print itself. More... | |
virtual Int_t | Read (const char *name) |
Read contents of object with specified name from the current directory. More... | |
virtual void | RecursiveRemove (TObject *obj) |
Recursively remove this object from a list. More... | |
void | ResetBit (UInt_t f) |
virtual void | SaveAs (const char *filename="", Option_t *option="") const |
Save this object in the file specified by filename. More... | |
virtual void | SavePrimitive (std::ostream &out, Option_t *option="") |
Save a primitive as a C++ statement(s) on output stream "out". More... | |
void | SetBit (UInt_t f) |
void | SetBit (UInt_t f, Bool_t set) |
Set or unset the user status bits as specified in f. More... | |
virtual void | SetDrawOption (Option_t *option="") |
Set drawing option for object. More... | |
virtual void | SetUniqueID (UInt_t uid) |
Set the unique object id. More... | |
virtual void | SysError (const char *method, const char *msgfmt,...) const |
Issue system error message. More... | |
R__ALWAYS_INLINE Bool_t | TestBit (UInt_t f) const |
Int_t | TestBits (UInt_t f) const |
virtual void | UseCurrentStyle () |
Set current style settings in this object This function is called when either TCanvas::UseCurrentStyle or TROOT::ForceStyle have been invoked. More... | |
virtual void | Warning (const char *method, const char *msgfmt,...) const |
Issue warning message. More... | |
virtual Int_t | Write (const char *name=0, Int_t option=0, Int_t bufsize=0) |
Write this object to the current directory. More... | |
virtual Int_t | Write (const char *name=0, Int_t option=0, Int_t bufsize=0) const |
Write this object to the current directory. More... | |
Public Member Functions inherited from RooWorkspaceHandle | |
virtual | ~RooWorkspaceHandle () |
virtual RooWorkspace * | GetWS () const =0 |
Retrieve the workspace. More... | |
virtual void | ReplaceWS (RooWorkspace *ws)=0 |
Set the workspace irrespective of what the previous workspace is. More... | |
virtual void | SetWS (RooWorkspace &ws)=0 |
Set the workspace. If it exists, it is up to the implementing class to decide how to proceed. More... | |
Protected Member Functions | |
void | DefineSetInWS (const char *name, const RooArgSet &set) |
helper functions to define a set in the WS More... | |
void | ImportDataInWS (RooAbsData &data) |
internal function to import data in WS More... | |
void | ImportPdfInWS (const RooAbsPdf &pdf) |
internal function to import Pdf in WS More... | |
Bool_t | SetHasOnlyParameters (const RooArgSet &set, const char *errorMsgPrefix=0) |
helper function to check that content of a given set is exclusively parameters More... | |
Protected Member Functions inherited from TObject | |
virtual void | DoError (int level, const char *location, const char *fmt, va_list va) const |
Interface to ErrorHandler (protected). More... | |
void | MakeZombie () |
Protected Attributes | |
std::string | fConditionalObsName |
name for RooAbsPdf specifying a prior on the parameters More... | |
std::string | fConstrParamsName |
name for RooArgSet specifying nuisance parameters More... | |
std::string | fDataName |
name of PDF in workspace More... | |
std::string | fGlobalObsName |
name for RooArgSet specifying conditional observables More... | |
std::string | fNuisParamsName |
name for RooArgSet specifying parameters of interest More... | |
std::string | fObservablesName |
name for RooArgSet that specifies a particular hypothesis More... | |
std::string | fPdfName |
name of the WS More... | |
std::string | fPOIName |
name of data set in workspace More... | |
std::string | fPriorPdfName |
name for RooArgSet specifying constrained parameters More... | |
std::string | fProtoDataName |
name for RooArgSet specifying global observables More... | |
TRef | fRefWS |
std::string | fSnapshotName |
name for RooArgSet specifying dataset that should be used as proto-data More... | |
std::string | fWSName |
WS reference used in the file. More... | |
Protected Attributes inherited from TNamed | |
TString | fName |
TString | fTitle |
Additional Inherited Members | |
Public Types inherited from TObject | |
enum | { kIsOnHeap = 0x01000000 , kNotDeleted = 0x02000000 , kZombie = 0x04000000 , kInconsistent = 0x08000000 , kBitMask = 0x00ffffff } |
enum | { kSingleKey = BIT(0) , kOverwrite = BIT(1) , kWriteDelete = BIT(2) } |
enum | EDeprecatedStatusBits { kObjInCanvas = BIT(3) } |
enum | EStatusBits { kCanDelete = BIT(0) , kMustCleanup = BIT(3) , kIsReferenced = BIT(4) , kHasUUID = BIT(5) , kCannotPick = BIT(6) , kNoContextMenu = BIT(8) , kInvalidObject = BIT(13) } |
Static Public Member Functions inherited from TObject | |
static Long_t | GetDtorOnly () |
Return destructor only flag. More... | |
static Bool_t | GetObjectStat () |
Get status of object stat flag. More... | |
static void | SetDtorOnly (void *obj) |
Set destructor only flag. More... | |
static void | SetObjectStat (Bool_t stat) |
Turn on/off tracking of objects in the TObjectTable. More... | |
#include <RooStats/ModelConfig.h>
|
inline |
Definition at line 34 of file ModelConfig.h.
|
inline |
Definition at line 40 of file ModelConfig.h.
|
inline |
Definition at line 46 of file ModelConfig.h.
|
inlineoverridevirtual |
helper functions to define a set in the WS
helper functions to avoid code duplication
Definition at line 258 of file ModelConfig.cxx.
|
inline |
get RooArgSet for conditional observables (return NULL if not existing)
Definition at line 252 of file ModelConfig.h.
|
inline |
get RooArgSet containing the constraint parameters (return NULL if not existing)
Definition at line 243 of file ModelConfig.h.
|
inline |
get RooArgSet for global observables (return NULL if not existing)
Definition at line 255 of file ModelConfig.h.
|
inline |
get RooArgSet containing the nuisance parameters (return NULL if not existing)
Definition at line 240 of file ModelConfig.h.
|
inline |
get RooArgSet for observables (return NULL if not existing)
Definition at line 249 of file ModelConfig.h.
|
inline |
get RooArgSet containing the parameter of interest (return NULL if not existing)
Definition at line 237 of file ModelConfig.h.
|
inline |
get model PDF (return NULL if pdf has not been specified or does not exist)
Definition at line 234 of file ModelConfig.h.
|
inline |
get parameters prior pdf (return NULL if not existing)
Definition at line 246 of file ModelConfig.h.
|
inline |
get Proto data set (return NULL if not existing)
Definition at line 258 of file ModelConfig.h.
const RooArgSet * RooStats::ModelConfig::GetSnapshot | ( | ) | const |
get RooArgSet for parameters for a particular hypothesis (return NULL if not existing)
Load the snapshot from ws and return the corresponding set with the snapshot values.
User must delete returned RooArgSet.
Definition at line 225 of file ModelConfig.cxx.
|
inline |
alias for GetWS()
Definition at line 267 of file ModelConfig.h.
|
overridevirtual |
void RooStats::ModelConfig::GuessObsAndNuisance | ( | const RooAbsData & | data | ) |
Makes sensible guesses of observables, parameters of interest and nuisance parameters if one or multiple have been set by the creator of this ModelConfig.
Defaults:
We use NULL to mean not set, so we don't want to fill with empty RooArgSets.
Definition at line 68 of file ModelConfig.cxx.
|
protected |
internal function to import data in WS
Definition at line 297 of file ModelConfig.cxx.
internal function to import Pdf in WS
Definition at line 283 of file ModelConfig.cxx.
void RooStats::ModelConfig::LoadSnapshot | ( | ) | const |
load the snapshot from ws if it exists
Definition at line 250 of file ModelConfig.cxx.
overload the print method
print contents of Model on the default print stream It can be changed using RooPrintable
Reimplemented from TNamed.
Definition at line 119 of file ModelConfig.cxx.
|
inlineoverridevirtual |
Remove the existing reference to a workspace and replace it with this new one.
Implements RooWorkspaceHandle.
Definition at line 69 of file ModelConfig.h.
|
inlinevirtual |
Specify the conditional observables through a comma-separated list of arguments already in the workspace.
Definition at line 166 of file ModelConfig.h.
|
inlinevirtual |
Specify the conditional observables.
Definition at line 159 of file ModelConfig.h.
|
inlinevirtual |
Specify the constraint parameters through a comma-separated list of arguments already in the workspace.
Definition at line 140 of file ModelConfig.h.
Specify the constraint parameters.
Definition at line 133 of file ModelConfig.h.
|
inlinevirtual |
Specify the global observables through a comma-separated list of arguments already in the workspace.
Definition at line 189 of file ModelConfig.h.
Specify the global observables.
Definition at line 172 of file ModelConfig.h.
|
protected |
helper function to check that content of a given set is exclusively parameters
Definition at line 310 of file ModelConfig.cxx.
|
inlinevirtual |
Specify the nuisance parameters using a comma-separated list of arguments already in the workspace.
Definition at line 127 of file ModelConfig.h.
Specify the nuisance parameters (parameters that are not POI).
Definition at line 119 of file ModelConfig.h.
|
inlinevirtual |
specify the observables through a comma-separated list of arguments already in the workspace.
Definition at line 153 of file ModelConfig.h.
Specify the observables.
Definition at line 146 of file ModelConfig.h.
|
inlinevirtual |
Specify parameters using a list of comma-separated list of arguments already in the workspace.
Definition at line 107 of file ModelConfig.h.
Specify parameters of the PDF.
Definition at line 93 of file ModelConfig.h.
|
inlinevirtual |
Specify parameters of interest using a comma-separated list of arguments already in the workspace.
Definition at line 114 of file ModelConfig.h.
Specify parameters of interest.
Definition at line 100 of file ModelConfig.h.
|
inlinevirtual |
Specify the name of the PDF in the workspace to be used.
Definition at line 199 of file ModelConfig.h.
Set the Pdf, add to the the workspace if not already there.
Definition at line 81 of file ModelConfig.h.
|
inlinevirtual |
Specify the name of the PDF in the workspace to be used.
Definition at line 209 of file ModelConfig.h.
Set the Prior Pdf, add to the the workspace if not already there.
Definition at line 87 of file ModelConfig.h.
|
inlinevirtual |
Specify the name of the dataset in the workspace to be used.
Definition at line 220 of file ModelConfig.h.
|
inlinevirtual |
Set the proto DataSet, add to the the workspace if not already there.
Definition at line 75 of file ModelConfig.h.
Set parameter values for a particular hypothesis if using a common PDF by saving a snapshot in the workspace.
save snapshot in the workspace and use values passed with the set
Definition at line 209 of file ModelConfig.cxx.
|
inlinevirtual |
Definition at line 66 of file ModelConfig.h.
|
overridevirtual |
Set a workspace that owns all the necessary components for the analysis.
If a workspace already exists in this ModelConfig, RooWorkspace::merge(ws) will be called on the existing workspace.
Implements RooWorkspaceHandle.
Definition at line 180 of file ModelConfig.cxx.
|
protected |
name for RooAbsPdf specifying a prior on the parameters
Definition at line 300 of file ModelConfig.h.
|
protected |
name for RooArgSet specifying nuisance parameters
Definition at line 297 of file ModelConfig.h.
|
protected |
name of PDF in workspace
Definition at line 293 of file ModelConfig.h.
|
protected |
name for RooArgSet specifying conditional observables
Definition at line 301 of file ModelConfig.h.
|
protected |
name for RooArgSet specifying parameters of interest
Definition at line 296 of file ModelConfig.h.
|
protected |
name for RooArgSet that specifies a particular hypothesis
Definition at line 306 of file ModelConfig.h.
|
protected |
name of the WS
Definition at line 292 of file ModelConfig.h.
|
protected |
name of data set in workspace
Definition at line 294 of file ModelConfig.h.
|
protected |
name for RooArgSet specifying constrained parameters
Definition at line 298 of file ModelConfig.h.
|
protected |
name for RooArgSet specifying global observables
Definition at line 302 of file ModelConfig.h.
|
protected |
Definition at line 288 of file ModelConfig.h.
|
protected |
name for RooArgSet specifying dataset that should be used as proto-data
Definition at line 304 of file ModelConfig.h.
|
protected |
WS reference used in the file.
Definition at line 290 of file ModelConfig.h.