Project
Loading...
Searching...
No Matches
cosmics-match-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
36
37using namespace o2::framework;
40// ------------------------------------------------------------------
41void customize(std::vector<o2::framework::CallbacksPolicy>& policies)
42{
44}
45
46// we need to add workflow options before including Framework/runDataProcessing
47void customize(std::vector<o2::framework::ConfigParamSpec>& workflowOptions)
48{
49 // option allowing to set parameters
50 std::vector<o2::framework::ConfigParamSpec> options{
51 {"disable-mc", o2::framework::VariantType::Bool, false, {"disable MC propagation even if available"}},
52 {"disable-root-input", o2::framework::VariantType::Bool, false, {"disable root-files input reader"}},
53 {"disable-root-output", o2::framework::VariantType::Bool, false, {"disable root-files output writer"}},
54 {"track-sources", VariantType::String, std::string{GID::ALL}, {"comma-separated list of sources to use"}},
55 {"configKeyValues", VariantType::String, "", {"Semicolon separated key=value strings ..."}}};
59 std::swap(workflowOptions, options);
60}
61
62// RS FIXME Is this needed ?
63// the matcher process requires the TPC sector completion to trigger and data on
64// all defined routes
65void customize(std::vector<o2::framework::CompletionPolicy>& policies)
66{
67 // the TPC sector completion policy checks when the set of TPC/CLUSTERNATIVE data is complete
68 // in addition we require to have input from all other routes
69 policies.push_back(o2::tpc::TPCSectorCompletionPolicy("cosmics-matcher",
71 InputSpec{"cluster", o2::framework::ConcreteDataTypeMatcher{"TPC", "CLUSTERNATIVE"}})());
72 policies.push_back(CompletionPolicyHelpers::consumeWhenAllOrdered(".*cosm.*[W,w]riter.*"));
73}
74
75// ------------------------------------------------------------------
76
78
80{
81 WorkflowSpec specs;
82 GID::mask_t alowedSources = GID::getSourcesMask("ITS,TPC,ITS-TPC,TPC-TRD,TPC-TOF,TPC-TRD-TOF,ITS-TPC-TOF,ITS-TPC-TRD-TOF");
83
84 // Update the (declared) parameters if changed from the command line
85 o2::conf::ConfigurableParam::updateFromString(configcontext.options().get<std::string>("configKeyValues"));
86 // write the configuration used for the workflow
87 o2::conf::ConfigurableParam::writeINI("o2match-cosmics-workflow_configuration.ini");
89 auto useMC = !configcontext.options().get<bool>("disable-mc");
90 auto disableRootOut = configcontext.options().get<bool>("disable-root-output");
91
92 GID::mask_t src = alowedSources & GID::getSourcesMask(configcontext.options().get<std::string>("track-sources"));
93 if (GID::includesDet(DetID::TPC, src)) {
94 src |= GID::getSourceMask(GID::TPC);
95 }
96 if (GID::includesDet(DetID::TRD, src)) {
97 src |= GID::getSourceMask(GID::TRD);
98 }
99 if (GID::includesDet(DetID::TOF, src)) {
100 src |= GID::getSourceMask(GID::TOF);
101 }
102 if (sclOpt.requestCTPLumi) {
103 src = src | GID::getSourcesMask("CTP");
104 }
105 GID::mask_t srcCl = src;
106 GID::mask_t dummy;
107 if (!configcontext.options().get<bool>("disable-root-input")) {
108 specs.emplace_back(o2::tpc::getTPCScalerSpec(sclOpt.lumiType == o2::tpc::LumiScaleType::TPCScaler, sclOpt.enableMShapeCorrection, sclOpt));
109 }
110 specs.emplace_back(o2::globaltracking::getCosmicsMatchingSpec(src, useMC));
111
112 o2::globaltracking::InputHelper::addInputSpecs(configcontext, specs, src, src, src, useMC, dummy); // clusters MC is not needed
113
114 if (!disableRootOut) {
115 specs.emplace_back(o2::globaltracking::getTrackCosmicsWriterSpec(useMC));
116 }
117
118 // configure dpl timer to inject correct firstTForbit: start from the 1st orbit of TF containing 1st sampled orbit
119 o2::raw::HBFUtilsInitializer hbfIni(configcontext, specs);
120
121 return std::move(specs);
122}
Device to produce TPC clusters sharing map.
Helper class to parse options for correction maps.
Global index for barrel track: provides provenance (detectors combination), index in respective array...
Helper function to tokenize sequences and ranges of integral numbers.
DPL completion policy helper for TPC scetor data.
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 TRD
Definition DetID.h:65
static constexpr ID TPC
Definition DetID.h:64
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 void addGlobalOptions(std::vector< o2::framework::ConfigParamSpec > &options)
static CorrectionMapsGloOpts parseGlobalOptions(const o2::framework::ConfigParamRegistry &opts)
WorkflowSpec defineDataProcessing(ConfigContext const &configcontext)
void customize(std::vector< o2::framework::CallbacksPolicy > &policies)
GLenum src
Definition glcorearb.h:1767
Defining ITS Vertex explicitly as messageable.
Definition Cartesian.h:288
std::vector< DataProcessorSpec > WorkflowSpec
framework::DataProcessorSpec getTrackCosmicsWriterSpec(bool useMC)
framework::DataProcessorSpec getCosmicsMatchingSpec(o2::dataformats::GlobalTrackID::mask_t src, bool useMC)
create a processor spec
@ TPCScaler
use TPC scaler for scaling
o2::framework::DataProcessorSpec getTPCScalerSpec(bool enableIDCs, bool enableMShape, const o2::tpc::CorrectionMapsGloOpts &sclOpts)
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))