Skip to content

Commit b9ae55d

Browse files
authored
[QC-1070] Add doc about the Custom Parameters for checkers (#2068)
1 parent fb19f7a commit b9ae55d

1 file changed

Lines changed: 25 additions & 8 deletions

File tree

doc/Advanced.md

Lines changed: 25 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1035,19 +1035,36 @@ The following tasks will be merged correctly:
10351035
```
10361036
The same approach can be applied to other actors in the QC framework, like Checks (`checkName`), Aggregators(`aggregatorName`), External Tasks (`taskName`) and Postprocessing Tasks (`taskName`).
10371037

1038-
## Definition and access of user-specific configuration
1038+
## Definition and access of simple user-defined task configuration ("taskParameters")
10391039

1040-
A task can access custom parameters declared in the configuration file at `qc.tasks.<task_id>.extendedTaskParameters` or `qc.tasks.<task_id>.taskParameters`. They are stored inside an object of type `CustomParameters` named `mCustomParameters`, which is a protected member of `TaskInterface`.
1040+
The new, extended, way of defining such parameters, not only in Tasks but also in Checks, Aggregators and PP tasks,
1041+
is described in the next section.
10411042

1042-
The simple, deprecated, syntax is
1043+
A task can access custom parameters declared in the configuration file at `qc.tasks.<task_id>.taskParameters`. They are stored inside an object of type `CustomParameters` named `mCustomParameters`, which is a protected member of `TaskInterface`.
1044+
1045+
The syntax is
10431046
```json
10441047
"tasks": {
10451048
"QcTask": {
10461049
"taskParameters": {
10471050
"myOwnKey1": "myOwnValue1"
10481051
},
10491052
```
1050-
It is accessed with : `mCustomParameters["myOwnKey"]`.
1053+
It is accessed with : `mCustomParameters["myOwnKey"]`.
1054+
1055+
## Definition and access of user-defined configuration ("extendedTaskParameters")
1056+
1057+
User code, whether it is a Task, a Check, an Aggregator or a PostProcessing task, can access custom parameters declared in the configuration file.
1058+
They are stored inside an object of type `CustomParameters` named `mCustomParameters`, which is a protected member of `TaskInterface`.
1059+
1060+
The following table gives the path in the config file and the name of the configuration parameter for the various types of user code:
1061+
1062+
| User code | Config File item |
1063+
|----------------|--------------------------------------------------------|
1064+
| Task | `qc.tasks.<task_id>.extendedTaskParameters` |
1065+
| Check | `qc.checks.<check_id>.extendedCheckParameters` |
1066+
| Aggregator | `qc.aggregators.<agg_id>.extendedAggregatorParameters` |
1067+
| PostProcessing | `qc.postprocessing.<pp_id>.extendedTaskParameters` |
10511068

10521069
The new syntax is
10531070
```json
@@ -1083,7 +1100,7 @@ It allows to have variations of the parameters depending on the run and beam typ
10831100
to ignore the run or the beam type.
10841101
The beam type is one of the following: `PROTON-PROTON`, `Pb-Pb`, `Pb-PROTON`
10851102

1086-
The values can be accessed in various ways.
1103+
The values can be accessed in various ways described in the following sub-sections.
10871104

10881105
### Access optional values with or without activity
10891106

@@ -1093,11 +1110,11 @@ However, before returning an empty value we try to substitute the runType and th
10931110
```c++
10941111
// returns an Optional<string> if it finds the key `myOwnKey` for the runType and beamType of the provided activity,
10951112
// or if it can find the key with the runType or beamType substituted with "default".
1096-
auto param = mCustomParameters.atOptional("myOwnKey", activity); // activity is "PHYSICS", "Pb-Pb" , returns "myOwnValue1d"
1113+
auto param = mCustomParameters.atOptional("myOwnKey1", activity); // activity is "PHYSICS", "Pb-Pb" , returns "myOwnValue1d"
10971114
// same but passing directly the run and beam types
1098-
auto param = mCustomParameters.atOptional("myOwnKey", "PHYSICS", "Pb-Pb"); // returns "myOwnValue1d"
1115+
auto param = mCustomParameters.atOptional("myOwnKey1", "PHYSICS", "Pb-Pb"); // returns "myOwnValue1d"
10991116
// or with only the run type
1100-
auto param = mCustomParameters.atOptional("myOwnKey", "PHYSICS"); // returns "myOwnValue1b"
1117+
auto param = mCustomParameters.atOptional("myOwnKey1", "PHYSICS"); // returns "myOwnValue1b"
11011118
```
11021119

11031120
### Access values directly specifying the run and beam type

0 commit comments

Comments
 (0)