You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: RelVal/README.md
+40-38Lines changed: 40 additions & 38 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -12,11 +12,11 @@ There are 2 ROOT macros which can in principle be used as-is. Their functionalit
12
12
13
13
This macro allows to compare 2 ROOT files that contain `TH1` objects. Objects are considered to correspond to each other if they have the same name.
14
14
At the moment, 3 different comparisons are implemented:
15
-
1.relative difference of bin contents,
16
-
1.Chi2 test,
17
-
1.simple comparison of number of entries
15
+
1.`chi2`: Chi2 test of compared histograms,
16
+
1.`bin_cont`: relative difference of normalised bin content of both histograms,
17
+
1.`num_entries`: relative difference in the number of entries.
18
18
19
-
The first 2 tests are considered critical, hence if the threshold is exceeded, the comparison result is named `BAD`.
19
+
The first 2 tests are considered critical, hence if the threshold is exceeded, the comparison result is named `BAD`. Also the third test is considered critical in case efficiencies are compared coming from `TEfficiency` objects.
20
20
21
21
There are 5 different test severities per test:
22
22
1.`GOOD` if the threshold was not exceeded,
@@ -49,52 +49,40 @@ The wrapper includes 3 different sub-commands for now
49
49
1.`compare` to compare the results of 2 RelVal runs,
50
50
1.`influx` to convert the summary into a format that can be understood by and sent to an InfluxDB instance.
51
51
52
+
Each sub-command can be run with `--help` to see all options/flags.
This performs all of the above mentioned tests. If only certain tests should be performed, this can be achieved with the flags `--with-test-<which-test>` where `<which-test>` is one of
59
61
1.`chi2`,
60
-
1.`bincont`,
61
-
1.`numentries`.
62
+
1.`bin-cont`,
63
+
1.`num-entries`.
62
64
63
65
By default, all of them are switched on.
64
66
65
-
If `--include-dirs` is specified, only objects under those directories are taken into account. Note that this is not a patter matching but it needs to start with the top directory. Thus, if for instance `--include-dirs /path/to/interesting`, everything below that path will be considered. However, something placed in `/another/path/to/interesting` will not be considered.
66
-
Note that `o2::quality_control::core::MonitorObjectCollection` is treated as a directory in this respect.
67
-
68
-
### Apply to entire simulation outcome
69
-
70
-
In addition to simply comparing 2 ROOT files, the script offers the possibility of comparing 2 corresponding directories that contain simulation artifacts (and potentially QC and analysis results). It is not foreseen to run over everything inside those directories but the files must be specifiec via a small config file. See [this example](config/rel_val_sim_dirs_default.json). It is passed via the option `--dirs-config`. In addition, top-level keys can be enabled(disabled) with `--dirs-config-enable <keys>`(`dirs-config-disable <keys>`) where disabling takes precedence.
71
-
72
-
**NOTE** That each single one of the comparisons is only done if mutual files were found in the 2 corresponding directories. As an example, one could do
This would run the RelVal von everything specified under the top key `QC`.
67
+
If `--include-dirs` is specified, only objects under those directories inside the given ROOT files are taken into account. Note that this is not a pattern matching but it needs to start with the top directory. Thus, if for instance `--include-dirs /path/to/interesting`, everything below that path will be considered. However, something placed in `/another/path/to/interesting` will not be considered.
68
+
**Note** that `o2::quality_control::core::MonitorObjectCollection` is treated as a directory in this respect.
If only a path is provided, a summary will be printed on the screen showing the number of `GOOD`, `CRIT_NC` and `BAD`.
90
77
Adding patterns for `--include-patterns` only objects matching at least one of the patterns will be taken into account for the summary.
91
-
If `--plot` is provided, another summary grid will be written into the same directory passed to the `inspect` command and it will be called `SummaryTestUser.png`. If `--flags` are given, only the objects where at least one test has one of the flags will be included in the grid.
78
+
If `--plot` is provided, new summary plots (grid, pie charts, values compared to thresholds) will be produced. By default they are written to `<input-directory>/user_summary` or, if the `-o` option is provided, to the custom output directory.
79
+
If `--flags` are given, only the objects where at least one test has one of the flags will be included in the grid.
92
80
93
81
### Make ready for InfluxDB
94
82
95
83
To convert the final output to something that can be digested by InfluxDB, use
When the `--tags` argument is specified, these are injected as TAGS for InfluxDB in addition. The table name can also be specified explicitly; if not given, it defaults to `O2DPG_MC_ReleaseValidation`.
100
88
@@ -110,25 +98,39 @@ There are various plots created during the RelVal run. For each compared file th
110
98
111
99
As mentioned above, the basic usage of the `rel-val` sub-command is straightforward. But there are quite a few more options available and some of them will be explained briefly below.
112
100
113
-
### Setting new thresholds from another RelVal run (towards threshold tuning)
101
+
### Setting new/custom thresholds from another RelVal run
102
+
Each RelVal run produces a `Summary.json` file in the corresponding output directories. Among other things, it contains the computed values of all tests for each compared histogram pair. Such a `Summary.json` can now be used as a input file for a future RelVal to set all thresholds according to the values. In fact, multiple such files can be passed and for each historgam-test combination, the mean or max of the previously calculated values can be used to set the new thresholds.
114
103
115
-
Imagine the scenario, where you assume that one has 2 outputs (either custom or full simulation output) which should be compatible. For instance, these could be 2 simulation runs with the same generator seed and reasonably high statistics and also otherwise with the same parameters.
116
-
Running the RelVal on these directories will - as usual - yield the `<parent/output/dir/SummaryGlobal.json>` as well as `<parent/output/dir/sub/dirSummary.json>`. Now, assuming there is another simulation output from - for instance - another software version. To check, where this is truly worse in terms of the RelVal comparison, one could compare it to one of the "baseline" runs while setting all thresholds to the computed values of the first comparison. This can be done with
which will set each threshold individually per test and per histogram.
121
-
122
-
In addition each test threshold can be set globally for all histogram comparisons with
123
-
*`--chi2-threshold <value>`,
124
-
*`--rel-mean-diff-threshold <value>`,
125
-
*`--rel-entries-diff-threshold <value>`.
107
+
In addition, a margin for each test can be provided as shown in the command above. This is a factor by which the threshold is multiplied. So to add a `10%` margin for the chi2 test, simply put `test-chi2-threshold-margin 1.1`.
126
108
127
109
## RelVal for QC (examples)
128
110
129
111
### Comparing data with MC
130
112
113
+
There is an ongoing effort to unify the names of QC objects inside MC and data QC files. Some are already unified and the following command would run comparison of those. However, others are not yet unified and will not be considered in the comparison.
114
+
131
115
MC QC objects are usually distributed over multiple files while those from data are all contained in one single file. It is possible to directly compare them with
**This is still under development and does not yet work when e.g. comparing an MC directory to a data directory.**
123
+
124
+
In addition to simply comparing 2 ROOT files, the script offers the possibility of comparing 2 corresponding directories that contain simulation artifacts (and potentially QC and analysis results). It is not foreseen to run over everything inside those directories but the files must be specifiec via a small config file. See [this example](config/rel_val_sim_dirs_default.json). It is passed via the option `--dirs-config`. In addition, top-level keys can be enabled(disabled) with `--dirs-config-enable <keys>`(`dirs-config-disable <keys>`) where disabling takes precedence.
125
+
126
+
**NOTE** That each single one of the comparisons is only done if mutual files were found in the 2 corresponding directories. As an example, one could do
0 commit comments