Project
Loading...
Searching...
No Matches
o2-zdc-raw2digits.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
15
16using namespace o2::framework;
17
18// ------------------------------------------------------------------
19// we need to add workflow options before including Framework/runDataProcessing
20void customize(std::vector<ConfigParamSpec>& workflowOptions)
21{
22 // option allowing to set parameters
23 std::vector<ConfigParamSpec> options{
24 {"use-process", VariantType::Bool, false, {"enable processor for data taking/dumping"}},
25 {"dump-blocks-process", VariantType::Bool, false, {"enable dumping of event blocks at processor side"}},
26 {"dump-blocks-reader", VariantType::Bool, false, {"enable dumping of event blocks at reader side"}},
27 {"disable-root-output", VariantType::Bool, false, {"disable root-files output writers"}},
28 {"ignore-dist-stf", VariantType::Bool, false, {"do not subscribe to FLP/DISTSUBTIMEFRAME/0 message (no lost TF recovery)"}},
29 {"configKeyValues", VariantType::String, "", {"Semicolon separated key=value strings ..."}}};
30 std::swap(workflowOptions, options);
31}
32
33void customize(std::vector<o2::framework::CompletionPolicy>& policies)
34{
35 // ordered policies for the writers
36 policies.push_back(CompletionPolicyHelpers::consumeWhenAllOrdered(".*(?:ZDC|zdc).*[W,w]riter.*"));
37}
38
39// ------------------------------------------------------------------
43#include "ZDCRaw/RawReaderZDC.h"
44
46{
47 auto useProcessor = configcontext.options().get<bool>("use-process");
48 auto dumpProcessor = configcontext.options().get<bool>("dump-blocks-process");
49 auto dumpReader = configcontext.options().get<bool>("dump-blocks-reader");
50 auto disableRootOut = configcontext.options().get<bool>("disable-root-output");
51 auto askSTFDist = true;
52 auto notaskSTFDist = configcontext.options().get<bool>("ignore-dist-stf");
53 if (notaskSTFDist) {
54 LOG(info) << "Not subscribing to FLP/DISTSUBTIMEFRAME/0 message (no lost TF recovery)";
55 askSTFDist = false;
56 }
57
58 o2::conf::ConfigurableParam::updateFromString(configcontext.options().get<std::string>("configKeyValues"));
59 WorkflowSpec specs;
60 specs.emplace_back(o2::zdc::getZDCDataReaderDPLSpec(o2::zdc::RawReaderZDC{dumpReader}, askSTFDist));
61 // if (useProcess) {
62 // specs.emplace_back(o2::zdc::getZDCDataProcessDPLSpec(dumpProcessor));
63 // }
64 if (!disableRootOut) {
65 specs.emplace_back(o2::zdc::getZDCDigitWriterDPLSpec(false, false));
66 }
67 return std::move(specs);
68}
static void updateFromString(std::string const &)
ConfigParamRegistry & options() const
Defining PrimaryVertex explicitly as messageable.
Definition TFIDInfo.h:20
std::vector< DataProcessorSpec > WorkflowSpec
framework::DataProcessorSpec getZDCDigitWriterDPLSpec(bool mctruth, bool simVersion)
create a processor spec
framework::DataProcessorSpec getZDCDataReaderDPLSpec(const RawReaderZDC &rawReader, const bool askSTFDist)
WorkflowSpec defineDataProcessing(ConfigContext const &configcontext)
This function hooks up the the workflow specifications into the DPL driver.
void customize(std::vector< ConfigParamSpec > &workflowOptions)
static CompletionPolicy consumeWhenAllOrdered(const char *name, CompletionPolicy::Matcher matcher)
as consumeWhenAll, but ensures that records are processed with incremental timeSlice (DataHeader::sta...
LOG(info)<< "Compressed in "<< sw.CpuTime()<< " s"