19 using namespace RooFit;
27 RooRealVar x(
"x",
"x", -10, 10);
28 RooRealVar m(
"m",
"m", 0, -10, 10);
29 RooRealVar s(
"s",
"s", 1, -10, 10);
30 RooGaussian gauss(
"g",
"g", x, m, s);
33 RooRealVar p0(
"p0",
"p0", 0.01, 0., 1.);
34 RooPolynomial poly(
"p",
"p", x, p0);
37 RooRealVar f(
"f",
"f", 0.5, 0., 1.);
38 RooAddPdf model(
"model",
"model", RooArgSet(gauss, poly), f);
43 RooDataSet *d = model.generate(x, 1000);
50 RooArgSet *params = model.getParameters(x);
53 params->writeToFile(
"rf505_asciicfg_example.txt");
55 TString dir1 = gROOT->GetTutorialDir() ;
56 dir1.Append(
"/roofit/rf505_asciicfg.txt") ;
57 TString dir2 =
"rf505_asciicfg_example.txt";
63 params->readFromFile(dir2);
67 params->readFromFile(dir1, 0,
"Section2");
72 params->readFromFile(dir1,
"READ",
"Section3");
75 cout <<
"The following parameters of the were _not_ read from Section3: "
76 << (*params->selectByAttrib(
"READ", kFALSE)) << endl;
82 params->readFromFile(dir1, 0,
"Section4");