Replaced dynamic_cast with obtain_from_generic in FITCInferenceMethod class