Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,7 @@ GPUhdi() Tracklet::Tracklet(const int idx0, const int idx1, float tanL, float ph
// Nothing to do
}

GPUhdi() unsigned char Tracklet::operator<(const Tracklet & t) const
GPUhdi() unsigned char Tracklet::operator<(const Tracklet& t) const
{
if (isEmpty()) {
return false;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// Copyright 2019-2020 CERN and copyright holders of ALICE O2.
// Copyright 2019-2026 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.
//
Expand All @@ -14,6 +14,7 @@
#ifndef ALICEO2_ITSMFT_RAWPIXELDECODER_H_
#define ALICEO2_ITSMFT_RAWPIXELDECODER_H_

#include <unordered_map>
#include <array>
#include <TStopwatch.h>
#include "Framework/Logger.h"
Expand All @@ -30,7 +31,6 @@
#include "DataFormatsITSMFT/ROFRecord.h"
#include "ITSMFTReconstruction/PixelData.h"
#include "ITSMFTReconstruction/GBTWord.h"
#include <unordered_map>

namespace o2
{
Expand All @@ -57,7 +57,7 @@ class RawPixelDecoder final : public PixelReader
bool getNextChipData(ChipPixelData& chipData) final;
ChipPixelData* getNextChipData(std::vector<ChipPixelData>& chipDataVec) final;
void ensureChipOrdering() {}
void startNewTF(o2::framework::InputRecord& inputs, const std::vector<o2::framework::InputSpec>& filter);
void startNewTF(o2::framework::InputRecord& inputs);
void collectROFCableData(int iru);
int decodeNextTrigger() final;

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

void setInputFilter(std::vector<o2::framework::InputSpec> filter) { mInputFilter = std::move(filter); }
const auto& getInputFilter() const noexcept { return mInputFilter; }

void setAlwaysParseTrigger(bool v) { mAlwaysParseTrigger = v; }
bool getAlwaysParseTrigger() const { return mAlwaysParseTrigger; }

Expand Down Expand Up @@ -139,14 +142,15 @@ class RawPixelDecoder final : public PixelReader
void reset();

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

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

std::vector<o2::framework::InputSpec> mInputFilter; // input spec filter
std::vector<GBTLink> mGBTLinks; // active links pool
std::unordered_map<uint32_t, LinkEntry> mSubsSpec2LinkID; // link subspec to link entry in the pool mapping
std::vector<RUDecodeData> mRUDecodeVec; // set of active RUs
Expand Down
19 changes: 11 additions & 8 deletions Detectors/ITSMFT/common/reconstruction/src/RawPixelDecoder.cxx
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// Copyright 2019-2020 CERN and copyright holders of ALICE O2.
// Copyright 2019-2026 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.
//
Expand Down Expand Up @@ -40,7 +40,8 @@ RawPixelDecoder<Mapping>::RawPixelDecoder()
mTimerDecode.Stop();
mTimerFetchData.Stop();
mSelfName = o2::utils::Str::concat_string(Mapping::getName(), "Decoder");
DPLRawParser<>::setCheckIncompleteHBF(false); // Disable incomplete HBF checking, see ErrPacketCounterJump check in GBTLink.cxx
DPLRawParser<>::setCheckIncompleteHBF(false); // Disable incomplete HBF checking, see ErrPacketCounterJump check in GBTLink.cxx
mInputFilter = {InputSpec{"filter", ConcreteDataTypeMatcher{Mapping::getOrigin(), o2::header::gDataDescriptionRawData}}}; // by default take all raw data
}

///______________________________________________________________
Expand Down Expand Up @@ -102,8 +103,7 @@ int RawPixelDecoder<Mapping>::decodeNextTrigger()
}

#ifdef WITH_OPENMP
#pragma omp parallel for schedule(dynamic) num_threads(mNThreads) reduction(+ \
: mNChipsFiredROF, mNPixelsFiredROF)
#pragma omp parallel for schedule(dynamic) num_threads(mNThreads) reduction(+ : mNChipsFiredROF, mNPixelsFiredROF)
#endif
for (int iru = 0; iru < nru; iru++) {
auto& ru = mRUDecodeVec[iru];
Expand Down Expand Up @@ -136,7 +136,7 @@ int RawPixelDecoder<Mapping>::decodeNextTrigger()
///______________________________________________________________
/// prepare for new TF
template <class Mapping>
void RawPixelDecoder<Mapping>::startNewTF(InputRecord& inputs, const std::vector<InputSpec>& filter)
void RawPixelDecoder<Mapping>::startNewTF(InputRecord& inputs)
{
mTimerTFStart.Start(false);
for (auto& link : mGBTLinks) {
Expand All @@ -149,7 +149,7 @@ void RawPixelDecoder<Mapping>::startNewTF(InputRecord& inputs, const std::vector
ru.linkHBFToDump.clear();
ru.nLinksDone = 0;
}
setupLinks(inputs, filter);
setupLinks(inputs);
mNLinksDone = 0;
mExtTriggers.clear();
mTimerTFStart.Stop();
Expand Down Expand Up @@ -226,7 +226,7 @@ bool RawPixelDecoder<Mapping>::doIRMajorityPoll()
///______________________________________________________________
/// Setup links checking the very RDH of every input
template <class Mapping>
void RawPixelDecoder<Mapping>::setupLinks(InputRecord& inputs, const std::vector<InputSpec>& filter)
void RawPixelDecoder<Mapping>::setupLinks(InputRecord& inputs)
{
constexpr uint32_t ROF_RAMP_FLAG = 0x1 << 4;
constexpr uint32_t LINK_RECOVERY_FLAG = 0x1 << 5;
Expand All @@ -235,6 +235,9 @@ void RawPixelDecoder<Mapping>::setupLinks(InputRecord& inputs, const std::vector
auto nLinks = mGBTLinks.size();
auto origin = (mUserDataOrigin == o2::header::gDataOriginInvalid) ? mMAP.getOrigin() : mUserDataOrigin;
auto datadesc = (mUserDataDescription == o2::header::gDataDescriptionInvalid) ? o2::header::gDataDescriptionRawData : mUserDataDescription;
if (mUserDataDescription != o2::header::gDataDescriptionInvalid) { // overwrite data filter descriptions with user
mInputFilter = {InputSpec{"filter", ConcreteDataTypeMatcher{origin, datadesc}}}; // TODO: for now assume all are requested and no explicit filter was set
}

// if we see requested data type input with 0xDEADBEEF subspec and 0 payload this means that the "delayed message"
// mechanism created it in absence of real data from upstream. Processor should send empty output to not block the workflow
Expand All @@ -257,7 +260,7 @@ void RawPixelDecoder<Mapping>::setupLinks(InputRecord& inputs, const std::vector
contDeadBeef = 0; // if good data, reset the counter
}
mROFRampUpStage = false;
DPLRawParser parser(inputs, filter, o2::conf::VerbosityConfig::Instance().rawParserSeverity);
DPLRawParser parser(inputs, mInputFilter, o2::conf::VerbosityConfig::Instance().rawParserSeverity);
parser.setMaxFailureMessages(o2::conf::VerbosityConfig::Instance().maxWarnRawParser);
static size_t cntParserFailures = 0;
parser.setExtFailureCounter(&cntParserFailures);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -109,7 +109,6 @@ class STFDecoder : public Task
std::vector<std::unique_ptr<RawPixelDecoder<Mapping>>> mDecoder;
std::unique_ptr<Clusterer> mClusterer;
std::shared_ptr<o2::base::GRPGeomRequest> mGGCCDBRequest;
std::vector<std::vector<InputSpec>> mRawFilter;
};

using STFDecoderITS = STFDecoder<ChipMappingITS>;
Expand Down
9 changes: 4 additions & 5 deletions Detectors/ITSMFT/common/workflow/src/STFDecoderSpec.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -135,13 +135,12 @@ void STFDecoder<Mapping>::init(InitContext& ic)
if (mDoStaggering) {
Mapping map;
for (uint32_t iLayer{0}; iLayer < mLayers; ++iLayer) {
auto& filter = mRawFilter.emplace_back();
std::vector<o2::framework::InputSpec> filter;
for (const auto feeID : map.getLayer2FEEIDs(iLayer)) {
filter.emplace_back("filter", ConcreteDataMatcher{Mapping::getOrigin(), o2::header::gDataDescriptionRawData, (o2::header::DataHeader::SubSpecificationType)feeID});
}
mDecoder[iLayer]->setInputFilter(filter);
}
} else {
mRawFilter.push_back({InputSpec{"filter", ConcreteDataTypeMatcher{Mapping::getOrigin(), o2::header::gDataDescriptionRawData}}});
}
}

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

try {
mDecoder[iLayer]->startNewTF(pc.inputs(), mRawFilter[iLayer]);

mDecoder[iLayer]->startNewTF(pc.inputs());
mDecoder[iLayer]->setDecodeNextAuto(false);

o2::InteractionRecord lastIR{};
int nTriggersProcessed = mDecoder[iLayer]->getNROFsProcessed();
static long lastErrReportTS = 0;
Expand Down
Loading