-
Notifications
You must be signed in to change notification settings - Fork 85
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #237 from RasmusOrsoe/pisa_weight_fitter
Pisa weight fitter
- Loading branch information
Showing
3 changed files
with
305 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
from graphnet.pisa.fitting import WeightFitter | ||
|
||
outdir = "/mnt/scratch/rasmus_orsoe/weight_test" | ||
database_path = "/mnt/scratch/rasmus_orsoe/databases/dev_lvl3_genie_burnsample_v5/data/dev_lvl3_genie_burnsample_v5.db" | ||
fitter = WeightFitter(database_path=database_path) | ||
|
||
pisa_config_dict = { | ||
"reco_energy": {"num_bins": 8}, | ||
"reco_coszen": {"num_bins": 8}, | ||
"pid": {"bin_edges": [0, 0.5, 1]}, | ||
"true_energy": {"num_bins": 200}, | ||
"true_coszen": {"num_bins": 200}, | ||
"livetime": 10 | ||
* 0.01, # set to 1% of 10 years - correspond to the size of the oscNext burn sample | ||
} | ||
# by calling fitter.fit_weights we get the weights returned pr. event. if add_to_database = True, a table will be added to the database | ||
weights = fitter.fit_weights( | ||
outdir, | ||
add_to_database=True, | ||
weight_name="weight_livetime10_1percent", | ||
pisa_config_dict=pisa_config_dict, | ||
) | ||
|
||
print(weights) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
101 changes: 101 additions & 0 deletions
101
src/graphnet/pisa/resources/configuration_templates/pipeline_config_weight_template.cfg
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,101 @@ | ||
#include settings/osc/nufitv20.cfg as osc | ||
#include settings/osc/earth.cfg as earth | ||
[pipeline] | ||
order = data.sqlite_loader, flux.honda_ip, flux.barr_simple, osc.prob3, aeff.aeff | ||
param_selections = nh | ||
name = neutrinos | ||
output_binning = graphnet_dynamic_binning | ||
output_key = weights, errors | ||
|
||
[data.sqlite_loader] | ||
calc_mode = events | ||
apply_mode = events | ||
output_names = nue_cc, numu_cc, nutau_cc, nue_nc, numu_nc, nutau_nc, nuebar_cc, numubar_cc, nutaubar_cc, nuebar_nc, numubar_nc, nutaubar_nc | ||
post_fix = _pred | ||
database = /mnt/scratch/rasmus_orsoe/databases/oscillations/dev_lvl7_robustness_muon_neutrino_0000/pipelines/pipeline_oscillation_final/pipeline_oscillation_final.db | ||
|
||
[flux.honda_ip] | ||
calc_mode = true_allsky_fine | ||
apply_mode = events | ||
param.flux_table = flux/honda-2015-spl-solmin-aa.d | ||
|
||
[flux.barr_simple] | ||
calc_mode = true_allsky_fine | ||
apply_mode = events | ||
param.nu_nubar_ratio = 1.0 +/- 0.1 | ||
param.nu_nubar_ratio.fixed = True | ||
param.nu_nubar_ratio.range = nominal + [-3., +3.] * sigma | ||
param.nue_numu_ratio = 1.0 +/- 0.05 | ||
param.nue_numu_ratio.fixed = False | ||
param.nue_numu_ratio.range = nominal + [-0.5, +0.5] | ||
param.Barr_uphor_ratio = 0.0 +/- 1.0 | ||
param.Barr_uphor_ratio.fixed = False | ||
param.Barr_uphor_ratio.range = nominal + [-3.0, +3.0] | ||
param.Barr_nu_nubar_ratio = 0.0 +/- 1.0 | ||
param.Barr_nu_nubar_ratio.fixed = False | ||
param.Barr_nu_nubar_ratio.range = nominal + [-3.0, +3.0] | ||
param.delta_index = 0.0 +/- 0.1 | ||
param.delta_index.fixed = False | ||
param.delta_index.range = nominal + [-5, +5] * sigma | ||
|
||
[osc.prob3] | ||
calc_mode = true_allsky_fine | ||
apply_mode = events | ||
param.earth_model = osc/PREM_12layer.dat | ||
param.YeI = ${earth:YeI} | ||
param.YeM = ${earth:YeM} | ||
param.YeO = ${earth:YeO} | ||
param.detector_depth = ${earth:detector_depth} | ||
param.prop_height = ${earth:prop_height} | ||
param.theta12 = ${osc:theta12} | ||
param.theta12.fixed = True | ||
param.nh.theta13 = ${osc:theta13_nh} | ||
param.nh.theta13.fixed = False | ||
param.nh.theta13.range = ${osc:theta13_nh.range} | ||
param.ih.theta13 = ${osc:theta13_ih} | ||
param.ih.theta13.fixed = False | ||
param.ih.theta13.range = ${osc:theta13_ih.range} | ||
param.nh.theta23 = ${osc:theta23_nh} | ||
param.nh.theta23.fixed = False | ||
param.nh.theta23.range = ${osc:theta23_nh.range} | ||
param.nh.theta23.prior = uniform | ||
param.ih.theta23 = ${osc:theta23_ih} | ||
param.ih.theta23.fixed = False | ||
param.ih.theta23.range = ${osc:theta23_ih.range} | ||
param.ih.theta23.prior = uniform | ||
param.nh.deltacp = 0.0 * units.degree | ||
param.nh.deltacp.fixed = True | ||
param.nh.deltacp.range = ${osc:deltacp_nh.range} | ||
param.nh.deltacp.prior = uniform | ||
param.ih.deltacp = 0.0 * units.degree | ||
param.ih.deltacp.fixed = True | ||
param.deltam21 = ${osc:deltam21} | ||
param.deltam21.fixed = True | ||
param.nh.deltam31 = ${osc:deltam31_nh} | ||
param.nh.deltam31.fixed = False | ||
param.nh.deltam31.prior = uniform | ||
param.nh.deltam31.range = [0.001, +0.007] * units.eV**2 | ||
param.ih.deltam31 = ${osc:deltam31_ih} | ||
param.ih.deltam31.fixed = False | ||
param.ih.deltam31.prior = uniform | ||
param.ih.deltam31.range = [-0.007, -0.001] * units.eV**2 | ||
|
||
[aeff.aeff] | ||
calc_mode = events | ||
apply_mode = events | ||
param.livetime = 10 * units.common_year | ||
param.aeff_scale = 1.0 | ||
param.aeff_scale.fixed = False | ||
param.aeff_scale.prior = uniform | ||
param.aeff_scale.range = [0.,3.] * units.dimensionless | ||
param.nutau_cc_norm = 1.0 | ||
param.nutau_cc_norm.fixed = True | ||
param.nutau_cc_norm.range = [0.2, 2.0] * units.dimensionless | ||
param.nutau_cc_norm.prior = uniform | ||
param.nutau_norm = 1.0 | ||
param.nutau_norm.fixed = False | ||
param.nutau_norm.range = [-1.0, 8.5] * units.dimensionless | ||
param.nutau_norm.prior = uniform | ||
param.nu_nc_norm = 1.0 +/- 0.2 | ||
param.nu_nc_norm.fixed = False | ||
param.nu_nc_norm.range = nominal + [-.5,+.5] |