Q: generateAndFit of RooMCStudy

Dear all,

I did toyMC by using RooMCStudy class.
(/afs/cern.ch/sw/lcg/external/root/5.18.00/slc4_ia32_gcc34/root/bin/root is used.)
To see the data used in toyMC later, I kept them by
where nTrial=1000, nEventToy=500 (for the test).
When I counted the number of data storded in toymc_0000.dat etc,
it is not 500 (but close to 500). Is there a way to generate data with
a fixed one, for example, 500 in this case?

best regards,

Hi Junichi,

You have probably configured your RooMCStudy for an extended likelihood fit.
In that case a Poisson fluctuation on the number of events generated is introduced.
If you do not do this, some of your pull distributions will not come out right.
You can inhibit this feature (and thus generate exactly N events) if you omit
the Extended() argument in the RooMCStudy constructor.


Hi Wouter,

thanks for your answer.
(I did not turn on “Notify me when …” of this topic…)
Your reply is correct. I’m using extended likilihood fit.
To check it, when I use non-exteneed one, the number
of events is constant. Thanks.