Hopefully, someone could give me a hint on what could cause the problems I have been experiencing for a while already,
I get the following errors while trying to create a RooStats workspace with the help of hist2workspace:
[#0] ERROR:InputArguments -- model_channel1: calculated negative expected events: -4.93228
[#0] WARNING:Minization -- RooFitGlue: Minimized function has error status.
Returning maximum FCN so far (1495.38) to force MIGRAD to back out of this region. Error log follows
Parameter values: Lumi=0.978791, SigXsecOverSM=1.17, alpha_FLAT=-3.29668, alpha_JER=-0.0114967, alpha_JES=-0.196884, alpha_fake=-3.6494, alpha_uncert_stat=0.300105
RooRealSumPdf::channel1_model[ binWidth_obs_channel1_0 * L_x_sample_1_channel1_overallSyst_x_HistSyst + binWidth_obs_channel1_1 * L_x_sample_2_channel1_overallSyst_x_HistSyst + binWidth_obs_channel1_2 * L_x_signal_channel1_overallSyst_x_HistSyst ]
Expected number of events is negative @ !funcList=(L_x_sample_1_channel1_overallSyst_x_HistSyst = 0,L_x_sample_2_channel1_overallSyst_x_HistSyst = 0,L_x_signal_channel1_overallSyst_x_HistSyst = 0), !coefList=(binWidth_obs_channel1_0 = 0.005,binWidth_obs_channel1_1 = 0.005,binWidth_obs_channel1_2 = 0.005)
The problem is that the expected number of events appears to be negative and hence the extended term could not be calculated (log). My understanding is that this negative expectation value is achieved during some interpolation process.
I have no bins with negative values in my histograms (Though, I believe if I have some, the tool will set the contents of such bins to zero), though I have pretty large systematic uncertainties associated to some bins.
I have no problems with calculating limits with using different CLs limit setting tools (not ROOT-affiliated).
The creation of workspace is done with:
hist2workspace -standard_form limit.xml
which I believe is the only way to create the workspace if events are weighted.
ROOT version is 5.30.01
If you need to see input histograms / xml files I would be happy to provide ones. Any hints on how one could get a solution for the errors pasted above would be very much appreciated.
I don’t have experience on hist2workspace so I’ll let Kyle comment about it.
On the issue though I think that even if the histograms bin content is always positive it may happen that the overall PDF gets negative if some normalisation contribution plays in that direction. Now the normalisation is possibly made of sum and product of different terms; you could try to make sure the terms summed up are always positive. Are terms parameterizing efficiency terms constrained between 0 and 1 for example? Cross-sections constrained to be positive? etc. What may also happen is that when you add systematics you are more likely to encounter this issue. A downward fluctuation on a systematics may end in a negative yield if you didn’t prevent that carefully. Try finding if the issue is also there without systematics and what systematics may be the cause otherwise. I hope those advices are any useful to you.
If I understand correctly, you are pointing out two possible reasons for the observed errors.
The constraints on cross section and parametrization terms should be always positive which I believe is true in my case. At least, all bins in input histograms are positive (nominal and ± systematics), xml top options file has the following specified:
Variations due to systematics. I think this could be true, but the exact reason is still being unclear to me.
I do not have any negative bins in all input histograms. The variation could go negative because of stat uncertainty but nothing could be done about that. Here is the link for input files used in xml files, as well as xml files itself, maybe you or anybody else could try to convert it to RooStats workspace:
I will appreciate again, if someone could try to produce a workspace with that, maybe you will notice something which is causing those errors to pop up, but I can’t find any issues in the inputs.
the uncertainty of second contribution in your xml file seems pretty large ~40%. That’s the kind of contribution I may suspect contribute to a possible large downward fluctuation of a yield if not properly constrained. Could you try with an uncertainty of 15% for example; do you still see the issue then?
I see. So maybe the systematics are not the contributing reason the yield becomes negative as I would have initially fear.
Doesn’t the logfile tell you for which bin the issue is arrising? If I were you I’d try to identify it and test with fewer/other histograms to find out what’s happening/where.