QualityControl
1.5.1
O2 Data Quality Control Framework
|
← Go back to Post-processing | ../README.md "↑ Go to the Table of Content ↑" | Continue to Frequently Asked Questions →
Your existing DPL workflow can simply be considered a publisher. Therefore, replace o2-qc-run-producer
with your own workflow.
For example, if TPC wants to monitor the output {"TPC", "CLUSTERS"}
of the workflow o2-qc-run-tpcpid
, modify the config file to point to the correct data and do :
QC objects (e.g. histograms) are typically produced in a QC task. This is however not the only way. Some processing tasks such as the calibration might have already processed the data and produced histograms that should be monitored. Instead of re-processing and doing twice the work, one can simply push this QC object to the QC framework where it will be checked and stored.
Let be a device in the main data flow that produces a histogram on a channel defined as TST/HISTO/0
. To get this histogram in the QC and check it, add to the configuration file an "external device":
The "query" syntax is the same as the one used in the DPL and in the Dispatcher. It must match the output of another device, whether it is in the same workflow or in a piped one. The binding
(first part, before the colon) is used in the path of the stored objects and thus we encourage to use the task name to avoid confusion. Moreover, the origin
(first element after the colon) is used as detectorName.
As a basic example, we are going to produce histograms with the HistoProducer and collect them with the QC. The configuration is in basic-external-histo.json. An external task is defined and named "External-1" (see subsection above). It is then used in the Check QCCheck :
When using this feature, make sure that the name of the MO in the Check definition matches the name of the object you are sending from the external device.
To run it, do:
The object is visible in the QCG or the CCDB at qc/TST/MO/External-1/hello_0
. In general we publish the objects of an external device at qc/<detector>/MO/<binding>/object
.
The check results are stored at qc/<detector>/QO/<binding>/object
.
This second, more advanced, example mixes QC tasks and external tasks. It is defined in advanced-external-histo.json. It is represented here:
First, it runs 1 QC task (QC-TASK-RUNNER-QcTask) getting data from a data producer (bottom boxes, typical QC worfklow).
On top we see 3 histogram producers. histoProducer-2
is not part of the QC, it is not an external device defined in the configuration file. The two other histogram producers are configured as external devices in the configuration file.
histoProducer-0
produces an object that is used in a check (QcCheck-External-1
). histoProducer-1
objects are not used in any check but we generate one automatically to take care of the storage in the database.
To run it, do:
During the data-taking Quality Control runs on a distributed computing system. Some QC Tasks are executed on dedicated QC servers, while others run on FLPs and EPNs. In the first case, messages coming from Data Sampling should reach QC servers where they are processed. In the latter case, locally produced Monitor Objects should be merged on QC servers and then have Checks run on them. By remote QC tasks we mean those which run on QC servers (remote machines), while local QC Tasks run on FLPs and EPNs (local machines).
While it is responsibility of the run operators to run all the processing topologies during the data taking, here we show how to achieve such multinode workflows on development setups, running them just with DPL driver. Note that for now we support cases with one or more local machines, but just only one remote machine.
In our example, we assume having two local processing nodes (localnode1
, localnode2
) and one QC node (qcnode
). There are two types of QC Tasks declared:
MultiNodeLocal
which are executed on the local nodes and their results are merged and checked on the QC server.MultiNodeRemote
which runs on the QC server, receiving a small percent of data from localnode2
only. Mergers are not needed in this case, but there is a process running Checks against Monitor Objects generated by this Task.We use the SkeletonTask
class for both, but any Task can be used of course. Should a Task be local, all its MonitorObject
s need to be mergeable - they should be one of the mergeable ROOT types (histograms, TTrees) or inherit MergeInterface.
These are the steps to follow to get a multinode setup:
In this example we will use the Framework/multiNode.json
config file. A config file should look almost like the usual one, but with a few additional parameters. In case of a local task, these parameters should be added:
List the local processing machines in the localMachines
array. remoteMachine
should contain the host name which will serve as a QC server and remotePort
should be a port number on which Mergers will wait for upcoming MOs. Make sure it is not used by other service. If different QC Tasks are run in parallel, use separate ports for each. One also may choose the merging mode - delta
is the default and recommended (tasks are reset after each cycle, so they send only updates), but if it is not feasible, Mergers may expect entire
objects - tasks are not reset, they always send entire objects and the latest versions are combined in Mergers.
In case of a remote task, choosing "remote"
option for the "location"
parameter is enough.
However in both cases, one has to specify the machines where data should be sampled, as below. If data should be published to external machines (with remote tasks), one has to add a local port number. Use separate ports for each Data Sampling Policy.
/
o2-qc-run-producer
represents any DPL workflow, here it is just a process which produces some random data. If there are no problems, on QCG you should see the example
histogram updated under the paths qc/TST/MO/MultiNodeLocal
and qc/TST/MO/MultiNodeRemote
, and corresponding Checks under the path qc/TST/QO/
.
For your convenience, and although it does not lie within the QC scope, we would like to document how to write a simple data producer in the DPL. The DPL documentation can be found https://github.com/AliceO2Group/AliceO2/blob/dev/Framework/Core/README.md "here" and for questions please head to the forum.
As an example we take the DataProducerExample
that you can find in the QC repository. It is produces a number. By default it will be 1s but one can specify with the parameter my-param
a different number. It is made of 3 files :
customize(...)
to add parameters to the executable. Note that it must be written before the includes for the dataProcessing.defineDataProcessing(...)
to define the workflow to be ran, in our case the device(s) publishing the number.#include <Framework/DataProcessorSpec.h>
getDataProducerExampleSpec(...)
which must return a DataProcessorSpec
i.e. the description of a device (name, inputs, outputs, algorithm)getDataProducerExampleAlgorithm
which must return an AlgorithmSpec
i.e. the actual algorithm that produces the data.getDataProducerExampleSpec
and the inner-most block of getDataProducerExampleAlgorithm
. You might be taken aback by the look of this function, if you don't know what a lambda is just ignore it and write your code inside the accolades.You will probably write it in your detector's O2 directory rather than in the QC repository.
The MonitorObjects generated by Quality Control are stored in a dedicated repository based on CCDB. The run conditions, on the other hand, are located in another, separate database. One can access these conditions inside a Task by a dedicated method of the TaskInterface, as below:
Make sure to declare a valid URL of CCDB in the config file. Keep in mind that it might be different from the CCDB instance used for storing QC objects.
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
.
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).
For example, to add two parameters of different types do :
One can add custom metadata on the QC objects produced in a QC task. Simply call ObjectsManager::addMetadata(...)
, like in
This metadata will end up in the QCDB.
The developer of a Task might perfectly know how to display a plot or a graph but cannot set these options if they belong to the Canvas. This is typically the case of drawOptions
such as colz
or alp
. It is also the case for canvases' properties such as logarithmic scale and grid. These options can be set by the end user in the QCG but it is likely that the developer wants to give pertinent default options.
To do so, one can use one of the two following methods.
TObjectsManager::setDefaultDrawOptions(<objectname or pointer>, string& drawOptions)
drawOptions
is a space-separated list of drawing options. E.g. "colz" or "alp lego1".
TObjectsManager::setDisplayHint(<objectname or pointer>, string& hints)
hints
is a space-separated list of hints on how to draw the object. E.g. "logz" or "gridy logy".
Currently supported by QCG: logx, logy, logz, gridx, gridy, gridz.
This is a GUI to inspect the data coming out of the DataSampling, in particular the Readout.
If not already done, install GLFW for your platform. On CC7 install glfw-devel
from epel repository : sudo yum install glfw-devel --enablerepo=epel
Build the QualityControl as usual.
To monitor the readout, 3 processes have to be started : the Readout, the Data Sampling and the Data Inspector.
First make sure that the Data Sampling is enabled in the readout :
In 3 separate terminals, do respectively
readout.exe file:///absolute/path/to/config.cfg
o2-qc-run-readout-for-data-dump --batch
o2-qc-data-dump --mq-config $QUALITYCONTROL_ROOT/etc/dataDump.json --id dataDump --control static
Fraction of data The Data Sampling tries to take 100% of the events by default. Edit $QUALITYCONTROL_ROOT/etc/readoutForDataDump.json
to change it. Look for the parameter fraction
that is set to 1.
Port The Data Sampling sends data to the GUI via the port 26525
. If this port is not free, edit the config file $QUALITYCONTROL_ROOT/etc/readoutForDataDump.json
and $QUALITYCONTROL_ROOT/etc/dataDump.json
.
Each MonitorObject is stored as a TFile in the CCDB. It is therefore possible to easily open it with ROOT when loaded with alienv. It also seamlessly supports class schema evolution.
The MonitorObjects are stored at a path which is enforced by the qc framework : /qc/<detector code>/MO/<task name>/object/name
Note that the name of the object can contain slashes (/
) in order to build a sub-tree visible in the GUI. The detector name and the taskname are set in the config file :
The quality is stored as a CCDB metadata of the object.
Before September 2019, objects were serialized with TMessage and stored as blobs in the CCDB. The main drawback was the loss of the corresponding streamer infos leading to problems when the class evolved or when accessing the data outside the QC framework.
The QC framework is nevertheless backward compatible and can handle the old and the new storage system.
Having a central ccdb for test (ccdb-test) is handy but also means that everyone can access, modify or delete the data. If you prefer to have a local instance of the CCDB, for example in your lab or on your development machine, follow these instructions.
java -jar local.jar
It will start listening by default on port 8080. This can be changed either with the java parameter “tomcat.port” or with the environment variable “TOMCAT_PORT”. Similarly the default listening address is 127.0.0.1 and it can be changed with the java parameter “tomcat.address” or with the environment variable “TOMCAT_ADDRESS” to something else (for example ‘*’ to listen on all interfaces).
By default the local repository is located in /tmp/QC (or java.io.tmpdir/QC to be more precise). You can change this location in a similar way by setting the java parameter “file.repository.location” or the environment variable “FILE_REPOSITORY_LOCATION”.
The address of the CCDB will have to be updated in the Tasks config file.
At the moment, the description of the REST api can be found in this document : https://docs.google.com/presentation/d/1PJ0CVW7QHgnFzi0LELc06V82LFGPgmG3vsmmuurPnUg
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
To load a development library in a setup with FLP suite, specify its full path in the config file (e.g. /etc/flp.d/qc/readout.json
):
Make sure that:
WARNING. We do not actively support MySQL as QC database anymore. The interface might not work as expected anymore.
sudo yum install mariadb-server
brew install mysql
The QC requires a number of configuration items. An example config file is provided in the repo under the name example-default.json. This is a quick reference for all the parameters.
This is the global structure of the configuration in QC.
There are four QC-related components:
The configuration file can also include a path to Data Sampling configuration ("dataSamplingPoliciesFile") or the list of Data Sampling Policies. Please refer to the Data Sampling documentation to find more information.
This is how a typical "config" structure looks like. Each configuration element is described with a relevant comment afterwards. The "": "\<comment\>",
formatting is to keep the JSON structure valid. Please note that these comments should not be present in real configuration files.
Below the full QC Task configuration structure is described. Note that more than one task might be declared inside in the "tasks" path.
Below the full QC Checks configuration structure is described. Note that more than one check might be declared inside in the "checks" path. Please also refer to the Checks documentation for more details.
Below the full QC Aggregators configuration structure is described. Note that more than one aggregator might be declared inside in the "aggregators" path. Please also refer to the Aggregators documentation for more details.
Below the full QC Post-processing (PP) configuration structure is described. Note that more than one PP Task might be declared inside in the "postprocessing" path. Please also refer to the Post-processing documentation for more details.
Below the external task configuration structure is described. Note that more than one external task might be declared inside in the "externalTasks" path.
← Go back to Post-processing | ../README.md "↑ Go to the Table of Content ↑" | Continue to Frequently Asked Questions →