Special function for kinematic fit