Project
Loading...
Searching...
No Matches
tracks-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 <vector>
16
17using namespace o2::framework;
18
19void customize(std::vector<o2::framework::CompletionPolicy>& policies)
20{
21 // ordered policies for the writers
22 policies.push_back(CompletionPolicyHelpers::consumeWhenAllOrdered(".*(?:MCH|mch).*[W,w]riter.*"));
23}
24
25// we need to add workflow options before including Framework/runDataProcessing
26void customize(std::vector<ConfigParamSpec>& workflowOptions)
27{
28 workflowOptions.emplace_back("enable-mc", VariantType::Bool, false, ConfigParamSpec::HelpString{"Propagate MC info"});
29 workflowOptions.emplace_back("digits", VariantType::Bool, false, ConfigParamSpec::HelpString{"Write associated digits"});
30}
31
33
35{
36 bool useMC = config.options().get<bool>("enable-mc");
37 bool digits = config.options().get<bool>("digits");
38 return WorkflowSpec{o2::mch::getTrackWriterSpec(useMC, "mch-track-writer", "mchtracks.root", digits)};
39}
WorkflowSpec defineDataProcessing(const ConfigContext &config)
void customize(std::vector< o2::framework::CompletionPolicy > &policies)
ConfigParamRegistry & options() const
Defining PrimaryVertex explicitly as messageable.
Definition TFIDInfo.h:20
std::vector< DataProcessorSpec > WorkflowSpec
o2::framework::DataProcessorSpec getTrackWriterSpec(bool useMC, const char *specName="mch-track-writer", const char *fileName="mchtracks.root", bool digits=false)
static CompletionPolicy consumeWhenAllOrdered(const char *name, CompletionPolicy::Matcher matcher)
as consumeWhenAll, but ensures that records are processed with incremental timeSlice (DataHeader::sta...
std::vector< Digit > digits