Project
Loading...
Searching...
No Matches
mft-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
17
18using namespace o2::framework;
19
20void customize(std::vector<o2::framework::CallbacksPolicy>& policies)
21{
23}
24
25void customize(std::vector<o2::framework::CompletionPolicy>& policies)
26{
27 // ordered policies for the writers
28 policies.push_back(CompletionPolicyHelpers::consumeWhenAllOrdered(".*(?:MFT|mft).*[W,w]riter.*"));
29}
30
31// we need to add workflow options before including Framework/runDataProcessing
32void customize(std::vector<o2::framework::ConfigParamSpec>& workflowOptions)
33{
34 // option allowing to set parameters
35 std::vector<o2::framework::ConfigParamSpec> options{
36 {"digits-from-upstream", o2::framework::VariantType::Bool, false, {"digits will be provided from upstream, skip digits reader"}},
37 {"clusters-from-upstream", o2::framework::VariantType::Bool, false, {"clusters will be provided from upstream, skip clusterizer"}},
38 {"disable-root-output", o2::framework::VariantType::Bool, false, {"do not write output root files"}},
39 {"disable-mc", o2::framework::VariantType::Bool, false, {"disable MC propagation even if available"}},
40 {"disable-tracking", o2::framework::VariantType::Bool, false, {"disable tracking step"}},
41 {"run-assessment", o2::framework::VariantType::Bool, false, {"run MFT assessment workflow"}},
42 {"disable-process-gen", o2::framework::VariantType::Bool, false, {"disable processing of all generated tracks (depends on --run-assessment)"}},
43 {"configKeyValues", VariantType::String, "", {"Semicolon separated key=value strings"}},
44 {"nThreads", VariantType::Int, 1, {"Number of threads"}},
45 {"use-full-geometry", o2::framework::VariantType::Bool, false, {"use full geometry instead of the light-weight MFT part"}},
46 {"run-tracks2records", o2::framework::VariantType::Bool, false, {"run MFT alignment tracks to records workflow"}}};
48 std::swap(workflowOptions, options);
49}
50
52
54{
55 // Update the (declared) parameters if changed from the command line
56 o2::conf::ConfigurableParam::updateFromString(configcontext.options().get<std::string>("configKeyValues"));
57 // write the configuration
58 o2::conf::ConfigurableParam::writeINI("o2mftrecoflow_configuration.ini");
59
60 auto useMC = !configcontext.options().get<bool>("disable-mc");
61 auto extDigits = configcontext.options().get<bool>("digits-from-upstream");
62 auto extClusters = configcontext.options().get<bool>("clusters-from-upstream");
63 auto disableRootOutput = configcontext.options().get<bool>("disable-root-output");
64 auto runAssessment = configcontext.options().get<bool>("run-assessment");
65 auto processGen = !configcontext.options().get<bool>("disable-process-gen");
66 auto runTracking = !configcontext.options().get<bool>("disable-tracking");
67 auto nThreads = configcontext.options().get<int>("nThreads");
68 auto runTracks2Records = configcontext.options().get<bool>("run-tracks2records");
69 auto useGeom = configcontext.options().get<bool>("use-full-geometry");
70
72 useMC,
73 useGeom,
74 extDigits,
75 extClusters,
76 disableRootOutput,
77 runAssessment,
78 processGen,
79 runTracking,
80 nThreads,
81 runTracks2Records);
82
83 // configure dpl timer to inject correct firstTForbit: start from the 1st orbit of TF containing 1st sampled orbit
84 o2::raw::HBFUtilsInitializer hbfIni(configcontext, wf);
85
86 return std::move(wf);
87}
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
framework::WorkflowSpec getWorkflow(bool useMC, bool useGeom, bool upstreamDigits, bool upstreamClusters, bool disableRootOutput, bool runAssessment, bool processGen, bool runTracking, int nThreads, bool runTracks2Records)
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))