Project
Loading...
Searching...
No Matches
trd-track-reader-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
18
19using namespace o2::framework;
21
22// ------------------------------------------------------------------
23
24void customize(std::vector<o2::framework::CallbacksPolicy>& policies)
25{
27}
28
29// we need to add workflow options before including Framework/runDataProcessing
30void customize(std::vector<ConfigParamSpec>& workflowOptions)
31{
32 // option allowing to set parameters
33 std::vector<o2::framework::ConfigParamSpec> options{
34 {"disable-mc", o2::framework::VariantType::Bool, true, {"disable MC propagation"}},
35 {"track-types", VariantType::String, std::string{GTrackID::ALL}, {"comma-separated list of sources to use for tracking"}},
36 {"output-strict", o2::framework::VariantType::Bool, false, {"outputs specs should correspond to strict matching mode"}},
37 {"configKeyValues", VariantType::String, "", {"Semicolon separated key=value strings ..."}}};
39 std::swap(workflowOptions, options);
40}
41
42// ------------------------------------------------------------------
43
45
47{
48 // Update the (declared) parameters if changed from the command line
49 o2::conf::ConfigurableParam::updateFromString(configcontext.options().get<std::string>("configKeyValues"));
50
51 auto useMC = !configcontext.options().get<bool>("disable-mc");
52 if (useMC) {
53 LOG(warning) << "TRD track reader cannot read MC labels, useMC = false will be enforced";
54 useMC = false;
55 }
56
57 GTrackID::mask_t allowedSources = GTrackID::getSourcesMask("ITS-TPC-TRD,TPC-TRD");
58 GTrackID::mask_t srcTRD = allowedSources & GTrackID::getSourcesMask(configcontext.options().get<std::string>("track-types"));
59
60 WorkflowSpec specs;
61 if (GTrackID::includesSource(GTrackID::Source::ITSTPCTRD, srcTRD)) {
62 specs.emplace_back(o2::trd::getTRDGlobalTrackReaderSpec(useMC));
63 }
64 if (GTrackID::includesSource(GTrackID::Source::TPCTRD, srcTRD)) {
65 specs.emplace_back(o2::trd::getTRDTPCTrackReaderSpec(useMC, configcontext.options().get<bool>("output-strict")));
66 }
67 o2::raw::HBFUtilsInitializer hbfIni(configcontext, specs);
68 return specs;
69}
Global index for barrel track: provides provenance (detectors combination), index in respective array...
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
Defining PrimaryVertex explicitly as messageable.
Definition TFIDInfo.h:20
std::vector< DataProcessorSpec > WorkflowSpec
framework::DataProcessorSpec getTRDTPCTrackReaderSpec(bool useMC, bool subSpecStrict=false)
read TPC-TRD matched tracks from a root file
framework::DataProcessorSpec getTRDGlobalTrackReaderSpec(bool useMC)
read ITS-TPC-TRD matched tracks from a root file
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)
This function hooks up the the workflow specifications into the DPL driver.
void customize(std::vector< o2::framework::CallbacksPolicy > &policies)