Project
Loading...
Searching...
No Matches
tof-match-checker-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
30
31using namespace o2::framework;
34// ------------------------------------------------------------------
35void customize(std::vector<o2::framework::CallbacksPolicy>& policies)
36{
38}
39
40void customize(std::vector<o2::framework::CompletionPolicy>& policies)
41{
42 // ordered policies for the writers
43 policies.push_back(CompletionPolicyHelpers::consumeWhenAllOrdered(".*(?:ITS|its).*[W,w]riter.*"));
44}
45
46// we need to add workflow options before including Framework/runDataProcessing
47void customize(std::vector<o2::framework::ConfigParamSpec>& workflowOptions)
48{
49 // option allowing to set parameters
50 std::vector<o2::framework::ConfigParamSpec> options{
51 {"disable-mc", o2::framework::VariantType::Bool, false, {"disable MC propagation even if available"}},
52 {"disable-root-input", o2::framework::VariantType::Bool, false, {"disable root-files input reader"}},
53 {"disable-root-output", o2::framework::VariantType::Bool, false, {"disable root-files output writer"}},
54 {"track-sources", VariantType::String, std::string{GID::ALL}, {"comma-separated list of sources to use: allowed TPC-TOF,ITS-TPC-TOF,TPC-TRD-TOF,ITS-TPC-TRD-TOF (all)"}},
55 {"configKeyValues", VariantType::String, "", {"Semicolon separated key=value strings ..."}}};
57 std::swap(workflowOptions, options);
58}
59
60// ------------------------------------------------------------------
61
63
65{
66 WorkflowSpec specs;
67
68 // Update the (declared) parameters if changed from the command line
69 o2::conf::ConfigurableParam::updateFromString(configcontext.options().get<std::string>("configKeyValues"));
70 // write the configuration used for the workflow
71 o2::conf::ConfigurableParam::writeINI("o2match-check-tof-workflow_configuration.ini");
72
73 auto useMC = !configcontext.options().get<bool>("disable-mc");
74
75 LOG(debug) << "TOF MATCHER WORKFLOW configuration";
76 LOG(debug) << "TOF track inputs = " << configcontext.options().get<std::string>("track-sources");
77 LOG(debug) << "TOF disable-mc = " << configcontext.options().get<std::string>("disable-mc");
78
79 GID::mask_t alowedSources = GID::getSourcesMask("ITS-TPC-TOF,TPC-TOF,ITS-TPC-TRD-TOF,TPC-TRD-TOF");
80
81 GID::mask_t src = alowedSources & GID::getSourcesMask(configcontext.options().get<std::string>("track-sources"));
82 GID::mask_t mcmaskcl;
84 GID::mask_t clustermask = GID::getSourcesMask("TOF");
85
86 if (useMC) {
87 mcmaskcl |= GID::getSourceMask(GID::TOF);
88 }
89 // pass strict flag to fetch eventual TPC-TRD input with correct subspec
90 o2::globaltracking::InputHelper::addInputSpecs(configcontext, specs, clustermask, src, src, useMC, mcmaskcl, GID::getSourcesMask(GID::ALL), false);
91
92 specs.emplace_back(o2::globaltracking::getTOFMatchCheckerSpec(src, useMC)); // doTPCrefit not yet supported (need to load TPC clusters?)
93
94 o2::raw::HBFUtilsInitializer hbfIni(configcontext, specs);
95
96 return std::move(specs);
97}
Global index for barrel track: provides provenance (detectors combination), index in respective array...
Helper function to tokenize sequences and ranges of integral numbers.
DPL completion policy helper for TPC scetor data.
std::ostringstream debug
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 NONE
keywork for no sources
static constexpr std::string_view ALL
keywork for all sources
Static class with identifiers, bitmasks and names for ALICE detectors.
Definition DetID.h:58
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)
GLenum src
Definition glcorearb.h:1767
Defining PrimaryVertex explicitly as messageable.
Definition TFIDInfo.h:20
std::vector< DataProcessorSpec > WorkflowSpec
framework::DataProcessorSpec getTOFMatchCheckerSpec(o2::dataformats::GlobalTrackID::mask_t src, bool useMC)
create a processor spec
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))
LOG(info)<< "Compressed in "<< sw.CpuTime()<< " s"
WorkflowSpec defineDataProcessing(ConfigContext const &configcontext)
void customize(std::vector< o2::framework::CallbacksPolicy > &policies)