add cache in MultiHitGeneratorFromChi2, protect chi2 from nan