Project
Loading...
Searching...
No Matches
alice3-global-reconstruction-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
14
18
19#include <stdexcept>
20#include <vector>
21
22using namespace o2::framework;
23
24void customize(std::vector<CallbacksPolicy>& policies)
25{
26 // o2::raw::HBFUtilsInitializer::addNewTimeSliceCallback(policies);
27}
28
29void customize(std::vector<CompletionPolicy>& policies)
30{
31 policies.push_back(CompletionPolicyHelpers::consumeWhenAllOrdered(".*(?:TRK|trk).*[W,w]riter.*"));
32}
33
34void customize(std::vector<ConfigParamSpec>& workflowOptions)
35{
36 std::vector<ConfigParamSpec> options{
37 {"disable-root-output", VariantType::Bool, false, {"do not write output root files"}},
38 {"disable-mc", VariantType::Bool, false, {"disable MC propagation even if available"}},
39 {"tracking-from-hits-config", VariantType::String, "", {"JSON file with tracking from hits configuration"}},
40 {"tracking-from-clusters-config", VariantType::String, "", {"JSON file with tracking from clusters configuration"}},
41 {"configKeyValues", VariantType::String, "", {"Semicolon separated key=value strings"}},
42 {"gpu-device", VariantType::Int, 1, {"use gpu device: CPU=1,CUDA=2,HIP=3 (default: CPU)"}}};
43 std::swap(workflowOptions, options);
44}
45
47#include "Framework/Logger.h"
48
50{
51 auto useMC = !configcontext.options().get<bool>("disable-mc");
52 auto hitRecoConfig = configcontext.options().get<std::string>("tracking-from-hits-config");
53 auto clusterRecoConfig = configcontext.options().get<std::string>("tracking-from-clusters-config");
54 auto gpuDevice = static_cast<o2::gpu::gpudatatypes::DeviceType>(configcontext.options().get<int>("gpu-device"));
55 auto disableRootOutput = configcontext.options().get<bool>("disable-root-output");
56 o2::conf::ConfigurableParam::updateFromString(configcontext.options().get<std::string>("configKeyValues"));
57
58 if (hitRecoConfig.empty() && clusterRecoConfig.empty()) {
59 throw std::invalid_argument("no reconstruction input configured: provide either --tracking-from-hits-config <file> or --tracking-from-clusters-config <file>");
60 }
61
62 o2::conf::ConfigurableParam::writeINI("o2alice3globalrecoflow_configuration.ini");
63
64 return o2::trk::global_reco_workflow::getWorkflow(useMC, hitRecoConfig, clusterRecoConfig, disableRootOutput, gpuDevice);
65}
WorkflowSpec defineDataProcessing(ConfigContext const &configcontext)
This function hooks up the the workflow specifications into the DPL driver.
void customize(std::vector< CallbacksPolicy > &policies)
static void writeINI(std::string const &filename, std::string const &keyOnly="")
static void updateFromString(std::string const &)
ConfigParamRegistry & options() const
Defining ITS Vertex explicitly as messageable.
Definition Cartesian.h:288
std::vector< DataProcessorSpec > WorkflowSpec
o2::framework::WorkflowSpec getWorkflow(bool useMC, const std::string &hitRecoConfig, const std::string &clusterRecoConfig, bool disableRootOutput=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...