The final value of RooRealVar is always equal to the initial value

I find the reason:
The fit variable of some events are nan, which lead to errors. After removing such events, everything get fine.
Similar situation: Extended fit with RooHistPdf results in ‘function value is NAN’ - Newbie - ROOT Forum (cern.ch)