Skip to content

Commit 48ca92b

Browse files
author
Tony Wood
authored
Merge pull request #4 from woodtp/dev
Refactor the config.py...
2 parents 7ec6a6e + a701322 commit 48ca92b

15 files changed

+449
-204
lines changed

README.md

Lines changed: 14 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -33,9 +33,10 @@ Before you begin, make sure you have the following prerequisites installed:
3333
## Usage
3434
```shell
3535
$ flux_tool -h
36-
usage: flux_uncertainties [-h] [-c CONFIG] [-p PRODUCTS_FILE] [-v] [-z]
36+
usage: flux_uncertainties [-h] [-c CONFIG] [-p PRODUCTS_FILE] [-v] [-z] [--example-config]
3737
38-
This package coerces PPFX output into a neutrino flux prediction with uncertainties, and stores various spectra related to the flux, e.g., fractional uncertainties, covariance matrices, etc.
38+
This package coerces PPFX output into a neutrino flux prediction with uncertainties, and stores various spectra related to the
39+
flux, e.g., fractional uncertainties, covariance matrices, etc.
3940
4041
options:
4142
-h, --help show this help message and exit
@@ -46,6 +47,7 @@ options:
4647
-v, --verbose
4748
-z, --enable-compression
4849
Enable compression of the output plots directory
50+
--example-config Print an example configuration file
4951
```
5052

5153
Alternatively, this package can be imported directly into an existing python script:
@@ -59,7 +61,14 @@ import flux_tool
5961
# flux_tool configuration file
6062
6163
output_file_name = "out.root"
62-
sources = "/path/to/directory/containing/input/histograms"
64+
65+
[Inputs]
66+
directory = "/path/to/directory/containing/input/histograms"
67+
fhc.nominal = "input_fhc_nominal.root"
68+
rhc.nominal = "input_rhc_nominal.root"
69+
fhc.horn_current_up = "input_fhc_horn_current_up.root"
70+
fhc.horn_current_down = "input_fhc_horn_current_down.root"
71+
6372
6473
[Binning]
6574
# Histogram bin edges for each neutrino flavor.
@@ -110,6 +119,7 @@ numubar = [
110119
# appearing in the fractional uncertainty directory
111120
# true = included, false = excluded
112121
[PPFX.enabled]
122+
total = true
113123
attenuation = true
114124
mesinc = true
115125
mesinc_parent_K0 = true
@@ -153,7 +163,7 @@ pca_mesinc_overlay = true
153163
pca_top_components = true
154164
pca_variances = true
155165
pca_components = true
156-
hadron_covariance_matrices = true
166+
hadron_covariance_matrices = "total" # Can specify the exact name instead of drawing all of the matrices.
157167
hadron_correlation_matrices = true
158168
beam_uncertainties = true
159169
beam_covariance_matrices = true

example_config.toml

Lines changed: 16 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,23 @@
11
# flux_tool configuration file
22

33
output_file_name = "out.root"
4-
sources = "/path/to/directory/containing/input/histograms"
4+
5+
[Inputs]
6+
directory = "/path/to/directory/containing/input/histograms"
7+
fhc.nominal = "input_fhc_nominal.root"
8+
rhc.nominal = "input_rhc_nominal.root"
9+
fhc.horn_current_up = "input_fhc_horn_current_up.root"
10+
fhc.horn_current_down = "input_fhc_horn_current_down.root"
511

612
[Binning]
713
# Histogram bin edges for each neutrino flavor.
814
# Accepts:
915
# 1. an integer number of bins (between 0 and 20 GeV)
1016
# 2. An array of bin edges (NOTE: they can be variable bin widths, but must be monotonically increasing)
11-
# 3. If unspecified, then fixed bin widths of 100 MeV is applied along the [0, 20] GeV interval.
17+
# 3. An array of arrays where the inner arrays are [start, stop, step] for fixed bin widths.
18+
# 4. If unspecified, then fixed bin widths of 100 MeV is applied along the [0, 20] GeV interval.
1219
nue = 200
20+
1321
nuebar = [
1422
0.0,
1523
0.2,
@@ -27,31 +35,17 @@ nuebar = [
2735
8.0,
2836
12.0,
2937
]
30-
numu = []
31-
numubar = [
32-
0.0,
33-
0.2,
34-
0.4,
35-
0.6,
36-
0.8,
37-
1.0,
38-
1.5,
39-
2.0,
40-
2.5,
41-
3.0,
42-
3.5,
43-
4.0,
44-
6.0,
45-
8.0,
46-
12.0,
47-
20.0
48-
]
38+
39+
numu = [[0.0, 6.0, 0.1], [6.0, 20.0, 0.5]]
40+
41+
numubar = [[0.0, 6.0, 0.1], [6.0, 20.0, 0.5]]
4942

5043
[PPFX]
5144
# enable/disable specific PPFX reweight categories from
5245
# appearing in the fractional uncertainty directory
5346
# true = included, false = excluded
5447
[PPFX.enabled]
48+
total = true
5549
attenuation = true
5650
mesinc = true
5751
mesinc_parent_K0 = true
@@ -96,7 +90,7 @@ pca_mesinc_overlay = true
9690
pca_top_components = true
9791
pca_variances = true
9892
pca_components = true
99-
hadron_covariance_matrices = true
93+
hadron_covariance_matrices = "total"
10094
hadron_correlation_matrices = true
10195
beam_uncertainties = true
10296
beam_covariance_matrices = true

0 commit comments

Comments
 (0)