Project
Loading...
Searching...
No Matches
decoded-data-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"
21#include "MIDRaw/CrateMasks.h"
23#include "MIDRaw/FEEIdConfig.h"
26
27using namespace o2::framework;
28
29// add workflow options, note that customization needs to be declared before
30// including Framework/runDataProcessing
31void customize(std::vector<ConfigParamSpec>& workflowOptions)
32{
33 std::vector<ConfigParamSpec>
34 options{
35 {"feeId-config-file", VariantType::String, "", {"Filename with crate FEE ID correspondence"}},
36 {"crate-masks-file", VariantType::String, "", {"Filename with crate masks"}},
37 {"electronics-delay-file", VariantType::String, "", {"Filename with electronics delay"}}};
38 workflowOptions.insert(workflowOptions.end(), options.begin(), options.end());
39}
40
42
44{
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 WorkflowSpec specs;
62 specs.emplace_back(o2::mid::getRawDecoderSpec(true, feeIdConfig, crateMasks, electronicsDelay, false));
63 specs.emplace_back(o2::mid::getRawDumpSpec());
64 return specs;
65}
MID crate masks.
Delay parameters for MID electronics.
Hardware Id to FeeId mapper.
Data processor spec for MID raw decoder device.
Device to dump decoded raw data.
ConfigParamRegistry & options() const
WorkflowSpec defineDataProcessing(ConfigContext const &cfgc)
void customize(std::vector< ConfigParamSpec > &workflowOptions)
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 getRawDumpSpec()