Project
Loading...
Searching...
No Matches
trk-reco-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// Copyright 2019-2020 CERN and copyright holders of ALICE O2.
13// See https://alice-o2.web.cern.ch/copyright for details of the copyright holders.
14// All rights not expressly granted are reserved.
15//
16// This software is distributed under the terms of the GNU General Public
17// License v3 (GPL Version 3), copied verbatim in the file "COPYING".
18//
19// In applying this license CERN does not waive the privileges and immunities
20// granted to it by virtue of its status as an Intergovernmental Organization
21// or submit itself to any jurisdiction.
22
27
31
32#include <vector>
33
34using namespace o2::framework;
35
36void customize(std::vector<CallbacksPolicy>& policies)
37{
38 // o2::raw::HBFUtilsInitializer::addNewTimeSliceCallback(policies);
39}
40
41void customize(std::vector<CompletionPolicy>& policies)
42{
43 // ordered policies for the writers
44 policies.push_back(CompletionPolicyHelpers::consumeWhenAllOrdered(".*(?:TRK|trk).*[W,w]riter.*"));
45}
46
47void customize(std::vector<ConfigParamSpec>& workflowOptions)
48{
49 // option allowing to set parameters
50 std::vector<ConfigParamSpec> options{
51 {"digits-from-upstream", VariantType::Bool, false, {"digits will be provided from upstream, skip digits reader"}},
52 {"clusters-from-upstream", VariantType::Bool, false, {"clusters will be provided from upstream, skip clusterizer"}},
53 {"disable-root-output", VariantType::Bool, false, {"do not write output root files"}},
54 {"disable-mc", VariantType::Bool, false, {"disable MC propagation even if available"}},
55 {"disable-tracking", VariantType::Bool, false, {"disable tracking step"}},
56 {"configKeyValues", VariantType::String, "", {"Semicolon separated key=value strings"}},
57 {"use-gpu-workflow", VariantType::Bool, false, {"use GPU workflow (default: false)"}},
58 {"gpu-device", VariantType::Int, 1, {"use gpu device: CPU=1,CUDA=2,HIP=3 (default: CPU)"}}};
59 std::swap(workflowOptions, options);
60}
61
63#include "Framework/Logger.h"
64
66{
67 // Update the (declared) parameters if changed from the command line
68 auto useMC = !configcontext.options().get<bool>("disable-mc");
69 auto useGpuWF = configcontext.options().get<bool>("use-gpu-workflow");
70 auto gpuDevice = static_cast<o2::gpu::GPUDataTypes::DeviceType>(configcontext.options().get<int>("gpu-device"));
71 auto extDigits = configcontext.options().get<bool>("digits-from-upstream");
72 auto extClusters = configcontext.options().get<bool>("clusters-from-upstream");
73 auto disableRootOutput = configcontext.options().get<bool>("disable-root-output");
74 o2::conf::ConfigurableParam::updateFromString(configcontext.options().get<std::string>("configKeyValues"));
75
76 // write the configuration used for the reco workflow
77 o2::conf::ConfigurableParam::writeINI("o2itsrecoflow_configuration.ini");
78
79 return o2::trk::reco_workflow::getWorkflow(useMC, extDigits, extClusters, disableRootOutput, useGpuWF, gpuDevice);
80}
static void writeINI(std::string const &filename, std::string const &keyOnly="")
static void updateFromString(std::string const &)
ConfigParamRegistry & options() const
Defining PrimaryVertex explicitly as messageable.
Definition TFIDInfo.h:20
std::vector< DataProcessorSpec > WorkflowSpec
o2::framework::WorkflowSpec getWorkflow(bool useMC, bool upstreamDigits=false, bool upstreamClusters=false, bool disableRootOutput=false, bool useGPUWF=false, o2::gpu::GPUDataTypes::DeviceType dType=o2::gpu::GPUDataTypes::DeviceType::CPU)
static CompletionPolicy consumeWhenAllOrdered(const char *name, CompletionPolicy::Matcher matcher)
as consumeWhenAll, but ensures that records are processed with incremental timeSlice (DataHeader::sta...
WorkflowSpec defineDataProcessing(ConfigContext const &configcontext)
This function hooks up the the workflow specifications into the DPL driver.
void customize(std::vector< CallbacksPolicy > &policies)