After the fitting, I want to do some plotting. However, I want to switch to Minuit1 for the plotting (for the minuit_hf->contour). May I ask how to do it?
What you are attempting there in the code doesn’t work. The RooMinuit class is a wrapper around the old Minuit 1. To be able to switch between Miniut 1 and Minuit 2, use the newer RooMinimizer class.
Then, you can switch the underlying minimizer at any time, also between calling Migrad and contour:
m.setMinimizerType("Minuit"); // for Minuit 1
m.setMinimizerType("Minuit2"); // for Minuit 2
You can find more info about the switch from RooMinuit to RooMinimizer here:
Also note that RooFit::Minimizer("Minuit2") like in your snippet has absolutely no effect. It only makes sense as a command argument to RooAbsPdf::fitTo() to control the Minimizer type used in the fit.