Project
Loading...
Searching...
No Matches
trackMCStudy-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
25
26using namespace o2::framework;
29
30// ------------------------------------------------------------------
31void customize(std::vector<o2::framework::CallbacksPolicy>& policies)
32{
34}
35
36// we need to add workflow options before including Framework/runDataProcessing
37void customize(std::vector<ConfigParamSpec>& workflowOptions)
38{
39 // option allowing to set parameters
40 std::vector<o2::framework::ConfigParamSpec> options{
41 {"track-sources", VariantType::String, std::string{GID::ALL}, {"comma-separated list of track sources to use"}},
42 {"cluster-sources", VariantType::String, std::string{GID::ALL}, {"comma-separated list of cluster sources to use"}},
43 {"disable-root-input", VariantType::Bool, false, {"disable root-files input reader"}},
44 {"ignore-sv-check", VariantType::Bool, false, {"disable check for SV combinatorics"}},
45 {"disable-mc", o2::framework::VariantType::Bool, false, {"disable MC propagation, never use it"}},
46 {"configKeyValues", VariantType::String, "", {"Semicolon separated key=value strings ..."}}};
49 std::swap(workflowOptions, options);
50}
51
52// ------------------------------------------------------------------
53
55
57{
58 WorkflowSpec specs;
59 auto useMC = !configcontext.options().get<bool>("disable-mc");
60 auto checkSV = !configcontext.options().get<bool>("ignore-sv-check");
61 if (!useMC) {
62 throw std::runtime_error("MC cannot be disabled for this workflow");
63 }
65 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");
66 GID::mask_t allowedSourcesClus = GID::getSourcesMask("ITS,TPC");
67
68 // Update the (declared) parameters if changed from the command line
69 o2::conf::ConfigurableParam::updateFromString(configcontext.options().get<std::string>("configKeyValues"));
70
71 GID::mask_t srcTrc = allowedSourcesTrc & GID::getSourcesMask(configcontext.options().get<std::string>("track-sources"));
72 GID::mask_t srcCls = allowedSourcesClus & GID::getSourcesMask(configcontext.options().get<std::string>("cluster-sources"));
73 srcCls |= GID::getSourcesMask("ITS,TPC");
74 if (sclOpt.requestCTPLumi) {
75 srcTrc = srcTrc | GID::getSourcesMask("CTP");
76 srcCls = srcCls | GID::getSourcesMask("CTP");
77 }
78 o2::globaltracking::InputHelper::addInputSpecs(configcontext, specs, srcCls, srcTrc, srcTrc, true);
79 o2::globaltracking::InputHelper::addInputSpecsPVertex(configcontext, specs, true); // P-vertex is always needed
80 if (checkSV) {
82 }
83 if (sclOpt.needTPCScalersWorkflow() && !configcontext.options().get<bool>("disable-root-input")) {
84 specs.emplace_back(o2::tpc::getTPCScalerSpec(sclOpt.lumiType == 2, sclOpt.enableMShapeCorrection));
85 }
86
87 specs.emplace_back(o2::trackstudy::getTrackMCStudySpec(srcTrc, srcCls, sclOpt, checkSV));
88 // configure dpl timer to inject correct firstTForbit: start from the 1st orbit of TF containing 1st sampled orbit
89 o2::raw::HBFUtilsInitializer hbfIni(configcontext, specs);
90
91 return std::move(specs);
92}
Helper class to access load maps from CCDB.
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)
static void addGlobalOptions(std::vector< o2::framework::ConfigParamSpec > &options)
static CorrectionMapsLoaderGloOpts parseGlobalOptions(const o2::framework::ConfigParamRegistry &opts)
Defining PrimaryVertex explicitly as messageable.
Definition TFIDInfo.h:20
std::vector< DataProcessorSpec > WorkflowSpec
o2::framework::DataProcessorSpec getTPCScalerSpec(bool enableIDCs, bool enableMShape)
o2::framework::DataProcessorSpec getTrackMCStudySpec(o2::dataformats::GlobalTrackID::mask_t srcTracks, o2::dataformats::GlobalTrackID::mask_t srcClus, const o2::tpc::CorrectionMapsLoaderGloOpts &sclOpts, bool checkSV)
create a processor spec
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)