I am trying to perform MINUIT fits to determine values for two fit parameters, G2 and G4. Due to physical considerations G2 is always greater than G4.
For some situations, MINUIT is able to find a set of values that match the data but for which G4 is greater than G2. As results of this type are non-physical I would like to introduce a constraint to prevent MINUIT from pursuing results with G4>G2.
The way in which I have done this so far is to test the fit result and loop through the fit again with the value of G4 as a lower limit to the fit for G2.
Is there a more elegant to apply the constraint G2 always > G4 in a MINUIT fit?
Minuit does not support constraints between parameters. It is just an unconstrained minimizer. The Support for simple inequality constraints like ( a < par < b) where a and b are numbers and not parameters is provided via a simple variable transformation.
You could try to use a trick like adding a penalty function to penalize the unwanted region. However, this is not guaranteed to work in all problems and it can introduce discontinuities in the derivatives in the border regions.