From 7bd260e16271bfb4a4c826c2f89512b335528d64 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Einar=20El=C3=A9n?= Date: Tue, 31 Oct 2023 14:10:58 +0100 Subject: [PATCH] Remove extra check for event type This was already covered by the switch-statement --- DQM/src/DQM/PhotoNuclearDQM.cxx | 30 ++++++++++++++---------------- 1 file changed, 14 insertions(+), 16 deletions(-) diff --git a/DQM/src/DQM/PhotoNuclearDQM.cxx b/DQM/src/DQM/PhotoNuclearDQM.cxx index b55fea65a..218e944d2 100644 --- a/DQM/src/DQM/PhotoNuclearDQM.cxx +++ b/DQM/src/DQM/PhotoNuclearDQM.cxx @@ -304,23 +304,21 @@ void PhotoNuclearDQM::analyze(const framework::Event &event) { switch (eventType) { case EventType::single_neutron: - if (eventType == EventType::single_neutron) { - if (pnDaughters.size() > 1) { - auto secondHardestPdgID{abs(pnDaughters[1]->getPdgID())}; - auto nEventType{-10}; - if (secondHardestPdgID == 2112) { - nEventType = 0; // n + n - } else if (secondHardestPdgID == 2212) { - nEventType = 1; // p + n - } else if (secondHardestPdgID == 211) { - nEventType = 2; // Pi+/- + n - } else if (secondHardestPdgID == 111) { - nEventType = 3; // Pi0 + n - } else { - nEventType = 4; // other - } - histograms_.fill("1n_event_type", nEventType); + if (pnDaughters.size() > 1) { + auto secondHardestPdgID{abs(pnDaughters[1]->getPdgID())}; + auto nEventType{-10}; + if (secondHardestPdgID == 2112) { + nEventType = 0; // n + n + } else if (secondHardestPdgID == 2212) { + nEventType = 1; // p + n + } else if (secondHardestPdgID == 211) { + nEventType = 2; // Pi+/- + n + } else if (secondHardestPdgID == 111) { + nEventType = 3; // Pi0 + n + } else { + nEventType = 4; // other } + histograms_.fill("1n_event_type", nEventType); } [[fallthrough]]; // Remaining code is important for 1n as well case EventType::two_neutrons: