diff --git a/ecal-readout-sim/src/main/java/org/hps/readout/trigger2019/SinglesTrigger2019ReadoutDriver.java b/ecal-readout-sim/src/main/java/org/hps/readout/trigger2019/SinglesTrigger2019ReadoutDriver.java index ac3c6d1faf..ec49be48d7 100644 --- a/ecal-readout-sim/src/main/java/org/hps/readout/trigger2019/SinglesTrigger2019ReadoutDriver.java +++ b/ecal-readout-sim/src/main/java/org/hps/readout/trigger2019/SinglesTrigger2019ReadoutDriver.java @@ -141,18 +141,31 @@ public void process(EventHeader event) { // Check that clusters are available for the trigger. Collection clusters = null; Collection hodoPatterns = null; - ArrayList hodoPatternList = null; - if(ReadoutDataManager.checkCollectionStatus(inputCollectionNameEcal, localTime) && ReadoutDataManager.checkCollectionStatus(inputCollectionNameHodo, localTime)) { - clusters = ReadoutDataManager.getData(localTime, localTime + 4.0, inputCollectionNameEcal, Cluster.class); - hodoPatterns = ReadoutDataManager.getData(localTime, localTime + 4.0, inputCollectionNameHodo, HodoscopePattern.class); - - localTime += 4.0; - - if(clusters.size() == 0 || hodoPatterns.size() == 0) return; - - hodoPatternList = new ArrayList<>(hodoPatterns); - - } else { return; } + ArrayList hodoPatternList = new ArrayList<>(); + + if(triggerType.equals("singles3")) { + if(ReadoutDataManager.checkCollectionStatus(inputCollectionNameEcal, localTime) && ReadoutDataManager.checkCollectionStatus(inputCollectionNameHodo, localTime)) { + clusters = ReadoutDataManager.getData(localTime, localTime + 4.0, inputCollectionNameEcal, Cluster.class); + hodoPatterns = ReadoutDataManager.getData(localTime, localTime + 4.0, inputCollectionNameHodo, HodoscopePattern.class); + + localTime += 4.0; + + if(clusters.size() == 0 || hodoPatterns.size() == 0) return; + + hodoPatternList.addAll(hodoPatterns); + + } else { return; } + } + else { + if(ReadoutDataManager.checkCollectionStatus(inputCollectionNameEcal, localTime)) { + clusters = ReadoutDataManager.getData(localTime, localTime + 4.0, inputCollectionNameEcal, Cluster.class); + + localTime += 4.0; + + if(clusters.size() == 0) return; + + } else { return; } + } // Track whether or not a trigger was seen. boolean triggered = false;