Skip to content

Commit

Permalink
Fix crash of ECAL local reco on GPU if ECAL is not in the run.
Browse files Browse the repository at this point in the history
  • Loading branch information
thomreis committed Jun 30, 2021
1 parent ac5ca81 commit 07a68aa
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 2 deletions.
7 changes: 5 additions & 2 deletions EventFilter/EcalRawToDigi/plugins/EcalRawToDigiGPU.cc
Expand Up @@ -134,8 +134,11 @@ void EcalRawToDigiGPU::acquire(edm::Event const& event,
++counter;
}

ecal::raw::entryPoint(
inputCPU, inputGPU, outputGPU_, scratchGPU, outputCPU_, conditions, ctx.stream(), counter, currentCummOffset);
// unpack if at least one FED has data
if (counter > 0) {
ecal::raw::entryPoint(
inputCPU, inputGPU, outputGPU_, scratchGPU, outputCPU_, conditions, ctx.stream(), counter, currentCummOffset);
}
}

void EcalRawToDigiGPU::produce(edm::Event& event, edm::EventSetup const& setup) {
Expand Down
Expand Up @@ -164,6 +164,10 @@ void EcalRecHitProducerGPU::acquire(edm::Event const& event,
neb_ = ebUncalibRecHits.size;
nee_ = eeUncalibRecHits.size;

// stop here if there are no uncalibRecHits
if (neb_ + nee_ == 0)
return;

if ((neb_ > configParameters_.maxNumberHitsEB) || (nee_ > configParameters_.maxNumberHitsEE)) {
edm::LogError("EcalRecHitProducerGPU")
<< "max number of channels exceeded. See options 'maxNumberHitsEB and maxNumberHitsEE' ";
Expand Down
Expand Up @@ -207,6 +207,10 @@ void EcalUncalibRecHitProducerGPU::acquire(edm::Event const& event,
neb_ = ebDigis.size;
nee_ = eeDigis.size;

// stop here if there are no digis
if (neb_ + nee_ == 0)
return;

if ((neb_ > configParameters_.maxNumberHitsEB) || (nee_ > configParameters_.maxNumberHitsEE)) {
edm::LogError("EcalUncalibRecHitProducerGPU")
<< "max number of channels exceeded. See options 'maxNumberHitsEB and maxNumberHitsEE' ";
Expand Down

0 comments on commit 07a68aa

Please sign in to comment.