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// #include "ITStracking/TrackingConfigParam.h"
26// #include "ITStracking/Configuration.h"
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(".*(?:TF3|iotof).*[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 };
61 std::swap(workflowOptions, options);
62}
63
65#include "Framework/Logger.h"
66
68{
69 // Update the (declared) parameters if changed from the command line
70 auto useMC = !configcontext.options().get<bool>("disable-mc");
71 // auto hitRecoConfig = configcontext.options().get<std::string>("tracking-from-hits-config");
72 // auto useGpuWF = configcontext.options().get<bool>("use-gpu-workflow");
73 // auto gpuDevice = static_cast<o2::gpu::gpudatatypes::DeviceType>(configcontext.options().get<int>("gpu-device"));
74 auto extDigits = configcontext.options().get<bool>("digits-from-upstream");
75 auto extClusters = configcontext.options().get<bool>("clusters-from-upstream");
76 auto disableRootOutput = configcontext.options().get<bool>("disable-root-output");
77 o2::conf::ConfigurableParam::updateFromString(configcontext.options().get<std::string>("configKeyValues"));
78
79 // write the configuration used for the reco workflow
80 o2::conf::ConfigurableParam::writeINI("o2itsrecoflow_configuration.ini");
81
82 return o2::iotof::reco_workflow::getWorkflow(useMC, /*hitRecoConfig,*/ extDigits, extClusters, disableRootOutput /*, useGpuWF, gpuDevice*/);
83}
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...