## n_call_minuit: number of calls to Minuit for each trial
## n_iterations_minuit: number of trial iterations if convergence is not achieved
## n_bootstrap: number of bootstraps for each statistic
## plot_figsize: figure size in inches for prefit figures
## plot_fontsize: fontsize for output plots
## plot_cmap: colour map for output plots
##
## This function defines the basic information stored by PeakOTron and the default fit value dictionary that is updated with the input parameters of ## the user.
## tau: slow time-constant of SiPM pulse in nanoseconds
## tau_err: optional error to allow tau to float
## t_0: pre-gate integration window in nanoseconds.
## t_0_err: optional error to allow t_0 to float
## tau_R: recovery time of SiPM in nanoseconds
## tau_R_err: optional error to allow tau_R to float
## t_gate: gate length in nanoseconds
## t_gate_err: optional error to allow t_gate to float
## bw: optional bin width if data is 1D
## truncate_nG: optional parameter to truncate distribution a certain fraction/number of estimated gain units before the estimated pedestal.
## peak_dist_nG: required minimum distance between peaks in gain units to register a peaks. See https://docs.scipy.org/doc/scipy/reference/generated/scipy.signal.find_peaks.html
## peak_rel_height: Chooses the relative height at which the peak width is measured as a percentage of its prominence. 1.0 calculates the width of the peak at its lowest contour line while 0.5 evaluates at half the prominence height. Must be at least 0. See https://docs.scipy.org/doc/scipy/reference/generated/scipy.signal.peak_widths.html#scipy.signal.peak_widths
## bin_method: binning method for unbinned data. "knuth", "freedman" or "scott" rules are available.
## alpha_peaks: the maximum percentile of the distribution a found peak is allowed to have. This determines the threshold on the selected peak positions.
##
## Main fit function of PeakOTron, which performs the prefit and main fit using Minuit.
raiseException ("Please set truncate_nG to a positive float which represents the number of estimated units of gain before the estimated pedestal which will be excluded from the minimisation process.")
if(self._fit_kwargs["truncate_nG"]<0):
raiseException ("Please set truncate_nG to a positive float which represents the number of estimated units of gain before the estimated pedestal which will be excluded from the minimisation process.")
raiseException ("Please set alpha_peaks to a positive float between 0 and 1 which represents the maximum percentile of selected peaks during peak finding.")
raiseException ("Please set peak_dist_nG to a positive float between 0 and 1 which represents the minimum distance as a fraction of one gain unit required between peaks")
raiseException ("Please set peak_dist_nG to a positive float between 0 and 1 which represents the minimum distance as a fraction of one gain unit required between peaks")
raiseException ("Please set peak_rel_height to a positive float between 0 and 1 which represents relative height at which the peak width is measured as a percentage of its prominence")
raiseException ("Please set peak_rel_height to a positive float between 0 and 1 which represents relative height at which the peak width is measured as a percentage of its prominence")
ifself._fit_kwargs["bw"]isnotNone:
if(notisinstance(self._fit_kwargs["bw"],float)):
raiseException ("Please set bw (bin width) to a positive float.")
if(self._fit_kwargs["bw"]<=0):
raiseException ("Please set bw (bin width) to a positive float.")
## tau: slow time-constant of SiPM pulse in nanoseconds
## tau_err: optional error to allow tau to float
## t_0: pre-gate integration window in nanoseconds.
## t_0_err: optional error to allow t_0 to float
## tau_R: recovery time of SiPM in nanoseconds
## tau_R_err: optional error to allow tau_R to float
## t_gate: gate length in nanoseconds
## t_gate_err: optional error to allow t_gate to float
## bw: optional bin width if data is 1D
## truncate_nG: optional parameter to truncate distribution a certain fraction/number of estimated gain units before the estimated pedestal.
## peak_dist_nG: required minimum distance between peaks in gain units to register a peaks. See https://docs.scipy.org/doc/scipy/reference/generated/scipy.signal.find_peaks.html
## peak_rel_height: Chooses the relative height at which the peak width is measured as a percentage of its prominence. 1.0 calculates the width of the peak at its lowest contour line while 0.5 evaluates at half the prominence height. Must be at least 0. See https://docs.scipy.org/doc/scipy/reference/generated/scipy.signal.peak_widths.html#scipy.signal.peak_widths
## bin_method: binning method for unbinned data. "knuth", "freedman" or "scott" rules are available.
## alpha_peaks: the maximum percentile of the distribution a found peak is allowed to have. This determines the threshold on the selected peak positions.