Project
Loading...
Searching...
No Matches
cluster-writer-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
12#include <string>
13#include <vector>
14#include "Framework/Variant.h"
20
21using namespace o2::framework;
22using namespace o2::cpv;
23
24// we need to add workflow options before including Framework/runDataProcessing
25void customize(std::vector<ConfigParamSpec>& workflowOptions)
26{
27 std::vector<ConfigParamSpec> options{{"disable-mc", VariantType::Bool, false, {"Do not propagate MC labels"}},
28 {"configKeyValues", VariantType::String, "", {"Semicolon separated key=value strings"}}};
29 workflowOptions.insert(workflowOptions.end(), options.begin(), options.end());
30}
31
32void customize(std::vector<o2::framework::CompletionPolicy>& policies)
33{
34 // ordered policies for the writers
35 policies.push_back(CompletionPolicyHelpers::consumeWhenAllOrdered(".*(?:CPV|cpv).*[W,w]riter.*"));
36}
37
39
41{
42 bool useMC = !cfgc.options().get<bool>("disable-mc");
43 o2::conf::ConfigurableParam::updateFromString(cfgc.options().get<std::string>("configKeyValues"));
44 WorkflowSpec specs;
45 specs.emplace_back(o2::cpv::getClusterWriterSpec(useMC));
46 return specs;
47}
Configurable generator for RootTreeWriter processor spec.
static void updateFromString(std::string const &)
ConfigParamRegistry & options() const
WorkflowSpec defineDataProcessing(ConfigContext const &cfgc)
void customize(std::vector< ConfigParamSpec > &workflowOptions)
framework::DataProcessorSpec getClusterWriterSpec(bool useMC)
Defining PrimaryVertex explicitly as messageable.
Definition TFIDInfo.h:20
std::vector< DataProcessorSpec > WorkflowSpec
static CompletionPolicy consumeWhenAllOrdered(const char *name, CompletionPolicy::Matcher matcher)
as consumeWhenAll, but ensures that records are processed with incremental timeSlice (DataHeader::sta...