Project
Loading...
Searching...
No Matches
tpc-refitter-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 {"use-mc", o2::framework::VariantType::Bool, false, {"use MC information"}},
42 {"disable-mc", o2::framework::VariantType::Bool, false, {"disable MC usage"}},
43 {"enable-cosmics", o2::framework::VariantType::Bool, false, {"enable reading cosmics"}},
44 {"track-sources", VariantType::String, std::string{GID::ALL}, {"comma-separated list of track sources to use"}},
45 {"cluster-sources", VariantType::String, std::string{GID::ALL}, {"comma-separated list of cluster sources to use"}},
46 {"disable-root-input", VariantType::Bool, false, {"disable root-files input reader"}},
47 {"enable-M-shape-correction", VariantType::Bool, false, {"Enable M-shape distortion correction"}},
48 {"disable-IDC-scalers", VariantType::Bool, false, {"Disable TPC scalers for space-charge distortion fluctuation correction"}},
49 {"configKeyValues", VariantType::String, "", {"Semicolon separated key=value strings ..."}}};
52 std::swap(workflowOptions, options);
53}
54
55// ------------------------------------------------------------------
56
58
60{
61 WorkflowSpec specs;
62
63 // Update the (declared) parameters if changed from the command line
64 o2::conf::ConfigurableParam::updateFromString(configcontext.options().get<std::string>("configKeyValues"));
65 auto useMC = configcontext.options().get<bool>("use-mc");
67 const auto enableCosmics = configcontext.options().get<bool>("enable-cosmics");
68
69 GID::mask_t allowedSourcesTrc = GID::getSourcesMask("ITS,TPC,ITS-TPC,TPC-TOF");
70 GID::mask_t allowedSourcesClus = GID::getSourcesMask("TPC,TOF");
71 if (enableCosmics) {
72 allowedSourcesTrc = allowedSourcesTrc | GID::getSourcesMask("ITS-TPC-TRD,ITS-TPC-TOF,ITS-TPC-TRD-TOF");
73 }
74
75 GID::mask_t srcTrc = allowedSourcesTrc & GID::getSourcesMask(configcontext.options().get<std::string>("track-sources"));
76 GID::mask_t srcCls = allowedSourcesClus & GID::getSourcesMask(configcontext.options().get<std::string>("cluster-sources"));
77 if (sclOpt.requestCTPLumi) {
78 srcTrc = srcTrc | GID::getSourcesMask("CTP");
79 srcCls = srcCls | GID::getSourcesMask("CTP");
80 }
81
82 if (sclOpt.lumiType == 2) {
83 const auto enableMShape = configcontext.options().get<bool>("enable-M-shape-correction");
84 const auto enableIDCs = !configcontext.options().get<bool>("disable-IDC-scalers");
85 specs.emplace_back(o2::tpc::getTPCScalerSpec(enableIDCs, enableMShape));
86 }
87
88 o2::globaltracking::InputHelper::addInputSpecs(configcontext, specs, srcCls, srcTrc, srcTrc, useMC);
89 o2::globaltracking::InputHelper::addInputSpecsPVertex(configcontext, specs, useMC); // P-vertex is always needed
90 if (enableCosmics) {
92 }
93 specs.emplace_back(o2::trackstudy::getTPCRefitterSpec(srcTrc, srcCls, useMC, sclOpt, enableCosmics));
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}
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 addInputSpecsCosmics(const o2::framework::ConfigContext &configcontext, o2::framework::WorkflowSpec &specs, bool mc)
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 getTPCRefitterSpec(o2::dataformats::GlobalTrackID::mask_t srcTracks, o2::dataformats::GlobalTrackID::mask_t srcClus, bool useMC, const o2::tpc::CorrectionMapsLoaderGloOpts &sclOpts, bool requestCosmics=false)
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)
This function hooks up the the workflow specifications into the DPL driver.
void customize(std::vector< o2::framework::CallbacksPolicy > &policies)