53 if (!GetObservables()) {
54 const RooArgSet * obs = GetPdf()->getObservables(data);
59 if (!GetGlobalObservables()) {
61 const RooArgSet * obs = GetPdf()->getObservables(data);
65 SetGlobalObservables(co);
80 if (!GetNuisanceParameters()) {
81 const RooArgSet * params = GetPdf()->getParameters(data);
83 p.
remove(*GetParametersOfInterest());
86 SetNuisanceParameters(p);
104 os << endl <<
"=== Using the following for " <<
GetName() <<
" ===" << endl;
108 if(GetObservables()){
109 os <<
"Observables: ";
110 GetObservables()->Print(
"");
112 if(GetParametersOfInterest()) {
113 os <<
"Parameters of Interest: ";
114 GetParametersOfInterest()->Print(
"");
116 if(GetNuisanceParameters()){
117 os <<
"Nuisance Parameters: ";
118 GetNuisanceParameters()->Print(
"");
120 if(GetGlobalObservables()){
121 os <<
"Global Observables: ";
122 GetGlobalObservables()->Print(
"");
124 if(GetConstraintParameters()){
125 os <<
"Constraint Parameters: ";
126 GetConstraintParameters()->Print(
"");
128 if(GetConditionalObservables()){
129 os <<
"Conditional Observables: ";
130 GetConditionalObservables()->Print(
"");
133 os <<
"Proto Data: ";
134 GetProtoData()->Print(
"");
144 GetPriorPdf()->Print(
"");
148 const RooArgSet * snapshot = GetSnapshot();
150 os <<
"Snapshot: " << endl;
151 snapshot->
Print(
"v");
162 if( !fRefWS.GetObject() ) {
191 if ( !GetWS() )
return;
194 if (fSnapshotName.size() > 0) fSnapshotName +=
"_";
195 fSnapshotName +=
set.GetName();
196 if (fSnapshotName.size() > 0) fSnapshotName +=
"_";
197 fSnapshotName +=
"snapshot";
198 GetWS()->saveSnapshot(fSnapshotName.c_str(),
set,
true);
199 DefineSetInWS(fSnapshotName.c_str(),
set);
207 if ( !GetWS() )
return 0;
208 if (!fSnapshotName.length())
return 0;
211 if (! GetWS()->set(fSnapshotName.c_str() ) )
return 0;
212 RooArgSet snapshotVars(*GetWS()->
set(fSnapshotName.c_str() ) );
213 if (snapshotVars.
getSize() == 0)
return 0;
216 snapshotVars.
snapshot(tempSnapshot);
218 if (!(GetWS()->loadSnapshot(fSnapshotName.c_str())) )
return 0;
225 return modelSnapshot;
231 void ModelConfig::LoadSnapshot()
const{
232 if ( !GetWS() )
return;
233 GetWS()->loadSnapshot(fSnapshotName.c_str());
240 if ( !GetWS() )
return;
242 const RooArgSet * prevSet = GetWS()->set(name);
246 GetWS()->removeSet(name);
255 GetWS()->defineSet(name,
set,
true);
264 void ModelConfig::ImportPdfInWS(
const RooAbsPdf & pdf) {
265 if ( !GetWS() )
return;
267 if (! GetWS()->pdf( pdf.
GetName() ) ){
279 if ( !GetWS() )
return;
284 GetWS()->import(data);
291 Bool_t ModelConfig::SetHasOnlyParameters(
const RooArgSet&
set,
const char* errorMsgPrefix) {
296 while ((arg=iter.
next())) {
298 nonparams.
add(*arg) ;
302 if (errorMsgPrefix && nonparams.
getSize()>0) {
303 cout << errorMsgPrefix <<
" ERROR: specified set contains non-parameters: " << nonparams << endl ;
305 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.