pint.templates.lcprimitives.check_gradient

pint.templates.lcprimitives.check_gradient(func, n=1000, atol=1e-08, rtol=1e-05, quiet=False, ph=None, en=None)[source]

Test gradient function with a set of MC photons. This works with either LCPrimitive or LCTemplate objects.

TODO – there is trouble with the numerical gradient when a for the location-related parameters when the finite step causes the peak to shift from one side of an evaluation phase to the other.