-
Notifications
You must be signed in to change notification settings - Fork 1
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Simplify TemplateSource, CombinedSource and SpectrumTemplateSource #69
Merged
Merged
Changes from 15 commits
Commits
Show all changes
25 commits
Select commit
Hold shift + click to select a range
ec0bc27
Simplify TemplateSource
dachengx cd0a594
Update settings of utils, add SR2 to demo CombinedSource
dachengx 1f9251b
Minor change
dachengx 789e3f2
Set numpy version to less than 1.23.0
dachengx e1aac2a
Update docstring to Google style
dachengx ef53ff8
Check needed weighted parameters of CombinedSource
dachengx 459c93b
Update docstring
dachengx e1cf100
Merge remote-tracking branch 'origin/main' into simplify_source
dachengx 698e0ba
No need to use multiple inheritance
dachengx c7252e8
Merge branch 'main' into simplify_source
dachengx 462fb5b
Raise error when there is no key in the json file
dachengx 20b53de
Merge remote-tracking branch 'origin/main' into simplify_source
dachengx de2044d
Recover logging, update docstring
dachengx 07fb1c0
Kill cache of coverage
dachengx 6fd9c19
Test SpectrumTemplateSource
dachengx 1356abb
Demo future callable uncertainty
dachengx 52c2681
Use latest numpy
dachengx bf29d49
Rename histogram_multiplier to histogram_scale_factor
dachengx c2b0cf3
Merge remote-tracking branch 'origin/main' into simplify_source
dachengx b3955f3
Test template source separately in another test module
dachengx b063d6e
Remove double quotes if not necessary
dachengx 4f5508a
Forget to upload this file
dachengx 68d2a2a
tiny typo
kdund 72b4e17
tiny docstring change
kdund acbd7db
Fix little typo
dachengx File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
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,10 @@ | ||
{ | ||
"coordinate_system": [ | ||
0.0, | ||
100.0 | ||
], | ||
"map": [ | ||
1.0, | ||
1.0 | ||
] | ||
} |
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
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
135 changes: 135 additions & 0 deletions
135
alea/examples/configs/unbinned_wimp_statistical_model_template_source_test.yaml
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,135 @@ | ||
parameter_definition: | ||
wimp_mass: | ||
nominal_value: 50 | ||
fittable: false | ||
description: WIMP mass in GeV/c^2 | ||
|
||
livetime_sr2: | ||
nominal_value: 0.5 | ||
fittable: false | ||
description: Livetime of SR2 in years | ||
|
||
livetime_sr3: | ||
nominal_value: 1.0 | ||
fittable: false | ||
description: Livetime of SR3 in years | ||
|
||
wimp_rate_multiplier: | ||
nominal_value: 1.0 | ||
ptype: rate | ||
fittable: true | ||
fit_limits: | ||
- 0 | ||
- null | ||
parameter_interval_bounds: | ||
- 0 | ||
- null | ||
|
||
er_rate_multiplier: | ||
nominal_value: 1.0 | ||
ptype: rate | ||
uncertainty: 0.2 | ||
relative_uncertainty: true | ||
fittable: true | ||
fit_limits: | ||
- 0 | ||
- null | ||
fit_guess: 1.0 | ||
|
||
signal_efficiency: | ||
nominal_value: 1.0 | ||
ptype: efficiency | ||
uncertainty: 0.1 | ||
relative_uncertainty: true | ||
fittable: true | ||
fit_limits: | ||
- 0 | ||
- 10. | ||
fit_guess: 1.0 | ||
description: Parameter to account for the uncertain signal expectation given a certain cross-section | ||
|
||
er_band_shift: | ||
nominal_value: 0 | ||
ptype: shape | ||
uncertainty: null # stats.uniform(loc=0, scale=2) | ||
# relative_uncertainty: false | ||
fittable: true | ||
blueice_anchors: | ||
- -2 | ||
- -1 | ||
- 0 | ||
- 1 | ||
- 2 | ||
fit_limits: | ||
- -2 | ||
- 2 | ||
description: ER band shape parameter (shifts the ER band up and down) | ||
|
||
likelihood_config: | ||
template_folder: null # will try to find the templates in alea | ||
likelihood_terms: | ||
# SR2 | ||
- name: sr2 | ||
default_source_class: alea.template_source.TemplateSource | ||
likelihood_type: blueice.likelihood.UnbinnedLogLikelihood | ||
analysis_space: | ||
- cs1: np.linspace(0, 100, 51) | ||
- cs2: np.geomspace(100, 100000, 51) | ||
in_events_per_bin: true | ||
livetime_parameter: livetime_sr2 | ||
slice_args: {} | ||
sources: | ||
- name: er | ||
class: alea.template_source.CombinedSource | ||
parameters: | ||
- er_rate_multiplier | ||
- er_band_shift | ||
named_parameters: | ||
- er_band_shift | ||
fixed_weight: 0.2 | ||
weight_names: [fixed_weight, er_band_shift] # not meaningful, just an example | ||
histnames: [er_template, er_template, er_template] | ||
template_filenames: [er_template_0.h5, er_template_1.h5, er_template_-1.h5] | ||
histogram_scale_factor: 100 # absolute rate, /year | ||
|
||
- name: wimp | ||
histname: wimp_template | ||
parameters: | ||
- wimp_rate_multiplier | ||
- wimp_mass | ||
- signal_efficiency | ||
template_filename: wimp50gev_template.h5 | ||
apply_efficiency: True | ||
efficiency_name: signal_efficiency | ||
|
||
# SR3 | ||
- name: sr3 | ||
default_source_class: alea.template_source.TemplateSource | ||
likelihood_type: blueice.likelihood.UnbinnedLogLikelihood | ||
analysis_space: | ||
- cs1: np.linspace(0, 100, 51) | ||
- cs2: np.geomspace(100, 100000, 51) | ||
in_events_per_bin: true | ||
livetime_parameter: livetime_sr3 | ||
slice_args: {} | ||
sources: | ||
- name: er | ||
histname: er_template | ||
parameters: | ||
- er_rate_multiplier | ||
- er_band_shift | ||
named_parameters: | ||
- er_band_shift | ||
template_filename: er_template_{er_band_shift}.h5 | ||
|
||
- name: wimp | ||
class: alea.template_source.SpectrumTemplateSource | ||
histname: wimp_template | ||
parameters: | ||
- wimp_rate_multiplier | ||
- wimp_mass | ||
- signal_efficiency | ||
template_filename: wimp50gev_template.h5 | ||
spectrum_name: test_cs1_spectrum.json | ||
apply_efficiency: True | ||
efficiency_name: signal_efficiency |
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
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
acknowledgements :)