Skip to content
This repository has been archived by the owner on May 18, 2023. It is now read-only.

Commit

Permalink
check run number from above
Browse files Browse the repository at this point in the history
  • Loading branch information
Nathan Baltzell authored and raffaelladevita committed Dec 5, 2022
1 parent 6b5b203 commit a4340ce
Showing 1 changed file with 21 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,9 @@ public abstract class ReconstructionEngine implements Engine {

volatile boolean dropOutputBanks = false;
private final Set<String> outputBanks = new HashSet<>();


private boolean ignoreInvalidRunNumbers = true;

volatile long triggerMask = 0xFFFFFFFFFFFFFFFFL;

String engineName = "UnknownEngine";
Expand Down Expand Up @@ -167,6 +169,10 @@ public EngineData configure(EngineData ed) {
this.getEngineConfigString("dropBanks").equals("true")) {
dropOutputBanks=true;
}
if (this.getEngineConfigString("ignoreInvalidRunNumbers")!=null &&
this.getEngineConfigString("ignoreInvalidRunNumbers").equals("false")) {
ignoreInvalidRunNumbers=false;
}
if (this.getEngineConfigString("triggerMask")!=null) {
this.setTriggerMask(this.getEngineConfigString("triggerMask"));
}
Expand Down Expand Up @@ -314,7 +320,15 @@ public void dropBanks(DataEvent event) {
}
}
}


public boolean checkRunNumber(DataEvent event) {
if (!this.ignoreInvalidRunNumbers) return true;
int run = 0;
if (event.hasBank("RUN::config")) {
run = event.getBank("RUN::config").getInt("run",0);
}
return run>0;
}

@Override
public EngineData execute(EngineData input) {
Expand Down Expand Up @@ -357,8 +371,11 @@ public EngineData execute(EngineData input) {
if (this.dropOutputBanks) {
this.dropBanks(dataEventHipo);
}
if(this.applyTriggerMask(dataEventHipo))
this.processDataEvent(dataEventHipo);
if(this.applyTriggerMask(dataEventHipo)) {
if (this.checkRunNumber(dataEventHipo)) {
this.processDataEvent(dataEventHipo);
}
}
output.setData(mt, dataEventHipo.getHipoEvent());
} catch (Exception e) {
String msg = String.format("Error processing input event%n%n%s", ClaraUtil.reportException(e));
Expand Down

0 comments on commit a4340ce

Please sign in to comment.