Project
Loading...
Searching...
No Matches
check-resid-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
24
25using namespace o2::framework;
28
29// ------------------------------------------------------------------
30void customize(std::vector<o2::framework::CallbacksPolicy>& policies)
31{
33}
34
35// we need to add workflow options before including Framework/runDataProcessing
36void customize(std::vector<ConfigParamSpec>& workflowOptions)
37{
38 // option allowing to set parameters
39 std::vector<o2::framework::ConfigParamSpec> options{
40 {"draw-external-only", VariantType::Bool, false, {"just draw content of comma-separated list of histomanagers from checkresid.ext_hm_list"}},
41 {"postproc-external-only", VariantType::Bool, false, {"just post-process raw content of comma-separated list of histomanagers from checkresid.ext_hm_list"}},
42 {"track-sources", VariantType::String, std::string{GID::ALL}, {"comma-separated list of track sources to use"}},
43 {"cluster-sources", VariantType::String, "ITS", {"comma-separated list of cluster sources to use"}},
44 {"disable-root-input", VariantType::Bool, false, {"disable root-files input reader"}},
45 {"configKeyValues", VariantType::String, "", {"Semicolon separated key=value strings ..."}}};
46
49 std::swap(workflowOptions, options);
50}
51
52// ------------------------------------------------------------------
53
55
57{
58 WorkflowSpec specs;
59
60 bool drawOnly = configcontext.options().get<bool>("draw-external-only");
61 bool postProcOnly = configcontext.options().get<bool>("postproc-external-only");
62 GID::mask_t allowedSourcesTrc = GID::getSourcesMask("ITS,TPC,ITS-TPC,ITS-TPC-TRD,ITS-TPC-TOF,ITS-TPC-TRD-TOF");
63 GID::mask_t allowedSourcesClus = GID::getSourcesMask("ITS");
64
65 // Update the (declared) parameters if changed from the command line
66 o2::conf::ConfigurableParam::updateFromString(configcontext.options().get<std::string>("configKeyValues"));
67
68 GID::mask_t srcTrc = allowedSourcesTrc & GID::getSourcesMask(configcontext.options().get<std::string>("track-sources"));
69 GID::mask_t srcCls = allowedSourcesClus & GID::getSourcesMask(configcontext.options().get<std::string>("cluster-sources"));
70
71 if (!drawOnly) {
72 o2::globaltracking::InputHelper::addInputSpecs(configcontext, specs, srcCls, srcTrc, srcTrc, false);
73 o2::globaltracking::InputHelper::addInputSpecsPVertex(configcontext, specs, false); // P-vertex is always needed
74 } else {
75 allowedSourcesTrc = {};
76 allowedSourcesClus = {};
77 }
78 specs.emplace_back(o2::checkresid::getCheckResidSpec(srcTrc, srcCls, drawOnly, postProcOnly));
79
80 // configure dpl timer to inject correct firstTForbit: start from the 1st orbit of TF containing 1st sampled orbit
81 if (!drawOnly) {
82 o2::raw::HBFUtilsInitializer hbfIni(configcontext, specs);
83 }
84
85 return std::move(specs);
86}
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
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 addInputSpecsPVertex(const o2::framework::ConfigContext &configcontext, o2::framework::WorkflowSpec &specs, bool mc)
o2::framework::DataProcessorSpec getCheckResidSpec(o2::dataformats::GlobalTrackID::mask_t srcTracks, o2::dataformats::GlobalTrackID::mask_t srcClus, bool drawOnly, bool postProcOnly)
create a processor spec
Defining ITS Vertex explicitly as messageable.
Definition Cartesian.h:288
std::vector< DataProcessorSpec > WorkflowSpec
static void addITSConfigOption(std::vector< o2::framework::ConfigParamSpec > &opts)
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))