Project
Loading...
Searching...
No Matches
TRDTrackletTransformerWorkflow.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
20
21using namespace o2::framework;
22
23void customize(std::vector<o2::framework::CallbacksPolicy>& policies)
24{
26}
27
28void customize(std::vector<o2::framework::CompletionPolicy>& policies)
29{
30 // ordered policies for the writers
31 policies.push_back(CompletionPolicyHelpers::consumeWhenAllOrdered(".*(?:TRD|trd).*[W,w]riter.*"));
32}
33
34void customize(std::vector<ConfigParamSpec>& workflowOptions)
35{
36 std::vector<o2::framework::ConfigParamSpec> options{
37 {"disable-mc", o2::framework::VariantType::Bool, false, {"Disable MC labels"}},
38 {"disable-irframe-reader", o2::framework::VariantType::Bool, false, {"Don't read ITS IR frames from file"}},
39 {"disable-root-input", o2::framework::VariantType::Bool, false, {"disable root-files input reader"}},
40 {"disable-root-output", o2::framework::VariantType::Bool, false, {"disable root-files output writer"}},
41 {"filter-trigrec", o2::framework::VariantType::Bool, false, {"ignore interaction records without ITS data"}},
42 {"configKeyValues", VariantType::String, "", {"Semicolon separated key=value strings ..."}}};
44 std::swap(workflowOptions, options);
45}
46
48
50{
51 o2::conf::ConfigurableParam::updateFromString(configcontext.options().get<std::string>("configKeyValues"));
52
53 // MC labels are passed through for the global tracking downstream
54 // in case ROOT output is requested the tracklet labels are duplicated
55 bool useMC = !configcontext.options().get<bool>("disable-mc");
56
57 WorkflowSpec spec;
58
59 if (!configcontext.options().get<bool>("disable-root-input")) {
60 // cannot use InputHelper here, since we have to create the calibrated tracklets first
61 spec.emplace_back(o2::trd::getTRDTrackletReaderSpec(useMC, false));
62 }
63
64 auto trigRecFilterActive = configcontext.options().get<bool>("filter-trigrec");
65 if (trigRecFilterActive && !configcontext.options().get<bool>("disable-irframe-reader")) {
67 }
68
69 spec.emplace_back(o2::trd::getTRDTrackletTransformerSpec(trigRecFilterActive));
70
71 if (!configcontext.options().get<bool>("disable-root-output")) {
72 spec.emplace_back(o2::trd::getTRDCalibratedTrackletWriterSpec(useMC));
73 }
74 // configure dpl timer to inject correct firstTForbit: start from the 1st orbit of TF containing 1st sampled orbit
75 o2::raw::HBFUtilsInitializer hbfIni(configcontext, spec);
76
77 return spec;
78}
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)
static void updateFromString(std::string const &)
ConfigParamRegistry & options() const
static int addInputSpecsIRFramesITS(const o2::framework::ConfigContext &configcontext, o2::framework::WorkflowSpec &specs)
Defining PrimaryVertex explicitly as messageable.
Definition TFIDInfo.h:20
std::vector< DataProcessorSpec > WorkflowSpec
framework::DataProcessorSpec getTRDTrackletReaderSpec(bool useMC, bool useCalibratedTracklets)
o2::framework::DataProcessorSpec getTRDTrackletTransformerSpec(bool trigRecFilterActive)
framework::DataProcessorSpec getTRDCalibratedTrackletWriterSpec(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))