Project
Loading...
Searching...
No Matches
stf-decoder-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
15
16using namespace o2::framework;
17
18// ------------------------------------------------------------------
19
20// we need to add workflow options before including Framework/runDataProcessing
21void customize(std::vector<o2::framework::ConfigParamSpec>& workflowOptions)
22{
23 // option allowing to set parameters
24 std::vector<ConfigParamSpec> options{
25 ConfigParamSpec{"verify", VariantType::Bool, false, {"verify ALPIDE decoder by re-encoding the data"}},
26 ConfigParamSpec{"runmft", VariantType::Bool, false, {"source detector is MFT (default ITS)"}},
27 ConfigParamSpec{"no-clusters", VariantType::Bool, false, {"do not produce clusters (def: produce)"}},
28 ConfigParamSpec{"no-cluster-patterns", VariantType::Bool, false, {"do not produce clusters patterns (def: produce)"}},
29 ConfigParamSpec{"digits", VariantType::Bool, false, {"produce digits (def: skip)"}},
30 ConfigParamSpec{"enable-calib-data", VariantType::Bool, false, {"produce GBT calibration stream (def: skip)"}},
31 ConfigParamSpec{"squash-overflow-pixels", VariantType::Bool, false, {"merge chip information of consecutively fired neighbour pixels (for ALPIDE time-walking)"}},
32 ConfigParamSpec{"ignore-dist-stf", VariantType::Bool, false, {"do not subscribe to FLP/DISTSUBTIMEFRAME/0 message (no lost TF recovery)"}},
33 ConfigParamSpec{"dataspec", VariantType::String, "", {"selection string for the input data, if not provided <DET>Raw:<DET>/RAWDATA with DET=ITS or MFT will be used"}},
34 ConfigParamSpec{"report-dds-collection-index", VariantType::Int, -1, {"number of dpl collection allowed to produce decoding report (-1 means no limit)"}},
35 ConfigParamSpec{"configKeyValues", VariantType::String, "", {"Semicolon separated key=value strings"}}};
36
37 std::swap(workflowOptions, options);
38}
39
40// ------------------------------------------------------------------
41
43
45{
46 WorkflowSpec wf;
48 inp.doClusters = !cfgc.options().get<bool>("no-clusters");
49 inp.doPatterns = inp.doClusters && !cfgc.options().get<bool>("no-cluster-patterns");
50 inp.doDigits = cfgc.options().get<bool>("digits");
51 inp.doCalib = cfgc.options().get<bool>("enable-calib-data");
52 inp.doSquashing = cfgc.options().get<bool>("squash-overflow-pixels");
53 inp.askSTFDist = !cfgc.options().get<bool>("ignore-dist-stf");
54 inp.verifyDecoder = cfgc.options().get<bool>("verify");
55 inp.inputSpec = cfgc.options().get<std::string>("dataspec");
56 // Update the (declared) parameters if changed from the command line
57 o2::conf::ConfigurableParam::updateFromString(cfgc.options().get<std::string>("configKeyValues"));
58
59 if (cfgc.options().get<bool>("runmft")) {
60 if (inp.inputSpec.empty()) {
61 inp.inputSpec = "mftRAW:MFT/RAWDATA";
62 }
64 inp.deviceName = "mft-stf-decoder";
65 } else {
66 if (inp.inputSpec.empty()) {
67 inp.inputSpec = "itsRAW:ITS/RAWDATA";
68 }
70 inp.deviceName = "its-stf-decoder";
71 }
72
73 inp.allowReporting = true;
74 int repDDSColIdx = cfgc.options().get<int>("report-dds-collection-index");
75 if (repDDSColIdx != -1) {
76 char* colIdx = getenv("DDS_COLLECTION_INDEX");
77 int myIdx = colIdx ? atoi(colIdx) : -1;
78 inp.allowReporting = myIdx == repDDSColIdx;
79 }
80
81 wf.emplace_back(o2::itsmft::getSTFDecoderSpec(inp));
82
83 return wf;
84}
Device to decode ITS/MFT raw data from STF.
static void updateFromString(std::string const &)
ConfigParamRegistry & options() const
constexpr o2::header::DataOrigin gDataOriginMFT
Definition DataHeader.h:572
constexpr o2::header::DataOrigin gDataOriginITS
Definition DataHeader.h:570
Defining PrimaryVertex explicitly as messageable.
Definition TFIDInfo.h:20
std::vector< DataProcessorSpec > WorkflowSpec
o2::framework::DataProcessorSpec getSTFDecoderSpec(const STFDecoderInp &inp)
void customize(std::vector< o2::framework::ConfigParamSpec > &workflowOptions)
WorkflowSpec defineDataProcessing(ConfigContext const &cfgc)
o2::header::DataOrigin origin