Suggestion: Improved control of SPE model and shared parameters between runs
Currently the only control of how parameters of the SPE model change between separate runs is to use the multi=True
argument, and then specify n_illuminations
during the fit. This does not allow for more fine-grain control, where different parameters may remain shared in certain circumstances but not others. This became apparent to me in the situation where you might have the combined fit of the following 3 datasets:
- Low gain (and therefore harder to see the individual SPE peaks)
- High gain (therefore easier to extract the shape of the SPE spectrum)
- Pedestal (to better constrain the pedestal peak parameters)
Between the low and high gain datasets, only the gain. But when considering the pedestal dataset, both the gain and average illumination are zero.
To handle these cases nicely, and to make the simultaneous fitting of multiple different datasets more general, the following changes could be implemented:
- Create a new class that is a collection of PDF classes. Move the multi-illumination stuff out of PDF and into this class. The collection of PDF classes has a length equal to the number of datasets to be simultaneously fit.
- Create subclasses of this new class that can handle specific cases (e.g. SiPMGentileMultiIllumination, PMTDoubleGaussianMultiHV, ...). These subclasses become what are specified by name when selecting a PDF description for a CameraFitter.
- PDFParameters become defined outside of a PDF, and passed into the PDF. This enables the explicit indication of which parameters are being shared between models. Also improves declaration of initial, limits and fixed.
The additional advantage of this is it would allow a completely different model for the pedestal dataset, where k p.e. is not iterated over.
Questions:
- NectarCAM: Why is a combined fit with pedestal data required? Can't this be performed separately first, and used as initial (+fixed) values to the fit of the low and high gain data
- NectarCAM: Does a combined fit of low and high gain datasets share the same average illumination?