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");
92 GID::mask_t src = allowedSources & GID::getSourcesMask(configcontext.options().get<std::string>("vertexing-sources"));
93 GID::mask_t dummy, srcClus = GID::includesDet(DetID::TOF, src) ? GID::getSourceMask(GID::TOF) : dummy; // eventually, TPC clusters will be needed for refit
94 if (enableStrTr) {
95 srcClus |= GID::getSourceMask(GID::ITS);
96 }
97 if (src[GID::TPC]) {
98 srcClus |= GID::getSourceMask(GID::TPC);
99 if (sclOpt.requestCTPLumi) {
100 src = src | GID::getSourcesMask("CTP");
101 }
102 }
103 WorkflowSpec specs;
104 if (!configcontext.options().get<bool>("disable-root-input")) {
105 specs.emplace_back(o2::tpc::getTPCScalerSpec(sclOpt.lumiType == o2::tpc::LumiScaleType::TPCScaler, sclOpt.enableMShapeCorrection, sclOpt));
106 }
107 specs.emplace_back(o2::vertexing::getSecondaryVertexingSpec(src, enableCasc, enable3body, enableStrTr, enableCCDBParams, useMC, useGeom));
108
109 // only TOF clusters are needed if TOF is involved, no clusters MC needed
110 WorkflowSpec inputspecs;
111 o2::globaltracking::InputHelper::addInputSpecs(configcontext, inputspecs, srcClus, src, src, useMC, srcClus);
112 o2::globaltracking::InputHelper::addInputSpecsPVertex(configcontext, inputspecs, useMC); // P-vertex is always needed
113
114 if (configcontext.options().get<bool>("combine-source-devices")) {
115 std::vector<DataProcessorSpec> unmerged;
116 specs.push_back(specCombiner("SV-Input-Reader", inputspecs, unmerged));
117 if (unmerged.size() > 0) {
118 // LOG(fatal) << "unexpected DPL merge error";
119 for (auto& s : unmerged) {
120 specs.push_back(s);
121 LOG(info) << " adding unmerged spec " << s.name;
122 }
123 }
124 } else {
125 for (auto& s : inputspecs) {
126 specs.push_back(s);
127 }
128 }
129
130 if (!disableRootOut) {
132 if (enableStrTr) {
134 }
135 }
136
137 // configure dpl timer to inject correct firstTForbit: start from the 1st orbit of TF containing 1st sampled orbit
138 o2::raw::HBFUtilsInitializer hbfIni(configcontext, specs);
139
140 return std::move(specs);
141}
Helper class to parse options for correction maps.
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:58
static constexpr ID TOF
Definition DetID.h:66
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)
GLenum src
Definition glcorearb.h:1767
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)
@ TPCScaler
use TPC scaler for scaling
o2::framework::DataProcessorSpec getTPCScalerSpec(bool enableIDCs, bool enableMShape, 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)
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 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"