Project
All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Modules Pages Concepts
tof-compressed-inspector.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
20#include <fairlogger/Logger.h>
21
22using namespace o2::framework;
23
24// add workflow options, note that customization needs to be declared before
25// including Framework/runDataProcessing
26void customize(std::vector<ConfigParamSpec>& workflowOptions)
27{
28 auto inputDesc = ConfigParamSpec{"tof-compressed-inspector-input-desc", VariantType::String, "CRAWDATA", {"Input specs description string"}};
29 auto rdhVersion = ConfigParamSpec{"tof-compressed-inspector-rdh-version", VariantType::Int, 7, {"Raw Data Header version"}};
30 workflowOptions.push_back(inputDesc);
31 workflowOptions.push_back(rdhVersion);
32}
33
34#include "Framework/runDataProcessing.h" // the main driver
35
38{
39 auto inputDesc = cfgc.options().get<std::string>("tof-compressed-inspector-input-desc");
40 auto rdhVersion = cfgc.options().get<int>("tof-compressed-inspector-rdh-version");
41
42 AlgorithmSpec algoSpec;
43 if (rdhVersion == 4) {
44 algoSpec = AlgorithmSpec{adaptFromTask<o2::tof::CompressedInspectorTask<o2::header::RAWDataHeaderV4>>()};
45 } else if (rdhVersion == 6) {
46 algoSpec = AlgorithmSpec{adaptFromTask<o2::tof::CompressedInspectorTask<o2::header::RAWDataHeaderV6>>()};
47 } else if (rdhVersion == 7) {
48 algoSpec = AlgorithmSpec{adaptFromTask<o2::tof::CompressedInspectorTask<o2::header::RAWDataHeaderV7>>()};
49 }
50
51 WorkflowSpec workflow;
52 workflow.emplace_back(DataProcessorSpec{
53 "tof-compressed-inspector",
54 select(std::string("x:TOF/" + inputDesc).c_str()),
55 Outputs{},
56 algoSpec,
57 Options{
58 {"tof-compressed-inspector-filename", VariantType::String, "inspector.root", {"Name of the inspector output file"}},
59 {"tof-compressed-inspector-decoder-verbose", VariantType::Bool, false, {"Decode in verbose mode"}}}});
60
61 return workflow;
62}
TOF compressed data inspector task.
ConfigParamRegistry & options() const
Defining PrimaryVertex explicitly as messageable.
Definition TFIDInfo.h:20
std::vector< DataProcessorSpec > WorkflowSpec
std::vector< InputSpec > select(char const *matcher="")
std::vector< OutputSpec > Outputs
WorkflowSpec defineDataProcessing(ConfigContext const &cfgc)
This function hooks up the the workflow specifications into the DPL driver.
void customize(std::vector< ConfigParamSpec > &workflowOptions)