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
33
34using namespace o2::framework;
37// ------------------------------------------------------------------
38void customize(std::vector<o2::framework::CallbacksPolicy>& policies)
39{
41}
42
43void customize(std::vector<o2::framework::CompletionPolicy>& policies)
44{
45 // ordered policies for the writers
46 policies.push_back(CompletionPolicyHelpers::consumeWhenAllOrdered(".*secondary-vertex-writer.*"));
47}
48
49// we need to add workflow options before including Framework/runDataProcessing
50void customize(std::vector<ConfigParamSpec>& workflowOptions)
51{
52 // option allowing to set parameters
53 std::vector<o2::framework::ConfigParamSpec> options{
54 {"disable-root-input", o2::framework::VariantType::Bool, false, {"disable root-files input reader"}},
55 {"disable-root-output", o2::framework::VariantType::Bool, false, {"disable root-files output writer"}},
56 {"disable-mc", o2::framework::VariantType::Bool, false, {"disable MC (relevant for strangeness tracker only))"}},
57 {"vertexing-sources", VariantType::String, std::string{GID::ALL}, {"comma-separated list of sources to use in vertexing"}},
58 {"disable-cascade-finder", o2::framework::VariantType::Bool, false, {"do not run cascade finder"}},
59 {"disable-3body-finder", o2::framework::VariantType::Bool, false, {"do not run 3 body finder"}},
60 {"disable-strangeness-tracker", o2::framework::VariantType::Bool, false, {"do not run strangeness tracker"}},
61 {"disable-ccdb-params", o2::framework::VariantType::Bool, false, {"do not load the svertexer parameters from the ccdb"}},
62 {"use-full-geometry", o2::framework::VariantType::Bool, false, {"use full geometry instead of the light-weight ITS part"}},
63 {"configKeyValues", VariantType::String, "", {"Semicolon separated key=value strings ..."}},
64 {"combine-source-devices", o2::framework::VariantType::Bool, false, {"merge DPL source devices"}}};
67 std::swap(workflowOptions, options);
68}
69
70// ------------------------------------------------------------------
71
73
75{
76 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");
77
78 // Update the (declared) parameters if changed from the command line
79 o2::conf::ConfigurableParam::updateFromString(configcontext.options().get<std::string>("configKeyValues"));
80 // write the configuration used for the workflow
81 o2::conf::ConfigurableParam::writeINI("o2secondary-vertexing-workflow_configuration.ini");
82 bool useMC = !configcontext.options().get<bool>("disable-mc");
83 auto disableRootOut = configcontext.options().get<bool>("disable-root-output");
84 auto enableCCDBParams = !configcontext.options().get<bool>("disable-ccdb-params");
85 auto enableCasc = !configcontext.options().get<bool>("disable-cascade-finder");
86 auto enable3body = !configcontext.options().get<bool>("disable-3body-finder");
87 auto enableStrTr = !configcontext.options().get<bool>("disable-strangeness-tracker");
88 auto useGeom = configcontext.options().get<bool>("use-full-geometry");
90 GID::mask_t src = allowedSources & GID::getSourcesMask(configcontext.options().get<std::string>("vertexing-sources"));
91 GID::mask_t dummy, srcClus = GID::includesDet(DetID::TOF, src) ? GID::getSourceMask(GID::TOF) : dummy; // eventually, TPC clusters will be needed for refit
92 if (enableStrTr) {
93 srcClus |= GID::getSourceMask(GID::ITS);
94 }
95 if (src[GID::TPC]) {
96 srcClus |= GID::getSourceMask(GID::TPC);
97 }
98 if (sclOpt.requestCTPLumi) {
99 src = src | GID::getSourcesMask("CTP");
100 }
101 WorkflowSpec specs;
102 if (sclOpt.needTPCScalersWorkflow() && !configcontext.options().get<bool>("disable-root-input")) {
103 specs.emplace_back(o2::tpc::getTPCScalerSpec(sclOpt.lumiType == 2, sclOpt.enableMShapeCorrection));
104 }
105 specs.emplace_back(o2::vertexing::getSecondaryVertexingSpec(src, enableCasc, enable3body, enableStrTr, enableCCDBParams, useMC, useGeom, sclOpt));
106
107 // only TOF clusters are needed if TOF is involved, no clusters MC needed
108 WorkflowSpec inputspecs;
109 o2::globaltracking::InputHelper::addInputSpecs(configcontext, inputspecs, srcClus, src, src, useMC, srcClus);
110 o2::globaltracking::InputHelper::addInputSpecsPVertex(configcontext, inputspecs, useMC); // P-vertex is always needed
111
112 if (configcontext.options().get<bool>("combine-source-devices")) {
113 std::vector<DataProcessorSpec> unmerged;
114 specs.push_back(specCombiner("SV-Input-Reader", inputspecs, unmerged));
115 if (unmerged.size() > 0) {
116 // LOG(fatal) << "unexpected DPL merge error";
117 for (auto& s : unmerged) {
118 specs.push_back(s);
119 LOG(info) << " adding unmerged spec " << s.name;
120 }
121 }
122 } else {
123 for (auto& s : inputspecs) {
124 specs.push_back(s);
125 }
126 }
127
128 if (!disableRootOut) {
130 if (enableStrTr) {
132 }
133 }
134
135 // configure dpl timer to inject correct firstTForbit: start from the 1st orbit of TF containing 1st sampled orbit
136 o2::raw::HBFUtilsInitializer hbfIni(configcontext, specs);
137
138 return std::move(specs);
139}
Helper class to access load maps from CCDB.
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 CorrectionMapsLoaderGloOpts parseGlobalOptions(const o2::framework::ConfigParamRegistry &opts)
GLenum src
Definition glcorearb.h:1767
Defining PrimaryVertex explicitly as messageable.
Definition TFIDInfo.h:20
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(bool enableIDCs, bool enableMShape)
o2::framework::DataProcessorSpec getSecondaryVertexingSpec(o2::dataformats::GlobalTrackID::mask_t src, bool enableCasc, bool enable3body, bool enableStrangenesTracking, bool enableCCDBParams, bool useMC, bool useGeom, const o2::tpc::CorrectionMapsLoaderGloOpts &sclOpts)
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 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"