Project
Loading...
Searching...
No Matches
its3-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
20
21#include "GPUO2Interface.h"
22#include "GPUReconstruction.h"
23#include "GPUChainITS.h"
24
25using namespace o2::framework;
26
27void customize(std::vector<o2::framework::CallbacksPolicy>& policies)
28{
30}
31
32void customize(std::vector<o2::framework::CompletionPolicy>& policies)
33{
34 // ordered policies for the writers
35 policies.push_back(CompletionPolicyHelpers::consumeWhenAllOrdered(".*(?:ITS|its)3.*[W,w]riter.*"));
36}
37
38// we need to add workflow options before including Framework/runDataProcessing
39void customize(std::vector<o2::framework::ConfigParamSpec>& workflowOptions)
40{
41 // option allowing to set parameters
42 std::vector<o2::framework::ConfigParamSpec> options{
43 {"digits-from-upstream", o2::framework::VariantType::Bool, false, {"digits will be provided from upstream, skip digits reader"}},
44 {"clusters-from-upstream", o2::framework::VariantType::Bool, false, {"clusters will be provided from upstream, skip clusterizer"}},
45 {"disable-root-output", o2::framework::VariantType::Bool, false, {"do not write output root files"}},
46 {"disable-mc", o2::framework::VariantType::Bool, false, {"disable MC propagation even if available"}},
47 {"ccdb-meanvertex-seed", o2::framework::VariantType::Bool, false, {"use MeanVertex from CCDB if available to provide beam position seed (default: false)"}},
48 {"select-with-triggers", o2::framework::VariantType::String, "none", {"use triggers to prescale processed ROFs: phys, trd, none"}},
49 {"tracking-mode", o2::framework::VariantType::String, "off", {"off,sync,async,cosmics"}},
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 IT3 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)"}}};
56 std::swap(workflowOptions, options);
57}
58
60
62{
63 // Update the (declared) parameters if changed from the command line
64 auto useMC = !configcontext.options().get<bool>("disable-mc");
65 auto beamPosOVerride = configcontext.options().get<bool>("ccdb-meanvertex-seed");
66 auto trmode = configcontext.options().get<std::string>("tracking-mode");
67 auto selTrig = configcontext.options().get<std::string>("select-with-triggers");
68 auto gpuDevice = static_cast<o2::gpu::gpudatatypes::DeviceType>(configcontext.options().get<int>("gpu-device"));
69 auto extDigits = configcontext.options().get<bool>("digits-from-upstream");
70 auto extClusters = configcontext.options().get<bool>("clusters-from-upstream");
71 auto disableRootOutput = configcontext.options().get<bool>("disable-root-output");
72 auto useGeom = configcontext.options().get<bool>("use-full-geometry");
73 auto useGPUWfx = configcontext.options().get<bool>("use-gpu-workflow");
75
76 o2::conf::ConfigurableParam::updateFromString(configcontext.options().get<std::string>("configKeyValues"));
77 int trType = 0;
78 if (!selTrig.empty() && selTrig != "none") {
79 if (selTrig == "phys") {
80 trType = 1;
81 } else if (selTrig == "trd") {
82 trType = 2;
83 } else {
84 LOG(fatal) << "Unknown trigger type requested for events prescaling: " << selTrig;
85 }
86 }
87 auto wf = o2::its3::reco_workflow::getWorkflow(useMC, doStag, o2::its::TrackingMode::fromString(trmode), gpuDevice, useGPUWfx, extDigits, extClusters, disableRootOutput, useGeom, trType, beamPosOVerride);
88
89 // configure dpl timer to inject correct firstTForbit: start from the 1st orbit of TF containing 1st sampled orbit
90 o2::raw::HBFUtilsInitializer hbfIni(configcontext, wf);
91
92 // write the configuration used for the reco workflow
93 o2::conf::ConfigurableParam::writeINI("o2its3recoflow_configuration.ini");
94
95 return wf;
96}
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)
This function hooks up the the workflow specifications into the DPL driver.
void customize(std::vector< o2::framework::CallbacksPolicy > &policies)
Defining ITS Vertex explicitly as messageable.
Definition Cartesian.h:288
std::vector< DataProcessorSpec > WorkflowSpec
framework::WorkflowSpec getWorkflow(bool useMC, bool doStag, its::TrackingMode::Type trmode, o2::gpu::gpudatatypes::DeviceType dtype, bool useGPUWorkflow, bool upstreamDigits, bool upstreamClusters, bool disableRootOutput, bool useGeom, int useTrig, bool overrideBeamPosition)
Type fromString(std::string_view str)
static CompletionPolicy consumeWhenAllOrdered(const char *name, CompletionPolicy::Matcher matcher)
as consumeWhenAll, but ensures that records are processed with incremental timeSlice (DataHeader::sta...
static bool isITSStaggeringEnabled(o2::framework::ConfigContext const &cfgc)
static void addITSConfigOption(std::vector< o2::framework::ConfigParamSpec > &opts)
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"