Skip to content

Commit 5fcb9ee

Browse files
authored
Possibility to connect QC to readout without DS (QC-140) (#133)
1 parent 3451d5a commit 5fcb9ee

4 files changed

Lines changed: 47 additions & 7 deletions

File tree

Framework/CMakeLists.txt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -287,6 +287,7 @@ install(
287287
basic-no-sampling.json
288288
advanced.json
289289
readout.json
290+
readout-no-sampling.json
290291
readoutForDataDump.json
291292
DESTINATION etc
292293
)

Framework/readout-no-sampling.json

Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,36 @@
1+
{
2+
"qc": {
3+
"config": {
4+
"database": {
5+
"implementation": "CCDB",
6+
"host": "ccdb-test.cern.ch:8080",
7+
"username": "not_applicable",
8+
"password": "not_applicable",
9+
"name": "not_applicable"
10+
},
11+
"Activity": {
12+
"number": "42",
13+
"type": "2"
14+
}
15+
},
16+
"tasks": {
17+
"daqTask": {
18+
"active": "true",
19+
"className": "o2::quality_control_modules::daq::DaqTask",
20+
"moduleName": "QcDaq",
21+
"cycleDurationSeconds": "10",
22+
"maxNumberCycles": "-1",
23+
"dataSource": {
24+
"type": "direct",
25+
"binding": "readout",
26+
"dataOrigin": "ITS",
27+
"dataDescription": "RAWDATA",
28+
"subSpec": "0"
29+
},
30+
"location": "remote"
31+
}
32+
}
33+
},
34+
"dataSamplingPolicies": [
35+
]
36+
}

Framework/readout.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,8 +16,8 @@
1616
"tasks": {
1717
"daqTask": {
1818
"active": "true",
19-
"className": "o2::quality_control_modules::skeleton::SkeletonTask",
20-
"moduleName": "QcSkeleton",
19+
"className": "o2::quality_control_modules::daq::DaqTask",
20+
"moduleName": "QcDaq",
2121
"cycleDurationSeconds": "10",
2222
"maxNumberCycles": "-1",
2323
"dataSource": {

Framework/src/runReadout.cxx

Lines changed: 8 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,9 @@ void customize(std::vector<ChannelConfigurationPolicy>& policies)
4747
void customize(std::vector<ConfigParamSpec>& workflowOptions)
4848
{
4949
workflowOptions.push_back(
50-
ConfigParamSpec{"config-path", VariantType::String, "", {"Path to the config file."}});
50+
ConfigParamSpec{ "config-path", VariantType::String, "", { "Path to the config file. Overwrite the default paths. Do not use with no-data-sampling." } });
51+
workflowOptions.push_back(
52+
ConfigParamSpec{ "no-data-sampling", VariantType::Bool, false, { "Skips data sampling, connects directly the task to the producer." } });
5153
}
5254

5355
#include <TH1F.h>
@@ -125,10 +127,11 @@ WorkflowSpec defineDataProcessing(ConfigContext const& config)
125127

126128
std::string getConfigPath(const ConfigContext& config)
127129
{
128-
std::string userConfigPath = config.options().get<std::string>("config-path");
129-
std::string defaultConfigPath = getenv("QUALITYCONTROL_ROOT") != nullptr ?
130-
std::string(getenv("QUALITYCONTROL_ROOT")) + "/etc/readout.json" : "$QUALITYCONTROL_ROOT undefined";
131-
std::string path = userConfigPath == "" ? defaultConfigPath : userConfigPath;
130+
bool noDS = config.options().get<bool>("no-data-sampling");
131+
std::string filename = !noDS ? "readout.json" : "readout-no-sampling.json";
132+
auto userConfigPath = config.options().get<std::string>("config-path");
133+
std::string defaultConfigPath = getenv("QUALITYCONTROL_ROOT") != nullptr ? std::string(getenv("QUALITYCONTROL_ROOT")) + "/etc/" + filename : "$QUALITYCONTROL_ROOT undefined";
134+
std::string path = userConfigPath.empty() ? defaultConfigPath : userConfigPath;
132135
const std::string qcConfigurationSource = std::string("json:/") + path;
133136
return qcConfigurationSource;
134137
}

0 commit comments

Comments
 (0)