Skip to content

Commit 83bb5f9

Browse files
committed
ITS: try fix for QC
Signed-off-by: Felix Schlepper <felix.schlepper@cern.ch>
1 parent 3af5787 commit 83bb5f9

File tree

4 files changed

+23
-18
lines changed

4 files changed

+23
-18
lines changed

Detectors/ITSMFT/common/reconstruction/include/ITSMFTReconstruction/RawPixelDecoder.h

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
// Copyright 2019-2020 CERN and copyright holders of ALICE O2.
1+
// Copyright 2019-2026 CERN and copyright holders of ALICE O2.
22
// See https://alice-o2.web.cern.ch/copyright for details of the copyright holders.
33
// All rights not expressly granted are reserved.
44
//
@@ -14,6 +14,7 @@
1414
#ifndef ALICEO2_ITSMFT_RAWPIXELDECODER_H_
1515
#define ALICEO2_ITSMFT_RAWPIXELDECODER_H_
1616

17+
#include <unordered_map>
1718
#include <array>
1819
#include <TStopwatch.h>
1920
#include "Framework/Logger.h"
@@ -30,7 +31,6 @@
3031
#include "DataFormatsITSMFT/ROFRecord.h"
3132
#include "ITSMFTReconstruction/PixelData.h"
3233
#include "ITSMFTReconstruction/GBTWord.h"
33-
#include <unordered_map>
3434

3535
namespace o2
3636
{
@@ -57,7 +57,7 @@ class RawPixelDecoder final : public PixelReader
5757
bool getNextChipData(ChipPixelData& chipData) final;
5858
ChipPixelData* getNextChipData(std::vector<ChipPixelData>& chipDataVec) final;
5959
void ensureChipOrdering() {}
60-
void startNewTF(o2::framework::InputRecord& inputs, const std::vector<o2::framework::InputSpec>& filter);
60+
void startNewTF(o2::framework::InputRecord& inputs);
6161
void collectROFCableData(int iru);
6262
int decodeNextTrigger() final;
6363

@@ -92,6 +92,9 @@ class RawPixelDecoder final : public PixelReader
9292
void setVerbosity(int v);
9393
int getVerbosity() const { return mVerbosity; }
9494

95+
void setInputFilter(std::vector<o2::framework::InputSpec> filter) { mInputFilter = std::move(filter); }
96+
const auto& getInputFilter() const noexcept { return mInputFilter; }
97+
9598
void setAlwaysParseTrigger(bool v) { mAlwaysParseTrigger = v; }
9699
bool getAlwaysParseTrigger() const { return mAlwaysParseTrigger; }
97100

@@ -139,14 +142,15 @@ class RawPixelDecoder final : public PixelReader
139142
void reset();
140143

141144
private:
142-
void setupLinks(o2::framework::InputRecord& inputsm, const std::vector<o2::framework::InputSpec>& filter);
145+
void setupLinks(o2::framework::InputRecord& inputsm);
143146
int getRUEntrySW(int ruSW) const { return mRUEntry[ruSW]; }
144147
RUDecodeData* getRUDecode(int ruSW) { return &mRUDecodeVec[mRUEntry[ruSW]]; }
145148
GBTLink* getGBTLink(int i) { return i < 0 ? nullptr : &mGBTLinks[i]; }
146149
RUDecodeData& getCreateRUDecode(int ruSW);
147150

148151
static constexpr uint16_t NORUDECODED = 0xffff; // this must be > than max N RUs
149152

153+
std::vector<o2::framework::InputSpec> mInputFilter; // input spec filter
150154
std::vector<GBTLink> mGBTLinks; // active links pool
151155
std::unordered_map<uint32_t, LinkEntry> mSubsSpec2LinkID; // link subspec to link entry in the pool mapping
152156
std::vector<RUDecodeData> mRUDecodeVec; // set of active RUs

Detectors/ITSMFT/common/reconstruction/src/RawPixelDecoder.cxx

Lines changed: 11 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
// Copyright 2019-2020 CERN and copyright holders of ALICE O2.
1+
// Copyright 2019-2026 CERN and copyright holders of ALICE O2.
22
// See https://alice-o2.web.cern.ch/copyright for details of the copyright holders.
33
// All rights not expressly granted are reserved.
44
//
@@ -40,7 +40,8 @@ RawPixelDecoder<Mapping>::RawPixelDecoder()
4040
mTimerDecode.Stop();
4141
mTimerFetchData.Stop();
4242
mSelfName = o2::utils::Str::concat_string(Mapping::getName(), "Decoder");
43-
DPLRawParser<>::setCheckIncompleteHBF(false); // Disable incomplete HBF checking, see ErrPacketCounterJump check in GBTLink.cxx
43+
DPLRawParser<>::setCheckIncompleteHBF(false); // Disable incomplete HBF checking, see ErrPacketCounterJump check in GBTLink.cxx
44+
mInputFilter = {InputSpec{"filter", ConcreteDataTypeMatcher{Mapping::getOrigin(), o2::header::gDataDescriptionRawData}}}; // by default take all raw data
4445
}
4546

4647
///______________________________________________________________
@@ -102,8 +103,7 @@ int RawPixelDecoder<Mapping>::decodeNextTrigger()
102103
}
103104

104105
#ifdef WITH_OPENMP
105-
#pragma omp parallel for schedule(dynamic) num_threads(mNThreads) reduction(+ \
106-
: mNChipsFiredROF, mNPixelsFiredROF)
106+
#pragma omp parallel for schedule(dynamic) num_threads(mNThreads) reduction(+ : mNChipsFiredROF, mNPixelsFiredROF)
107107
#endif
108108
for (int iru = 0; iru < nru; iru++) {
109109
auto& ru = mRUDecodeVec[iru];
@@ -136,7 +136,7 @@ int RawPixelDecoder<Mapping>::decodeNextTrigger()
136136
///______________________________________________________________
137137
/// prepare for new TF
138138
template <class Mapping>
139-
void RawPixelDecoder<Mapping>::startNewTF(InputRecord& inputs, const std::vector<InputSpec>& filter)
139+
void RawPixelDecoder<Mapping>::startNewTF(InputRecord& inputs)
140140
{
141141
mTimerTFStart.Start(false);
142142
for (auto& link : mGBTLinks) {
@@ -149,7 +149,7 @@ void RawPixelDecoder<Mapping>::startNewTF(InputRecord& inputs, const std::vector
149149
ru.linkHBFToDump.clear();
150150
ru.nLinksDone = 0;
151151
}
152-
setupLinks(inputs, filter);
152+
setupLinks(inputs);
153153
mNLinksDone = 0;
154154
mExtTriggers.clear();
155155
mTimerTFStart.Stop();
@@ -226,7 +226,7 @@ bool RawPixelDecoder<Mapping>::doIRMajorityPoll()
226226
///______________________________________________________________
227227
/// Setup links checking the very RDH of every input
228228
template <class Mapping>
229-
void RawPixelDecoder<Mapping>::setupLinks(InputRecord& inputs, const std::vector<InputSpec>& filter)
229+
void RawPixelDecoder<Mapping>::setupLinks(InputRecord& inputs)
230230
{
231231
constexpr uint32_t ROF_RAMP_FLAG = 0x1 << 4;
232232
constexpr uint32_t LINK_RECOVERY_FLAG = 0x1 << 5;
@@ -235,6 +235,9 @@ void RawPixelDecoder<Mapping>::setupLinks(InputRecord& inputs, const std::vector
235235
auto nLinks = mGBTLinks.size();
236236
auto origin = (mUserDataOrigin == o2::header::gDataOriginInvalid) ? mMAP.getOrigin() : mUserDataOrigin;
237237
auto datadesc = (mUserDataDescription == o2::header::gDataDescriptionInvalid) ? o2::header::gDataDescriptionRawData : mUserDataDescription;
238+
if (mUserDataDescription != o2::header::gDataDescriptionInvalid) { // overwrite data filter descriptions with user
239+
mInputFilter = {InputSpec{"filter", ConcreteDataTypeMatcher{origin, datadesc}}}; // TODO: for now assume all are requested and no explicit filter was set
240+
}
238241

239242
// if we see requested data type input with 0xDEADBEEF subspec and 0 payload this means that the "delayed message"
240243
// mechanism created it in absence of real data from upstream. Processor should send empty output to not block the workflow
@@ -257,7 +260,7 @@ void RawPixelDecoder<Mapping>::setupLinks(InputRecord& inputs, const std::vector
257260
contDeadBeef = 0; // if good data, reset the counter
258261
}
259262
mROFRampUpStage = false;
260-
DPLRawParser parser(inputs, filter, o2::conf::VerbosityConfig::Instance().rawParserSeverity);
263+
DPLRawParser parser(inputs, mInputFilter, o2::conf::VerbosityConfig::Instance().rawParserSeverity);
261264
parser.setMaxFailureMessages(o2::conf::VerbosityConfig::Instance().maxWarnRawParser);
262265
static size_t cntParserFailures = 0;
263266
parser.setExtFailureCounter(&cntParserFailures);

Detectors/ITSMFT/common/workflow/include/ITSMFTWorkflow/STFDecoderSpec.h

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -109,7 +109,6 @@ class STFDecoder : public Task
109109
std::vector<std::unique_ptr<RawPixelDecoder<Mapping>>> mDecoder;
110110
std::unique_ptr<Clusterer> mClusterer;
111111
std::shared_ptr<o2::base::GRPGeomRequest> mGGCCDBRequest;
112-
std::vector<std::vector<InputSpec>> mRawFilter;
113112
};
114113

115114
using STFDecoderITS = STFDecoder<ChipMappingITS>;

Detectors/ITSMFT/common/workflow/src/STFDecoderSpec.cxx

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -135,13 +135,12 @@ void STFDecoder<Mapping>::init(InitContext& ic)
135135
if (mDoStaggering) {
136136
Mapping map;
137137
for (uint32_t iLayer{0}; iLayer < mLayers; ++iLayer) {
138-
auto& filter = mRawFilter.emplace_back();
138+
std::vector<o2::framework::InputSpec> filter;
139139
for (const auto feeID : map.getLayer2FEEIDs(iLayer)) {
140140
filter.emplace_back("filter", ConcreteDataMatcher{Mapping::getOrigin(), o2::header::gDataDescriptionRawData, (o2::header::DataHeader::SubSpecificationType)feeID});
141141
}
142+
mDecoder[iLayer]->setInputFilter(filter);
142143
}
143-
} else {
144-
mRawFilter.push_back({InputSpec{"filter", ConcreteDataTypeMatcher{Mapping::getOrigin(), o2::header::gDataDescriptionRawData}}});
145144
}
146145
}
147146

@@ -201,9 +200,9 @@ void STFDecoder<Mapping>::run(ProcessingContext& pc)
201200
}
202201

203202
try {
204-
mDecoder[iLayer]->startNewTF(pc.inputs(), mRawFilter[iLayer]);
205-
203+
mDecoder[iLayer]->startNewTF(pc.inputs());
206204
mDecoder[iLayer]->setDecodeNextAuto(false);
205+
207206
o2::InteractionRecord lastIR{};
208207
int nTriggersProcessed = mDecoder[iLayer]->getNROFsProcessed();
209208
static long lastErrReportTS = 0;

0 commit comments

Comments
 (0)