Project
Loading...
Searching...
No Matches
its-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
19
20#include <vector>
21
22using namespace o2::framework;
23
24void customize(std::vector<o2::framework::CallbacksPolicy>& policies)
25{
27}
28
29void customize(std::vector<o2::framework::CompletionPolicy>& policies)
30{
31 // ordered policies for the writers
32 policies.push_back(CompletionPolicyHelpers::consumeWhenAllOrdered(".*(?:ITS|its).*[W,w]riter.*"));
33 policies.push_back(CompletionPolicyHelpers::consumeWhenAllOrdered(".*irframe-writer.*"));
34}
35
36void customize(std::vector<o2::framework::ConfigParamSpec>& workflowOptions)
37{
38 // option allowing to set parameters
39 std::vector<o2::framework::ConfigParamSpec> options{
40 {"digits-from-upstream", o2::framework::VariantType::Bool, false, {"digits will be provided from upstream, skip digits reader"}},
41 {"clusters-from-upstream", o2::framework::VariantType::Bool, false, {"clusters will be provided from upstream, skip clusterizer"}},
42 {"disable-root-output", o2::framework::VariantType::Bool, false, {"do not write output root files"}},
43 {"disable-mc", o2::framework::VariantType::Bool, false, {"disable MC propagation even if available"}},
44 {"trackerCA", o2::framework::VariantType::Bool, false, {"use trackerCA (deprecated)"}}, // keep this around to not break scripts
45 {"trackerCM", o2::framework::VariantType::Bool, false, {"use trackerCM (default: trackerCA)"}},
46 {"ccdb-meanvertex-seed", o2::framework::VariantType::Bool, false, {"use MeanVertex from CCDB if available to provide beam position seed (default: false)"}},
47 {"select-with-triggers", o2::framework::VariantType::String, "none", {"use triggers to prescale processed ROFs: phys, trd, none"}},
48 {"tracking-mode", o2::framework::VariantType::String, "sync", {"sync,async,cosmics,unset,off"}},
49 {"disable-tracking", o2::framework::VariantType::Bool, false, {"disable tracking step"}},
50 {"configKeyValues", VariantType::String, "", {"Semicolon separated key=value strings"}},
51 {"use-full-geometry", o2::framework::VariantType::Bool, false, {"use full geometry instead of the light-weight ITS part"}},
52 {"use-gpu-workflow", o2::framework::VariantType::Bool, false, {"use GPU workflow (default: false)"}},
53 {"gpu-device", o2::framework::VariantType::Int, 1, {"use gpu device: CPU=1,CUDA=2,HIP=3 (default: CPU)"}}};
55 std::swap(workflowOptions, options);
56}
57
58// ------------------------------------------------------------------
59
61#include "Framework/Logger.h"
62
64{
65 // Update the (declared) parameters if changed from the command line
66 auto useMC = !configcontext.options().get<bool>("disable-mc");
67 auto beamPosOVerride = configcontext.options().get<bool>("ccdb-meanvertex-seed");
68 auto useCMtracker = configcontext.options().get<bool>("trackerCM");
69 auto trmode = configcontext.options().get<std::string>("tracking-mode");
70 auto selTrig = configcontext.options().get<std::string>("select-with-triggers");
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 auto useGeom = configcontext.options().get<bool>("use-full-geometry");
77 if (configcontext.options().get<bool>("disable-tracking")) {
78 trmode = "off";
79 }
80
81 o2::conf::ConfigurableParam::updateFromString(configcontext.options().get<std::string>("configKeyValues"));
82 int trType = 0;
83 if (!selTrig.empty() && selTrig != "none") {
84 if (selTrig == "phys") {
85 trType = 1;
86 } else if (selTrig == "trd") {
87 trType = 2;
88 } else {
89 LOG(fatal) << "Unknown trigger type requested for events prescaling: " << selTrig;
90 }
91 }
93 useCMtracker,
95 beamPosOVerride,
96 extDigits,
97 extClusters,
98 disableRootOutput,
99 useGeom,
100 trType,
101 useGpuWF,
102 gpuDevice);
103
104 // configure dpl timer to inject correct firstTForbit: start from the 1st orbit of TF containing 1st sampled orbit
105 o2::raw::HBFUtilsInitializer hbfIni(configcontext, wf);
106
107 // write the configuration used for the reco workflow
108 o2::conf::ConfigurableParam::writeINI("o2itsrecoflow_configuration.ini");
109
110 return std::move(wf);
111}
static void writeINI(std::string const &filename, std::string const &keyOnly="")
static void updateFromString(std::string const &)
ConfigParamRegistry & options() const
WorkflowSpec defineDataProcessing(ConfigContext const &configcontext)
void customize(std::vector< o2::framework::CallbacksPolicy > &policies)
Defining PrimaryVertex explicitly as messageable.
Definition TFIDInfo.h:20
std::vector< DataProcessorSpec > WorkflowSpec
Type fromString(std::string_view str)
framework::WorkflowSpec getWorkflow(bool useMC, bool useCMtracker, TrackingMode::Type trmode, const bool overrideBeamPosition=false, bool upstreamDigits=false, bool upstreamClusters=false, bool disableRootOutput=false, bool useGeom=false, int useTrig=0, 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...
static void addNewTimeSliceCallback(std::vector< o2::framework::CallbacksPolicy > &policies)
static void addConfigOption(std::vector< o2::framework::ConfigParamSpec > &opts, const std::string &defOpt=std::string(o2::base::NameConf::DIGITIZATIONCONFIGFILE))
LOG(info)<< "Compressed in "<< sw.CpuTime()<< " s"