Batch Jobs for RooMCStudy

Dear Experts,

I am trying to perform a toy study with RooMCStudy. I want to generate about 100 toys with ~ 0.5 million events each. The problem is that it is taking a lot of time > 9 hours and still does not finish. Here’s an example of what I am doing (5.9 KB).

Can we submit parallel jobs for this ? Or is there another way to solve this?

Please help.

I think @jonas can help

Hi! I’d advise you to adjust the FitOptions for you RooMCStudy a bit:

FitOptions(Save(), PrintEvalErrors(-1), BatchMode(true), Strategy(0))

Before, you were using PrintEvalErrors(0), which is expensive because the error printing is not completely disabled (it only prints the first encountered error to the screen), but all subsequent errors are still written to an internal buffer. With PrintEvalErrors(-1), nothing is printed even internally).

Then, the new BatchMode(true) backend makes the fit about 4 times faster (but be sure to use a new ROOT version).

Finally, the Minuit strategy 0 is a bit faster than the default strategy 1.

With this, it takes on my machine about 1.5 hours to fit 1000 toys (I was scaling up the yields in your script to also get an expected yield of 0.5 million). Do you still need Batch jobs for that?

But the best solution I think would be to don’t to an unbinned fit. This is really not necessary here, since you only have a 1D fit in each channel of the RooSimultaneous. You can do this by adding Binned(true) to the constructor of the RooMCStudy. For each variable, it will automatically take 100 uniform bins (you can change this e.g. like deltaM.setBins(40). Unbinned fits are more useful in the many-dimensional case, where a uniform fine-grained binning would give too many bins. With the binned fit, 1000 toys take 4 mins on my machine.

You’re example is pretty much a textbook case for why binned likelihood fits are important and popular :wink:

1 Like

Dear @jonas, thank you so much for your prompt response.

Actually, the code that I have shared has a much simpler fit. The actual problem that I am working on is a Weighted, unbinned, 2D simultaneous fit, and the fit is also a lot more complex. Also, unfortunately, I cannot use a binned fit.

Here’s the code that I am using kk_toystudy.C which is in (13.4 KB).

I have root 6.28 installed. I tried with 100 toys. It is much faster now. Thank you. :slight_smile:



This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.