diff --git a/Framework/advanced.json b/Framework/advanced.json index 858a0ae0e9..5a37ec8702 100644 --- a/Framework/advanced.json +++ b/Framework/advanced.json @@ -27,7 +27,7 @@ } }, "tasks": { - "dataSizeTask": { + "AdvTaskA": { "active": "true", "className": "o2::quality_control_modules::skeleton::SkeletonTask", "moduleName": "QcSkeleton", @@ -35,23 +35,23 @@ "cycleDurationSeconds": "10", "dataSource": { "type": "dataSamplingPolicy", - "name": "tst2" + "name": "tst" } }, - "someNumbersTask": { + "AdvTaskB": { "active": "true", "className": "o2::quality_control_modules::skeleton::SkeletonTask", "moduleName": "QcSkeleton", "detectorName": "TST", - "cycleDurationSeconds": "10", + "cycleDurationSeconds": "25", "dataSource": { - "type": "dataSamplingPolicy", - "name": "tst1" + "type": "direct", + "query": "data:TST/SUM" } } }, "checks": { - "dataSizeCheck": { + "AdvCheckA1": { "active": "true", "className": "o2::quality_control_modules::skeleton::SkeletonCheck", "moduleName": "QcSkeleton", @@ -59,52 +59,241 @@ "detectorName": "TST", "dataSource": [{ "type": "Task", - "name": "dataSizeTask", + "name": "AdvTaskA", "MOs": ["example"] }] }, - "someNumbersCheck": { + "AdvCheckA2": { "active": "true", "className": "o2::quality_control_modules::skeleton::SkeletonCheck", "moduleName": "QcSkeleton", - "policy": "OnAny", + "policy": "OnAll", "detectorName": "TST", "dataSource": [{ "type": "Task", - "name": "someNumbersTask", - "MOs": ["example"] + "name": "AdvTaskA", + "MOs": ["example", "example2"] + }] + }, + "AdvCheckB": { + "active": "true", + "className": "o2::quality_control_modules::common::TrendCheck", + "moduleName": "QualityControl", + "detectorName": "TST", + "policy": "OnAll", + "extendedCheckParameters": { + "default": { + "default": { + "trendCheckMode": "DeviationFromMean", + "nPointsForAverage": "3", + "thresholdsBad": "-0.02,0.02", + "thresholdsMedium": "-0.005,0.005" + } + } + }, + "dataSource": [ + { + "type": "PostProcessing", + "name": "AdvTrendB", + "MOs" : [ + "mean_of_histogram" + ] + } + ] + } + }, + "aggregators": { + "AdvAggregatorA": { + "active": "true", + "className": "o2::quality_control_modules::common::WorstOfAllAggregator", + "moduleName": "QcCommon", + "policy": "OnAny", + "detectorName": "TST", + "dataSource": [{ + "type": "Check", + "name": "AdvCheckA1" + }, { + "type": "Check", + "name": "AdvCheckA2" + }] + }, + "AdvAggregatorB": { + "active": "true", + "className": "o2::quality_control_modules::common::WorstOfAllAggregator", + "moduleName": "QcCommon", + "policy": "OnAll", + "detectorName": "TST", + "dataSource": [{ + "type": "Check", + "name": "AdvCheckB" + }] + }, + "AdvAggregatorC": { + "active": "true", + "className": "o2::quality_control_modules::common::WorstOfAllAggregator", + "moduleName": "QcCommon", + "policy": "OnAll", + "detectorName": "TST", + "dataSource": [{ + "type": "Aggregator", + "name": "AdvAggregatorA", + "QOs": [] + }, { + "type": "Aggregator", + "name": "AdvAggregatorB", + "QOs": [] }] } + + }, + "postprocessing": { + "AdvTrendB": { + "active": "true", + "className": "o2::quality_control::postprocessing::TrendingTask", + "moduleName": "QualityControl", + "detectorName": "TST", + "dataSources": [ + { + "type": "repository", + "path": "TST/MO/AdvTaskB", + "names": [ "example" ], + "reductorName": "o2::quality_control_modules::common::TH1Reductor", + "moduleName": "QcCommon" + } + ], + "plots": [ + { + "name": "mean_of_histogram", + "title": "Mean trend of the example histogram", + "graphAxisLabel": "Mean X:time", + "graphYRange": "0:10000", + "graphs" : [ + { + "name": "mean_trend", + "title": "mean trend", + "varexp": "example.mean:time", + "selection": "", + "option": "*L PLC PMC" + } + ] + } + ], + "initTrigger": [ + "userorcontrol" + ], + "updateTrigger": [ + "newobject:qcdb:TST/MO/AdvTaskB/example" + ], + "stopTrigger": [ + "userorcontrol" + ] + }, + "AdvTrendA": { + "active": "true", + "className": "o2::quality_control::postprocessing::TrendingTask", + "moduleName": "QualityControl", + "detectorName": "TST", + "dataSources": [ + { + "type": "repository-quality", + "path": "TST/QO", + "names": [ "AdvCheckA1" ], + "reductorName": "o2::quality_control_modules::common::QualityReductor", + "moduleName": "QcCommon" + } + ], + "plots": [ + { + "name": "example_quality", + "title": "Trend of the example histogram's quality", + "graphs" : [{ + "varexp": "AdvCheckA1.name:time", + "selection": "", + "option": "*" + }] + } + ], + "initTrigger": [ + "userorcontrol" + ], + "updateTrigger": [ + "newobject:qcdb:TST/QO/AdvCheckA1" + ], + "stopTrigger": [ + "userorcontrol" + ] + }, + "AdvQualityTask": { + "active": "true", + "className": "o2::quality_control_modules::common::QualityTask", + "moduleName": "QualityControl", + "detectorName": "TST", + "qualityGroups": [ + { + "name" : "global", + "title" : "Advanced example: Aggregators", + "path": "TST/QO", + "ignoreQualitiesDetails" : [], + "inputObjects": [ + { + "name" : "AdvAggregatorC/AdvAggregatorC", + "title" : "Adv. Aggregator C (total)" + }, + { + "name" : "AdvAggregatorA/AdvAggregatorA", + "title" : "Adv. Aggregator A" + }, + { + "name" : "AdvAggregatorB/AdvAggregatorB", + "title" : "Adv. Aggregator B" + } + ] + }, + { + "name" : "details", + "title" : "Advanced example: Checks", + "path": "TST/QO", + "ignoreQualitiesDetails" : [], + "inputObjects": [ + { + "name" : "AdvCheckA1", + "title" : "" + }, + { + "name" : "AdvCheckA2", + "title" : "" + }, + { + "name" : "AdvCheckB", + "title" : "" + } + ] + } + ], + "initTrigger": [ + "userorcontrol" + ], + "updateTrigger": [ + "newobject:qcdb:TST/QO/AdvAggregatorC/AdvAggregatorC" + ], + "stopTrigger": [ + "userorcontrol" + ] + } } }, "dataSamplingPolicies": [ { - "id": "tst1", + "id": "tst", "active": "true", - "machines": [], - "query" : "data:TST/SUM/2;param:TST/PARAM/2", + "query" : "data:TST/DATA/1", "samplingConditions": [ { "condition": "random", "fraction": "0.1", - "seed": "32112332123" - } - ], - "blocking": "false" - }, - { - "id": "tst2", - "active": "true", - "machines": [], - "query" : "data:TST/DATA", - "samplingConditions": [ - { - "condition": "payloadSize", - "lowerLimit": "8000", - "upperLimit": "10000" + "seed": "0" } - ], - "blocking": "false" + ] } ] } diff --git a/doc/ModulesDevelopment.md b/doc/ModulesDevelopment.md index 77b9315acb..f39800ecf3 100644 --- a/doc/ModulesDevelopment.md +++ b/doc/ModulesDevelopment.md @@ -86,7 +86,7 @@ Data Sampling is used by Quality Control to feed the tasks with data. Below we p } ``` -An example of using the data sampling in a DPL workflow is visible in [runAdvanced.cxx](https://github.com/AliceO2Group/QualityControl/blob/master/Framework/src/runAdvanced.cxx). +QC framework takes care of creating the necessary Data Sampling infrastructure when it finds it in the configuration file. #### Custom Data Sampling Condition @@ -512,16 +512,21 @@ The way we compute the run number is done in this order: ## A more advanced example -A more complete example is available. The config file is called [advanced.json](../Framework/advanced.json). The workflow is made of 3 sources, intermediate processing steps, 3 sinks and a Dispatcher connecting two QC tasks to a number of these steps and 2 checks. The topology doesn't mean to represent any particular physics processing, it is just an example with multiple data processors. +A more complete example is available. The config file is called [advanced.json](../Framework/advanced.json). +The workflow is made of 3 sources, intermediate processing steps, 3 sinks and a Dispatcher connecting two QC tasks to selected data outputs. +It also includes a few Checks, Aggregators and PostProcessing tasks. +The topology is not intended to represent any particular physics processing, it is just an example with multiple data processors. ![alt text](images/advanced.png) To run it do either ``` +# runs a fake processing workflow and associated QC o2-qc-run-advanced ``` or ``` +# o2-qc-run-advanced creates a fake processing workflow, while the QC is spawned by o2-qc o2-qc-run-advanced --no-qc | o2-qc --config json://${QUALITYCONTROL_ROOT}/etc/advanced.json ``` diff --git a/doc/images/advanced.png b/doc/images/advanced.png index 28c82c1d8c..5d35b60d48 100644 Binary files a/doc/images/advanced.png and b/doc/images/advanced.png differ