15 #ifndef ROO_MSG_SERVICE 19 #ifndef RooStats_RooStatsUtils 46 if (!GetObservables()) {
47 const RooArgSet * obs = GetPdf()->getObservables(data);
52 if (!GetGlobalObservables()) {
54 const RooArgSet * obs = GetPdf()->getObservables(data);
58 SetGlobalObservables(co);
73 if (!GetNuisanceParameters()) {
74 const RooArgSet * params = GetPdf()->getParameters(data);
76 p.
remove(*GetParametersOfInterest());
79 SetNuisanceParameters(p);
95 os << endl <<
"=== Using the following for " <<
GetName() <<
" ===" << endl;
100 os <<
"Observables: ";
101 GetObservables()->Print(
"");
103 if(GetParametersOfInterest()) {
104 os <<
"Parameters of Interest: ";
105 GetParametersOfInterest()->Print(
"");
107 if(GetNuisanceParameters()){
108 os <<
"Nuisance Parameters: ";
109 GetNuisanceParameters()->Print(
"");
111 if(GetGlobalObservables()){
112 os <<
"Global Observables: ";
113 GetGlobalObservables()->Print(
"");
115 if(GetConstraintParameters()){
116 os <<
"Constraint Parameters: ";
117 GetConstraintParameters()->Print(
"");
119 if(GetConditionalObservables()){
120 os <<
"Conditional Observables: ";
121 GetConditionalObservables()->Print(
"");
124 os <<
"Proto Data: ";
125 GetProtoData()->Print(
"");
135 GetPriorPdf()->Print(
"");
139 const RooArgSet * snapshot = GetSnapshot();
141 os <<
"Snapshot: " << endl;
142 snapshot->
Print(
"v");
152 if( !fRefWS.GetObject() ) {
177 if ( !GetWS() )
return;
180 if (fSnapshotName.size() > 0) fSnapshotName +=
"_";
181 fSnapshotName +=
set.GetName();
182 if (fSnapshotName.size() > 0) fSnapshotName +=
"_";
183 fSnapshotName +=
"snapshot";
184 GetWS()->saveSnapshot(fSnapshotName.c_str(),
set,
true);
185 DefineSetInWS(fSnapshotName.c_str(),
set);
191 if ( !GetWS() )
return 0;
192 if (!fSnapshotName.length())
return 0;
195 if (! GetWS()->set(fSnapshotName.c_str() ) )
return 0;
196 RooArgSet snapshotVars(*GetWS()->
set(fSnapshotName.c_str() ) );
197 if (snapshotVars.
getSize() == 0)
return 0;
200 snapshotVars.
snapshot(tempSnapshot);
202 if (!(GetWS()->loadSnapshot(fSnapshotName.c_str())) )
return 0;
209 return modelSnapshot;
212 void ModelConfig::LoadSnapshot()
const{
214 if ( !GetWS() )
return;
215 GetWS()->loadSnapshot(fSnapshotName.c_str());
220 if ( !GetWS() )
return;
222 const RooArgSet * prevSet = GetWS()->set(name);
226 GetWS()->removeSet(name);
235 GetWS()->defineSet(name,
set,
true);
241 void ModelConfig::ImportPdfInWS(
const RooAbsPdf & pdf) {
243 if ( !GetWS() )
return;
245 if (! GetWS()->pdf( pdf.
GetName() ) ){
255 if ( !GetWS() )
return;
260 GetWS()->import(data);
266 Bool_t ModelConfig::SetHasOnlyParameters(
const RooArgSet&
set,
const char* errorMsgPrefix) {
271 while ((arg=iter.
next())) {
273 nonparams.
add(*arg) ;
277 if (errorMsgPrefix && nonparams.
getSize()>0) {
278 cout << errorMsgPrefix <<
" ERROR: specified set contains non-parameters: " << nonparams << endl ;
280 return (nonparams.
getSize()==0) ;
virtual const char * GetName() const
Returns name of object.
std::string GetName(const std::string &scope_name)
ModelConfig is a simple class that holds configuration information specifying how a model should be u...
virtual Bool_t add(const RooAbsCollection &col, Bool_t silent=kFALSE)
Add a collection of arguments to this collection by calling add() for each element in the source coll...
RooFit::MsgLevel globalKillBelow() const
static RooMsgService & instance()
Return reference to singleton instance.
RooCmdArg RecycleConflictNodes(Bool_t flag=kTRUE)
void assignFast(const RooAbsCollection &other, Bool_t setValDirty=kTRUE)
Functional equivalent of operator=() but assumes this and other collection have same layout...
virtual void Print(Option_t *options=0) const
This method must be overridden when a class wants to print itself.
virtual Bool_t isFundamental() const
RooAbsCollection * snapshot(Bool_t deepCopy=kTRUE) const
Take a snap shot of current collection contents: An owning collection is returned containing clones o...
void setGlobalKillBelow(RooFit::MsgLevel level)
RooAbsData is the common abstract base class for binned and unbinned datasets.
static std::ostream & defaultPrintStream(std::ostream *os=0)
Return a reference to the current default stream to use in Print().
Namespace for the RooStats classes.
void Print(std::ostream &os, const OptionType &opt)
virtual Bool_t remove(const RooAbsArg &var, Bool_t silent=kFALSE, Bool_t matchByNameOnly=kFALSE)
Remove the specified argument from our list.
void RemoveConstantParameters(RooArgSet *set)
RooAbsPdf is the abstract interface for all probability density functions The class provides hybrid a...
RooAbsArg is the common abstract base class for objects that represent a value (of arbitrary type) an...
The RooWorkspace is a persistable container for RooFit projects.