Double_t old_par[]={-1, -1, -1}; Double_t myfunc(Double_t *x, Double_t *par) { // Check if parameter changed for(int i=0; i<3; i++) { if(old_par[i]!=par[i]) cout << "Parameter " << i << " changed from " << old_par[i] << " to " << par[i] << endl; old_par[i]=par[i]; } return par[0]*TMath::Gaus(x[0],par[1],par[2]); } void ExampleFixParam() { cout.precision(11); TH1D * h1 = new TH1D("h1","h1",100,-5,5); h1->FillRandom("gaus"); TVirtualFitter::SetDefaultFitter("Fumili2"); // TF1 * f1 = new TF1("f1","[0]*TMath::Gaus(x,[1],[2])"); TF1 * f1 = new TF1("f1",myfunc, 0, 2, 3); f1->SetParNames("Amplitude","mean","sigma"); f1->SetParameters(100,0,1); f1->FixParameter(2,1); h1->Fit(f1); }