Project
Loading...
Searching...
No Matches
raw-dump-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"
23
24using namespace o2::framework;
25
26// we need to add workflow options before including Framework/runDataProcessing
27void customize(std::vector<o2::framework::ConfigParamSpec>& workflowOptions)
28{
29 std::vector<ConfigParamSpec> options{
30 {"feeId-config-file", VariantType::String, "", {"Filename with crate FEE ID correspondence"}},
31 {"crate-masks-file", VariantType::String, "", {"Filename with crate masks"}},
32 {"electronics-delay-file", VariantType::String, "", {"Filename with electronics delay"}},
33 {"configKeyValues", VariantType::String, "", {"Semicolon separated key=value strings"}},
34 {"ignore-dist-stf", VariantType::Bool, false, {"do not subscribe to FLP/DISTSUBTIMEFRAME/0 message (no lost TF recovery)"}}};
35 workflowOptions.insert(workflowOptions.end(), options.begin(), options.end());
36}
37
39
41{
42 o2::conf::ConfigurableParam::updateFromString(cfgc.options().get<std::string>("configKeyValues"));
43 auto feeIdConfigFilename = cfgc.options().get<std::string>("feeId-config-file");
44 o2::mid::FEEIdConfig feeIdConfig;
45 if (!feeIdConfigFilename.empty()) {
46 feeIdConfig = o2::mid::FEEIdConfig(feeIdConfigFilename.c_str());
47 }
48 auto crateMasksFilename = cfgc.options().get<std::string>("crate-masks-file");
49 o2::mid::CrateMasks crateMasks;
50 if (!crateMasksFilename.empty()) {
51 crateMasks = o2::mid::CrateMasks(crateMasksFilename.c_str());
52 }
53 auto electronicsDelayFilename = cfgc.options().get<std::string>("electronics-delay-file");
54 o2::mid::ElectronicsDelay electronicsDelay;
55 if (!electronicsDelayFilename.empty()) {
56 electronicsDelay = o2::mid::readElectronicsDelay(electronicsDelayFilename.c_str());
57 }
58
59 auto askDISTSTF = !cfgc.options().get<bool>("ignore-dist-stf");
60
62 specs.emplace_back(o2::mid::getRawDumpSpec(true, feeIdConfig, crateMasks, electronicsDelay, askDISTSTF));
63 return specs;
64}
Device to dump decoded raw data.
static void updateFromString(std::string const &)
ConfigParamRegistry & options() const
Defining PrimaryVertex explicitly as messageable.
Definition TFIDInfo.h:20
std::vector< DataProcessorSpec > WorkflowSpec
ElectronicsDelay readElectronicsDelay(const char *filename)
framework::DataProcessorSpec getRawDumpSpec()
void customize(std::vector< o2::framework::ConfigParamSpec > &workflowOptions)
WorkflowSpec defineDataProcessing(ConfigContext const &cfgc)