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
24
25using namespace o2::framework;
27// ------------------------------------------------------------------
28void customize(std::vector<o2::framework::CallbacksPolicy>& policies)
29{
31}
32
33void customize(std::vector<o2::framework::CompletionPolicy>& policies)
34{
35 // ordered policies for the writers
36 policies.push_back(CompletionPolicyHelpers::consumeWhenAllOrdered(".*(?:FWD|fwd).*[W,w]riter.*"));
37}
38
39// we need to add workflow options before including Framework/runDataProcessing
40void customize(std::vector<o2::framework::ConfigParamSpec>& workflowOptions)
41{
42 // option allowing to set parameters
43 std::vector<o2::framework::ConfigParamSpec> options{
44 {"disable-mc", o2::framework::VariantType::Bool, false, {"disable MC propagation even if available"}},
45 {"disable-root-input", o2::framework::VariantType::Bool, false, {"disable root-files input reader"}},
46 {"disable-root-output", o2::framework::VariantType::Bool, false, {"do not write output root files"}},
47 {"enable-match-output", o2::framework::VariantType::Bool, false, {"stores mftmch matching info on mftmchmatches.root"}},
48 {"configKeyValues", VariantType::String, "", {"Semicolon separated key=value strings ..."}}};
50 std::swap(workflowOptions, options);
51}
52
53// ------------------------------------------------------------------
54
56
58{
59 // Update the (declared) parameters if changed from the command line
60 o2::conf::ConfigurableParam::updateFromString(configcontext.options().get<std::string>("configKeyValues"));
61 // write the configuration used for the workflow
62 o2::conf::ConfigurableParam::writeINI("o2matchmftmch-workflow_configuration.ini");
63
64 auto useMC = !configcontext.options().get<bool>("disable-mc");
65
66 bool disableRootOutput = configcontext.options().get<bool>("disable-root-output");
67 bool matchRootOutput = configcontext.options().get<bool>("enable-match-output");
68
69 const auto& matchingParam = o2::globaltracking::GlobalFwdMatchingParam::Instance();
70
72 specs.emplace_back(o2::globaltracking::getGlobalFwdMatchingSpec(useMC, matchRootOutput));
73 auto srcTracks = GID::getSourcesMask("MFT,MCH");
74 auto srcClusters = GID::getSourcesMask("MFT");
75 auto matchMask = GID::MASK_NONE;
76
77 if (!disableRootOutput) {
78 specs.emplace_back(o2::globaltracking::getGlobalFwdTrackWriterSpec(useMC));
79 }
80
81 if (matchRootOutput && (!disableRootOutput)) {
82 specs.emplace_back(o2::globaltracking::getMFTMCHMatchesWriterSpec(useMC));
83 }
84
85 if (matchingParam.isMatchUpstream()) {
86 matchMask = matchMask | GID::getSourcesMask("MFT-MCH");
87 }
88
89 if (matchingParam.useMIDMatch) {
90 matchMask = matchMask | GID::getSourcesMask("MCH-MID");
91 }
92
93 o2::globaltracking::InputHelper::addInputSpecs(configcontext, specs, srcClusters, matchMask, srcTracks, useMC, srcClusters, srcTracks);
94
95 // configure dpl timer to inject correct firstTForbit: start from the 1st orbit of TF containing 1st sampled orbit
96 o2::raw::HBFUtilsInitializer hbfIni(configcontext, specs);
97
98 return std::move(specs);
99}
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 PrimaryVertex explicitly as messageable.
Definition TFIDInfo.h:20
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 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))