我正在尝试在 zfit 中执行未合并的 3D 角度拟合,其中输入数据是具有从单独的不变质量峰值拟合分配的每个事件 sWeights 的样本。我想我在角相空间的某些区域遇到了负加权事件的问题,因为 zfit 给出了错误:
Traceback (most recent call last):
File "unbinned_angular_fit.py", line 282, in <module>
main()
File "unbinned_angular_fit.py", line 217, in main
result = minimizer.minimize(nll)
File "/home/dhill/miniconda/envs/ana_env/lib/python3.7/site-packages/zfit/minimizers/baseminimizer.py", line 265, in minimize
return self._hook_minimize(loss=loss, params=params)
File "/home/dhill/miniconda/envs/ana_env/lib/python3.7/site-packages/zfit/minimizers/baseminimizer.py", line 274, in _hook_minimize
return self._call_minimize(loss=loss, params=params)
File "/home/dhill/miniconda/envs/ana_env/lib/python3.7/site-packages/zfit/minimizers/baseminimizer.py", line 278, in _call_minimize
return self._minimize(loss=loss, params=params)
File "/home/dhill/miniconda/envs/ana_env/lib/python3.7/site-packages/zfit/minimizers/minimizer_minuit.py", line 179, in _minimize
result = minimizer.migrad(**minimize_options)
File "src/iminuit/_libiminuit.pyx", line 859, in iminuit._libiminuit.Minuit.migrad
RuntimeError: exception was raised in user function
User function arguments:
Hm_amp = +nan
Hm_phi = +0.000000
Hp_phi = +0.000000
Original python exception in user function:
RuntimeError: Loss starts already with NaN, cannot minimize.
File "/home/dhill/miniconda/envs/ana_env/lib/python3.7/site-packages/zfit/minimizers/minimizer_minuit.py", line 121, in func
values=info_values)
File "/home/dhill/miniconda/envs/ana_env/lib/python3.7/site-packages/zfit/minimizers/baseminimizer.py", line 47, in minimize_nan
return self._minimize_nan(loss=loss, params=params, minimizer=minimizer, values=values)
File "/home/dhill/miniconda/envs/ana_env/lib/python3.7/site-packages/zfit/minimizers/baseminimizer.py", line 107, in _minimize_nan
raise RuntimeError("Loss starts already with NaN, cannot minimize.")
我可以通过稍微限制一个拟合的可观察范围来避免这个错误,以避免出现少量数据事件的区域,其中一些数据被负权重(信号被 sWeights 稍微过度减去)。但我想知道在 zfit 中是否有另一种方法?
也许 zfit 中的 UnbinnedNLL 方法明确需要正事件,但负加权数据点可以设置为零或一个小的正值?我应该说,与权重的总和相比,负权重的水平似乎很小,并且发生在只有少量数据事件的角度分布之一的边缘。该区域的低数据率是由于实验接受效应。
在测试文件上运行以重现错误的代码在这里: https ://github.com/donalrinho/zfit_3D_unbinned_angular_fit_test
当costheta_X_VV_reco
变量的范围限制为 (-0.9, 1.0) 而不是整个范围 (-1.0, 1.0) 时,不会遇到此错误。我相信这是因为它消除了加权数据为负的相空间区域。