Skip to content

Commit

Permalink
Remove extra check for event type
Browse files Browse the repository at this point in the history
This was already covered by the switch-statement
  • Loading branch information
EinarElen authored and tomeichlersmith committed Oct 31, 2023
1 parent 0572c2b commit 7bd260e
Showing 1 changed file with 14 additions and 16 deletions.
30 changes: 14 additions & 16 deletions DQM/src/DQM/PhotoNuclearDQM.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down

0 comments on commit 7bd260e

Please sign in to comment.