OK - in one of the Roofit tutorials I see I can specify different models for generation and fitting.
But I want to change just one parameter in my tmodel PDF, so I thought that I can separate generation
and fitting and change the parameter “in-between” like:
toff_mich.setConstant(kTRUE) ;
toff_mich=0 ; // tmodel depends on RooRealVar toff_mich
RooMCStudy* mcstudy = new RooMCStudy(tmodel,t,Binned(kFALSE),Silence(),Extended(),
FitOptions(Save(kTRUE),PrintEvalErrors(0))) ;
mcstudy->generate(nsample,nev,0,"data/toymc_%04d.dat") ;
toff_mich=-3 ;
mcstudy->fit(nsample,"data/toymc_%04d.dat") ;
(That would save me some typing and make the coding more readable, so I don’t have
to have duplicate tmodel, tmodel2, and toff_mich, toff_mich2, as in the rf802_mcstudy_addons.C
tutorial.)
But the above does not work - I get the exactly same fit results regardless of the value I set
toff_mich to.
Is something like this supposed to work, or is my only option having duplicate generation
(tmodel) and fitting model (tmodel2)
RooMCStudy* mcstudy = new RooMCStudy(tmodel,t,FitModel(tmodel2),…
where the only difference is one parameter value?
Cheers, Emil
P.S. I also get the error message
[#0] PROGRESS:Generation – RooMCStudy::run: sample 2
[#0] PROGRESS:Generation – RooMCStudy::run: sample 1
[#0] PROGRESS:Generation – RooMCStudy::run: sample 0
[#0] ERROR:InputArguments – RooDataSet::merge(fitParData_tmodel) ERROR: datasets have different size
[#0] PROGRESS:Generation – RooMCStudy::run: sample 9
Should I worry about it?