Skip to content

Commit

Permalink
rename processDataEvent/processEvent
Browse files Browse the repository at this point in the history
  • Loading branch information
Nathan Baltzell committed Aug 28, 2023
1 parent d010e71 commit f0d3fe1
Show file tree
Hide file tree
Showing 45 changed files with 82 additions and 83 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -236,7 +236,7 @@ public void init(){
public void processEvent(DataEvent event){
for(Map.Entry<String,ReconstructionEngine> engine : this.processorEngines.entrySet()){
try {
engine.getValue().processEvent(event);
engine.getValue().processDataEvent(event);
} catch (Exception e){
LOGGER.log(Level.SEVERE, "[Exception] >>>>> engine : {0}\n\n", engine.getKey());
e.printStackTrace();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -67,10 +67,14 @@ public abstract class ReconstructionEngine implements Engine {

volatile long triggerMask = 0xFFFFFFFFFFFFFFFFL;

String engineName = "UnknownEngine";
String engineAuthor = "N.T.";
String engineVersion = "0.0";
String engineDescription = "CLARA Engine";
String engineName = "UnknownEngine";
String engineAuthor = "N.T.";
String engineVersion = "0.0";
String engineDescription = "CLARA Engine";

abstract public boolean processDataEventUser(DataEvent event);
abstract public boolean init();
abstract public void detectorChanged(int runNumber);

public ReconstructionEngine(String name, String author, String version){
engineName = name;
Expand Down Expand Up @@ -107,9 +111,6 @@ protected RawBank getRawBankReader(String bankName, OrderType... order) {
return new RawDataBank(bankName, order);
}

abstract public boolean processDataEvent(DataEvent event);
abstract public boolean init();

/**
* Use a map just to avoid name clash in ConstantsManager.
* @param tables map of table names to #indices
Expand Down Expand Up @@ -333,8 +334,6 @@ public void dropBanks(DataEvent event) {
}
}

public abstract void detectorChanged(int runNumber);

public synchronized boolean checkRunNumber(DataEvent event) {
int r = 0;
if (event.hasBank("RUN::config")) {
Expand All @@ -347,7 +346,7 @@ public synchronized boolean checkRunNumber(DataEvent event) {
return !this.ignoreInvalidRunNumbers || r>0;
}

public void processEvent(DataEvent dataEvent) {
public void processDataEvent(DataEvent dataEvent) {
if (!this.wroteConfig) {
this.wroteConfig = true;
JsonUtils.extend(dataEvent, CONFIG_BANK_NAME, "json", this.generateConfig());
Expand All @@ -357,7 +356,7 @@ public void processEvent(DataEvent dataEvent) {
}
if(this.applyTriggerMask(dataEvent)) {
if (this.checkRunNumber(dataEvent)) {
this.processDataEvent(dataEvent);
this.processDataEventUser(dataEvent);
}
}
}
Expand Down Expand Up @@ -396,7 +395,7 @@ public EngineData execute(EngineData input) {
}

try {
this.processEvent(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 Expand Up @@ -512,7 +511,7 @@ public Reco(){
super("a","b","c");
}
@Override
public boolean processDataEvent(DataEvent event) {
public boolean processDataEventUser(DataEvent event) {
throw new UnsupportedOperationException("Not supported yet.");
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -162,7 +162,7 @@ private void loadTables() {
}

@Override
public boolean processDataEvent(DataEvent event) {
public boolean processDataEventUser(DataEvent event) {
DataBank bank = event.getBank("RUN::config");
// Load the constants
// -------------------
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ public boolean init() {
public void detectorChanged(int runNumber) {}

@Override
public boolean processDataEvent(DataEvent event) {
public boolean processDataEventUser(DataEvent event) {

int runNo = 10;
int eventNo = 777;
Expand Down Expand Up @@ -182,7 +182,7 @@ public static void main(String[] args) {
// System.out.println("*********** NEXT EVENT ************");
// event.show();

en.processDataEvent(event);
en.processDataEventUser(event);
writer.writeEvent(event);

}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ public BANDEngine() {
int Run = -1;

@Override
public boolean processDataEvent(DataEvent event) {
public boolean processDataEventUser(DataEvent event) {
//System.out.println("**** NEW EVENT ****");
// update calibration constants based on run number if changed
setRunConditionsParameters(event);
Expand Down Expand Up @@ -127,7 +127,7 @@ public static void main (String arg[]) {
// event.getBank("band::adc").show();
// event.getBank("band::tdc").show();
//}
en.processDataEvent(event);
en.processDataEventUser(event);
writer.writeEvent(event);
//event.getBank("band::hits").show();
nevent++;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ public CNDCalibrationEngine() {
private int newRun = 0;

@Override
public boolean processDataEvent(DataEvent event) {
public boolean processDataEventUser(DataEvent event) {

if (!event.hasBank("RUN::config")) {
return true;
Expand Down Expand Up @@ -142,7 +142,7 @@ public static void main (String arg[]) {

//event.getBank("MC::Particle").show();
//if(event.hasBank("CVT::Tracks")){event.getBank("CVT::Tracks").show();};
en.processDataEvent(event);
en.processDataEventUser(event);

// System.out.println("event après process ");
// event.show();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -281,7 +281,7 @@ public void setBmtzmaxclussize(int bmtzmaxclussize) {
}

@Override
public boolean processDataEvent(DataEvent event) {
public boolean processDataEventUser(DataEvent event) {

Swim swimmer = new Swim();

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ public CVTSecondPassEngine() {


@Override
public boolean processDataEvent(DataEvent event) {
public boolean processDataEventUser(DataEvent event) {

int run = this.getRun(event);
if(Constants.getInstance().seedingDebugMode)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -140,7 +140,7 @@ public void LoadTables() {


@Override
public boolean processDataEvent(DataEvent event) {
public boolean processDataEventUser(DataEvent event) {
return true;
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ public void setDropBanks() {


@Override
public boolean processDataEvent(DataEvent event) {
public boolean processDataEventUser(DataEvent event) {

int run = this.getRun(event);
if(run==0) return true;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ public void setDropBanks() {
}

@Override
public boolean processDataEvent(DataEvent event) {
public boolean processDataEventUser(DataEvent event) {

int run = this.getRun(event);
if(run==0) return true;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ public void setDropBanks() {
}

@Override
public boolean processDataEvent(DataEvent event) {
public boolean processDataEventUser(DataEvent event) {

int run = this.getRun(event);
if(run==0) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ public void setDropBanks() {
}

@Override
public boolean processDataEvent(DataEvent event) {
public boolean processDataEventUser(DataEvent event) {

int run = this.getRun(event);
if(run==0) return true;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ public void setDropBanks() {
}

@Override
public boolean processDataEvent(DataEvent event) {
public boolean processDataEventUser(DataEvent event) {

int run = this.getRun(event);
if(run==0) return true;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -214,7 +214,7 @@ public boolean equals(Object obj) {
private final ArrayList<HashMap<Coordinate, H1F>> LayerEffsTrkD = new ArrayList<HashMap<Coordinate, H1F>>();

@Override
public boolean processDataEvent(DataEvent event) {
public boolean processDataEventUser(DataEvent event) {

int run = this.getRun(event);
if(run==0) return true;
Expand Down Expand Up @@ -449,7 +449,7 @@ public static void main(String[] args) {
while (reader.hasEvent()) {
counter++;
DataEvent event = reader.getNextEvent();
tm.processDataEvent(event);
tm.processDataEventUser(event);
tm.ProcessLayerEffs(event);
//event.show();
if(counter%1000==0) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -50,8 +50,8 @@ public void testDCReconstruction() {
DCHBPostClusterConv engineHB = new DCHBPostClusterConv();
engineCL.init();
engineHB.init();
engineCL.processEvent(testEvent);
engineHB.processEvent(testEvent);
engineCL.processDataEvent(testEvent);
engineHB.processDataEvent(testEvent);
if(testEvent.hasBank("HitBasedTrkg::HBTracks")) {
testEvent.getBank("HitBasedTrkg::HBTracks").show();
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@ public void setUsePOCA(boolean val) {
}

@Override
public boolean processDataEvent(DataEvent de) {
public boolean processDataEventUser(DataEvent de) {
throw new RuntimeException("EBEngine cannot be used directly. Use EBTBEngine/EBHBEngine instead.");
}

Expand All @@ -90,7 +90,7 @@ public void setOutputBankPrefix(String prefix) {
}
}

public boolean processDataEvent(DataEvent de,EBScalers ebs) {
public boolean processDataEventUser(DataEvent de,EBScalers ebs) {

// check run number, get constants from CCDB:
int run=-1;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,8 +18,8 @@ public EBHBAIEngine(){
}

@Override
public boolean processDataEvent(DataEvent de) {
return super.processDataEvent(de,ebScalers);
public boolean processDataEventUser(DataEvent de) {
return super.processDataEventUser(de,ebScalers);
}

@Override
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,8 +18,8 @@ public EBHBEngine(){
}

@Override
public boolean processDataEvent(DataEvent de) {
return super.processDataEvent(de,ebScalers);
public boolean processDataEventUser(DataEvent de) {
return super.processDataEventUser(de,ebScalers);
}

@Override
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,8 +18,8 @@ public EBTBAIEngine(){
}

@Override
public boolean processDataEvent(DataEvent de) {
return super.processDataEvent(de,ebScalers);
public boolean processDataEventUser(DataEvent de) {
return super.processDataEventUser(de,ebScalers);
}

@Override
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,8 +24,8 @@ public EBTBEngine(){
}

@Override
public boolean processDataEvent(DataEvent de) {
final boolean ret = super.processDataEvent(de,ebScalers);
public boolean processDataEventUser(DataEvent de) {
final boolean ret = super.processDataEventUser(de,ebScalers);
this.linkTracks(de);
return ret;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ public static void show(DataBank bank) {
}

@Override
public boolean processDataEvent(DataEvent event) {
public boolean processDataEventUser(DataEvent event) {
if (!done) {
JsonObject versions = Versions.getVersionsJson();
JsonObject config = new JsonObject();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ public ECEngine(){
}

@Override
public boolean processDataEvent(DataEvent de) {
public boolean processDataEventUser(DataEvent de) {

List<ECStrip> ecStrips = ECCommon.initEC(de, this.getConstantsManager()); // thresholds, ADC/TDC match
List<ECPeak> ecPeaks = ECCommon.processPeaks(ECCommon.createPeaks(ecStrips)); // thresholds, split peaks -> update peak-lines
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ public class SwimEngine extends ReconstructionEngine {
}

@Override
public boolean processDataEvent(DataEvent event) {
public boolean processDataEventUser(DataEvent event) {
//this.test_caching_index();
//this.test_caching();
this.swimParticles(event);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ public void testECReconstruction() {

ECEngine engineEC = new ECEngine();
engineEC.init();
engineEC.processEvent(testEvent);
engineEC.processDataEvent(testEvent);

testEvent.show();
testEvent.getBank("ECAL::hits").show();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,7 @@ public void detectorChanged(int runNumber) {
}

@Override
public boolean processDataEvent(DataEvent event) {
public boolean processDataEventUser(DataEvent event) {
// Initial setup.
if(debug) System.out.println("\nNew event");

Expand Down
10 changes: 5 additions & 5 deletions reconstruction/ft/src/main/java/org/jlab/rec/ft/FTEBEngine.java
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ public boolean init() {
public void detectorChanged(int runNumber) {}

@Override
public boolean processDataEvent(DataEvent event) {
public boolean processDataEventUser(DataEvent event) {

int run = this.setRunConditionsParameters(event);
if (run>=0) {
Expand Down Expand Up @@ -376,10 +376,10 @@ public static void main(String arg[]){
// always print to keep track of running
if(debugMode>-1) System.out.println("////////////// event read " + bankEvt + " - sequential number " + nev);
//if(nev > 10239) System.exit(0); if(nev != 10239) continue; // stop at a given evt number
cal.processDataEvent(event);
hodo.processDataEvent(event);
trk.processDataEventAndGetClusters(event);
en.processDataEvent(event);
cal.processDataEventUser(event);
hodo.processDataEventUser(event);
trk.processDataEventAndGetClusters(event);
en.processDataEventUser(event);
if(!event.hasBank("FTCAL::hits")) continue;
if (event instanceof EvioDataEvent) {
GenericKinematicFitter fitter = new GenericKinematicFitter(11);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ public boolean init() {
public void detectorChanged(int runNumber) {}

@Override
public boolean processDataEvent(DataEvent event) {
public boolean processDataEventUser(DataEvent event) {
List<FTCALHit> allHits = new ArrayList();
List<FTCALHit> selectedHits = new ArrayList();
List<FTCALCluster> clusters = new ArrayList();
Expand Down Expand Up @@ -123,7 +123,7 @@ public static void main (String arg[]) {
while(reader.hasEvent()){
// for(int nev=0; nev<2; nev++){
DataEvent event = (DataEvent) reader.getNextEvent();
cal.processDataEvent(event);
cal.processDataEventUser(event);

if(event instanceof EvioDataEvent) {
GenericKinematicFitter fitter = new GenericKinematicFitter(11);
Expand Down
Loading

0 comments on commit f0d3fe1

Please sign in to comment.