Reject invalid parameter vector during HMC sampling

Any chance someone might help me? Let me know if the question isn’t clear.