Skip to content
Open
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
6 changes: 5 additions & 1 deletion Detectors/MUON/MCH/IO/src/DigitReaderSpec.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -152,7 +152,11 @@ class DigitsReaderDeviceDPL
// get the IR frames to select
auto irFrames = pc.inputs().get<gsl::span<dataformats::IRFrame>>("driverInfo");

if (!irFrames.empty()) {
if (mTreeReader.GetEntries() == 0) {
// A timeframe holds no collision at all whenever the interaction rate is low enough, and the
// digit tree then has no entry. Nothing to select. Send empty containers.
LOG(info) << "digit tree has no entry, sending empty output";
} else if (!irFrames.empty()) {
utils::IRFrameSelector irfSel{};
irfSel.setSelectedIRFrames(irFrames, 0, 0, -mTimeOffset, true);
const auto irMin = irfSel.getIRFrames().front().getMin();
Expand Down
6 changes: 5 additions & 1 deletion Detectors/MUON/MID/Workflow/src/DigitReaderSpec.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -146,7 +146,11 @@ class DigitsReaderDeviceDPL
// get the IR frames to select
auto irFrames = pc.inputs().get<gsl::span<dataformats::IRFrame>>("driverInfo");

if (!irFrames.empty()) {
if (mTreeReader.GetEntries() == 0) {
// A timeframe holds no collision at all whenever the interaction rate is low enough, and the
// digit tree then has no entry. Nothing to select. Send empty containers.
LOG(info) << "digit tree has no entry, sending empty output";
} else if (!irFrames.empty()) {
utils::IRFrameSelector irfSel{};
irfSel.setSelectedIRFrames(irFrames, 0, 0, 0, true);
const auto irMin = irfSel.getIRFrames().front().getMin();
Expand Down
21 changes: 6 additions & 15 deletions Steer/DigitizerWorkflow/src/MCHDigitizerSpec.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,6 @@
#include "DataFormatsMCH/ROFRecord.h"
#include "DataFormatsParameters/GRPObject.h"
#include "DetectorsBase/BaseDPLDigitizer.h"
#include "DetectorsRaw/HBFUtils.h"
#include "Framework/ConfigParamRegistry.h"
#include "Framework/ControlService.h"
#include "Framework/DataProcessorSpec.h"
Expand Down Expand Up @@ -63,7 +62,7 @@ class MCHDPLDigitizerTask : public o2::base::BaseDPLDigitizer
if (labels.getIndexedSize() != digits.size()) {
LOGP(error, "Number of labels != number of digits");
}
LOGP(info, "Number of signal pileup : {} ({} %)", nPileup, 100. * nPileup / digits.size());
LOGP(info, "Number of signal pileup : {} ({} %)", nPileup, digits.empty() ? 0. : 100. * nPileup / digits.size());
auto tEnd = std::chrono::high_resolution_clock::now();
auto duration = tEnd - start;
auto d = std::chrono::duration_cast<std::chrono::milliseconds>(duration).count();
Expand Down Expand Up @@ -104,20 +103,12 @@ class MCHDPLDigitizerTask : public o2::base::BaseDPLDigitizer
}

// generate noise-only signals between first and last collisions ± 100 BC (= 25 ADC samples).
// A timeframe can hold no collision at all when the interaction rate is low; take the range
// from the timeframe itself in that case, since there are no collisions to take it from.
int64_t firstLong, lastLong;
if (eventRecords.empty()) {
const auto& hbf = o2::raw::HBFUtils::Instance();
firstLong = InteractionRecord(0, hbf.orbitFirstSampled).toLong();
lastLong = InteractionRecord(0, hbf.orbitFirstSampled + hbf.nHBFPerTF).toLong();
} else {
firstLong = eventRecords.front().toLong();
lastLong = eventRecords.back().toLong();
// A timeframe can hold no collision at all when the interaction rate is low; skip it in that case.
if (!eventRecords.empty()) {
auto firstIR = InteractionRecord::long2IR(std::max(int64_t(0), eventRecords.front().toLong() - timeOffset - 100));
auto lastIR = InteractionRecord::long2IR(std::max(int64_t(0), eventRecords.back().toLong() - timeOffset + 100));
mDigitizer->addNoise(firstIR, lastIR);
}
auto firstIR = InteractionRecord::long2IR(std::max(int64_t(0), firstLong - timeOffset - 100));
auto lastIR = InteractionRecord::long2IR(std::max(int64_t(0), lastLong - timeOffset + 100));
mDigitizer->addNoise(firstIR, lastIR);

// digitize
std::vector<Digit> digits{};
Expand Down
Loading