Skip to content

Commit

Permalink
fix an issue in SinglesTrigger2019ReadoutDriver to let it properly wo…
Browse files Browse the repository at this point in the history
…rk for other single triggers besides single3 trigger
  • Loading branch information
tongtongcao committed Dec 9, 2024
1 parent 054ee5d commit 9470e0e
Showing 1 changed file with 25 additions and 12 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -141,18 +141,31 @@ public void process(EventHeader event) {
// Check that clusters are available for the trigger.
Collection<Cluster> clusters = null;
Collection<HodoscopePattern> hodoPatterns = null;
ArrayList<HodoscopePattern> 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<HodoscopePattern> 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;
Expand Down

0 comments on commit 9470e0e

Please sign in to comment.