Skip to content
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

[New Common Data Format] JETS #1785

Closed
wants to merge 341 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
341 commits
Select commit Hold shift + click to select a range
3ceeb19
modified metadata for it to be compatible with reader
comane Aug 1, 2023
99b9442
it is definitions, not definition
comane Aug 1, 2023
293c9ef
added testing module
comane Aug 1, 2023
dd548a9
changed metadata files so as to be readable by parser
comane Aug 1, 2023
69138ba
CMS_1JET_8TEV new implementation is disagreeing with the older implem…
comane Aug 2, 2023
b892812
added minor modifications to commondataparser
comane Aug 3, 2023
0eb60df
added HEPdata tables for alternative scenario
comane Aug 3, 2023
c65407c
how to include both scenarios in the metadata.yaml files without havi…
comane Aug 3, 2023
9b94416
added decorr unc + names of unc
comane Aug 3, 2023
a993cea
this is how variants are included in metadataa.yaml
comane Aug 3, 2023
9fd2266
ATLAS 2 JET
comane Aug 3, 2023
5db76e2
finalized ATLAS_1JET
comane Aug 4, 2023
554fe31
finalized ATLAS 2JET
comane Aug 4, 2023
cbd6612
more or less final version of CMS 1JET
comane Aug 4, 2023
da722ef
more or less final version of CMS 2 JET
comane Aug 4, 2023
9fd5aa5
added reportengine to test new datasets
comane Aug 4, 2023
02161d5
Add Optional typehint
APJansen Aug 7, 2023
b0e8f26
Add np.testing
APJansen Aug 7, 2023
9d9b0c0
Set seed to 1 instead of 0
APJansen Aug 7, 2023
5b49c83
update values test_preprocessing
RoyStegeman Aug 7, 2023
8dc3814
Define MSR and VSR indices as global constants
APJansen Aug 7, 2023
a418e99
Remove build method
APJansen Aug 7, 2023
9685827
Add/improve documentation
APJansen Aug 7, 2023
bc41e61
factor out definitions of normalization to top as global constants
APJansen Aug 8, 2023
eb73f5a
Undo joining of photon integral
APJansen Aug 8, 2023
56b53e8
Merge pull request #1777 from NNPDF/refactor_preprocessing
APJansen Aug 8, 2023
5492542
Merge pull request #1780 from NNPDF/refactor_rotations
APJansen Aug 8, 2023
96b798b
turn lists into tensors
APJansen Aug 9, 2023
b52a6f4
Add module docstring
APJansen Aug 10, 2023
09a99b8
Avoid duplicate names
APJansen Aug 11, 2023
a85d314
formatting
APJansen Aug 11, 2023
62a6f0a
Use eolven3fit_new with the fitbot
scarlehoff Aug 11, 2023
606892c
update arclength regression due to scipy 1.10 -> 1.11
scarlehoff Aug 11, 2023
4034a64
Merge pull request #1791 from NNPDF/fix_tests_230811
scarlehoff Aug 11, 2023
39205db
Merge pull request #1789 from NNPDF/fitbot_evolv3n3fit_new
scarlehoff Aug 11, 2023
f2a38af
Add best_epochs and positivity_statusses to Stopping (and run black)
APJansen Aug 14, 2023
a514bf1
Clean up Writer
APJansen Aug 14, 2023
df0cc8f
Undo assumed changes to model structure
APJansen Aug 14, 2023
0c11088
various fixes
APJansen Aug 14, 2023
5db1c67
Update best_epochs and positivity_statusses
APJansen Aug 14, 2023
1a7de34
Remove now unused iterators over replicas
APJansen Aug 14, 2023
74bc818
Remove now unused positivity_pass and positivity_status from ReplicaS…
APJansen Aug 15, 2023
e04d336
Move all best and stop_epoch to Stopping, remove trainable=False
APJansen Aug 15, 2023
984d4fd
Remove all_positivity_status
APJansen Aug 15, 2023
57b3be1
Completely remove ReplicaState, move remaining functionality to FitHi…
APJansen Aug 15, 2023
85e0061
Uniformize notation
APJansen Aug 15, 2023
6c1229a
Improve documentation
APJansen Aug 15, 2023
2c48869
Move all but the losses from FitHistory to Stopping itself
APJansen Aug 15, 2023
df0dae0
Update documentation
APJansen Aug 15, 2023
635e6a0
Indicate private attributes
APJansen Aug 16, 2023
f541e1b
Precompute preprocessing, arclengths, integrability_numbers
APJansen Aug 16, 2023
4a281f4
Implement exact running for alpha_em in photon module
niclaurenti Aug 16, 2023
88aa313
Use mamba as resolver
APJansen Aug 17, 2023
7cd5ef7
fix formatting
APJansen Aug 17, 2023
fba45f9
fix formatting
APJansen Aug 17, 2023
3a5faed
Add tests
niclaurenti Aug 17, 2023
1d388e6
Interpolate alphaem exa running
niclaurenti Aug 17, 2023
49d81cb
Remove conda resolver entirely
APJansen Aug 17, 2023
fe10087
Add docstring to rge function and move block in __init__
niclaurenti Aug 17, 2023
f944e46
Merge pull request #1793 from NNPDF/mamba-ci
APJansen Aug 18, 2023
d8d677e
Merge branch 'master' into refactor_msr
APJansen Aug 18, 2023
168cca2
don't print msr layer summary if msr not enforced
RoyStegeman Aug 18, 2023
cfcb577
Merge pull request #1781 from NNPDF/refactor_msr
APJansen Aug 18, 2023
de9b6ef
Merge pull request #1795 from NNPDF/fix_msr_summary
RoyStegeman Aug 18, 2023
4237ff4
crash if all replicas are negative after many tries
scarlehoff Aug 11, 2023
1b12a34
apply suggestions
scarlehoff Aug 11, 2023
91ec2ff
Merge pull request #1790 from NNPDF/crash_if_replica_negative
scarlehoff Aug 22, 2023
6dd6055
add --lite option
scarlehoff Aug 25, 2023
01b05d0
remove innecessary stuff from .yaml
scarlehoff Aug 25, 2023
3cd2cd8
Merge pull request #1801 from NNPDF/add_lite_option_to_comparefits
scarlehoff Aug 25, 2023
5335b8f
added .md file for parallel reportengine doc
comane Apr 25, 2023
c07d734
added md file to rst index
comane Apr 25, 2023
bea1085
added some doc
comane Apr 25, 2023
3649112
added vp-comparefits example
comane Aug 31, 2023
9f07416
Add if statement before restoring best weights
APJansen Sep 4, 2023
78a6d30
Add default best_epoch to last_epoch
APJansen Sep 4, 2023
66d32ac
Merge branch 'master' into refactor_stopping
APJansen Sep 4, 2023
bc6da32
Test with less tests
scarlehoff Sep 6, 2023
93f5bb7
Merge pull request #1805 from NNPDF/scarlehoff-patch-1
scarlehoff Sep 6, 2023
e1d8714
Merge branch 'master' into refactor_stopping
APJansen Sep 6, 2023
1016ab2
Update doc/sphinx/source/tutorials/reportengine_parallel.md
comane Sep 8, 2023
71a85f1
Update doc/sphinx/source/tutorials/reportengine_parallel.md
comane Sep 8, 2023
a6e1ddf
Merge pull request #1804 from NNPDF/reportengine_dask_doc
scarlehoff Sep 8, 2023
e76d7d6
Add ability to add filter rules
Zaharid May 16, 2023
f75754b
Include local variables in rule comparison
Zaharid May 16, 2023
54c792e
Handle zero sized datasets
Zaharid May 16, 2023
32f7927
fix test
Zaharid May 16, 2023
2b93679
Write filters doc in rst
Zaharid Jul 12, 2023
6fc1441
Add docs on added cuts
Zaharid Jul 12, 2023
94bbc53
Add pass trough parser
Zaharid Jul 13, 2023
2e5721b
Add test
Zaharid Jul 13, 2023
8aab2da
Apply suggestions from code review
scarlehoff Sep 14, 2023
3742ba4
Merge pull request #1745 from NNPDF/addedrules
scarlehoff Sep 15, 2023
5f9b1bd
sorting of level1 commondata list
comane Jun 22, 2023
df4f7b7
added data_index for correct indexing of closure data
comane Jun 26, 2023
8369c38
closure tests use data_index for filtering of data. When running vp-s…
comane Jun 26, 2023
92de5b7
Update validphys2/src/validphys/results.py
comane Sep 14, 2023
fe8c2fa
Update validphys2/src/validphys/results.py
comane Sep 14, 2023
f553482
Merge pull request #1765 from NNPDF/fix_bug_make_level1_data_rebased
comane Sep 15, 2023
dfd53a9
Use numpy interpolator instead of scipy
niclaurenti Sep 15, 2023
171d8c7
Implement exact running for alpha_em in photon module
niclaurenti Aug 16, 2023
61ffa98
Add tests
niclaurenti Aug 17, 2023
9f76745
Interpolate alphaem exa running
niclaurenti Aug 17, 2023
119a5f8
Add docstring to rge function and move block in __init__
niclaurenti Aug 17, 2023
e87c62e
Use numpy interpolator instead of scipy
niclaurenti Sep 15, 2023
327c285
Merge branch 'exa_couplings' of github.com:NNPDF/nnpdf into exa_coupl…
niclaurenti Sep 15, 2023
8363da9
Fix test_fit
niclaurenti Sep 18, 2023
ea43b4e
Update docstrings
niclaurenti Sep 18, 2023
0bf5054
Run black
niclaurenti Sep 18, 2023
c09dc46
Fix bug and restructure __init__ in Alpha
niclaurenti Sep 18, 2023
7d00748
Change number of interpolation points 100 -> 200
niclaurenti Sep 19, 2023
14cd5b3
Fix test_fit
niclaurenti Sep 19, 2023
5e36769
Switch off betaQCD and beta_mix
niclaurenti Sep 20, 2023
8bbee31
Add threshold points to q interpolation vector
niclaurenti Sep 20, 2023
2a2851d
Merge branch 'exa_couplings2' of github.com:NNPDF/nnpdf into exa_coup…
niclaurenti Sep 21, 2023
5c7e2b3
Use decoupled running in EKO for the tests
niclaurenti Sep 21, 2023
998043f
Restore beta terms put to zero and comment out from rge
niclaurenti Sep 21, 2023
0e62fa3
fix test_compute
niclaurenti Sep 21, 2023
d2ecc69
Test only alpha_em
niclaurenti Sep 21, 2023
33ab571
Remove alphas part
niclaurenti Sep 21, 2023
09d83e9
use get_next_color instead of prop_cycler
scarlehoff Oct 3, 2023
bc08092
fix check for montecarlo/symmhessian
scarlehoff Oct 3, 2023
e4d1f1e
pin matplotlib < 3.8
scarlehoff Oct 3, 2023
1c69689
update example
scarlehoff Oct 3, 2023
f68a74b
update the jupyter example to use the recommended resources and lates…
scarlehoff Oct 4, 2023
6c936f7
Update conda-recipe/meta.yaml
scarlehoff Oct 4, 2023
f8b985f
statusses -> statuses
APJansen Oct 4, 2023
e2f65ec
combine 3 list comprehensions into one loop
APJansen Oct 4, 2023
6b364cf
Clarify comment
APJansen Oct 4, 2023
5c3c2e8
Using PurePath instead of str
APJansen Oct 4, 2023
9918791
Merge branch 'master' into refactor_stopping
APJansen Oct 4, 2023
154a6dd
Update validphys2/src/validphys/checks.py
scarlehoff Oct 4, 2023
d27b70a
Uncomment tests that were accidentally pushed
niclaurenti Oct 5, 2023
d5121f1
Merge pull request #1809 from NNPDF/bugfixes_231003
scarlehoff Oct 5, 2023
0a1446a
Merge pull request #1806 from NNPDF/exa_couplings2
scarlehoff Oct 5, 2023
905218c
improve documentation
APJansen Oct 10, 2023
17ff602
Use path object syntax
APJansen Oct 10, 2023
d82c826
Update n3fit/src/n3fit/stopping.py
APJansen Oct 10, 2023
93afd75
Update n3fit/src/n3fit/io/writer.py
APJansen Oct 10, 2023
5a6f743
Remove fix for tensorflow 2.2 path bug
APJansen Oct 10, 2023
e0b9cc8
Remove best_epoch method
APJansen Oct 10, 2023
2396d44
remove PurePath
scarlehoff Oct 11, 2023
db8b790
Merge pull request #1792 from NNPDF/refactor_stopping
scarlehoff Oct 11, 2023
0e3b1fc
Change private attributes _total_epochs and _stopping_patience back t…
APJansen Oct 18, 2023
e005a42
Merge pull request #1820 from NNPDF/fix-stopping-bug
APJansen Oct 18, 2023
b9af931
add scale variations for theory 600
t7phy Oct 20, 2023
3c51300
theory.db updated with theory 600 SVs
t7phy Oct 23, 2023
94917a4
Merge pull request #1823 from NNPDF/600_sv
t7phy Oct 24, 2023
56f4a71
updated metadatafile
comane Oct 24, 2023
6492ed5
new commondata reader
scarlehoff Feb 23, 2023
7b45689
improve the notebook
scarlehoff Feb 23, 2023
2cec73c
remove duplicated functions
scarlehoff Feb 23, 2023
67fd00d
make theory optional
scarlehoff Feb 23, 2023
b9724e4
remove old style data that was included with this pr
scarlehoff Mar 29, 2023
ab44049
updated reader to the new (new) format
scarlehoff Mar 29, 2023
e067bf9
some parser updates
scarlehoff Mar 30, 2023
3aa963a
update the reader: definition->definitions, add a columns of 0s when …
scarlehoff Mar 31, 2023
99f66a2
reorder in the parser
scarlehoff Mar 31, 2023
4a8fb08
handle nonstr
scarlehoff Mar 31, 2023
9b6db19
applied suggestion for ValidOperation
scarlehoff Mar 31, 2023
489d356
add check for -1 factors when they are just eigenvectors
scarlehoff Apr 3, 2023
d78e575
fill the mid kinematic value with the average of min and max
scarlehoff Apr 28, 2023
9810a6d
update notebook ; allow for hepdata version to be None
scarlehoff Apr 28, 2023
1ece070
update notebook
scarlehoff May 2, 2023
998c4d7
ignore kinematic variables beyond the 3rd one
scarlehoff May 3, 2023
8e3b693
fix tests
scarlehoff May 3, 2023
bb87745
minimal set of modifications so that one can actually use the new cd …
scarlehoff Sep 23, 2023
02001f6
first movements towards the deprecation of the yaml database; take th…
scarlehoff Sep 23, 2023
ad3d73f
add a specific error for datasets without TheoryMetaData
scarlehoff Sep 25, 2023
cb0d7f6
update commondataparser to "fake" PlotOptions
scarlehoff Sep 28, 2023
b27678b
separate plotting options so that they are compatible with the old-co…
scarlehoff Oct 10, 2023
2273e1a
import plotoptions
scarlehoff Oct 10, 2023
996330b
use kinematic coverage to select the kinematics
scarlehoff Oct 10, 2023
770443f
document a bit better each class inside the parser
scarlehoff Oct 11, 2023
b2d89c7
read kinematic_coverage as a list ; add a few checks
scarlehoff Oct 11, 2023
8e88036
add the transitional identity tranformation
scarlehoff Oct 20, 2023
117bcd6
remove todo and add extra info about the self.legacy
scarlehoff Oct 20, 2023
48f8b2c
use the kinematic coverage variables for the filter
scarlehoff Oct 24, 2023
e2a29bf
added dataset folder for new dataset implementation
comane Mar 13, 2023
04f5a33
.
comane Mar 14, 2023
065b12d
added statistical covariance matrix for ATLAS_2JET_7TEV_R06
comane Mar 20, 2023
7e91f1a
added tmp filter module
comane Mar 20, 2023
3ae38b4
filter file generating data.yaml, kin.yaml, and uncertainties.yaml fo…
comane Mar 22, 2023
2f6c86e
/
comane Mar 22, 2023
a1961b5
.
comane Mar 22, 2023
432ef77
added FKtable name
comane Mar 22, 2023
af306f4
added uncertainties yaml files
comane Mar 22, 2023
640577b
split filter_dataset into kinematics / data and uncertainties
comane Mar 23, 2023
021348f
added module to reproduce bugged sys from old CD implementation
comane Mar 23, 2023
9f86131
ignore pandas warnings
comane Mar 23, 2023
8f25e2c
lum unc treated as special unc, correlated with all ATLAS 7 TEV
comane Mar 23, 2023
7ce2e3d
cholesky decomposition of Csys + Cstat matrix is not unique
comane Mar 23, 2023
a6d911a
compute special sys in bugged filter
comane Mar 27, 2023
adf1380
added bugged uncertainties
comane Mar 27, 2023
87c564e
added folder for CMS_2JET_7TEV datasetss
comane Mar 27, 2023
bf3cd0b
read correlation matrix into numpy array
comane Mar 27, 2023
2d89d30
added corr to cov function + computed the Block diagonal stat cov mat
comane Mar 28, 2023
f45b8bb
added module with utils for CMS_2JET_7TEV filter
comane Apr 11, 2023
9bc67c9
import utils from filter_utils
comane Apr 11, 2023
45958e9
modify metadata
comane Apr 11, 2023
e02f5c6
fixed typo
comane Apr 11, 2023
65e6d24
added ATLAS_1JET_8TEV_R06 folder
comane Apr 11, 2023
e4f3a17
added functions to utils
comane Apr 12, 2023
510dde4
added CMS 2Jet uncertainty file
comane Apr 12, 2023
d1ac5d7
added unc file
comane Apr 13, 2023
49ed0f7
added comment to filter func
comane Apr 13, 2023
90c4e79
added comment
comane Apr 13, 2023
018d81c
added CMS_1JET_8TEV metadata file
comane Apr 13, 2023
7cf13ee
data central values
comane Apr 13, 2023
eefc939
added filter functions
comane Apr 13, 2023
1d81c28
removed non needed import
comane Apr 13, 2023
8e61299
added HEPData tables
comane Apr 13, 2023
dbd8ae9
added func to read stat corr dat
comane Apr 13, 2023
850d932
added space for readability by pd.read_csv
comane Apr 17, 2023
21539fe
.
comane Apr 17, 2023
b5a43ce
small modifications to ATLAS_1JET_8TEV_R06
comane Jul 31, 2023
6603b2a
added dataset ATLAS_1JET_8TEV_R06_DEC
comane Jul 31, 2023
6a1b641
black on filter
comane Jul 31, 2023
8ba3d59
modified metadata for it to be compatible with reader
comane Aug 1, 2023
000b0b8
it is definitions, not definition
comane Aug 1, 2023
eeda866
added testing module
comane Aug 1, 2023
356e4af
changed metadata files so as to be readable by parser
comane Aug 1, 2023
f9d66b6
CMS_1JET_8TEV new implementation is disagreeing with the older implem…
comane Aug 2, 2023
2650646
rebased on commondatareader branch
comane Oct 27, 2023
2f4a4cb
added HEPdata tables for alternative scenario
comane Aug 3, 2023
8bf8432
how to include both scenarios in the metadata.yaml files without havi…
comane Aug 3, 2023
2235957
added decorr unc + names of unc
comane Aug 3, 2023
c59dcc0
this is how variants are included in metadataa.yaml
comane Aug 3, 2023
5de718b
ATLAS 2 JET
comane Aug 3, 2023
8ca0f20
finalized ATLAS_1JET
comane Aug 4, 2023
4f9c354
finalized ATLAS 2JET
comane Aug 4, 2023
516f49b
more or less final version of CMS 1JET
comane Aug 4, 2023
8ac8bd3
more or less final version of CMS 2 JET
comane Aug 4, 2023
6d62d08
added reportengine to test new datasets
comane Aug 4, 2023
6de3610
updated metadatafile
comane Oct 24, 2023
d72281c
added dataset name mapping
comane Oct 27, 2023
e4368c9
metadata file as per doc
comane Oct 27, 2023
49eafb2
merged
comane Oct 27, 2023
1140585
.
comane Oct 30, 2023
2dee9f0
removed cut in pt
comane Oct 31, 2023
4414470
added comment to metadata regarding cut in pt
comane Oct 31, 2023
9d29296
minor modifications to metadata
comane Nov 13, 2023
6d26730
minor mod to metadata
comane Nov 13, 2023
213166b
CMS_2JET_7TEV, removed nominal variant + specified as MULT the MULT u…
comane Dec 1, 2023
8fb5a85
ATLAS_2JET_7TEV_R06, added MULT, removed nominal
comane Dec 1, 2023
5f8aa75
corrected ATLAS_2JET bugged uncertainties
comane Dec 6, 2023
7d3c825
added CMS 1JET bugged version + changed kinematis
comane Dec 6, 2023
23369b9
added CMS 1JET bugged version + changed kinematis
comane Dec 6, 2023
e3658d8
MULT and ADD for CMS_1JET_8TEV
comane Dec 7, 2023
eadbe3e
Update buildmaster/dataset_names.yml
comane Dec 7, 2023
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .github/workflows/fitbot.yml
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,7 @@ jobs:
run: |
conda activate nnpdfenv
cd $RUNFOLDER
evolven3fit $RUNCARD $N3FIT_MAXNREP
evolven3fit_new evolve $RUNCARD
# running postfit
- name: Postfit and upload fit
shell: bash -l {0}
Expand Down
2 changes: 2 additions & 0 deletions .github/workflows/tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,8 @@ jobs:
shell: bash -l {0}
run: |
echo "$NETRC_FILE" | base64 --decode > ~/.netrc
conda install -n base conda-libmamba-solver
conda config --set solver libmamba
conda config --append channels conda-forge
conda config --prepend channels https://packages.nnpdf.science/public
conda config --set show_channel_urls true
Expand Down
1,803 changes: 1,803 additions & 0 deletions Playground for the new commondata format.ipynb

Large diffs are not rendered by default.

172 changes: 172 additions & 0 deletions buildmaster/ATLAS_1JET_8TEV_R06/data.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,172 @@
data_central:
- 36994.0
- 15405.6
- 7009.4
- 3319.54
- 1627.69
- 822.52
- 421.667
- 223.264
- 123.88
- 69.53
- 40.254
- 23.062
- 13.626
- 8.337
- 5.1569
- 3.1134
- 1.8922
- 1.1635
- 0.7111
- 0.44279
- 0.27428
- 0.17043
- 0.10614
- 0.06661
- 0.041322
- 0.025443
- 0.015691
- 0.009639
- 0.005995
- 0.003448
- 0.0014775
- 0.0003872
- 5.009e-05
- 1.42e-06
- 35232.5
- 14221.5
- 6519.5
- 3066.07
- 1499.1
- 757.76
- 392.639
- 206.944
- 114.55
- 63.287
- 36.287
- 20.861
- 12.404
- 7.5669
- 4.5112
- 2.7158
- 1.6382
- 0.9953
- 0.6045
- 0.37186
- 0.22762
- 0.13906
- 0.085314
- 0.051916
- 0.031895
- 0.018985
- 0.011346
- 0.006725
- 0.003879
- 0.0020569
- 0.0008497
- 0.0001838
- 6.58e-06
- 30557.3
- 12452.7
- 5745.3
- 2630.59
- 1263.8
- 638.88
- 319.543
- 165.698
- 90.26
- 49.844
- 28.205
- 15.919
- 9.281
- 5.5009
- 3.2102
- 1.8731
- 1.1101
- 0.6558
- 0.38074
- 0.22072
- 0.12796
- 0.07427
- 0.042121
- 0.023943
- 0.013329
- 0.007287
- 0.003872
- 0.0019997
- 0.0010205
- 0.0004429
- 0.0001189
- 5.37e-06
- 24622.2
- 9795.9
- 4208.2
- 1970.38
- 949.4
- 466.875
- 229.994
- 116.89
- 62.17
- 33.357
- 18.199
- 9.772
- 5.426
- 3.0905
- 1.7167
- 0.90963
- 0.5003
- 0.26684
- 0.13761
- 0.07125
- 0.03547
- 0.017315
- 0.0082752
- 0.003744
- 0.0016581
- 0.0006909
- 0.0002583
- 0.00011
- 3.58e-05
- 3.04e-06
- 20104.9
- 7668.9
- 3167.6
- 1414.54
- 653.61
- 311.066
- 145.509
- 69.5
- 34.69
- 16.754
- 8.301
- 4.009
- 1.952
- 0.9391
- 0.4353
- 0.1905
- 0.08173
- 0.032263
- 0.012586
- 0.004426
- 0.001531
- 0.0004622
- 0.0001046
- 1.348e-05
- 13644.5
- 5071.1
- 2024.3
- 824.82
- 353.16
- 143.567
- 57.724
- 22.944
- 9.31
- 3.705
- 1.415
- 0.5147
- 0.1678
- 0.04826
- 0.01333
- 0.002652
- 0.000539
- 4.6e-05
170 changes: 170 additions & 0 deletions buildmaster/ATLAS_1JET_8TEV_R06/filter.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,170 @@
import yaml
import numpy as np
import pandas as pd
from filter_utils import get_data_values, get_kinematics, fill_df

# ignore pandas warning
import warnings

warnings.filterwarnings("ignore")


def filter_ATLAS_1JET_8TEV_data_kinetic():
"""
write kinematics and central data values
in kinematics.yaml and data.yaml files
respectively.
"""

with open("metadata.yaml", "r") as file:
metadata = yaml.safe_load(file)

version = metadata["hepdata"]["version"]
tables = metadata["hepdata"]["tables"]

# get kinematics from hepdata tables
kin = get_kinematics(tables, version)

# get central values from hepdata tables
data_central = get_data_values(tables, version)

data_central_yaml = {"data_central": data_central}
kinematics_yaml = {"bins": kin}

# write central values and kinematics to yaml file
with open("data.yaml", "w") as file:
yaml.dump(data_central_yaml, file, sort_keys=False)

with open("kinematics.yaml", "w") as file:
yaml.dump(kinematics_yaml, file, sort_keys=False)


def filter_ATLAS_1JET_8TEV_uncertainties(variant='nominal'):
"""
Writes the uncertainties to a .yaml file.
Two possible variants are implemented: nominal and decorrelated

There are three types of uncertainties:

1. Statistical Uncertainties: ADD, UNCORR


2. Systematic Uncertainties: ADD, CORR
Constructed following the exp. prescription:

- Construct an Error matrix in which
each part of an asymmetric error is considered
as as separate error (hence dividing by sqrt(2))
see also filter_utils/process_error and
filter_utils/HEP_table_to_df


3. Luminosity Uncertainty: ATLASLUMI12
this uncertainty is correlated with all
the other ATLASLUMI12 datasets
"""

with open("metadata.yaml", "r") as file:
metadata = yaml.safe_load(file)

version = metadata["hepdata"]["version"]
tables = metadata["hepdata"]["tables"]

# get df of uncertainties
dfs = []
for table in tables:
# uncertainties dataframe
df = fill_df(table, version, variant)
dfs.append(df)

df_unc = pd.concat([df for df in dfs], axis=0)

# statistical errors fully uncorrelated
stat_errors = df_unc["stat"].to_numpy()

# luminosity errors
lum_errors = df_unc["syst_lumi"].to_numpy()

A_corr = df_unc.drop(["stat", "syst_lumi"], axis=1).to_numpy() / np.sqrt(2.0)
cov_corr = np.einsum("ij,kj->ik", A_corr, A_corr)

# error definition
error_definition = {
f"{col}": {
"description": f"correlated systematic {col}",
"treatment": "ADD",
"type": "CORR",
}
for col in df_unc.drop(["stat", "syst_lumi"], axis=1).columns
}

error_definition["luminosity_uncertainty"] = {
"description": "luminosity uncertainty",
"treatment": "ADD",
"type": "ATLASLUMI12",
}

error_definition["statistical_uncertainty"] = {
"description": "statistical uncertainty",
"treatment": "ADD",
"type": "UNCORR",
}

# store error in dict
error = []
for n in range(A_corr.shape[0]):
error_value = {}
for col, m in zip(df_unc.drop(["stat", "syst_lumi"], axis=1).columns, range(A_corr.shape[1])):
error_value[f"{col}"] = float(A_corr[n, m])

error_value["luminosity_uncertainty"] = float(lum_errors[n])
error_value["statistical_uncertainty"] = float(stat_errors[n])
error.append(error_value)

uncertainties_yaml = {"definitions": error_definition, "bins": error}

# write uncertainties to file
if variant=='nominal':
with open(f"uncertainties.yaml", "w") as file:
yaml.dump(uncertainties_yaml, file, sort_keys=False)
else:
with open(f"uncertainties_{variant}.yaml", "w") as file:
yaml.dump(uncertainties_yaml, file, sort_keys=False)

# @@@@@@@@@@@ code below for testing only, should be removed at some point @@@@@@@@@@@@#
cov_lum = np.einsum("i,j->ij", lum_errors, lum_errors)
cov_stat = np.diag(stat_errors**2)

covmat = cov_corr + cov_stat + cov_lum

return np.real(covmat)


if __name__ == "__main__":
# write kinematics and central data values
filter_ATLAS_1JET_8TEV_data_kinetic()

# write uncertainties file
filter_ATLAS_1JET_8TEV_uncertainties(variant='nominal')

# write decorrelated uncertainties file
filter_ATLAS_1JET_8TEV_uncertainties(variant='decorrelated')

##

# # code below for testing only. Should be removed at some point
# covmat = filter_ATLAS_1JET_8TEV_uncertainties()

# from validphys.api import API

# setname = "ATLAS_1JET_8TEV_R06"
# dsinps = [
# {"dataset": setname},
# ]
# inp = dict(dataset_inputs=dsinps, theoryid=200, use_cuts="internal")
# cov = API.dataset_inputs_covmat_from_systematics(**inp)

# ones = cov / covmat
# print(ones)
# print(np.max(ones), np.min(ones))
# print(np.allclose(ones, np.ones(cov.shape), rtol=1e-5))
Loading