Project
Loading...
Searching...
No Matches
iotof-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
25
29
30#include <vector>
31
32using namespace o2::framework;
33
34void customize(std::vector<CallbacksPolicy>& policies)
35{
36 // o2::raw::HBFUtilsInitializer::addNewTimeSliceCallback(policies);
37}
38
39void customize(std::vector<CompletionPolicy>& policies)
40{
41 // ordered policies for the writers
42 policies.push_back(CompletionPolicyHelpers::consumeWhenAllOrdered(".*(?:TF3|iotof).*[W,w]riter.*"));
43}
44
45void customize(std::vector<ConfigParamSpec>& workflowOptions)
46{
47 // option allowing to set parameters
48 std::vector<ConfigParamSpec> options{
49 {"digits-from-upstream", VariantType::Bool, false, {"digits will be provided from upstream, skip digits reader"}},
50 {"clusters-from-upstream", VariantType::Bool, false, {"clusters will be provided from upstream, skip clusterizer"}},
51 {"disable-root-output", VariantType::Bool, false, {"do not write output root files"}},
52 {"disable-mc", VariantType::Bool, false, {"disable MC propagation even if available"}},
53 // {"tracking-from-hits-config", VariantType::String, "", {"JSON file with tracking from hits configuration"}},
54 // {"disable-tracking", VariantType::Bool, false, {"disable tracking step"}},
55 {"configKeyValues", VariantType::String, "", {"Semicolon separated key=value strings"}} //,
56 // {"use-gpu-workflow", VariantType::Bool, false, {"use GPU workflow (default: false)"}},
57 // {"gpu-device", VariantType::Int, 1, {"use gpu device: CPU=1,CUDA=2,HIP=3 (default: CPU)"}}
58 };
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 hitRecoConfig = configcontext.options().get<std::string>("tracking-from-hits-config");
70 // auto useGpuWF = configcontext.options().get<bool>("use-gpu-workflow");
71 // auto gpuDevice = static_cast<o2::gpu::gpudatatypes::DeviceType>(configcontext.options().get<int>("gpu-device"));
72 auto extDigits = configcontext.options().get<bool>("digits-from-upstream");
73 auto extClusters = configcontext.options().get<bool>("clusters-from-upstream");
74 auto disableRootOutput = configcontext.options().get<bool>("disable-root-output");
75 o2::conf::ConfigurableParam::updateFromString(configcontext.options().get<std::string>("configKeyValues"));
76
77 // write the configuration used for the reco workflow
78 o2::conf::ConfigurableParam::writeINI("o2tf3recoflow_configuration.ini");
79
80 return o2::iotof::reco_workflow::getWorkflow(useMC, /*hitRecoConfig,*/ extDigits, extClusters, disableRootOutput /*, useGpuWF, gpuDevice*/);
81}
static void writeINI(std::string const &filename, std::string const &keyOnly="")
static void updateFromString(std::string const &)
ConfigParamRegistry & options() const
o2::framework::WorkflowSpec defineDataProcessing(o2::framework::ConfigContext const &configcontext)
This function hooks up the the workflow specifications into the DPL driver.
void customize(std::vector< CallbacksPolicy > &policies)
Defining ITS Vertex explicitly as messageable.
Definition Cartesian.h:288
std::vector< DataProcessorSpec > WorkflowSpec
o2::framework::WorkflowSpec getWorkflow(bool useMC, bool upstreamDigits=false, bool upstreamClusters=false, bool disableRootOutput=false)
static CompletionPolicy consumeWhenAllOrdered(const char *name, CompletionPolicy::Matcher matcher)
as consumeWhenAll, but ensures that records are processed with incremental timeSlice (DataHeader::sta...