Project
Loading...
Searching...
No Matches
globalfwd-matcher-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
25
26using namespace o2::framework;
28// ------------------------------------------------------------------
29void customize(std::vector<o2::framework::CallbacksPolicy>& policies)
30{
32}
33
34void customize(std::vector<o2::framework::CompletionPolicy>& policies)
35{
36 // ordered policies for the writers
37 policies.push_back(CompletionPolicyHelpers::consumeWhenAllOrdered(".*(?:FWD|fwd).*[W,w]riter.*"));
38}
39
40// we need to add workflow options before including Framework/runDataProcessing
41void customize(std::vector<o2::framework::ConfigParamSpec>& workflowOptions)
42{
43 // option allowing to set parameters
44 std::vector<o2::framework::ConfigParamSpec> options{
45 {"disable-mc", o2::framework::VariantType::Bool, false, {"disable MC propagation even if available"}},
46 {"disable-root-input", o2::framework::VariantType::Bool, false, {"disable root-files input reader"}},
47 {"disable-root-output", o2::framework::VariantType::Bool, false, {"do not write output root files"}},
48 {"enable-match-output", o2::framework::VariantType::Bool, false, {"stores mftmch matching info on mftmchmatches.root"}},
49 {"configKeyValues", VariantType::String, "", {"Semicolon separated key=value strings ..."}}};
52 std::swap(workflowOptions, options);
53}
54
55// ------------------------------------------------------------------
56
58
60{
61 // Update the (declared) parameters if changed from the command line
62 o2::conf::ConfigurableParam::updateFromString(configcontext.options().get<std::string>("configKeyValues"));
63 // write the configuration used for the workflow
64 o2::conf::ConfigurableParam::writeINI("o2matchmftmch-workflow_configuration.ini");
65
66 auto useMC = !configcontext.options().get<bool>("disable-mc");
67
68 bool disableRootOutput = configcontext.options().get<bool>("disable-root-output");
69 bool matchRootOutput = configcontext.options().get<bool>("enable-match-output");
70
71 const auto& matchingParam = o2::globaltracking::GlobalFwdMatchingParam::Instance();
72
74 specs.emplace_back(o2::globaltracking::getGlobalFwdMatchingSpec(useMC, matchRootOutput));
75 auto srcTracks = GID::getSourcesMask("MFT,MCH");
76 auto srcClusters = GID::getSourcesMask("MFT");
77 auto matchMask = GID::MASK_NONE;
78
79 if (!disableRootOutput) {
80 specs.emplace_back(o2::globaltracking::getGlobalFwdTrackWriterSpec(useMC));
81 }
82
83 if (matchRootOutput && (!disableRootOutput)) {
84 specs.emplace_back(o2::globaltracking::getMFTMCHMatchesWriterSpec(useMC));
85 }
86
87 if (matchingParam.isMatchUpstream()) {
88 matchMask = matchMask | GID::getSourcesMask("MFT-MCH");
89 }
90
91 if (matchingParam.useMIDMatch) {
92 matchMask = matchMask | GID::getSourcesMask("MCH-MID");
93 }
94
95 o2::globaltracking::InputHelper::addInputSpecs(configcontext, specs, srcClusters, matchMask, srcTracks, useMC, srcClusters, srcTracks);
96
97 // configure dpl timer to inject correct firstTForbit: start from the 1st orbit of TF containing 1st sampled orbit
98 o2::raw::HBFUtilsInitializer hbfIni(configcontext, specs);
99
100 return std::move(specs);
101}
Global index for barrel track: provides provenance (detectors combination), index in respective array...
static void writeINI(std::string const &filename, std::string const &keyOnly="")
static void updateFromString(std::string const &)
static mask_t getSourcesMask(const std::string_view srcList)
static constexpr mask_t MASK_NONE
ConfigParamRegistry & options() const
static int addInputSpecs(const o2::framework::ConfigContext &configcontext, o2::framework::WorkflowSpec &specs, GID::mask_t maskClusters, GID::mask_t maskMatches, GID::mask_t maskTracks, bool useMC=true, GID::mask_t maskClustersMC=GID::getSourcesMask(GID::ALL), GID::mask_t maskTracksMC=GID::getSourcesMask(GID::ALL), bool subSpecStrict=false)
WorkflowSpec defineDataProcessing(o2::framework::ConfigContext const &configcontext)
void customize(std::vector< o2::framework::CallbacksPolicy > &policies)
Defining ITS Vertex explicitly as messageable.
Definition Cartesian.h:288
std::vector< DataProcessorSpec > WorkflowSpec
framework::DataProcessorSpec getGlobalFwdTrackWriterSpec(bool useMC)
framework::DataProcessorSpec getGlobalFwdMatchingSpec(bool useMC, bool matchRootOutput)
create a processor spec
framework::DataProcessorSpec getMFTMCHMatchesWriterSpec(bool useMC)
static CompletionPolicy consumeWhenAllOrdered(const char *name, CompletionPolicy::Matcher matcher)
as consumeWhenAll, but ensures that records are processed with incremental timeSlice (DataHeader::sta...
static void addMFTConfigOption(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))