Conversation
…on amplitude name
mashephe
left a comment
There was a problem hiding this comment.
It seems that setProductionParameter is not consistent with the design/intent of the FitResults class, which represents the result of a fit. Once you call setProductionParameter then the class is no longer in a state defined by the end of a fit. For example, the likelihood is not updated or the covariance matrix is no longer consistent with the parameter values.
What specific use case are you trying to address with setProductionParameter? I wonder if there is a better way to accomplish this in the framework.
|
If the goal is to modify production parameters in the plotting framework, then introducing a member function to the base class PlotGenerator might be the best option. You can see there that in the constructor it copies the production parameters from the fit results object to local member data. It also has a same length vector of zeroes and finally another vector that will hold either zero or the production parameter of fit results depending on whether the amplitude is toggled on or off. The pointer to this latter is the used by the IntensityManager in computing the intensities for weighting. (I know it is weird/non-conventional to have a class hold a pointer to data that is outside this class, but this is necessary/efficiency if you want many classes to "see" common parameters updated by MINUIT.) In any case, when plotting the plot generator holds the bank of production parameters. You could modify them with a member function. I'd recommend your member function modify: m_fitProdAmps and you'll probably need to look up the index in the map m_ampIndex. By modifying this, the change will be persistent if the user subsequently toggles off and and on the amplitude. |
… with different maximal fractions based on amplitude name.
This is useful when one expects some set of amplitudes to dominate, while others are expected to be small.
Also added a function that allows setting (i.e. changing) production parameters for FitResults, which can be used to plot mathematically ambiguous results to any given FitResult (given the relation is known).