From f770076d223af61ca58cf07f80b7e2bd8199f7a0 Mon Sep 17 00:00:00 2001 From: Raffaella De Vita Date: Fri, 6 Dec 2024 17:36:12 -0500 Subject: [PATCH] bug fixes --- .../java/org/jlab/analysis/eventmerger/ADCTDCMerger.java | 1 - .../java/org/jlab/analysis/eventmerger/EventMerger.java | 9 ++++----- 2 files changed, 4 insertions(+), 6 deletions(-) diff --git a/common-tools/clas-analysis/src/main/java/org/jlab/analysis/eventmerger/ADCTDCMerger.java b/common-tools/clas-analysis/src/main/java/org/jlab/analysis/eventmerger/ADCTDCMerger.java index f0813da3a..f3617a141 100644 --- a/common-tools/clas-analysis/src/main/java/org/jlab/analysis/eventmerger/ADCTDCMerger.java +++ b/common-tools/clas-analysis/src/main/java/org/jlab/analysis/eventmerger/ADCTDCMerger.java @@ -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; diff --git a/common-tools/clas-analysis/src/main/java/org/jlab/analysis/eventmerger/EventMerger.java b/common-tools/clas-analysis/src/main/java/org/jlab/analysis/eventmerger/EventMerger.java index a6319b030..a13ac5724 100644 --- a/common-tools/clas-analysis/src/main/java/org/jlab/analysis/eventmerger/EventMerger.java +++ b/common-tools/clas-analysis/src/main/java/org/jlab/analysis/eventmerger/EventMerger.java @@ -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; @@ -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(); } @@ -196,7 +195,7 @@ private void mergeEvents(DataEvent event, List 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")) @@ -205,8 +204,8 @@ private void mergeEvents(DataEvent event, List bgs) { if(event.hasBank("DC::doca")) event.removeBank("DC::doca"); int nbg = bgs.size()/2; - List bg1 = bgs.subList(1, nbg-1); - List bg2 = bgs.subList(nbg, 2*nbg-1); + List bg1 = bgs.subList(0, nbg); + List bg2 = bgs.subList(nbg, 2*nbg); ADCTDCMerger merger = new ADCTDCMerger(constants, event, bg1, bg2); merger.setSuppressDoubleHits(suppressDoubleHits); merger.setPreserveHitOrder(preserveHitOrder);