Skip to content

Commit 78cc049

Browse files
committed
split early returns for missing beamspot and vertex collections
1 parent 0927513 commit 78cc049

File tree

1 file changed

+9
-4
lines changed

1 file changed

+9
-4
lines changed

DQMOffline/RecoB/plugins/PrimaryVertexMonitor.cc

Lines changed: 9 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -400,10 +400,15 @@ void PrimaryVertexMonitor::analyze(const edm::Event& iEvent, const edm::EventSet
400400
//
401401
// check for absent products and simply "return" in that case
402402
//
403-
if (recVtxs.isValid() == false || beamSpotHandle.isValid() == false) {
404-
edm::LogWarning("PrimaryVertexMonitor")
405-
<< " Some products not available in the event: VertexCollection " << vertexInputTag_ << " " << recVtxs.isValid()
406-
<< " BeamSpot " << beamSpotInputTag_ << " " << beamSpotHandle.isValid() << ". Skipping plots for this event";
403+
if (!beamSpotHandle.isValid()) {
404+
edm::LogWarning("PrimaryVertexMonitor") << " Some products not available in the event: BeamSpot ("
405+
<< beamSpotInputTag_ << "). Skipping plots for this event.";
406+
return;
407+
}
408+
409+
if (!recVtxs.isValid()) {
410+
edm::LogWarning("PrimaryVertexMonitor") << " Some products not available in the event: VertexCollection ("
411+
<< vertexInputTag_ << "). Skipping plots for this event.";
407412
return;
408413
}
409414

0 commit comments

Comments
 (0)