Project
Loading...
Searching...
No Matches
trk-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
14
18
19#include <stdexcept>
20#include <vector>
21
22using namespace o2::framework;
23
24void customize(std::vector<CallbacksPolicy>& policies)
25{
26 // o2::raw::HBFUtilsInitializer::addNewTimeSliceCallback(policies);
27}
28
29void customize(std::vector<CompletionPolicy>& policies)
30{
31 // ordered policies for the writers
32 policies.push_back(CompletionPolicyHelpers::consumeWhenAllOrdered(".*(?:TRK|trk|FT3|ft3).*[W,w]riter.*"));
33}
34
35void customize(std::vector<ConfigParamSpec>& workflowOptions)
36{
37 // option allowing to set parameters
38 std::vector<ConfigParamSpec> options{
39 {"digits-from-upstream", VariantType::Bool, false, {"digits will be provided from upstream, skip digits reader"}},
40 {"clusters-from-upstream", VariantType::Bool, false, {"clusters will be provided from upstream, skip clusterizer"}},
41 {"disable-root-output", VariantType::Bool, false, {"do not write output root files"}},
42 {"disable-mc", VariantType::Bool, false, {"disable MC propagation even if available"}},
43 {"detectors", VariantType::String, "TRK", {"comma-separated list of the detectors to process: TRK, FT3"}},
44 {"configKeyValues", VariantType::String, "", {"Semicolon separated key=value strings"}}};
45 std::swap(workflowOptions, options);
46}
47
49#include "Framework/Logger.h"
50
52{
53 // Update the (declared) parameters if changed from the command line
54 auto useMC = !configcontext.options().get<bool>("disable-mc");
55 auto extDigits = configcontext.options().get<bool>("digits-from-upstream");
56 auto extClusters = configcontext.options().get<bool>("clusters-from-upstream");
57 auto disableRootOutput = configcontext.options().get<bool>("disable-root-output");
58 const auto detectors = o2::detectors::DetID::getMask(configcontext.options().get<std::string>("detectors"));
59 if ((detectors & ~(o2::detectors::DetID::getMask(o2::detectors::DetID::TRK) | o2::detectors::DetID::getMask(o2::detectors::DetID::FT3))).any() || detectors.none()) {
60 throw std::invalid_argument("--detectors takes TRK and/or FT3");
61 }
62 o2::conf::ConfigurableParam::updateFromString(configcontext.options().get<std::string>("configKeyValues"));
63
64 // write the configuration used for the reco workflow
65 o2::conf::ConfigurableParam::writeINI("o2itsrecoflow_configuration.ini");
66
67 return o2::trk::reco_workflow::getWorkflow(useMC, extDigits, extClusters, disableRootOutput, detectors);
68}
static void writeINI(std::string const &filename, std::string const &keyOnly="")
static void updateFromString(std::string const &)
static mask_t getMask(const std::string_view detList)
detector masks from any non-alpha-num delimiter-separated list (empty if NONE is supplied)
Definition DetID.cxx:42
ConfigParamRegistry & options() const
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, o2::detectors::DetID::mask_t detectors=o2::detectors::DetID::getMask(o2::detectors::DetID::TRK))
The digit readers, clusterers and cluster writers of detectors, TRK and/or FT3.
static CompletionPolicy consumeWhenAllOrdered(const char *name, CompletionPolicy::Matcher matcher)
as consumeWhenAll, but ensures that records are processed with incremental timeSlice (DataHeader::sta...
WorkflowSpec defineDataProcessing(ConfigContext const &configcontext)
This function hooks up the the workflow specifications into the DPL driver.
void customize(std::vector< CallbacksPolicy > &policies)