To avoid a crash in TotalSigmaFunctionX I added a check that the histogram being fitted has
GetEffectiveEntries() > 10. This avoids a fit to no data, which will crash when you try to
get a fitted parameter. It could be that there is a mistake in the code leading to the
histogram being empty in the first place.