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

Commit

Permalink
Merge pull request #101 from JeffersonLab/ignore-run0
Browse files Browse the repository at this point in the history
EC/CTOF/FTOFEngine:  handle RUN::config.run=0 more gracefully
  • Loading branch information
raffaelladevita authored Mar 27, 2018
2 parents 74eefbf + 78b748c commit 5f4e62b
Show file tree
Hide file tree
Showing 3 changed files with 19 additions and 9 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ public class ECEngine extends ReconstructionEngine {
public Boolean singleEvent = false;
public Boolean isMC = false;
int calrun = 2;

public ECEngine(){
super("EC","gavalian","1.0");
}
Expand All @@ -44,12 +44,15 @@ public boolean processDataEvent(DataEvent de) {

ECCommon.debug = this.debug;
ECCommon.singleEvent = this.singleEvent;

int runNo = 10;
//System.out.println(" PROCESSING EC EVENT ");
if(de.hasBank("RUN::config")==true){
DataBank bank = de.getBank("RUN::config");
runNo = bank.getInt("run", 0);
//System.out.println("------- The bank exists. run = " + runNo );
if (runNo<=0) {
System.err.println("ECEngine: got run <= 0 in RUN::config, skipping event.");
return false;
}
}


Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -70,15 +70,19 @@ public boolean init() {
public boolean processDataEvent(DataEvent event) {
//setRunConditionsParameters( event) ;
if(event.hasBank("RUN::config")==false ) {
System.err.println("RUN CONDITIONS NOT READ!");
return true;
}
System.err.println("RUN CONDITIONS NOT READ!");
return true;
}

DataBank bank = event.getBank("RUN::config");

// Load the constants
//-------------------
int newRun = bank.getInt("run", 0);
final int newRun = bank.getInt("run", 0);
if (newRun<=0) {
System.err.println("CTOFEngine: got run <= 0 in RUN::config, skipping event.");
return false;
}

if (geometry == null) {
System.err.println(" CTOF Geometry not loaded !!!");
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -109,7 +109,10 @@ public boolean processDataEvent(DataEvent event) {
// Load the constants
//-------------------
int newRun = bank.getInt("run", 0);

if (newRun<=0) {
System.err.println("FTOFEngine: got run <= 0 in RUN::config, skipping event.");
return false;
}

if (geometry == null) {
System.err.println(" FTOF Geometry not loaded !!!");
Expand Down

0 comments on commit 5f4e62b

Please sign in to comment.