Project
Loading...
Searching...
No Matches
aod-producer-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
21
22using namespace o2::framework;
25
26void customize(std::vector<o2::framework::CallbacksPolicy>& policies)
27{
29}
30
31void customize(std::vector<ConfigParamSpec>& workflowOptions)
32{
33 // option allowing to set parameters
34 std::vector<o2::framework::ConfigParamSpec> options{
35 {"disable-root-input", o2::framework::VariantType::Bool, false, {"disable root-files input reader"}},
36 {"disable-root-output", o2::framework::VariantType::Bool, false, {"disable root-files output writer"}},
37 {"disable-mc", o2::framework::VariantType::Bool, false, {"disable MC propagation"}},
38 {"disable-secondary-vertices", o2::framework::VariantType::Bool, false, {"disable filling secondary vertices"}},
39 {"disable-strangeness-tracker", o2::framework::VariantType::Bool, false, {"disable filling strangeness tracking"}},
40 {"enable-FIT-extra", o2::framework::VariantType::Bool, false, {"enable FIT extra output"}},
41 {"info-sources", VariantType::String, std::string{GID::ALL}, {"comma-separated list of sources to use"}},
42 {"configKeyValues", VariantType::String, "", {"Semicolon separated key=value strings ..."}},
43 {"combine-source-devices", o2::framework::VariantType::Bool, false, {"merge DPL source devices"}},
44 {"ctpconfig-run-independent", o2::framework::VariantType::Bool, false, {"Use CTP config w/o runNumber tag"}}};
46 std::swap(workflowOptions, options);
47}
48
50
52{
53 o2::conf::ConfigurableParam::updateFromString(configcontext.options().get<std::string>("configKeyValues"));
54 auto useMC = !configcontext.options().get<bool>("disable-mc");
55 bool enableSV = !configcontext.options().get<bool>("disable-secondary-vertices");
56 bool enableST = !configcontext.options().get<bool>("disable-strangeness-tracker");
57 bool ctpcfgperrun = !configcontext.options().get<bool>("ctpconfig-run-independent");
58 bool enableFITextra = configcontext.options().get<bool>("enable-FIT-extra");
59
60 GID::mask_t allowedSrc = GID::getSourcesMask("ITS,MFT,MCH,MID,MCH-MID,TPC,TRD,ITS-TPC,TPC-TOF,TPC-TRD,ITS-TPC-TOF,ITS-TPC-TRD,TPC-TRD-TOF,ITS-TPC-TRD-TOF,MFT-MCH,FT0,FV0,FDD,ZDC,EMC,CTP,PHS,CPV,HMP");
61 GID::mask_t src = allowedSrc & GID::getSourcesMask(configcontext.options().get<std::string>("info-sources"));
62
63 // manually add TOF to MC mask for addInputSpecs()
66 }
67
68 WorkflowSpec specs;
69 specs.emplace_back(o2::aodproducer::getAODProducerWorkflowSpec(src, enableSV, enableST, useMC, ctpcfgperrun, enableFITextra));
70
71 auto srcCls = src & ~(GID::getSourceMask(GID::MCH) | GID::getSourceMask(GID::MID)); // Don't read global MID and MCH clusters (those attached to tracks are always read)
72 auto srcMtc = src;
73
74 WorkflowSpec inputspecs;
75 o2::globaltracking::InputHelper::addInputSpecs(configcontext, inputspecs, srcCls, srcMtc, src, useMC, src);
76 o2::globaltracking::InputHelper::addInputSpecsPVertex(configcontext, inputspecs, useMC);
77 if (enableSV) {
79 }
80 if (enableST) {
81 o2::globaltracking::InputHelper::addInputSpecsStrangeTrack(configcontext, inputspecs, useMC);
82 }
83 if (configcontext.options().get<bool>("combine-source-devices")) {
84 std::vector<DataProcessorSpec> unmerged;
85 specs.push_back(specCombiner("AOD-input-reader", inputspecs, unmerged));
86 for (auto& is : unmerged) {
87 specs.push_back(is);
88 }
89 } else {
90 for (auto& s : inputspecs) {
91 specs.push_back(s);
92 }
93 }
94
95 // configure dpl timer to inject correct firstTForbit: start from the 1st orbit of TF containing 1st sampled orbit
96 o2::raw::HBFUtilsInitializer hbfIni(configcontext, specs);
97
98 return std::move(specs);
99}
Global index for barrel track: provides provenance (detectors combination), index in respective array...
WorkflowSpec defineDataProcessing(ConfigContext const &configcontext)
void customize(std::vector< o2::framework::CallbacksPolicy > &policies)
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
Static class with identifiers, bitmasks and names for ALICE detectors.
Definition DetID.h:58
static constexpr ID TOF
Definition DetID.h:66
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 int addInputSpecsStrangeTrack(const o2::framework::ConfigContext &configcontext, o2::framework::WorkflowSpec &specs, bool mc)
static int addInputSpecsSVertex(const o2::framework::ConfigContext &configcontext, o2::framework::WorkflowSpec &specs)
static int addInputSpecsPVertex(const o2::framework::ConfigContext &configcontext, o2::framework::WorkflowSpec &specs, bool mc)
GLenum src
Definition glcorearb.h:1767
framework::DataProcessorSpec getAODProducerWorkflowSpec(GID::mask_t src, bool enableSV, bool enableST, bool useMC, bool CTPConfigPerRun, bool enableFITextra)
create a processor spec
Defining PrimaryVertex explicitly as messageable.
Definition TFIDInfo.h:20
o2::framework::DataProcessorSpec specCombiner(std::string const &name, std::vector< DataProcessorSpec > const &speccollection, std::vector< DataProcessorSpec > &remaining)
std::vector< DataProcessorSpec > WorkflowSpec
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))