Skip to content

Commit

Permalink
move enable flag checks to avoid unused collections from being consumed
Browse files Browse the repository at this point in the history
  • Loading branch information
alejands committed Sep 12, 2022
1 parent 1701c24 commit ffdb7a8
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 32 deletions.
16 changes: 8 additions & 8 deletions DQM/EcalMonitorTasks/interface/GpuTask.h
Original file line number Diff line number Diff line change
Expand Up @@ -59,46 +59,46 @@ namespace ecaldqm {
inline bool GpuTask::analyze(void const* collection_data, Collections collection) {
switch (collection) {
case kEBCpuDigi:
if (collection_data && runGpuTask_)
if (collection_data && runGpuTask_ && enableDigi_)
runOnCpuDigis(*static_cast<EBDigiCollection const*>(collection_data), collection);
return runGpuTask_;
break;
case kEECpuDigi:
if (collection_data && runGpuTask_)
if (collection_data && runGpuTask_ && enableDigi_)
runOnCpuDigis(*static_cast<EEDigiCollection const*>(collection_data), collection);
return runGpuTask_;
break;
case kEBGpuDigi:
if (collection_data && runGpuTask_)
if (collection_data && runGpuTask_ && enableDigi_)
runOnGpuDigis(*static_cast<EBDigiCollection const*>(collection_data), collection);
return runGpuTask_;
break;
case kEEGpuDigi:
if (collection_data && runGpuTask_)
if (collection_data && runGpuTask_ && enableDigi_)
runOnGpuDigis(*static_cast<EEDigiCollection const*>(collection_data), collection);
return runGpuTask_;
break;
case kEBCpuUncalibRecHit:
case kEECpuUncalibRecHit:
if (collection_data && runGpuTask_)
if (collection_data && runGpuTask_ && enableUncalib_)
runOnCpuUncalibRecHits(*static_cast<EcalUncalibratedRecHitCollection const*>(collection_data), collection);
return runGpuTask_;
break;
case kEBGpuUncalibRecHit:
case kEEGpuUncalibRecHit:
if (collection_data && runGpuTask_)
if (collection_data && runGpuTask_ && enableUncalib_)
runOnGpuUncalibRecHits(*static_cast<EcalUncalibratedRecHitCollection const*>(collection_data), collection);
return runGpuTask_;
break;
case kEBCpuRecHit:
case kEECpuRecHit:
if (collection_data && runGpuTask_)
if (collection_data && runGpuTask_ && enableRecHit_)
runOnCpuRecHits(*static_cast<EcalRecHitCollection const*>(collection_data), collection);
return runGpuTask_;
break;
case kEBGpuRecHit:
case kEEGpuRecHit:
if (collection_data && runGpuTask_)
if (collection_data && runGpuTask_ && enableRecHit_)
runOnGpuRecHits(*static_cast<EcalRecHitCollection const*>(collection_data), collection);
return runGpuTask_;
break;
Expand Down
24 changes: 0 additions & 24 deletions DQM/EcalMonitorTasks/src/GpuTask.cc
Original file line number Diff line number Diff line change
Expand Up @@ -163,10 +163,6 @@ namespace ecaldqm {

template <typename DigiCollection>
void GpuTask::runOnCpuDigis(DigiCollection const& cpuDigis, Collections collection) {
// Return if not enabled
if (!enableDigi_)
return;

MESet& meDigiCpu(MEs_.at("DigiCpu"));
MESet& meDigiCpuAmplitude(MEs_.at("DigiCpuAmplitude"));

Expand Down Expand Up @@ -200,10 +196,6 @@ namespace ecaldqm {

template <typename DigiCollection>
void GpuTask::runOnGpuDigis(DigiCollection const& gpuDigis, Collections collection) {
// Return if not enabled
if (!enableDigi_)
return;

MESet& meDigiGpuCpu(MEs_.at("DigiGpuCpu"));
MESet& meDigiGpuCpuAmplitude(MEs_.at("DigiGpuCpuAmplitude"));

Expand Down Expand Up @@ -279,10 +271,6 @@ namespace ecaldqm {
}

void GpuTask::runOnCpuUncalibRecHits(EcalUncalibratedRecHitCollection const& cpuHits, Collections collection) {
// Return if not enabled
if (!enableUncalib_)
return;

MESet& meUncalibCpu(MEs_.at("UncalibCpu"));
MESet& meUncalibCpuAmp(MEs_.at("UncalibCpuAmp"));
MESet& meUncalibCpuAmpError(MEs_.at("UncalibCpuAmpError"));
Expand Down Expand Up @@ -335,10 +323,6 @@ namespace ecaldqm {
}

void GpuTask::runOnGpuUncalibRecHits(EcalUncalibratedRecHitCollection const& gpuHits, Collections collection) {
// Return if not enabled
if (!enableUncalib_)
return;

MESet& meUncalibGpuCpu(MEs_.at("UncalibGpuCpu"));
MESet& meUncalibGpuCpuAmp(MEs_.at("UncalibGpuCpuAmp"));
MESet& meUncalibGpuCpuAmpError(MEs_.at("UncalibGpuCpuAmpError"));
Expand Down Expand Up @@ -477,10 +461,6 @@ namespace ecaldqm {
}

void GpuTask::runOnCpuRecHits(EcalRecHitCollection const& cpuHits, Collections collection) {
// Return if not enabled
if (!enableRecHit_)
return;

MESet& meRecHitCpu(MEs_.at("RecHitCpu"));
MESet& meRecHitCpuEnergy(MEs_.at("RecHitCpuEnergy"));
MESet& meRecHitCpuTime(MEs_.at("RecHitCpuTime"));
Expand Down Expand Up @@ -509,10 +489,6 @@ namespace ecaldqm {
}

void GpuTask::runOnGpuRecHits(EcalRecHitCollection const& gpuHits, Collections collection) {
// Return if not enabled
if (!enableRecHit_)
return;

MESet& meRecHitGpuCpu(MEs_.at("RecHitGpuCpu"));
MESet& meRecHitGpuCpuEnergy(MEs_.at("RecHitGpuCpuEnergy"));
MESet& meRecHitGpuCpuTime(MEs_.at("RecHitGpuCpuTime"));
Expand Down

0 comments on commit ffdb7a8

Please sign in to comment.