RooMCStudy

Hi,

I am trying to get the generated value of “f” as shown in the attachment (filled as h_f_gen)…(below)one.cc (1.33 KB)

Is this the correct way to get generated “f” for toy samples ?

(2) Having said that i looked at
root.cern.ch/root/html/tutorial … str.C.html

What is “f_gen” in line-60 ? How does generated “f” is filled in that histogram ? Shouldn’t it have been
TH1* h_f_gen = mcs.fitParDataSet().createHistogram(“f”,-40) ; //f
instead of
TH1* h_f_gen = mcs.fitParDataSet().createHistogram(“f_gen”,-40) ; //f_gen

what is difference ? I see the two histograms give different distributions…

-sanjay

Hi,

Yes what you are doing seems to be the correct way to use it RooMCStudy.

Compared to the linked tutorial, rf804_mcstudy_constr.C , the difference is that there you have a constraint in the parameter f. In this case f is then sampled for every toy according to the given constraint. For this you have in that case a “f_gen” parameter that is not existing in your case. You have “f” fixed to the given initial value for every toy and what you get is the fitted value of “f”. The two histogram you are getting are the same, just done with different min, max values.

Best Regards

Lorenzo

Hi Lorenzo,

Can you please comment on if the line below (from my attached code one.cc)

// Make plot of distribution of generated value of f parameter
TH1* h_f_gen = mcs.fitParDataSet().createHistogram(“f”,-40) ;

will give me generated or fitted “f” (for 500 toys)?

because i think fitpardataset() gives fitted “f” but to get generated “f” one needs to use “genpardataset” …which i can’t figure out how to use ?

-sanjay

Hi,

fitParDataSet will give you the fitted parameters while genParDataSet will give the generated one when existing, i.e. in model who have constraints as in the tutorial example but not in your example.

Best Regards

Lorenzo