Project
Loading...
Searching...
No Matches
sv-study-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
23
24using namespace o2::framework;
27
28// ------------------------------------------------------------------
29void customize(std::vector<o2::framework::CallbacksPolicy>& policies)
30{
32}
33
34// we need to add workflow options before including Framework/runDataProcessing
35void customize(std::vector<ConfigParamSpec>& workflowOptions)
36{
37 // option allowing to set parameters
38 std::vector<o2::framework::ConfigParamSpec> options{
39 {"disable-mc", o2::framework::VariantType::Bool, false, {"disable MC propagation"}},
40 {"track-sources", VariantType::String, std::string{GID::ALL}, {"comma-separated list of track sources to use"}},
41 {"disable-root-input", VariantType::Bool, false, {"disable root-files input reader"}},
42 {"ignore-tpc-occ", VariantType::Bool, false, {"do not fill TPC occupancy (needs TPC clusters)"}},
43 {"configKeyValues", VariantType::String, "", {"Semicolon separated key=value strings ..."}}};
45 std::swap(workflowOptions, options);
46}
47
48// ------------------------------------------------------------------
49
51
53{
54 WorkflowSpec specs;
55
56 GID::mask_t allowedSourcesTrc = GID::getSourcesMask("ITS,TPC,ITS-TPC,TPC-TOF,TPC-TRD,ITS-TPC-TRD,TPC-TRD-TOF,ITS-TPC-TOF,ITS-TPC-TRD-TOF");
57
58 // Update the (declared) parameters if changed from the command line
59 o2::conf::ConfigurableParam::updateFromString(configcontext.options().get<std::string>("configKeyValues"));
60
61 auto useMC = !configcontext.options().get<bool>("disable-mc");
62
63 GID::mask_t srcTrc = allowedSourcesTrc & GID::getSourcesMask(configcontext.options().get<std::string>("track-sources"));
64 GID::mask_t srcCls{};
65 bool fillTPCOcc = !configcontext.options().get<bool>("ignore-tpc-occ");
66 if (fillTPCOcc) {
67 srcCls = srcCls | GID::getSourcesMask("TPC");
68 }
69 o2::globaltracking::InputHelper::addInputSpecs(configcontext, specs, srcCls, srcTrc, srcTrc, useMC);
70 o2::globaltracking::InputHelper::addInputSpecsPVertex(configcontext, specs, useMC); // P-vertex is always needed
71 o2::globaltracking::InputHelper::addInputSpecsSVertex(configcontext, specs); // S-vertex is always needed
72 specs.emplace_back(o2::svstudy::getSVStudySpec(srcTrc, srcCls, 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 std::move(specs);
78}
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
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)
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)
Defining PrimaryVertex explicitly as messageable.
Definition TFIDInfo.h:20
std::vector< DataProcessorSpec > WorkflowSpec
o2::framework::DataProcessorSpec getSVStudySpec(o2::dataformats::GlobalTrackID::mask_t srcTracks, o2::dataformats::GlobalTrackID::mask_t srcCls, bool useMC)
create a processor spec
Definition SVStudy.cxx:419
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))
WorkflowSpec defineDataProcessing(ConfigContext const &configcontext)
void customize(std::vector< o2::framework::CallbacksPolicy > &policies)