Project
Loading...
Searching...
No Matches
secondary-vertexing-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
34
35using namespace o2::framework;
38// ------------------------------------------------------------------
39void customize(std::vector<o2::framework::CallbacksPolicy>& policies)
40{
42}
43
44void customize(std::vector<o2::framework::CompletionPolicy>& policies)
45{
46 // ordered policies for the writers
47 policies.push_back(CompletionPolicyHelpers::consumeWhenAllOrdered(".*secondary-vertex-writer.*"));
48}
49
50// we need to add workflow options before including Framework/runDataProcessing
51void customize(std::vector<ConfigParamSpec>& workflowOptions)
52{
53 // option allowing to set parameters
54 std::vector<o2::framework::ConfigParamSpec> options{
55 {"disable-root-input", o2::framework::VariantType::Bool, false, {"disable root-files input reader"}},
56 {"disable-root-output", o2::framework::VariantType::Bool, false, {"disable root-files output writer"}},
57 {"disable-mc", o2::framework::VariantType::Bool, false, {"disable MC (relevant for strangeness tracker only))"}},
58 {"vertexing-sources", VariantType::String, std::string{GID::ALL}, {"comma-separated list of sources to use in vertexing"}},
59 {"disable-cascade-finder", o2::framework::VariantType::Bool, false, {"do not run cascade finder"}},
60 {"disable-3body-finder", o2::framework::VariantType::Bool, false, {"do not run 3 body finder"}},
61 {"disable-strangeness-tracker", o2::framework::VariantType::Bool, false, {"do not run strangeness tracker"}},
62 {"disable-ccdb-params", o2::framework::VariantType::Bool, false, {"do not load the svertexer parameters from the ccdb"}},
63 {"use-full-geometry", o2::framework::VariantType::Bool, false, {"use full geometry instead of the light-weight ITS part"}},
64 {"configKeyValues", VariantType::String, "", {"Semicolon separated key=value strings ..."}},
65 {"combine-source-devices", o2::framework::VariantType::Bool, false, {"merge DPL source devices"}}};
69 std::swap(workflowOptions, options);
70}
71
72// ------------------------------------------------------------------
73
75
77{
78 GID::mask_t allowedSources = GID::getSourcesMask("ITS,TPC,ITS-TPC,TPC-TOF,TPC-TRD,ITS-TPC-TRD,ITS-TPC-TOF,TPC-TRD-TOF,ITS-TPC-TRD-TOF");
79
80 // Update the (declared) parameters if changed from the command line
81 o2::conf::ConfigurableParam::updateFromString(configcontext.options().get<std::string>("configKeyValues"));
82 // write the configuration used for the workflow
83 o2::conf::ConfigurableParam::writeINI("o2secondary-vertexing-workflow_configuration.ini");
84 bool useMC = !configcontext.options().get<bool>("disable-mc");
85 auto disableRootOut = configcontext.options().get<bool>("disable-root-output");
86 auto enableCCDBParams = !configcontext.options().get<bool>("disable-ccdb-params");
87 auto enableCasc = !configcontext.options().get<bool>("disable-cascade-finder");
88 auto enable3body = !configcontext.options().get<bool>("disable-3body-finder");
89 auto enableStrTr = !configcontext.options().get<bool>("disable-strangeness-tracker");
90 auto useGeom = configcontext.options().get<bool>("use-full-geometry");
93 GID::mask_t src = allowedSources & GID::getSourcesMask(configcontext.options().get<std::string>("vertexing-sources"));
94 GID::mask_t dummy, srcClus = GID::includesDet(DetID::TOF, src) ? GID::getSourceMask(GID::TOF) : dummy; // eventually, TPC clusters will be needed for refit
95 if (enableStrTr) {
96 srcClus |= GID::getSourceMask(GID::ITS);
97 }
98 if (src[GID::TPC]) {
99 srcClus |= GID::getSourceMask(GID::TPC);
100 if (sclOpt.requestCTPLumi) {
101 src = src | GID::getSourcesMask("CTP");
102 }
103 }
104 WorkflowSpec specs;
105 if (!configcontext.options().get<bool>("disable-root-input")) {
106 specs.emplace_back(o2::tpc::getTPCScalerSpec(sclOpt));
107 }
108 specs.emplace_back(o2::vertexing::getSecondaryVertexingSpec(src, enableCasc, enable3body, enableStrTr, enableCCDBParams, useMC, useGeom, doStag));
109
110 // only TOF clusters are needed if TOF is involved, no clusters MC needed
111 WorkflowSpec inputspecs;
112 o2::globaltracking::InputHelper::addInputSpecs(configcontext, inputspecs, srcClus, src, src, useMC, srcClus);
113 o2::globaltracking::InputHelper::addInputSpecsPVertex(configcontext, inputspecs, useMC); // P-vertex is always needed
114
115 if (configcontext.options().get<bool>("combine-source-devices")) {
116 std::vector<DataProcessorSpec> unmerged;
117 specs.push_back(specCombiner("SV-Input-Reader", inputspecs, unmerged));
118 if (unmerged.size() > 0) {
119 // LOG(fatal) << "unexpected DPL merge error";
120 for (auto& s : unmerged) {
121 specs.push_back(s);
122 LOG(info) << " adding unmerged spec " << s.name;
123 }
124 }
125 } else {
126 for (auto& s : inputspecs) {
127 specs.push_back(s);
128 }
129 }
130
131 if (!disableRootOut) {
133 if (enableStrTr) {
135 }
136 }
137
138 // configure dpl timer to inject correct firstTForbit: start from the 1st orbit of TF containing 1st sampled orbit
139 o2::raw::HBFUtilsInitializer hbfIni(configcontext, specs);
140
141 return std::move(specs);
142}
Helper class to parse options for correction maps.
Timeframe settings Average distance in cm of events merged into Randomize distance around average distance of merged events Simulate correct bunch interactions instead of placing only the average number of events A value[n] sets TFlen for[n] collisions in Number of bunches per trainsort Number of bunch trains Instantaneous interaction rate Do not simulate border Total number of collisions to be placed in the interior of all time Do not select random but walk over array of events in stride steps h Event generator settings h configStandalone Use CPU for GPU Force usage of the specified GPU device no CPU fallback Continue processing after an error s
Global index for barrel track: provides provenance (detectors combination), index in respective array...
static void writeINI(std::string const &filename, std::string const &keyOnly="")
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:60
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)
static void addGlobalOptions(std::vector< o2::framework::ConfigParamSpec > &options)
static CorrectionMapsGloOpts parseGlobalOptions(const o2::framework::ConfigParamRegistry &opts)
Defining ITS Vertex explicitly as messageable.
Definition Cartesian.h:288
o2::framework::DataProcessorSpec specCombiner(std::string const &name, std::vector< DataProcessorSpec > const &speccollection, std::vector< DataProcessorSpec > &remaining)
std::vector< DataProcessorSpec > WorkflowSpec
o2::framework::DataProcessorSpec getStrangenessTrackingWriterSpec(bool useMC)
o2::framework::DataProcessorSpec getTPCScalerSpec(const o2::tpc::CorrectionMapsGloOpts &sclOpts)
o2::framework::DataProcessorSpec getSecondaryVertexingSpec(o2::dataformats::GlobalTrackID::mask_t src, bool enableCasc, bool enable3body, bool enableStrangenesTracking, bool enableCCDBParams, bool useMC, bool useGeom, bool itsStag)
create a processor spec
framework::DataProcessorSpec getSecondaryVertexWriterSpec()
create a processor spec
WorkflowSpec defineDataProcessing(ConfigContext const &configcontext)
void customize(std::vector< o2::framework::CallbacksPolicy > &policies)
static CompletionPolicy consumeWhenAllOrdered(const char *name, CompletionPolicy::Matcher matcher)
as consumeWhenAll, but ensures that records are processed with incremental timeSlice (DataHeader::sta...
static bool isITSStaggeringEnabled(o2::framework::ConfigContext const &cfgc)
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))
LOG(info)<< "Compressed in "<< sw.CpuTime()<< " s"