Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fixes for MID decoding and data access #8612

Merged
merged 2 commits into from
Apr 19, 2022
Merged
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 @@ -118,12 +118,12 @@ void o2::globaltracking::RecoContainer::createTracksVariadic(T creator) const
usedData[GTrackID::TPCTRDTOF].resize(getTPCTRDTOFMatches().size()); // to flag used ITSTPC-TOF matches
usedData[GTrackID::ITSTPCTRDTOF].resize(getITSTPCTRDTOFMatches().size()); // to flag used ITSTPC-TOF matches

static int BCDiffErrCount = 0;
constexpr int MAXBCDiffErrCount = 5;
auto getBCDiff = [startIR = this->startIR](const o2::InteractionRecord& ir) {
static int BCDiffErrCount = 0;
constexpr int MAXBCDiffErrCount = 5;
auto bcd = ir.differenceInBC(startIR);
if (uint64_t(bcd) > o2::constants::lhc::LHCMaxBunches * 256 && BCDiffErrCount < MAXBCDiffErrCount) {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Are you assuming that the number of orbits per TF is 256? Isn't it 128 now?

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

256 is the max we can have though in real data production we will likely have only 128 (but e.g. MC currently uses 256). To be rigorous, one should take the real NHBFperTF from the GRP, but I did not want to make RecoContainerCreateTracksVariadic on CCDB

LOGP(error, "ATTENTION: wrong bunches diff. {} for current IR {} wrt 1st TF orbit {}", bcd, ir, startIR);
LOGP(alarm, "ATTENTION: wrong bunches diff. {} for current IR {} wrt 1st TF orbit {}", bcd, ir, startIR);
BCDiffErrCount++;
}
return bcd;
Expand Down Expand Up @@ -374,8 +374,14 @@ void o2::globaltracking::RecoContainer::createTracksVariadic(T creator) const
for (const auto& rof : rofs) {
float t0err = 0.0005;
auto bcdiff = getBCDiff(rof.interactionRecord);
if (bcdiff < 0) {
if (BCDiffErrCount < MAXBCDiffErrCount) {
LOGP(alarm, "Skipping MID ROF with {} entries since it precedes TF start", rof.nEntries);
}
continue;
}
float t0 = bcdiff * o2::constants::lhc::LHCBunchSpacingMUS;
for (int idx = rof.firstEntry; idx <= rof.getEndIndex(); ++idx) {
for (int idx = rof.firstEntry; idx < rof.getEndIndex(); ++idx) {
if (isUsed2(idx, GTrackID::MID)) {
continue;
}
Expand Down
2 changes: 1 addition & 1 deletion Detectors/MUON/MID/CTF/include/MIDCTF/CTFCoder.h
Original file line number Diff line number Diff line change
Expand Up @@ -142,7 +142,7 @@ void CTFCoder::decode(const CTF::base& ec, std::array<VROF, NEvTypes>& rofVec, s
}
auto& cv = colVec[evType[irof]];
firstEntry = cv.size();
for (uint8_t ic = 0; ic < entries[irof]; ic++) {
for (uint16_t ic = 0; ic < entries[irof]; ic++) {
cv.emplace_back(ColumnData{deId[colCount], colId[colCount], std::array{pattern[pCount], pattern[pCount + 1], pattern[pCount + 2], pattern[pCount + 3], pattern[pCount + 4]}});
pCount += 5;
colCount++;
Expand Down