Skip to content

Commit

Permalink
bug fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
raffaelladevita committed Dec 6, 2024
1 parent 44c1ce1 commit 07b7096
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 6 deletions.
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
package org.jlab.analysis.eventmerger;

import java.util.ArrayList;
import java.util.Arrays;
import java.util.Collections;
import java.util.List;
import org.jlab.detector.banks.RawBank;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
package org.jlab.analysis.eventmerger;
import java.io.File;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.Collections;
import java.util.HashMap;
import java.util.List;
Expand Down Expand Up @@ -50,7 +49,7 @@ public class EventMerger {

public EventMerger() {
detectors = this.getDetectors(DetectorType.DC.getName(), DetectorType.FTOF.getName());
orders = this.getOrders(OrderType.NOMINAL.name(),OrderType.BGADDED_NOMINAL.name(),OrderType.BGREMOVED.name());
orders = this.getOrders(OrderType.NOMINAL.name(),OrderType.BGADDED_NOMINAL.name(),OrderType.BGREMOVED.name(),OrderType.BGREMOVED_BG.name());
printConfiguration();
}

Expand Down Expand Up @@ -196,7 +195,7 @@ private void mergeEvents(DataEvent event, List<DataEvent> bgs) {

if(!event.hasBank("RUN::config"))
return;
if(!bgs.isEmpty() && bgs.size()%2==0)
if(bgs.isEmpty() || bgs.size()%2!=0)
return;
for(DataEvent bg : bgs)
if(!bg.hasBank("RUN::config"))
Expand All @@ -205,8 +204,8 @@ private void mergeEvents(DataEvent event, List<DataEvent> bgs) {
if(event.hasBank("DC::doca")) event.removeBank("DC::doca");

int nbg = bgs.size()/2;
List<DataEvent> bg1 = bgs.subList(1, nbg-1);
List<DataEvent> bg2 = bgs.subList(nbg, 2*nbg-1);
List<DataEvent> bg1 = bgs.subList(0, nbg);
List<DataEvent> bg2 = bgs.subList(nbg, 2*nbg);
ADCTDCMerger merger = new ADCTDCMerger(constants, event, bg1, bg2);
merger.setSuppressDoubleHits(suppressDoubleHits);
merger.setPreserveHitOrder(preserveHitOrder);
Expand Down

0 comments on commit 07b7096

Please sign in to comment.