An easy way to read in the written RooMCStudy results?


I am just wondering whether there is an easy way to read in the written RooMCStudy results so that we could do some further editing, such as fitting the error distribution, changing the position of the stat box (sometimes the stat box is too small to contain all the information). It is also easy and economic to read in the written results instead of doing the toy Monte study again, in case we need some new plots of the toy Monte Caro study.

RooMCStudy *mgr = new RooMCStudy(...) //... // get the results of toy study RooDataSet fitResdata = mgr->fitParDataSet(); // print out the data structure of the results fitResdata.Print("v"); // write to results into an ascii file fitResdata.write("toyResults.file");

You know, it is easy to know the structure of the written RooMCStudy results (toyResults.file), but it is a hard job to define all the written parameters one by one before reading in the file. You know, there are so many parameters for some complicated toy Monte Carlo study. And the order of the parameters also makes sense here. So maybe

  1. RooFit could add a header line in the front of fitParDataSet file?
  2. RooFit provides more option to deal with the error distribution fitting, and the layout of the stat box?

Thanks a lot.

Cheers, Jibo


The RooMCStudy class is undergoing some design changes in the next release(s) to simplify management of large scale (parallel) toy MC
studies. In that context we can also make some improvements to
the ability to persist results.

I note that you can already get a long way with your current problem
if you use the RooWorkspace to persist the p.d.f on which you performed
the MC study. Look e.g. at $ROOTSYS/tutorials/roofit/rf502_wspacewrite.C
to write a p.d.f (and all its components including parameters) into a ROOT
file. An example of how to use a written files is shown in rf503_wspaceread.C. You can also add the fitParDataSet() to the workspace so that all data you need is persisted in a single container.