Skip to content

Commit

Permalink
icepeak update combined: Poisson loss, improved initial values, contr…
Browse files Browse the repository at this point in the history
…ol param
  • Loading branch information
mieskolainen committed Nov 2, 2024
1 parent 718b5af commit ba83501
Show file tree
Hide file tree
Showing 5 changed files with 302 additions and 262 deletions.
53 changes: 39 additions & 14 deletions configs/peakfit/tune0.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,15 +7,13 @@
# Tips: One can simplify the model by settings some parameters to
# their "symmetric" (e.g. 0) values and fixing those.
#
# [email protected], 2023
# [email protected], 2024

input_path: './actions-stash/input/icefit/dqcd_2018_test/flat/muon/generalTracks/JPsi'
output_name: 'tune0'

years: [2018] #[2016, 2017, 2018]

fitrange: [2.91, 3.29] # Nominal fit window (GeV)

systematics: ['Nominal'] # ['Nominal', 'nVertices_Up', 'nVertices_Down']

# List of systematic variations active
Expand All @@ -38,15 +36,30 @@ fit:
pdf_pair: ['CB_pdf', 'asym_RBW_pdf'] # name of pdfs to be convoluted
par_index: [[0,1,2,3], [0,4,5]] # parameter indices per pdf (use same index for shared parameters)

# Function weight (fit contribution) parameter
# -----------------------------------------------
# See /docs/pdf/peakfit.pdf

# `single`, `dual` and `dual-unitary-I` [signal weight]
theta_start: 100.0
theta_limit: [1.0e-4, 1.0e+5]
theta_limit: [1.0e-4, 1.0e+9]
theta_fixed: False

# `dual`, `dual-unitary-I` and `dual-unitary-II` [efficiency]
eps_start: 0.5
eps_limit: [0.0, 1.0]
eps_fixed: False

# `dual-unitary-II` [signal fraction]
f_start: 0.5
f_limit: [0.0, 1.0]
f_fixed: False
# -----------------------------------------------

# Gamma(J/psi) = 9.32e-05 GeV (very narrow!)
# CB_param = par[0],par[1],par[2],par[3] ~ Crystal-Ball detector smearing x radiative
# asym_RBW = par[0],par[4],par[5] ~ J/Psi resonance ~ [initial state pdf x form factor x breit-wigner]

# Fit function
p_name: ['M0', 'sigma', 'n', 'alpha', 'Gamma', 'asym']
p_start: [3.097, 0.02, 1.001, 5.0, 1.0e-4, -0.01]
p_limit: [[3.085, 3.12], [0.01, 0.05], [1.001, 2.0], [0.001, 10.0], [9.32e-5, 0.01], [-3.0, 3.0]]
Expand All @@ -57,11 +70,21 @@ fit:
args:
norm: True

# Function weight (fit contribution) parameter
# -----------------------------------------------
# See /docs/pdf/peakfit.pdf

# `single` and `dual` [background weight]
theta_start: 0.1
theta_limit: [1.0e-4, 1.0e+5]
theta_limit: [1.0e-4, 1.0e+9]
theta_fixed: False

# `dual`, `dual-unitary-I` and `dual-unitary-II` [efficiency]
eps_start: 0.5
eps_limit: [0.0, 1.0]
eps_fixed: False
# -----------------------------------------------

# Fit function
p_name: ['lambda']
p_start: [1.0e-4]
p_limit: [[1.0e-5, 4.0]]
Expand All @@ -82,26 +105,28 @@ techno:

huber_delta: 1.0 # 'huber' loss threshold parameter

# Use enough calls / iterations (otherwise can get stuck in bad local minima)
# Use enough 'trials' (otherwise can get stuck in bad local minima)

ncall_scipy_simplex: 0 # Number of scipy search calls
ncall_mystic_diffev2: 1 # Number of Mystic solver calls
ncall_mystic_fmin_powell: 1 # Number of Mystic solver calls
ncall_scipy_simplex: 0 # Number of scipy search calls (recursively)
ncall_mystic_diffev2: 1 # Number of Mystic solver calls (recursively)
ncall_mystic_fmin_powell: 1 # Number of Mystic solver calls (recursively)

ncall_minuit_scan: 0 # Number of brute force 1D-scan calls
ncall_minuit_simplex: 0 # Number of Nelder-Mead simplex search calls
ncall_minuit_gradient: 10000 # Number of Minuit gradient search calls

minos: True # If True, Minuit MINOS uncertainties (slower but best), otherwise HESSE
minos: True # If True, Minuit MINOS uncertainties (slower but best), otherwise HESSE
migrad_first_step: 0.001 # First step size (relative percentage), set None for migrad heuristic

min_ndof: 1 # Minimum number of d.o.f required
max_chi2: 1200 # Maximum chi2/ndf for a succesful fit
min_count: 5 # Minimum number of total entries (sum of bin content) in the histogram
max_trials: 3 # Number of restarts
trials: 10 # Number of random restarts (all are executed and inspected, the best is kept)
rand_sigma: 0.5 # Random perturbation scale for initial values per trial

set_to_nan: True # Set parameters after the fit to NaN if not passing max_chi2 or min_count

strategy: 1 # Default 1
strategy: 2 # Default 1 (0 ~ fast, 1 ~ balanced, 2 ~ accurate)
tol: 0.1 # Default 0.1, https://iminuit.readthedocs.io/en/stable/reference.html#iminuit.Minuit.tol

cov_eps: 0.0 # Covariance matrix post-regularization (added to diagonal) (set to 0 for none, can bias!)
75 changes: 50 additions & 25 deletions configs/peakfit/tune2.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,15 +7,13 @@
# Tips: One can simplify the model by settings some parameters to
# their "symmetric" (e.g. 0) values and fixing those.
#
# [email protected], 2023
# [email protected], 2024

input_path: './actions-stash/input/icefit/dqcd_2018_test/flat/muon/generalTracks/JPsi'
output_name: 'tune2'

years: [2018] #[2016, 2017, 2018]

fitrange: [2.91, 3.29] # Nominal fit window (GeV)

systematics: ['Nominal'] # ['Nominal', 'nVertices_Up', 'nVertices_Down']

# List of systematic variations active
Expand All @@ -33,11 +31,26 @@ fit:
args:
norm: True

# Function weight (fit contribution) parameter
# -----------------------------------------------
# See /docs/pdf/peakfit.pdf

# `single`, `dual` and `dual-unitary-I` [signal weight]
theta_start: 100.0
theta_limit: [1.0e-4, 1.0e+5]
theta_limit: [1.0e-4, 1.0e+9]
theta_fixed: False

# `dual`, `dual-unitary-I` and `dual-unitary-II` [efficiency]
eps_start: 0.5
eps_limit: [0.0, 1.0]
eps_fixed: False

# `dual-unitary-II` [signal fraction]
f_start: 0.5
f_limit: [0.0, 1.0]
f_fixed: False
# -----------------------------------------------

# Fit function
p_name: ['M0', 'sigma', 'n_low', 'alpha_low', 'n_high', 'alpha_high']
p_start: [3.097, 0.03, 1.5, 1.1, 1.5, 1.1]
p_limit: [[3.085, 3.12], [0.015, 0.05], [1.001, 20.0], [0.001, 2.0], [1.001, 20.0], [0.001, 2.0]]
Expand All @@ -48,11 +61,21 @@ fit:
args:
norm: True

# Function weight (fit contribution) parameter
# -----------------------------------------------
# See /docs/pdf/peakfit.pdf

# `single` and `dual` [background weight]
theta_start: 0.1
theta_limit: [1.0e-4, 1.0e+5]
theta_limit: [1.0e-4, 1.0e+9]
theta_fixed: False

# `dual`, `dual-unitary-I` and `dual-unitary-II` [efficiency]
eps_start: 0.5
eps_limit: [0.0, 1.0]
eps_fixed: False
# -----------------------------------------------

# Fit function
p_name: ['lambda']
p_start: [1.0e-4]
p_limit: [[1.0e-5, 4.0]]
Expand All @@ -73,26 +96,28 @@ techno:

huber_delta: 1.0 # 'huber' loss threshold parameter

# Use enough calls / iterations (otherwise can get stuck in bad local minima)
# Use enough 'trials' (otherwise can get stuck in bad local minima)

ncall_scipy_simplex: 0 # Number of scipy search calls
ncall_mystic_diffev2: 1 # Number of Mystic solver calls
ncall_mystic_fmin_powell: 1 # Number of Mystic solver calls
ncall_scipy_simplex: 0 # Number of scipy search calls (recursively)
ncall_mystic_diffev2: 1 # Number of Mystic solver calls (recursively)
ncall_mystic_fmin_powell: 1 # Number of Mystic solver calls (recursively)

ncall_minuit_scan: 0 # Number of brute force 1D-scan calls
ncall_minuit_simplex: 0 # Number of Nelder-Mead simplex search calls
ncall_minuit_scan: 0 # Number of brute force 1D-scan calls (0 or 1)
ncall_minuit_simplex: 0 # Number of Nelder-Mead simplex search calls (0 or 1)
ncall_minuit_gradient: 10000 # Number of Minuit gradient search calls

minos: True # If True, Minuit MINOS uncertainties (slower but best), otherwise HESSE

min_ndof: 1 # Minimum number of d.o.f required
max_chi2: 1200 # Maximum chi2/ndf for a succesful fit
min_count: 5 # Minimum number of total entries (sum of bin content) in the histogram
max_trials: 3 # Number of restarts

set_to_nan: True # Set parameters after the fit to NaN if not passing max_chi2 or min_count

strategy: 1 # Default 1
tol: 0.1 # Default 0.1, https://iminuit.readthedocs.io/en/stable/reference.html#iminuit.Minuit.tol
minos: True # If True, Minuit MINOS uncertainties (slower but best), otherwise HESSE
migrad_first_step: 0.001 # First step size (relative percentage), set None for migrad heuristic

min_ndof: 1 # Minimum number of d.o.f required
max_chi2: 1200 # Maximum chi2/ndf for a succesful fit
min_count: 5 # Minimum number of total entries (sum of bin content) in the histogram
trials: 10 # Number of random restarts (all are executed and inspected, the best is kept)
rand_sigma: 0.5 # Random perturbation scale for initial values per trial

set_to_nan: True # Set parameters after the fit to NaN if not passing max_chi2 or min_count

cov_eps: 0.0 # Covariance matrix post-regularization (added to diagonal) (set to 0 for none, can bias!)
strategy: 2 # Default 1 (0 ~ fast, 1 ~ balanced, 2 ~ accurate)
tol: 0.1 # Default 0.1, https://iminuit.readthedocs.io/en/stable/reference.html#iminuit.Minuit.tol

cov_eps: 0.0 # Covariance matrix post-regularization (added to diagonal) (set to 0 for none, can bias!)
Loading

0 comments on commit ba83501

Please sign in to comment.