Skip to content

Commit 3c65169

Browse files
committed
update doc
1 parent 6ac57a6 commit 3c65169

3 files changed

Lines changed: 77 additions & 65 deletions

File tree

doc/Advanced.md

Lines changed: 59 additions & 41 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,9 @@
55
<!--./gh-md-toc --insert /path/to/README.md-->
66
<!--ts-->
77
* [Advanced topics](#advanced-topics)
8+
* [Access conditions from the CCDB](#access-conditions-from-the-ccdb)
9+
* [Definition and access of task-specific configuration](#definition-and-access-of-task-specific-configuration)
10+
* [Custom QC object metadata](#custom-qc-object-metadata)
811
* [Data Inspector](#data-inspector)
912
* [Prerequisite](#prerequisite)
1013
* [Compilation](#compilation)
@@ -13,8 +16,6 @@
1316
* [Use MySQL as QC backend](#use-mysql-as-qc-backend)
1417
* [Local CCDB setup](#local-ccdb-setup)
1518
* [Local QCG (QC GUI) setup](#local-qcg-qc-gui-setup)
16-
* [Custom QC object metadata](#custom-qc-object-metadata)
17-
* [Access conditions from the CCDB](#access-conditions-from-the-ccdb)
1819
* [Information Service](#information-service)
1920
* [Usage](#usage)
2021
* [Configuration files details](#configuration-files-details)
@@ -26,6 +27,62 @@
2627

2728
[← Go back to Modules Development](ModulesDevelopment.md) | [↑ Go to the Table of Content ↑](../README.md) | [Continue to Frequently Asked Questions →](FAQ.md)
2829

30+
## Access conditions from the CCDB
31+
32+
The MonitorObjects generated by Quality Control are stored in a dedicated
33+
repository based on CCDB. The run conditions, on the other hand, are located
34+
in another, separate database. One can access these conditions inside a
35+
Task by a dedicated method of the TaskInterface, as below:
36+
```
37+
TObject* condition = TaskInterface::retrieveCondition("Path/to/condition");
38+
if (condition) {
39+
LOG(INFO) << "Retrieved " << condition->ClassName();
40+
delete condition;
41+
}
42+
```
43+
Make sure to declare a valid URL of CCDB in the config file. Keep in
44+
mind that it might be different from the CCDB instance used for storing
45+
QC objects.
46+
47+
```
48+
{
49+
"qc": {
50+
"config": {
51+
...
52+
"conditionDB": {
53+
"url": "ccdb-test.cern.ch:8080"
54+
}
55+
},
56+
...
57+
```
58+
59+
## Definition and access of task-specific configuration
60+
61+
A task can access custom parameters declared in the configuration file at `qc.tasks.<task_name>.taskParameters`. They are stored inside a key-value map named mCustomParameters, which is a protected member of `TaskInterface`.
62+
63+
One can also tell the DPL driver to accept new arguments. This is done using the `customize` method at the top of your workflow definition (usually called "runXXX" in the QC).
64+
65+
For example, to add two parameters of different types do :
66+
```
67+
void customize(std::vector<ConfigParamSpec>& workflowOptions)
68+
{
69+
workflowOptions.push_back(
70+
ConfigParamSpec{ "config-path", VariantType::String, "", { "Path to the config file. Overwrite the default paths. Do not use with no-data-sampling." } });
71+
workflowOptions.push_back(
72+
ConfigParamSpec{ "no-data-sampling", VariantType::Bool, false, { "Skips data sampling, connects directly the task to the producer." } });
73+
}
74+
```
75+
76+
## Custom QC object metadata
77+
78+
One can add custom metadata on the QC objects produced in a QC task.
79+
Simply call `ObjectsManager::addMetadata(...)`, like in
80+
```
81+
// add a metadata on histogram mHistogram, key is "custom" and value "34"
82+
getObjectsManager()->addMetadata(mHistogram->GetName(), "custom", "34");
83+
```
84+
This metadata will end up in the CCDB.
85+
2986
## Data Inspector
3087

3188
This is a GUI to inspect the data coming out of the DataSampling, in
@@ -108,45 +165,6 @@ At the moment, the description of the REST api can be found in this document : h
108165

109166
To install and run the QCG locally, and its fellow process tobject2json, please follow these instructions : https://github.com/AliceO2Group/WebUi/tree/dev/QualityControl#run-qcg-locally
110167

111-
## Custom QC object metadata
112-
113-
One can add custom metadata on the QC objects produced in a QC task.
114-
Simply call `ObjectsManager::addMetadata(...)`, like in
115-
```
116-
// add a metadata on histogram mHistogram, key is "custom" and value "34"
117-
getObjectsManager()->addMetadata(mHistogram->GetName(), "custom", "34");
118-
```
119-
This metadata will end up in the CCDB.
120-
121-
## Access conditions from the CCDB
122-
123-
The MonitorObjects generated by Quality Control are stored in a dedicated
124-
repository based on CCDB. The run conditions, on the other hand, are located
125-
in another, separate database. One can access these conditions inside a
126-
Task by a dedicated method of the TaskInterface, as below:
127-
```
128-
TObject* condition = TaskInterface::retrieveCondition("Path/to/condition");
129-
if (condition) {
130-
LOG(INFO) << "Retrieved " << condition->ClassName();
131-
delete condition;
132-
}
133-
```
134-
Make sure to declare a valid URL of CCDB in the config file. Keep in
135-
mind that it might be different from the CCDB instance used for storing
136-
QC objects.
137-
138-
```
139-
{
140-
"qc": {
141-
"config": {
142-
...
143-
"conditionDB": {
144-
"url": "ccdb-test.cern.ch:8080"
145-
}
146-
},
147-
...
148-
```
149-
150168
## Information Service
151169

152170
The information service publishes information about the tasks currently

doc/ModulesDevelopment.md

Lines changed: 2 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -17,9 +17,6 @@
1717
* [Modification of a Task](#modification-of-a-task)
1818
* [Addition of a Check](#addition-of-a-check)
1919
* [Commit Code](#commit-code)
20-
* [DPL workflow customization](#dpl-workflow-customization)
21-
* [Usage of DS and QC in an existing DPL workflow](#usage-of-ds-and-qc-in-an-existing-dpl-workflow)
22-
* [Addition of parameters to a task](#addition-of-parameters-to-a-task)
2320

2421
<!-- Added by: bvonhall, at: -->
2522

@@ -165,8 +162,8 @@ cd QualityControl/Modules
165162

166163
Now that there is a module, we can build it and test it. First let's build it :
167164
```
168-
# We are in ~/alice
169-
# Go to the build directory of QualityControl
165+
# We are in ~/alice and alienv has been called.
166+
# Go to the build directory of QualityControl.
170167
cd sw/slc7_x86-64/BUILD/QualityControl-latest/QualityControl
171168
make -j8 install # replace 8 by the number of cores on your machine
172169
```
@@ -222,24 +219,6 @@ For a new feature, just create a new branch for it and use the same procedure. D
222219

223220
General ALICE Git guidelines can be accessed [here](https://alisw.github.io/git-tutorial/).
224221

225-
## Addition of parameters to a task
226-
227-
A task can access custom parameters declared in the configuration file at `qc.tasks.<task_name>.taskParameters`. They are stored inside a key-value map named mCustomParameters, which is a protected member of `TaskInterface`.
228-
229-
One can also tell the DPL driver to accept new arguments. This is done using the `customize` method at the top of your workflow definition (usually called "runXXX" in the QC).
230-
231-
For example, to add two parameters of different types do :
232-
```
233-
void customize(std::vector<ConfigParamSpec>& workflowOptions)
234-
{
235-
workflowOptions.push_back(
236-
ConfigParamSpec{ "config-path", VariantType::String, "", { "Path to the config file. Overwrite the default paths. Do not use with no-data-sampling." } });
237-
workflowOptions.push_back(
238-
ConfigParamSpec{ "no-data-sampling", VariantType::Bool, false, { "Skips data sampling, connects directly the task to the producer." } });
239-
}
240-
```
241-
242-
243222
---
244223

245224
[← Go back to Quickstart](QuickStart.md) | [↑ Go to the Table of Content ↑](../README.md) | [Continue to Advanced Topics →](Advanced.md)

doc/QuickStart.md

Lines changed: 16 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,8 @@
1010
* [Execution](#execution)
1111
* [Basic workflow](#basic-workflow)
1212
* [Readout chain](#readout-chain)
13+
* [Getting real data from readout](#getting-real-data-from-readout)
14+
* [Readout data format as received by the Task](#readout-data-format-as-received-by-the-task)
1315

1416
<!-- Added by: bvonhall, at: -->
1517

@@ -121,7 +123,20 @@ o2-qc-run-readout | o2-qc-run-qc --config json://${QUALITYCONTROL_ROOT}/etc/read
121123

122124
The data sampling is configured to sample 1% of the data as the readout should run by default at full speed.
123125

124-
#### Readout data received by the Task
126+
#### Getting real data from readout
127+
128+
The first option is to configure readout.exe to connect to a cru. Please refer to the [Readout documentation](https://github.com/AliceO2Group/Readout/blob/master/doc/README.md).
129+
130+
A more practical approach is to record a data file with Readout and then replay it on your development setup to develop and test your QC. The configuration options are described [here](https://github.com/AliceO2Group/Readout/blob/master/doc/configurationParameters.md), in particular :
131+
132+
```
133+
equipment-player-* filePath string
134+
Path of file containing data to be injected in readout.
135+
equipment-player-* preLoad int 1 If 1, data pages preloaded with file content on startup. If 0, data is copied at runtime.
136+
equipment-player-* fillPage int 1 If 1, content of data file is copied multiple time in each data page until page is full (or almost full: on the last iteration, there is no partial copy if remaining space is smaller than full file size). If 0, data file is copied exactly once in each data page.
137+
```
138+
139+
#### Readout data format as received by the Task
125140

126141
The header is a O2 header populated with data from the header built by the Readout.
127142
The payload received is a 2MB (configurable) data page made of CRU pages (8kB).

0 commit comments

Comments
 (0)