Skip to content

Commit

Permalink
log and ignore multiple run numbers instead of exception (#215)
Browse files Browse the repository at this point in the history
Co-authored-by: Nathan Baltzell <[email protected]>
  • Loading branch information
baltzell and Nathan Baltzell authored Mar 7, 2024
1 parent 99bd50e commit e79a7c2
Showing 1 changed file with 6 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -88,16 +88,17 @@ public final boolean addState(HelicityState state) {

LOGGER.log(Level.FINE, "HelicitySequence: adding state: {0}", state);

// terminate if trying to add more than one run number:
// ignore states from other run numbers:
for (HelicityState hs : this.states) {
if (hs.getRun()!=state.getRun()) {
throw new RuntimeException("Run number mismatch: "+state.getRun()+"/"+state.getRun());
if (hs.getRun() != state.getRun()) {
LOGGER.log(Level.WARNING, "HelicitySequence: run number mismatch (OLD/NEW = {0},{1}), ignoring state", new Object[]{hs.getRun(), state.getRun()});
return false;
}
}

// mark that we'll need to redo the analysis:
this.analyzed=false;

// FIXME: should we be using a SortedSet instead?
// Looks like SortedList doesn't exist until java 10,
// and SortedSet doesn't give easy access by index?
Expand Down

0 comments on commit e79a7c2

Please sign in to comment.