164 std::vector< HistFactory::Measurement > measurement_list;
185 for(
unsigned int i = 0; i < measurement_list.size(); ++i) {
197 std::string rowTitle = measurement.
GetName();
202 TFile* outFile =
new TFile(outputFileName.c_str(),
"recreate");
204 measurement.
GetLumi(), lumiError,
208 vector<RooWorkspace*> channel_workspaces;
209 vector<string> channel_names;
218 for(
unsigned int chanItr = 0; chanItr < measurement.
GetChannels().size(); ++chanItr ) {
223 string ch_name=channel.
GetName();
224 channel_names.push_back(ch_name);
226 std::vector< EstimateSummary >
dummy;
229 std::cout <<
"Failed to create SingleChannelModel for channel: " << channel.
GetName()
230 <<
" and measurement: " << measurement.
GetName() << std::endl;
234 channel_workspaces.push_back(ws);
239 std::cout <<
"Setting Parameter of Interest as :" << measurement.
GetPOI() << endl;
252 proto_config->
SetPdf( *ws->
pdf(
"newSimPdf") );
260 std::string ChannelFileName = measurement.
GetOutputFilePrefix() +
"_" + ch_name +
"_" + rowTitle +
"_model.root";
275 cout <<
"can't do fit for this channel, no parameter of interest"<<endl;
277 factory.FitModel(ws, ch_name,
"newSimPdf",
"expData",
false);
280 fprintf(factory.pFile,
" & " );
285 RooWorkspace* ws=factory.MakeCombinedModel(channel_names, channel_workspaces);
287 std::cout <<
"Error: Failed to create workspace" << std::endl;
298 cout <<
"Setting Parameter of Interest as :" << measurement.
GetPOI() << endl;
311 combined_config->
SetPdf(*ws->
pdf(
"newSimPdf"));
316 std::string CombinedFileName = measurement.
GetOutputFilePrefix()+
"_combined_"+rowTitle+
"_model.root";
328 cout <<
"can't do fit for this channel, no parameter of interest"<<endl;
330 factory.FitModel(ws,
"combined",
"simPdf",
"simData",
false);
ModelConfig is a simple class that holds configuration information specifying how a model should be u...
void topDriver(string input)
RooAbsData * data(const char *name) const
Retrieve dataset (binned or unbinned) with given name. A null pointer is returned if not found...
void GuessObsAndNuisance(const RooAbsData &data)
guesses Observables and ParametersOfInterest if not already set
std::string GetPOI(unsigned int i=0)
A ROOT file is a suite of consecutive data records (TKey instances) with a well defined format...
std::string GetOutputFilePrefix()
static TFile * Open(const char *name, Option_t *option="", const char *ftitle="", Int_t compress=1, Int_t netopt=0)
Create / open a file.
RooAbsPdf * pdf(const char *name) const
Retrieve p.d.f (RooAbsPdf) with given name. A null pointer is returned if not found.
std::vector< RooStats::HistFactory::Channel > & GetChannels()
virtual void SetPdf(const RooAbsPdf &pdf)
Set the Pdf, add to the the workspace if not already there.
std::map< std::string, double > & GetUniformSyst()
std::vector< RooStats::HistFactory::Measurement > GetMeasurementsFromXML(std::string input)
virtual const char * GetName() const
Returns name of object.
Bool_t writeToFile(const char *fileName, Bool_t recreate=kTRUE)
Save this current workspace into given file.
RooRealVar * var(const char *name) const
Retrieve real-valued variable (RooRealVar) with given name. A null pointer is returned if not found...
std::vector< std::string > & GetConstantParams()
Namespace for the RooStats classes.
static RooMathCoreReg dummy
std::map< std::string, double > & GetLogNormSyst()
TObject * obj(const char *name) const
Return any type of object (RooAbsArg, RooAbsData or generic object) with given name) ...
void Print(Option_t *opts=0) const
Print contents of the workspace.
virtual void SetParametersOfInterest(const RooArgSet &set)
void writeToFile(TFile *file)
virtual Bool_t add(const RooAbsArg &var, Bool_t silent=kFALSE)
Add element to non-owning set.
std::map< std::string, double > & GetGammaSyst()
virtual void Close(Option_t *option="")
Close a file.