Project
Loading...
Searching...
No Matches
tpcits-match-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
29
30using namespace o2::framework;
32
33void customize(std::vector<o2::framework::CallbacksPolicy>& policies)
34{
36}
37
38void customize(std::vector<o2::framework::ConfigParamSpec>& workflowOptions)
39{
40 // option allowing to set parameters
41 std::vector<o2::framework::ConfigParamSpec> options{
42 {"use-ft0", o2::framework::VariantType::Bool, false, {"use FT0 in matching"}},
43 {"disable-mc", o2::framework::VariantType::Bool, false, {"disable MC propagation even if available"}},
44 {"disable-root-input", o2::framework::VariantType::Bool, false, {"disable root-files input reader"}},
45 {"disable-root-output", o2::framework::VariantType::Bool, false, {"disable root-files output writer"}},
46 {"track-sources", VariantType::String, "TPC", {"comma-separated list of sources to use: TPC,TPC-TOF,TPC-TRD,TPC-TRD-TOF"}},
47 {"produce-calibration-data", o2::framework::VariantType::Bool, false, {"produce output for TPC vdrift calibration"}},
48 {"use-full-geometry", o2::framework::VariantType::Bool, false, {"use full geometry instead of the light-weight ITS part"}},
49 {"configKeyValues", VariantType::String, "", {"Semicolon separated key=value strings ..."}}};
53 std::swap(workflowOptions, options);
54}
55
56// the matcher process requires the TPC sector completion to trigger and data on
57// all defined routes
58void customize(std::vector<o2::framework::CompletionPolicy>& policies)
59{
60 // the TPC sector completion policy checks when the set of TPC/CLUSTERNATIVE data is complete
61 // in addition we require to have input from all other routes
62 policies.push_back(o2::tpc::TPCSectorCompletionPolicy("itstpc-track-matcher",
64 o2::framework::InputSpec{"cluster", o2::framework::ConcreteDataTypeMatcher{"TPC", "CLUSTERNATIVE"}})());
65 policies.push_back(CompletionPolicyHelpers::consumeWhenAllOrdered(".*itstpc-track-writer.*"));
66}
67
68// ------------------------------------------------------------------
69
71
73{
74 // Update the (declared) parameters if changed from the command line
75 o2::conf::ConfigurableParam::updateFromString(configcontext.options().get<std::string>("configKeyValues"));
76 // write the configuration used for the workflow
77 o2::conf::ConfigurableParam::writeINI("o2matchtpcits-workflow_configuration.ini");
78 GID::mask_t alowedSources = GID::getSourcesMask("ITS,TPC,TPC-TOF");
79 GID::mask_t src = alowedSources & GID::getSourcesMask(configcontext.options().get<std::string>("track-sources"));
80 bool needStrictTRDTOF = (src & GID::getSourcesMask("TPC-TRD,TPC-TOF,TPC-TRD-TOF")).any();
81 auto doStag = o2::itsmft::DPLAlpideParamInitializer::isITSStaggeringEnabled(configcontext); // RS at the moment is not passed to the matching w-flow
83 auto useGeom = configcontext.options().get<bool>("use-full-geometry");
84 auto useFT0 = configcontext.options().get<bool>("use-ft0");
85 if (useFT0) {
86 src |= GID::getSourceMask(GID::FT0);
87 }
88 auto useMC = !configcontext.options().get<bool>("disable-mc");
89 auto calib = configcontext.options().get<bool>("produce-calibration-data");
90 auto srcL = src | GID::getSourcesMask("ITS,TPC"); // ITS is needed always, TPC must be loaded even if bare TPC tracks are not used in matching
91 if (sclOpt.requestCTPLumi) {
92 srcL = srcL | GID::getSourcesMask("CTP");
93 }
94
96 if (!configcontext.options().get<bool>("disable-root-input")) {
97 specs.emplace_back(o2::tpc::getTPCScalerSpec(sclOpt.lumiType == o2::tpc::LumiScaleType::TPCScaler, sclOpt.enableMShapeCorrection, sclOpt));
98 }
99 specs.emplace_back(o2::globaltracking::getTPCITSMatchingSpec(srcL, useFT0, calib, !GID::includesSource(GID::TPC, src), useGeom, useMC, sclOpt.requestCTPLumi));
100
101 if (!configcontext.options().get<bool>("disable-root-output")) {
102 specs.emplace_back(o2::globaltracking::getTrackWriterTPCITSSpec(useMC));
103 }
104
105 // the only clusters MC which is need with useMC is ITS (for afterburner), for the rest we use tracks MC labels
106 o2::globaltracking::InputHelper::addInputSpecs(configcontext, specs, srcL, srcL, srcL, useMC, GID::getSourceMask(GID::ITS), GID::getSourcesMask(GID::ALL), needStrictTRDTOF);
107
108 // configure dpl timer to inject correct firstTForbit: start from the 1st orbit of TF containing 1st sampled orbit
109 o2::raw::HBFUtilsInitializer hbfIni(configcontext, specs);
110
111 return std::move(specs);
112}
Device to produce TPC clusters sharing map.
Helper class to parse options for correction maps.
Global index for barrel track: provides provenance (detectors combination), index in respective array...
DPL completion policy helper for TPC scetor data.
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 std::string_view ALL
keywork for all sources
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)
static void addGlobalOptions(std::vector< o2::framework::ConfigParamSpec > &options)
static CorrectionMapsGloOpts parseGlobalOptions(const o2::framework::ConfigParamRegistry &opts)
GLenum src
Definition glcorearb.h:1767
Defining ITS Vertex explicitly as messageable.
Definition Cartesian.h:288
std::vector< DataProcessorSpec > WorkflowSpec
framework::DataProcessorSpec getTrackWriterTPCITSSpec(bool useMC)
framework::DataProcessorSpec getTPCITSMatchingSpec(o2::dataformats::GlobalTrackID::mask_t src, bool useFT0, bool calib, bool skipTPCOnly, bool useGeom, bool useMC, bool requestCTPLumi)
create a processor spec
@ TPCScaler
use TPC scaler for scaling
o2::framework::DataProcessorSpec getTPCScalerSpec(bool enableIDCs, bool enableMShape, const o2::tpc::CorrectionMapsGloOpts &sclOpts)
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))
WorkflowSpec defineDataProcessing(o2::framework::ConfigContext const &configcontext)
void customize(std::vector< o2::framework::CallbacksPolicy > &policies)