nsmith- / rhalphalib

A binned fit intermediate representation library
BSD 3-Clause "New" or "Revised" License
6 stars 18 forks source link

shape paramEffect handling for TemplateSample #28

Open stalbrec opened 1 year ago

stalbrec commented 1 year ago

Hi,

I encountered a apparently rare situation when building TemplateSamples with shape nuisances using histograms as up/down effect, where both the norm of the nominal and up/down hists is ~1.

First part is that paramEffectUp is saved even if the effect is nil (i.e. np.all(effect_up==1)) whenever one gives also something not None as effect_down even if np.all(effect_down==1). Thats why I moved the line self._paramEffectsUp[param] = effect_up down to the point where the check if the down-variation is different from 1 has been done.

Second part is in the symmetrisation of the paramEffect if effect_down is None for a parameter. In the function setParamEffect effects for a shape param are stored as relatives but here it is handled as absolutes, if i understand this correctly. So whenever one would provide only the param up-effect the constructed down-effect could be some bogus negative array. Which happened to me before i fixed the first part.

Does it make sense to fix it like this, or am i missing something?

nsmith- commented 1 year ago

Sorry for the delay. I for some reason don't get notifications on this library