Add protection against failed Gaussian fits to the scurveMean distribution and restrict the fit range automatically.
Description
The scurve mean and the error on the scurve mean are determined by a Gaussian fit to a histogram (actually a TGraph) of the scurveMean. The Gaussian fit can fail in a way that produces a reasonable scurveMean but an scurveMeanError that is unreasonably small. This can cause the scurveMean vs THR_DAC fit to fail. So, this pull request removes points in which the scurveMeanError is less than 0.1% of the scurveMean error.
The new fit range restriction will not affect the fit, but will affect how the fitted function is plotted. The fit range is determined on a per vfat basis based on which points are included in the fit.
Types of changes
[ ] Bug fix (non-breaking change which fixes an issue)
[x] New feature (non-breaking change which adds functionality)
[ ] Breaking change (fix or feature that would cause existing functionality to change)
Yes. As stated in the issue, among the 33 list of scandates files that I tested, there are 7 points that are removed by this algorithm. The scurveMean distributions shown there all indicate that it is reasonable to remove them. And the problematic scurveMean vs thrDac fit is improved in the case that motivated the issue (notice VFAT18):
Before:
With the new point removal algorithm:
With the new point removal algorithm and the new restriction on the fit range:
Checklist:
[x] My code follows the code style of this project.
[ ] My change requires a change to the documentation.
Add protection against failed Gaussian fits to the scurveMean distribution and restrict the fit range automatically.
Description
The scurve mean and the error on the scurve mean are determined by a Gaussian fit to a histogram (actually a TGraph) of the scurveMean. The Gaussian fit can fail in a way that produces a reasonable scurveMean but an scurveMeanError that is unreasonably small. This can cause the scurveMean vs THR_DAC fit to fail. So, this pull request removes points in which the scurveMeanError is less than 0.1% of the scurveMean error.
The new fit range restriction will not affect the fit, but will affect how the fitted function is plotted. The fit range is determined on a per vfat basis based on which points are included in the fit.
Types of changes
Motivation and Context
This address https://github.com/cms-gem-daq-project/gem-plotting-tools/issues/208 including the comment https://github.com/cms-gem-daq-project/gem-plotting-tools/issues/208#issuecomment-495305202.
How Has This Been Tested?
Yes. As stated in the issue, among the 33 list of scandates files that I tested, there are 7 points that are removed by this algorithm. The scurveMean distributions shown there all indicate that it is reasonable to remove them. And the problematic scurveMean vs thrDac fit is improved in the case that motivated the issue (notice VFAT18):
Before:
With the new point removal algorithm:
With the new point removal algorithm and the new restriction on the fit range:
Checklist: