Project
Loading...
Searching...
No Matches
TRDTrapSimulatorWorkFlow.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
22
23// for TRD
27
29
30#include <string>
31
32using namespace o2::framework;
33
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(".*(?:TRD|trd).*[W,w]riter.*"));
44}
45
46void customize(std::vector<o2::framework::ConfigParamSpec>& workflowoptions)
47{
48 workflowoptions.push_back(ConfigParamSpec{"disable-mc", o2::framework::VariantType::Bool, false, {"Disable MC labels"}});
49 workflowoptions.push_back(ConfigParamSpec{"disable-root-input", o2::framework::VariantType::Bool, false, {"Disable root-files input readers"}});
50 workflowoptions.push_back(ConfigParamSpec{"disable-root-output", o2::framework::VariantType::Bool, false, {"Disable root-files output writers"}});
51 workflowoptions.push_back(ConfigParamSpec{"configKeyValues", VariantType::String, "", {"Semicolon separated key=value strings (e.g.: 'TRDSimParams.digithreads=4;...')"}});
53}
54
56
60{
61 using namespace o2::conf;
62 ConfigurableParam::updateFromString(configcontext.options().get<std::string>("configKeyValues"));
63 WorkflowSpec specs;
64 auto useMC = !configcontext.options().get<bool>("disable-mc");
65 auto disableRootInput = configcontext.options().get<bool>("disable-root-input");
66 auto disableRootOutput = configcontext.options().get<bool>("disable-root-output");
67 if (!disableRootInput) {
68 specs.emplace_back(o2::trd::getTRDDigitReaderSpec(useMC));
69 }
70 specs.emplace_back(o2::trd::getTRDTrapSimulatorSpec(useMC, 1));
71 if (!disableRootOutput) {
72 specs.emplace_back(o2::trd::getTRDTrackletWriterSpec(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, specs);
76
77 return specs;
78}
Header of the General Run Parameters object.
Helper function to tokenize sequences and ranges of integral numbers.
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)
ConfigParamRegistry & options() const
Defining PrimaryVertex explicitly as messageable.
Definition TFIDInfo.h:20
std::vector< DataProcessorSpec > WorkflowSpec
o2::framework::DataProcessorSpec getTRDTrapSimulatorSpec(bool useMC, int digitDownscaling)
o2::framework::DataProcessorSpec getTRDTrackletWriterSpec(bool useMC)
o2::framework::DataProcessorSpec getTRDDigitReaderSpec(bool useMC, bool trigRec=true, int dataSubspec=1)
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))