I should mention that
getHessian(problem, X, Z) is not the Hessian, but it is "Hessian along Z". For example, if X were a vector (so, Z is a vector too), then getHessian(problem, X, Z) is "Hessian at X multiplied with Z". Hence, doing eigs on getHessian(problem, X, Z) does not make sense.
The correct spectrum is indeed given by hessianspectrum(problem, X).
No, positiveness does not depend on Z. We look at hessianspectrum(problem, X) and see whether they are positive.
Regards,
Bamdev