Skip to content

Commit

Permalink
allow run number override from YAML
Browse files Browse the repository at this point in the history
  • Loading branch information
Nathan Baltzell authored and Nathan Baltzell committed Oct 18, 2024
1 parent ecb43a3 commit e52cbcb
Showing 1 changed file with 9 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -65,6 +65,8 @@ public abstract class ReconstructionEngine implements Engine {

private boolean ignoreInvalidRunNumbers = true;

private int runNumberOverride = -1;

volatile long triggerMask = 0xFFFFFFFFFFFFFFFFL;

String engineName = "UnknownEngine";
Expand Down Expand Up @@ -187,6 +189,9 @@ public EngineData configure(EngineData ed) {
engineDictionary = new SchemaFactory();
LOGGER.log(Level.INFO,"--- engine configuration is called " + this.getDescription());
try {
if (this.getEngineConfigString("runNumberOverride")!=null) {
this.runNumberOverride = Integer.valueOf(this.getEngineConfigString("runNumberOverride"));
}
if (this.getEngineConfigString("rawBankGroup")!=null) {
this.rawBankOrders = RawBank.getFilterGroup(this.getEngineConfigString("rawBankGroup"));
}
Expand Down Expand Up @@ -339,9 +344,11 @@ public void dropBanks(DataEvent event) {
}

public synchronized boolean checkRunNumber(DataEvent event) {
int r = 0;
if (event.hasBank("RUN::config")) {
int r = runNumberOverride;
if (r <= 0 && event.hasBank("RUN::config")) {
r = event.getBank("RUN::config").getInt("run",0);
}
if (r > 0) {
if (this.runNumbers.isEmpty() || r != this.runNumbers.get(this.runNumbers.size()-1)) {
this.runNumbers.add(r);
this.detectorChanged(11);
Expand Down

0 comments on commit e52cbcb

Please sign in to comment.