forked from AliceO2Group/AliceO2
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathSTFDecoderSpec.cxx
More file actions
447 lines (417 loc) · 21.9 KB
/
STFDecoderSpec.cxx
File metadata and controls
447 lines (417 loc) · 21.9 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
// Copyright 2019-2020 CERN and copyright holders of ALICE O2.
// See https://alice-o2.web.cern.ch/copyright for details of the copyright holders.
// All rights not expressly granted are reserved.
//
// This software is distributed under the terms of the GNU General Public
// License v3 (GPL Version 3), copied verbatim in the file "COPYING".
//
// In applying this license CERN does not waive the privileges and immunities
// granted to it by virtue of its status as an Intergovernmental Organization
// or submit itself to any jurisdiction.
/// \file STFDecoderSpec.cxx
/// \brief Device to decode ITS or MFT raw data from STF
/// \author ruben.shahoyan@cern.ch
#include <vector>
#include "Framework/WorkflowSpec.h"
#include "Framework/ConfigParamRegistry.h"
#include "Framework/ControlService.h"
#include "Framework/DeviceSpec.h"
#include "Framework/CCDBParamSpec.h"
#include "DataFormatsITSMFT/Digit.h"
#include "DataFormatsITSMFT/ROFRecord.h"
#include "ITSMFTReconstruction/RawPixelDecoder.h"
#include "ITSMFTReconstruction/DigitPixelReader.h"
#include "ITSMFTReconstruction/Clusterer.h"
#include "ITSMFTReconstruction/ClustererParam.h"
#include "ITSMFTReconstruction/GBTLink.h"
#include "ITSMFTWorkflow/STFDecoderSpec.h"
#include "DetectorsCommonDataFormats/DetectorNameConf.h"
#include "ITSMFTBase/DPLAlpideParam.h"
#include "DataFormatsITSMFT/CompCluster.h"
#include "DetectorsCommonDataFormats/DetID.h"
#include "CommonUtils/StringUtils.h"
#include "CommonUtils/VerbosityConfig.h"
#include "DetectorsBase/GRPGeomHelper.h"
#include "DataFormatsParameters/GRPECSObject.h"
namespace o2
{
namespace itsmft
{
using namespace o2::framework;
///_______________________________________
template <class Mapping>
STFDecoder<Mapping>::STFDecoder(const STFDecoderInp& inp, std::shared_ptr<o2::base::GRPGeomRequest> gr)
: mDoClusters(inp.doClusters), mDoPatterns(inp.doPatterns), mDoDigits(inp.doDigits), mDoCalibData(inp.doCalib), mAllowReporting(inp.allowReporting), mVerifyDecoder(inp.verifyDecoder), mInputSpec(inp.inputSpec), mGGCCDBRequest(gr)
{
mSelfName = o2::utils::Str::concat_string(Mapping::getName(), "STFDecoder");
mTimer.Stop();
mTimer.Reset();
}
///_______________________________________
template <class Mapping>
void STFDecoder<Mapping>::init(InitContext& ic)
{
o2::base::GRPGeomHelper::instance().setRequest(mGGCCDBRequest);
try {
mDecoder = std::make_unique<RawPixelDecoder<Mapping>>();
auto v0 = o2::utils::Str::tokenize(mInputSpec, ':');
auto v1 = o2::utils::Str::tokenize(v0[1], '/');
auto v2 = o2::utils::Str::tokenize(v1[1], '?');
header::DataOrigin dataOrig;
header::DataDescription dataDesc;
dataOrig.runtimeInit(v1[0].c_str());
dataDesc.runtimeInit(v2[0].c_str());
mDecoder->setUserDataOrigin(dataOrig);
mDecoder->setUserDataDescription(dataDesc);
mDecoder->init(); // is this no-op?
} catch (const std::exception& e) {
LOG(error) << "exception was thrown in decoder creation: " << e.what();
throw;
} catch (...) {
LOG(error) << "non-std::exception was thrown in decoder creation";
throw;
}
mApplyNoiseMap = !ic.options().get<bool>("ignore-noise-map");
mUseClusterDictionary = !ic.options().get<bool>("ignore-cluster-dictionary");
try {
float fr = ic.options().get<float>("rof-lenght-error-freq");
mROFErrRepIntervalMS = fr <= 0. ? -1 : long(fr * 1e3);
mNThreads = std::max(1, ic.options().get<int>("nthreads"));
mDecoder->setNThreads(mNThreads);
mUnmutExtraLanes = ic.options().get<bool>("unmute-extra-lanes");
mVerbosity = ic.options().get<int>("decoder-verbosity");
auto dmpSz = ic.options().get<int>("stop-raw-data-dumps-after-size");
if (dmpSz > 0) {
mMaxRawDumpsSize = size_t(dmpSz) * 1024 * 1024;
}
mDumpOnError = ic.options().get<int>("raw-data-dumps");
if (mDumpOnError < 0) {
mDumpOnError = -mDumpOnError;
mDumpFrom1stPipeline = true;
}
if (mDumpOnError >= int(GBTLink::RawDataDumps::DUMP_NTYPES)) {
throw std::runtime_error(fmt::format("unknown raw data dump level {} requested", mDumpOnError));
}
auto dumpDir = ic.options().get<std::string>("raw-data-dumps-directory");
if (mDumpOnError != int(GBTLink::RawDataDumps::DUMP_NONE) && (!dumpDir.empty() && !o2::utils::Str::pathIsDirectory(dumpDir))) {
throw std::runtime_error(fmt::format("directory {} for raw data dumps does not exist", dumpDir));
}
mDecoder->setAlwaysParseTrigger(ic.options().get<bool>("always-parse-trigger"));
mDecoder->setAllowEmptyROFs(ic.options().get<bool>("allow-empty-rofs"));
mDecoder->setRawDumpDirectory(dumpDir);
mDecoder->setFillCalibData(mDoCalibData);
mDecoder->setVerifyDecoder(mVerifyDecoder);
bool ignoreRampUp = !ic.options().get<bool>("accept-rof-rampup-data");
mDecoder->setSkipRampUpData(ignoreRampUp);
} catch (const std::exception& e) {
LOG(error) << "exception was thrown in decoder configuration: " << e.what();
throw;
} catch (...) {
LOG(error) << "non-std::exception was thrown in decoder configuration";
throw;
}
if (mDoClusters) {
mClusterer = std::make_unique<Clusterer>();
mClusterer->setNChips(Mapping::getNChips());
}
}
///_______________________________________
template <class Mapping>
void STFDecoder<Mapping>::run(ProcessingContext& pc)
{
updateTimeDependentParams(pc);
static bool firstCall = true;
if (!firstCall && pc.services().get<o2::framework::TimingInfo>().globalRunNumberChanged) { // reset at the beginning of the new run
reset();
}
if (firstCall) {
firstCall = false;
mDecoder->setInstanceID(pc.services().get<const o2::framework::DeviceSpec>().inputTimesliceId);
mDecoder->setNInstances(pc.services().get<const o2::framework::DeviceSpec>().maxInputTimeslices);
mDecoder->setVerbosity(mDecoder->getInstanceID() == 0 ? mVerbosity : (mUnmutExtraLanes ? mVerbosity : -1));
mAllowReporting &= (mDecoder->getInstanceID() == 0) || mUnmutExtraLanes;
}
int nSlots = pc.inputs().getNofParts(0);
double timeCPU0 = mTimer.CpuTime(), timeReal0 = mTimer.RealTime();
mTimer.Start(false);
auto orig = Mapping::getOrigin();
std::vector<o2::itsmft::CompClusterExt> clusCompVec;
std::vector<o2::itsmft::ROFRecord> clusROFVec;
std::vector<unsigned char> clusPattVec;
std::vector<Digit> digVec;
std::vector<GBTCalibData> calVec;
std::vector<ROFRecord> digROFVec;
auto& chipStatus = pc.outputs().make<std::vector<char>>(Output{orig, "CHIPSSTATUS", 0}, (size_t)Mapping::getNChips());
try {
mDecoder->startNewTF(pc.inputs());
if (mDoDigits) {
digVec.reserve(mEstNDig);
digROFVec.reserve(mEstNROF);
}
if (mDoClusters) {
clusCompVec.reserve(mEstNClus);
clusROFVec.reserve(mEstNROF);
clusPattVec.reserve(mEstNClusPatt);
}
if (mDoCalibData) {
calVec.reserve(mEstNCalib);
}
mDecoder->setDecodeNextAuto(false);
o2::InteractionRecord lastIR{}, firstIR{0, pc.services().get<o2::framework::TimingInfo>().firstTForbit};
int nTriggersProcessed = mDecoder->getNROFsProcessed();
static long lastErrReportTS = 0;
while (mDecoder->decodeNextTrigger() >= 0) {
if ((!lastIR.isDummy() && lastIR >= mDecoder->getInteractionRecord()) || firstIR > mDecoder->getInteractionRecord()) {
const int MaxErrLog = 2;
static int errLocCount = 0;
if (errLocCount++ < MaxErrLog) {
LOGP(warn, "Impossible ROF IR {}, previous was {}, TF 1st IR was {}, discarding in decoding", mDecoder->getInteractionRecord().asString(), lastIR.asString(), firstIR.asString());
}
nTriggersProcessed = 0x7fffffff; // to account for a problem with event
continue;
}
lastIR = mDecoder->getInteractionRecord();
mDecoder->fillChipsStatus(chipStatus);
if (mDoDigits || mClusterer->getMaxROFDepthToSquash()) { // call before clusterization, since the latter will hide the digits
mDecoder->fillDecodedDigits(digVec, digROFVec); // lot of copying involved
if (mDoCalibData) {
mDecoder->fillCalibData(calVec);
}
}
if (mDoClusters && !mClusterer->getMaxROFDepthToSquash()) { // !!! THREADS !!!
mClusterer->process(mNThreads, *mDecoder.get(), &clusCompVec, mDoPatterns ? &clusPattVec : nullptr, &clusROFVec);
}
}
nTriggersProcessed = mDecoder->getNROFsProcessed() - nTriggersProcessed - 1;
const auto& alpParams = o2::itsmft::DPLAlpideParam<Mapping::getDetID()>::Instance();
int expectedTFSize = static_cast<int>(o2::constants::lhc::LHCMaxBunches * o2::base::GRPGeomHelper::instance().getGRPECS()->getNHBFPerTF() / alpParams.roFrameLengthInBC); // 3564*32 / ROF Length in BS = number of ROFs per TF
if ((expectedTFSize != nTriggersProcessed) && mROFErrRepIntervalMS > 0 && mTFCounter > 1 && nTriggersProcessed > 0) {
long currTS = std::chrono::time_point_cast<std::chrono::milliseconds>(std::chrono::system_clock::now()).time_since_epoch().count();
if (currTS - lastErrReportTS > mROFErrRepIntervalMS) {
LOGP(critical, "Inconsistent number of ROF per TF. From parameters: {} from readout: {} (muting further reporting for {} ms)", expectedTFSize, nTriggersProcessed, mROFErrRepIntervalMS);
lastErrReportTS = currTS;
}
}
if (mDoClusters && mClusterer->getMaxROFDepthToSquash()) {
// Digits squashing require to run on a batch of digits and uses a digit reader, cannot (?) run with decoder
// - Setup decoder for running on a batch of digits
o2::itsmft::DigitPixelReader reader;
reader.setSquashingDepth(mClusterer->getMaxROFDepthToSquash());
reader.setSquashingDist(mClusterer->getMaxRowColDiffToMask()); // Sharing same parameter/logic with masking
reader.setMaxBCSeparationToSquash(mClusterer->getMaxBCSeparationToSquash());
reader.setDigits(digVec);
reader.setROFRecords(digROFVec);
reader.init();
mClusterer->process(mNThreads, reader, &clusCompVec, mDoPatterns ? &clusPattVec : nullptr, &clusROFVec);
}
} catch (const std::exception& e) {
static size_t nErr = 0;
auto maxWarn = o2::conf::VerbosityConfig::Instance().maxWarnRawParser;
if (++nErr < maxWarn) {
LOGP(alarm, "EXCEPTION {} in raw decoder, abandoning TF decoding {}", e.what(), nErr == maxWarn ? "(will mute further warnings)" : "");
}
}
if (mDoDigits) {
pc.outputs().snapshot(Output{orig, "DIGITS", 0}, digVec);
pc.outputs().snapshot(Output{orig, "DIGITSROF", 0}, digROFVec);
mEstNDig = std::max(mEstNDig, size_t(digVec.size() * 1.2));
mEstNROF = std::max(mEstNROF, size_t(digROFVec.size() * 1.2));
if (mDoCalibData) {
pc.outputs().snapshot(Output{orig, "GBTCALIB", 0}, calVec);
mEstNCalib = std::max(mEstNCalib, size_t(calVec.size() * 1.2));
}
}
if (mDoClusters) { // we are not obliged to create vectors which are not requested, but other devices might not know the options of this one
pc.outputs().snapshot(Output{orig, "COMPCLUSTERS", 0}, clusCompVec);
pc.outputs().snapshot(Output{orig, "PATTERNS", 0}, clusPattVec);
pc.outputs().snapshot(Output{orig, "CLUSTERSROF", 0}, clusROFVec);
mEstNClus = std::max(mEstNClus, size_t(clusCompVec.size() * 1.2));
mEstNClusPatt = std::max(mEstNClusPatt, size_t(clusPattVec.size() * 1.2));
mEstNROF = std::max(mEstNROF, size_t(clusROFVec.size() * 1.2));
}
auto& linkErrors = pc.outputs().make<std::vector<GBTLinkDecodingStat>>(Output{orig, "LinkErrors", 0});
auto& decErrors = pc.outputs().make<std::vector<ChipError>>(Output{orig, "ChipErrors", 0});
auto& errMessages = pc.outputs().make<std::vector<ErrorMessage>>(Output{orig, "ErrorInfo", 0});
mDecoder->collectDecodingErrors(linkErrors, decErrors, errMessages);
pc.outputs().snapshot(Output{orig, "PHYSTRIG", 0}, mDecoder->getExternalTriggers());
if (mDumpOnError != int(GBTLink::RawDataDumps::DUMP_NONE) &&
(!mDumpFrom1stPipeline || pc.services().get<const o2::framework::DeviceSpec>().inputTimesliceId == 0)) {
mRawDumpedSize += mDecoder->produceRawDataDumps(mDumpOnError, pc.services().get<o2::framework::TimingInfo>());
if (mRawDumpedSize > mMaxRawDumpsSize && mMaxRawDumpsSize > 0) {
LOGP(info, "Max total dumped size {} MB exceeded allowed limit, disabling further dumping", mRawDumpedSize / (1024 * 1024));
mDumpOnError = int(GBTLink::RawDataDumps::DUMP_NONE);
}
}
if (mDoClusters) {
LOG(debug) << mSelfName << " Built " << clusCompVec.size() << " clusters in " << clusROFVec.size() << " ROFs";
}
if (mDoDigits) {
LOG(debug) << mSelfName << " Decoded " << digVec.size() << " Digits in " << digROFVec.size() << " ROFs";
}
mTimer.Stop();
auto tfID = pc.services().get<o2::framework::TimingInfo>().tfCounter;
LOG(debug) << mSelfName << " Total time for TF " << tfID << '(' << mTFCounter << ") : CPU: " << mTimer.CpuTime() - timeCPU0 << " Real: " << mTimer.RealTime() - timeReal0;
mTFCounter++;
}
///_______________________________________
template <class Mapping>
void STFDecoder<Mapping>::finalize()
{
if (mFinalizeDone) {
return;
}
mFinalizeDone = true;
LOGF(info, "%s statistics:", mSelfName);
LOGF(info, "%s Total STF decoding%s timing (w/o disk IO): Cpu: %.3e Real: %.3e s in %d slots", mSelfName,
mDoClusters ? "/clustering" : "", mTimer.CpuTime(), mTimer.RealTime(), mTimer.Counter() - 1);
if (mDecoder && mAllowReporting) {
mDecoder->printReport();
}
if (mClusterer) {
mClusterer->print();
}
}
///_______________________________________
template <class Mapping>
void STFDecoder<Mapping>::updateTimeDependentParams(ProcessingContext& pc)
{
// we call these methods just to trigger finaliseCCDB callback
o2::base::GRPGeomHelper::instance().checkUpdates(pc);
if (pc.services().get<o2::framework::TimingInfo>().globalRunNumberChanged) { // this params need to be queried only in the beginning of the run
pc.inputs().get<o2::itsmft::NoiseMap*>("noise");
pc.inputs().get<o2::itsmft::DPLAlpideParam<Mapping::getDetID()>*>("alppar");
const auto& alpParams = DPLAlpideParam<Mapping::getDetID()>::Instance();
alpParams.printKeyValues();
if (mDoClusters) {
mClusterer->setContinuousReadOut(o2::base::GRPGeomHelper::instance().getGRPECS()->isDetContinuousReadOut(Mapping::getDetID()));
pc.inputs().get<o2::itsmft::TopologyDictionary*>("cldict");
pc.inputs().get<o2::itsmft::ClustererParam<Mapping::getDetID()>*>("cluspar");
// settings for the fired pixel overflow masking
const auto& clParams = ClustererParam<Mapping::getDetID()>::Instance();
if (clParams.maxBCDiffToMaskBias > 0 && clParams.maxBCDiffToSquashBias > 0) {
LOGP(fatal, "maxBCDiffToMaskBias = {} and maxBCDiffToMaskBias = {} cannot be set at the same time. Either set masking or squashing with a BCDiff > 0", clParams.maxBCDiffToMaskBias, clParams.maxBCDiffToSquashBias);
}
clParams.printKeyValues();
auto nbc = clParams.maxBCDiffToMaskBias;
nbc += mClusterer->isContinuousReadOut() ? alpParams.roFrameLengthInBC : (alpParams.roFrameLengthTrig / o2::constants::lhc::LHCBunchSpacingNS);
mClusterer->setMaxBCSeparationToMask(nbc);
mClusterer->setMaxRowColDiffToMask(clParams.maxRowColDiffToMask);
// Squasher
int rofBC = mClusterer->isContinuousReadOut() ? alpParams.roFrameLengthInBC : (alpParams.roFrameLengthTrig / o2::constants::lhc::LHCBunchSpacingNS); // ROF length in BC
mClusterer->setMaxBCSeparationToSquash(rofBC + clParams.maxBCDiffToSquashBias);
int nROFsToSquash = 0; // squashing disabled if no reset due to maxSOTMUS>0.
if (clParams.maxSOTMUS > 0 && rofBC > 0) {
nROFsToSquash = 2 + int(clParams.maxSOTMUS / (rofBC * o2::constants::lhc::LHCBunchSpacingMUS)); // use squashing
}
mClusterer->setMaxROFDepthToSquash(clParams.maxBCDiffToSquashBias > 0 ? nROFsToSquash : 0);
mClusterer->print();
}
}
}
///_______________________________________
template <class Mapping>
void STFDecoder<Mapping>::finaliseCCDB(o2::framework::ConcreteDataMatcher& matcher, void* obj)
{
if (o2::base::GRPGeomHelper::instance().finaliseCCDB(matcher, obj)) {
return;
}
if (matcher == ConcreteDataMatcher(Mapping::getOrigin(), "NOISEMAP", 0)) {
LOG(info) << Mapping::getName() << " noise map updated" << (!mApplyNoiseMap ? " but masking is disabled" : "");
if (mApplyNoiseMap) {
AlpideCoder::setNoisyPixels((const NoiseMap*)obj);
}
return;
}
if (matcher == ConcreteDataMatcher(Mapping::getOrigin(), "CLUSDICT", 0)) {
LOG(info) << Mapping::getName() << " cluster dictionary updated" << (!mUseClusterDictionary ? " but its using is disabled" : "");
if (mUseClusterDictionary) {
mClusterer->setDictionary((const TopologyDictionary*)obj);
}
return;
}
// Note: strictly speaking, for Configurable params we don't need finaliseCCDB check, the singletons are updated at the CCDB fetcher level
if (matcher == ConcreteDataMatcher(Mapping::getOrigin(), "ALPIDEPARAM", 0)) {
LOG(info) << "Alpide param updated";
return;
}
}
///_______________________________________
template <class Mapping>
void STFDecoder<Mapping>::reset()
{
// reset for the new run
mFinalizeDone = false;
mTFCounter = 0;
mTimer.Reset();
if (mDecoder) {
mDecoder->reset();
}
if (mClusterer) {
mClusterer->reset();
}
}
///_______________________________________
DataProcessorSpec getSTFDecoderSpec(const STFDecoderInp& inp)
{
std::vector<OutputSpec> outputs;
auto inputs = o2::framework::select(inp.inputSpec.c_str());
if (inp.doDigits) {
outputs.emplace_back(inp.origin, "DIGITS", 0, Lifetime::Timeframe);
outputs.emplace_back(inp.origin, "DIGITSROF", 0, Lifetime::Timeframe);
if (inp.doCalib) {
outputs.emplace_back(inp.origin, "GBTCALIB", 0, Lifetime::Timeframe);
}
}
if (inp.doClusters) {
outputs.emplace_back(inp.origin, "COMPCLUSTERS", 0, Lifetime::Timeframe);
outputs.emplace_back(inp.origin, "CLUSTERSROF", 0, Lifetime::Timeframe);
// in principle, we don't need to open this input if we don't need to send real data,
// but other devices expecting it do not know about options of this device: problem?
// if (doClusters && doPatterns)
outputs.emplace_back(inp.origin, "PATTERNS", 0, Lifetime::Timeframe);
}
outputs.emplace_back(inp.origin, "PHYSTRIG", 0, Lifetime::Timeframe);
outputs.emplace_back(inp.origin, "LinkErrors", 0, Lifetime::Timeframe);
outputs.emplace_back(inp.origin, "ChipErrors", 0, Lifetime::Timeframe);
outputs.emplace_back(inp.origin, "ErrorInfo", 0, Lifetime::Timeframe);
outputs.emplace_back(inp.origin, "CHIPSSTATUS", 0, Lifetime::Timeframe);
if (inp.askSTFDist) {
// request the input FLP/DISTSUBTIMEFRAME/0 that is _guaranteed_ to be present, even if none of our raw data is present.
inputs.emplace_back("stfDist", "FLP", "DISTSUBTIMEFRAME", 0, o2::framework::Lifetime::Timeframe);
}
inputs.emplace_back("noise", inp.origin, "NOISEMAP", 0, Lifetime::Condition,
o2::framework::ccdbParamSpec(fmt::format("{}/Calib/NoiseMap", inp.origin.as<std::string>())));
inputs.emplace_back("alppar", inp.origin, "ALPIDEPARAM", 0, Lifetime::Condition, ccdbParamSpec(fmt::format("{}/Config/AlpideParam", inp.origin.as<std::string>())));
if (inp.doClusters) {
inputs.emplace_back("cldict", inp.origin, "CLUSDICT", 0, Lifetime::Condition, ccdbParamSpec(fmt::format("{}/Calib/ClusterDictionary", inp.origin.as<std::string>())));
inputs.emplace_back("cluspar", inp.origin, "CLUSPARAM", 0, Lifetime::Condition, ccdbParamSpec(fmt::format("{}/Config/ClustererParam", inp.origin.as<std::string>())));
}
auto ggRequest = std::make_shared<o2::base::GRPGeomRequest>(false, // orbitResetTime
true, // GRPECS=true
false, // GRPLHCIF
false, // GRPMagField
false, // askMatLUT
o2::base::GRPGeomRequest::None, // geometry
inputs,
true); // query only once all objects except mag.field
return DataProcessorSpec{
inp.deviceName,
inputs,
outputs,
inp.origin == o2::header::gDataOriginITS ? AlgorithmSpec{adaptFromTask<STFDecoder<ChipMappingITS>>(inp, ggRequest)} : AlgorithmSpec{adaptFromTask<STFDecoder<ChipMappingMFT>>(inp, ggRequest)},
Options{
{"nthreads", VariantType::Int, 1, {"Number of decoding/clustering threads"}},
{"decoder-verbosity", VariantType::Int, 0, {"Verbosity level (-1: silent, 0: errors, 1: headers, 2: data, 3: raw data dump) of 1st lane"}},
{"always-parse-trigger", VariantType::Bool, false, {"parse trigger word even if flags continuation of old trigger"}},
{"raw-data-dumps", VariantType::Int, int(GBTLink::RawDataDumps::DUMP_NONE), {"Raw data dumps on error (0: none, 1: HBF for link, 2: whole TF for all links. If negative, dump only on from 1st pipeline."}},
{"raw-data-dumps-directory", VariantType::String, "", {"Destination directory for the raw data dumps"}},
{"stop-raw-data-dumps-after-size", VariantType::Int, 1024, {"Stop dumping once this size in MB is accumulated. 0: no limit"}},
{"unmute-extra-lanes", VariantType::Bool, false, {"allow extra lanes to be as verbose as 1st one"}},
{"allow-empty-rofs", VariantType::Bool, false, {"record ROFs w/o any hit"}},
{"ignore-noise-map", VariantType::Bool, false, {"do not mask pixels flagged in the noise map"}},
{"accept-rof-rampup-data", VariantType::Bool, false, {"do not discard data during ROF ramp up"}},
{"rof-lenght-error-freq", VariantType::Float, 60.f, {"do not report ROF lenght error more frequently than this value, disable if negative"}},
{"ignore-cluster-dictionary", VariantType::Bool, false, {"do not use cluster dictionary, always store explicit patterns"}}}};
}
} // namespace itsmft
} // namespace o2