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
28
29using namespace o2::framework;
31
32void customize(std::vector<o2::framework::CallbacksPolicy>& policies)
33{
35}
36
37void customize(std::vector<o2::framework::ConfigParamSpec>& workflowOptions)
38{
39 // option allowing to set parameters
40 std::vector<o2::framework::ConfigParamSpec> options{
41 {"use-ft0", o2::framework::VariantType::Bool, false, {"use FT0 in matching"}},
42 {"disable-mc", o2::framework::VariantType::Bool, false, {"disable MC propagation even if available"}},
43 {"disable-root-input", o2::framework::VariantType::Bool, false, {"disable root-files input reader"}},
44 {"disable-root-output", o2::framework::VariantType::Bool, false, {"disable root-files output writer"}},
45 {"track-sources", VariantType::String, "TPC", {"comma-separated list of sources to use: TPC,TPC-TOF,TPC-TRD,TPC-TRD-TOF"}},
46 {"produce-calibration-data", o2::framework::VariantType::Bool, false, {"produce output for TPC vdrift calibration"}},
47 {"use-full-geometry", o2::framework::VariantType::Bool, false, {"use full geometry instead of the light-weight ITS part"}},
48 {"configKeyValues", VariantType::String, "", {"Semicolon separated key=value strings ..."}}};
51 std::swap(workflowOptions, options);
52}
53
54// the matcher process requires the TPC sector completion to trigger and data on
55// all defined routes
56void customize(std::vector<o2::framework::CompletionPolicy>& policies)
57{
58 // the TPC sector completion policy checks when the set of TPC/CLUSTERNATIVE data is complete
59 // in addition we require to have input from all other routes
60 policies.push_back(o2::tpc::TPCSectorCompletionPolicy("itstpc-track-matcher",
62 o2::framework::InputSpec{"cluster", o2::framework::ConcreteDataTypeMatcher{"TPC", "CLUSTERNATIVE"}})());
63 policies.push_back(CompletionPolicyHelpers::consumeWhenAllOrdered(".*itstpc-track-writer.*"));
64}
65
66// ------------------------------------------------------------------
67
69
71{
72 // Update the (declared) parameters if changed from the command line
73 o2::conf::ConfigurableParam::updateFromString(configcontext.options().get<std::string>("configKeyValues"));
74 // write the configuration used for the workflow
75 o2::conf::ConfigurableParam::writeINI("o2matchtpcits-workflow_configuration.ini");
76 GID::mask_t alowedSources = GID::getSourcesMask("ITS,TPC,TPC-TOF");
77 GID::mask_t src = alowedSources & GID::getSourcesMask(configcontext.options().get<std::string>("track-sources"));
78 bool needStrictTRDTOF = (src & GID::getSourcesMask("TPC-TRD,TPC-TOF,TPC-TRD-TOF")).any();
80 auto useGeom = configcontext.options().get<bool>("use-full-geometry");
81 auto useFT0 = configcontext.options().get<bool>("use-ft0");
82 if (useFT0) {
83 src |= GID::getSourceMask(GID::FT0);
84 }
85 auto useMC = !configcontext.options().get<bool>("disable-mc");
86 auto calib = configcontext.options().get<bool>("produce-calibration-data");
87 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
88 if (sclOpt.requestCTPLumi) {
89 srcL = srcL | GID::getSourcesMask("CTP");
90 }
91
93 if (sclOpt.needTPCScalersWorkflow() && !configcontext.options().get<bool>("disable-root-input")) {
94 specs.emplace_back(o2::tpc::getTPCScalerSpec(sclOpt.lumiType == 2, sclOpt.enableMShapeCorrection));
95 }
96 specs.emplace_back(o2::globaltracking::getTPCITSMatchingSpec(srcL, useFT0, calib, !GID::includesSource(GID::TPC, src), useGeom, useMC, sclOpt));
97
98 if (!configcontext.options().get<bool>("disable-root-output")) {
99 specs.emplace_back(o2::globaltracking::getTrackWriterTPCITSSpec(useMC));
100 }
101
102 // the only clusters MC which is need with useMC is ITS (for afterburner), for the rest we use tracks MC labels
103 o2::globaltracking::InputHelper::addInputSpecs(configcontext, specs, srcL, srcL, srcL, useMC, GID::getSourceMask(GID::ITS), GID::getSourcesMask(GID::ALL), needStrictTRDTOF);
104
105 // configure dpl timer to inject correct firstTForbit: start from the 1st orbit of TF containing 1st sampled orbit
106 o2::raw::HBFUtilsInitializer hbfIni(configcontext, specs);
107
108 return std::move(specs);
109}
Device to produce TPC clusters sharing map.
Helper class to access load maps from CCDB.
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 CorrectionMapsLoaderGloOpts parseGlobalOptions(const o2::framework::ConfigParamRegistry &opts)
GLenum src
Definition glcorearb.h:1767
Defining PrimaryVertex explicitly as messageable.
Definition TFIDInfo.h:20
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, const o2::tpc::CorrectionMapsLoaderGloOpts &sclOpts)
create a processor spec
o2::framework::DataProcessorSpec getTPCScalerSpec(bool enableIDCs, bool enableMShape)
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))
WorkflowSpec defineDataProcessing(o2::framework::ConfigContext const &configcontext)
void customize(std::vector< o2::framework::CallbacksPolicy > &policies)