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 {"tracking-from-hits-config", VariantType::String, "", {"JSON file with tracking from hits configuration"}},
56 {"disable-tracking", VariantType::Bool, false, {"disable tracking step"}},
57 {"configKeyValues", VariantType::String, "", {"Semicolon separated key=value strings"}},
58 {"use-gpu-workflow", VariantType::Bool, false, {"use GPU workflow (default: false)"}},
59 {"gpu-device", VariantType::Int, 1, {"use gpu device: CPU=1,CUDA=2,HIP=3 (default: CPU)"}}};
60 std::swap(workflowOptions, options);
61}
62
64#include "Framework/Logger.h"
65
67{
68 // Update the (declared) parameters if changed from the command line
69 auto useMC = !configcontext.options().get<bool>("disable-mc");
70 auto hitRecoConfig = configcontext.options().get<std::string>("tracking-from-hits-config");
71 auto useGpuWF = configcontext.options().get<bool>("use-gpu-workflow");
72 auto gpuDevice = static_cast<o2::gpu::gpudatatypes::DeviceType>(configcontext.options().get<int>("gpu-device"));
73 auto extDigits = configcontext.options().get<bool>("digits-from-upstream");
74 auto extClusters = configcontext.options().get<bool>("clusters-from-upstream");
75 auto disableRootOutput = configcontext.options().get<bool>("disable-root-output");
76 o2::conf::ConfigurableParam::updateFromString(configcontext.options().get<std::string>("configKeyValues"));
77
78 // write the configuration used for the reco workflow
79 o2::conf::ConfigurableParam::writeINI("o2itsrecoflow_configuration.ini");
80
81 return o2::trk::reco_workflow::getWorkflow(useMC, hitRecoConfig, extDigits, extClusters, disableRootOutput, useGpuWF, gpuDevice);
82}
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.
std::vector< DataProcessorSpec > WorkflowSpec
o2::framework::WorkflowSpec getWorkflow(bool useMC, const std::string &hitRecoConfig, 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)