diff --git a/common-tools/clas-detector/src/main/java/org/jlab/detector/pulse/ModeAHDC.java b/common-tools/clas-detector/src/main/java/org/jlab/detector/pulse/ModeAHDC.java index 862915e17c..c5600575b4 100644 --- a/common-tools/clas-detector/src/main/java/org/jlab/detector/pulse/ModeAHDC.java +++ b/common-tools/clas-detector/src/main/java/org/jlab/detector/pulse/ModeAHDC.java @@ -53,6 +53,8 @@ public class ModeAHDC extends HipoExtractor { //wfType 2 ⇒ bad trailingEdgeTime //wfType 1 ⇒ saturing //wfType 0 ⇒ OK + // warnings: The ToT does not make sense for type 1 and 2 + // We shoudl not apply a ToT cut on them private static class AHDCPulse extends Pulse { private long time_ZS; @@ -305,8 +307,8 @@ public int waveformCFAprocessing(AHDCPulse p){ } p.timeOverThreshold = p.trailingEdgeTime - p.leadingEdgeTime; - //if ((this.pulse.timeOverThreshold < 300) || (this.pulse.timeOverThreshold > 750)) this.assignValidType(4); // bad tot - if (p.timeOverThreshold < 300) this.assignValidType(4, p); // tot too small + // if binFall == -99, the ToT does not make sense + if (p.timeOverThreshold < 300 && binFall > 0) this.assignValidType(4, p); // tot too small } else { // there are necessary type 1, so we use the slope_max if (p.wftype == 1) { diff --git a/reconstruction/alert/src/main/java/org/jlab/rec/ahdc/Hit/HitReader.java b/reconstruction/alert/src/main/java/org/jlab/rec/ahdc/Hit/HitReader.java index 6268dd5dd2..add808cc06 100644 --- a/reconstruction/alert/src/main/java/org/jlab/rec/ahdc/Hit/HitReader.java +++ b/reconstruction/alert/src/main/java/org/jlab/rec/ahdc/Hit/HitReader.java @@ -156,12 +156,20 @@ private void fetch_AHDCHits(DataEvent event, AlertDCDetector detector, IndexedTa double ped_min = rawHitCutsTable.getDoubleValueByHash("ped_min", hash); double ped_max = rawHitCutsTable.getDoubleValueByHash("ped_max", hash); - boolean passCuts = - (wfType <= 2) && - (adcRaw >= adc_min) && (adcRaw <= adc_max) && - (time >= t_min) && (time <= t_max) && - (timeOverThreshold >= tot_min) && (timeOverThreshold <= tot_max) && - (adcOffset >= ped_min) && (adcOffset <= ped_max); + boolean passCuts = false; + if (wfType == 0) { + passCuts = + (adcRaw >= adc_min) && (adcRaw <= adc_max) && + (time >= t_min) && (time <= t_max) && + (timeOverThreshold >= tot_min) && (timeOverThreshold <= tot_max) && + (adcOffset >= ped_min) && (adcOffset <= ped_max); + } + else if (wfType == 1 || wfType == 2) { + passCuts = + (adcRaw >= adc_min) && (adcRaw <= adc_max) && + (time >= t_min) && (time <= t_max) && + (adcOffset >= ped_min) && (adcOffset <= ped_max); + } if (!passCuts) continue; }