Project
Loading...
Searching...
No Matches
raw-to-digits-workflow.cxx
Go to the documentation of this file.
1// Copyright 2019-2020 CERN and copyright holders of ALICE O2.
2// See https://alice-o2.web.cern.ch/copyright for details of the copyright holders.
3// All rights not expressly granted are reserved.
4//
5// This software is distributed under the terms of the GNU General Public
6// License v3 (GPL Version 3), copied verbatim in the file "COPYING".
7//
8// In applying this license CERN does not waive the privileges and immunities
9// granted to it by virtue of its status as an Intergovernmental Organization
10// or submit itself to any jurisdiction.
11
16
17#include <string>
18#include <vector>
19#include "Framework/Variant.h"
24
25using namespace o2::framework;
26
27// we need to add workflow options before including Framework/runDataProcessing
28void customize(std::vector<o2::framework::ConfigParamSpec>& workflowOptions)
29{
30 std::vector<ConfigParamSpec> options{
31 {"feeId-config-file", VariantType::String, "", {"Filename with crate FEE ID correspondence"}},
32 {"crate-masks-file", VariantType::String, "", {"Filename with crate masks"}},
33 {"electronics-delay-file", VariantType::String, "", {"Filename with electronics delay"}},
34 {"decode-only", o2::framework::VariantType::Bool, false, {"Output decoded boards instead of digits"}},
35 {"configKeyValues", VariantType::String, "", {"Semicolon separated key=value strings"}},
36 {"ignore-dist-stf", VariantType::Bool, false, {"do not subscribe to FLP/DISTSUBTIMEFRAME/0 message (no lost TF recovery)"}}};
37 workflowOptions.insert(workflowOptions.end(), options.begin(), options.end());
38}
39
41
43{
44 o2::conf::ConfigurableParam::updateFromString(cfgc.options().get<std::string>("configKeyValues"));
45 auto feeIdConfigFilename = cfgc.options().get<std::string>("feeId-config-file");
46 o2::mid::FEEIdConfig feeIdConfig;
47 if (!feeIdConfigFilename.empty()) {
48 feeIdConfig = o2::mid::FEEIdConfig(feeIdConfigFilename.c_str());
49 }
50 auto crateMasksFilename = cfgc.options().get<std::string>("crate-masks-file");
51 o2::mid::CrateMasks crateMasks;
52 if (!crateMasksFilename.empty()) {
53 crateMasks = o2::mid::CrateMasks(crateMasksFilename.c_str());
54 }
55 auto electronicsDelayFilename = cfgc.options().get<std::string>("electronics-delay-file");
56 o2::mid::ElectronicsDelay electronicsDelay;
57 if (!electronicsDelayFilename.empty()) {
58 electronicsDelay = o2::mid::readElectronicsDelay(electronicsDelayFilename.c_str());
59 }
60
61 bool decodeOnly = cfgc.options().get<bool>("decode-only");
62 auto askDISTSTF = !cfgc.options().get<bool>("ignore-dist-stf");
63
65 specs.emplace_back(o2::mid::getRawDecoderSpec(false, feeIdConfig, crateMasks, electronicsDelay, askDISTSTF));
66 if (!decodeOnly) {
67 specs.emplace_back(o2::mid::getDecodedDataAggregatorSpec());
68 }
69 return specs;
70}
Data processor spec for MID decoded data aggregator devices.
Data processor spec for MID raw decoder device.
void customize(std::vector< o2::framework::ConfigParamSpec > &workflowOptions)
WorkflowSpec defineDataProcessing(ConfigContext const &cfgc)
static void updateFromString(std::string const &)
ConfigParamRegistry & options() const
Defining PrimaryVertex explicitly as messageable.
Definition TFIDInfo.h:20
std::vector< DataProcessorSpec > WorkflowSpec
framework::DataProcessorSpec getRawDecoderSpec(bool isDebugMode=false)
ElectronicsDelay readElectronicsDelay(const char *filename)
framework::DataProcessorSpec getDecodedDataAggregatorSpec()