Skip to content

Commit

Permalink
Merge pull request #42848 from alejands/noisyGpuValidation_133X
Browse files Browse the repository at this point in the history
Remove noisy missing collection warnings coming from EcalDQMonitorTask
  • Loading branch information
cmsbuild authored Sep 27, 2023
2 parents f3dfef0 + 6ec2b12 commit 20c8c10
Show file tree
Hide file tree
Showing 8 changed files with 69 additions and 15 deletions.
11 changes: 10 additions & 1 deletion DQM/EcalMonitorTasks/interface/EcalDQMonitorTask.h
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,16 @@ class EcalDQMonitorTask : public DQMOneEDAnalyzer<edm::LuminosityBlockCache<ecal

edm::EDGetToken collectionTokens_[ecaldqm::nCollections]; // list of EDGetTokens
std::vector<std::pair<Processor, ecaldqm::Collections>> schedule_; // schedule of collections to run
bool allowMissingCollections_; // when true, skip missing collections silently

std::vector<std::string> skipCollections_; // list of collections to explicitly remove from schedule
// note: skipping a collection here will result in
// EcalDQMonitorTask not consuming it, which may lead the
// module producing the collection to not run at all

bool allowMissingCollections_; // when true (default), skip missing collections and log as warning
// note: collections skipped by the parameter skipCollections will
// bypass this check and not issue warnings

int processedEvents_;

/* TASK TIME PROFILING */
Expand Down
16 changes: 8 additions & 8 deletions DQM/EcalMonitorTasks/interface/GpuTask.h
Original file line number Diff line number Diff line change
Expand Up @@ -61,46 +61,46 @@ namespace ecaldqm {
case kEBCpuDigi:
if (collection_data && runGpuTask_ && enableDigi_)
runOnCpuDigis(*static_cast<EBDigiCollection const*>(collection_data), collection);
return runGpuTask_;
return enableDigi_;
break;
case kEECpuDigi:
if (collection_data && runGpuTask_ && enableDigi_)
runOnCpuDigis(*static_cast<EEDigiCollection const*>(collection_data), collection);
return runGpuTask_;
return enableDigi_;
break;
case kEBGpuDigi:
if (collection_data && runGpuTask_ && enableDigi_)
runOnGpuDigis(*static_cast<EBDigiCollection const*>(collection_data), collection);
return runGpuTask_;
return enableDigi_;
break;
case kEEGpuDigi:
if (collection_data && runGpuTask_ && enableDigi_)
runOnGpuDigis(*static_cast<EEDigiCollection const*>(collection_data), collection);
return runGpuTask_;
return enableDigi_;
break;
case kEBCpuUncalibRecHit:
case kEECpuUncalibRecHit:
if (collection_data && runGpuTask_ && enableUncalib_)
runOnCpuUncalibRecHits(*static_cast<EcalUncalibratedRecHitCollection const*>(collection_data), collection);
return runGpuTask_;
return enableUncalib_;
break;
case kEBGpuUncalibRecHit:
case kEEGpuUncalibRecHit:
if (collection_data && runGpuTask_ && enableUncalib_)
runOnGpuUncalibRecHits(*static_cast<EcalUncalibratedRecHitCollection const*>(collection_data), collection);
return runGpuTask_;
return enableUncalib_;
break;
case kEBCpuRecHit:
case kEECpuRecHit:
if (collection_data && runGpuTask_ && enableRecHit_)
runOnCpuRecHits(*static_cast<EcalRecHitCollection const*>(collection_data), collection);
return runGpuTask_;
return enableRecHit_;
break;
case kEBGpuRecHit:
case kEEGpuRecHit:
if (collection_data && runGpuTask_ && enableRecHit_)
runOnGpuRecHits(*static_cast<EcalRecHitCollection const*>(collection_data), collection);
return runGpuTask_;
return enableRecHit_;
break;
default:
break;
Expand Down
15 changes: 13 additions & 2 deletions DQM/EcalMonitorTasks/plugins/EcalDQMonitorTask.cc
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@ EcalDQMonitorTask::EcalDQMonitorTask(edm::ParameterSet const& _ps)
: DQMOneEDAnalyzer<edm::LuminosityBlockCache<ecaldqm::EcalLSCache>>(),
ecaldqm::EcalDQMonitor(_ps),
schedule_(),
skipCollections_(_ps.getUntrackedParameter<std::vector<std::string>>("skipCollections")),
allowMissingCollections_(_ps.getUntrackedParameter<bool>("allowMissingCollections")),
processedEvents_(0),
lastResetTime_(0),
Expand Down Expand Up @@ -92,6 +93,7 @@ void EcalDQMonitorTask::fillDescriptions(edm::ConfigurationDescriptions& _descs)
collectionTags.addWildcardUntracked<edm::InputTag>("*");
desc.add("collectionTags", collectionTags);

desc.addUntracked<std::vector<std::string>>("skipCollections", std::vector<std::string>());
desc.addUntracked<bool>("allowMissingCollections", true);
desc.addUntracked<double>("resetInterval", 0.);

Expand Down Expand Up @@ -158,8 +160,15 @@ void EcalDQMonitorTask::analyze(edm::Event const& _evt, edm::EventSetup const& _

std::set<ecaldqm::DQWorker*> enabledTasks;

bool eventTypeFiltering(false);
edm::Handle<EcalRawDataCollection> dcchsHndl;
if (_evt.getByToken(collectionTokens_[ecaldqm::kEcalRawData], dcchsHndl)) {

if (std::find(skipCollections_.begin(), skipCollections_.end(), "EcalRawData") != skipCollections_.end()) {
if (verbosity_ > 2)
edm::LogInfo("EcalDQM") << "EcalRawDataCollection is being skipped. No event-type filtering will be applied";

} else if (_evt.getByToken(collectionTokens_[ecaldqm::kEcalRawData], dcchsHndl)) {
eventTypeFiltering = true;
// determine event type (called run type in DCCHeader for some reason) for each FED
std::stringstream ss;
if (verbosity_ > 2)
Expand Down Expand Up @@ -192,9 +201,11 @@ void EcalDQMonitorTask::analyze(edm::Event const& _evt, edm::EventSetup const& _
return;
} else {
edm::LogWarning("EcalDQM") << "EcalRawDataCollection does not exist. No event-type filtering will be applied";
executeOnWorkers_([&enabledTasks](ecaldqm::DQWorker* worker) { enabledTasks.insert(worker); }, "");
}

if (!eventTypeFiltering)
executeOnWorkers_([&enabledTasks](ecaldqm::DQWorker* worker) { enabledTasks.insert(worker); }, "");

++processedEvents_;

// start event processing
Expand Down
26 changes: 26 additions & 0 deletions DQM/EcalMonitorTasks/plugins/EcalDQMonitorTask2.cc
Original file line number Diff line number Diff line change
Expand Up @@ -45,12 +45,34 @@ void EcalDQMonitorTask::runOnCollection(edm::Event const& _evt,

void EcalDQMonitorTask::formSchedule(std::vector<ecaldqm::Collections> const& _preSchedule,
edm::ParameterSet const& _tagPSet) {
std::vector<ecaldqm::Collections> collectionsToSkip;
for (const auto& skipColName : skipCollections_) {
for (unsigned iCol = 0; iCol <= ecaldqm::nCollections; iCol++) {
if (iCol == ecaldqm::nCollections)
throw cms::Exception("InvalidConfiguration")
<< moduleName_ << "::formSchedule: Collection name " << skipColName << " in skipCollections does not exist";
if (skipColName == ecaldqm::collectionName[iCol]) {
collectionsToSkip.push_back(ecaldqm::Collections(iCol));
break;
}
}
}

for (std::vector<ecaldqm::Collections>::const_iterator colItr(_preSchedule.begin()); colItr != _preSchedule.end();
++colItr) {
std::pair<Processor, ecaldqm::Collections> sch;

edm::InputTag tag(_tagPSet.getUntrackedParameter<edm::InputTag>(ecaldqm::collectionName[*colItr]));

auto skipItr = std::find(collectionsToSkip.begin(), collectionsToSkip.end(), *colItr);
if (skipItr != collectionsToSkip.end()) {
if (verbosity_ > 0)
edm::LogInfo("EcalDQM") << moduleName_ << ": Skipping collection " << ecaldqm::collectionName[*colItr]
<< " and removing from schedule";
collectionsToSkip.erase(skipItr);
continue;
}

switch (*colItr) {
case ecaldqm::kSource:
collectionTokens_[*colItr] = edm::EDGetToken(consumes<FEDRawDataCollection>(tag));
Expand Down Expand Up @@ -152,4 +174,8 @@ void EcalDQMonitorTask::formSchedule(std::vector<ecaldqm::Collections> const& _p

schedule_.push_back(sch);
}
for (const auto& colNotSkipped : collectionsToSkip)
edm::LogWarning("EcalDQM") << moduleName_
<< "::formSchedule: Collection: " << ecaldqm::collectionName[colNotSkipped]
<< " is not in the schedule but was listed to be skipped";
}
1 change: 1 addition & 0 deletions DQM/EcalMonitorTasks/python/EcalMonitorTask_cfi.py
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,7 @@
),
commonParameters = ecalCommonParams,
collectionTags = ecalDQMCollectionTags,
skipCollections = cms.untracked.vstring(),
allowMissingCollections = cms.untracked.bool(True),
verbosity = cms.untracked.int32(0),
resetInterval = cms.untracked.double(2.)
Expand Down
7 changes: 4 additions & 3 deletions DQM/EcalMonitorTasks/python/ecalGpuTask_cfi.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,12 +5,13 @@

ecalGpuTask = cms.untracked.PSet(
params = cms.untracked.PSet(
# ecalGpuTask must be explicitly turned on when using
runGpuTask = cms.untracked.bool(False),

# Default plots for each object are 1D CPU distributions and 1D GPU-CPU diff
enableDigi = cms.untracked.bool(True),
enableUncalib = cms.untracked.bool(True),
enableRecHit = cms.untracked.bool(True),

# GPU rechits currently unavailable; last edited Sep 2023
enableRecHit = cms.untracked.bool(False),

# 1D flags enable distributions of GPU values
# 2D flags enable 2D comparison maps
Expand Down
6 changes: 5 additions & 1 deletion DQM/EcalMonitorTasks/src/GpuTask.cc
Original file line number Diff line number Diff line change
Expand Up @@ -31,13 +31,17 @@ namespace ecaldqm {

void GpuTask::addDependencies(DependencySet& dependencies) {
// Ensure we run on CPU objects before GPU objects
if (runGpuTask_) {
if (enableDigi_) {
dependencies.push_back(Dependency(kEBGpuDigi, kEBCpuDigi));
dependencies.push_back(Dependency(kEEGpuDigi, kEECpuDigi));
}

if (enableUncalib_) {
dependencies.push_back(Dependency(kEBGpuUncalibRecHit, kEBCpuUncalibRecHit));
dependencies.push_back(Dependency(kEEGpuUncalibRecHit, kEECpuUncalibRecHit));
}

if (enableRecHit_) {
dependencies.push_back(Dependency(kEBGpuRecHit, kEBCpuRecHit));
dependencies.push_back(Dependency(kEEGpuRecHit, kEECpuRecHit));
}
Expand Down
2 changes: 2 additions & 0 deletions DQMOffline/Ecal/python/ecal_dqm_source_offline_cff.py
Original file line number Diff line number Diff line change
Expand Up @@ -31,3 +31,5 @@
)

ecalMonitorTask.workerParameters.TrigPrimTask.params.runOnEmul = False
ecalMonitorTaskEcalOnly.workerParameters.TrigPrimTask.params.runOnEmul = False
ecalMonitorTaskEcalOnly.workerParameters.RecoSummaryTask.params.fillRecoFlagReduced = False

0 comments on commit 20c8c10

Please sign in to comment.