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 75058451a6..c5bc797859 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 @@ -221,7 +221,8 @@ public int waveformCFAprocessing(){ this.pulse.timeOverThreshold = -9999; //Waveforms for which timing cannot be defined - if(this.pulse.wftype == -1 || this.pulse.wftype>=4) return 0; + //compute the values even if the type may seem bad + //if(this.pulse.wftype == -1 || this.pulse.wftype>=4) return 0; //Set the CFA threshold float threshold = this.amplitudeFractionCFA*this.pulse.adcMax; 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 771d8e1ab8..cce9aceda2 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 @@ -74,12 +74,17 @@ public final void fetch_AHDCHits(DataEvent event, AlertDCDetector detector) { // Apply time calibration // We may need adc calibration too // Remark: leadingEdgeTime already has the fine timestamp correction - double time = leadingEdgeTime - t0 - startTime; + double time = leadingEdgeTime - t0 - startTime; if ((bankDGTZ.getShort("wfType", i) <= 1) || sim) { // Apply raw hit cuts //if (((adc >= adc_min) && (adc <= adc_max) && (time >= t_min) && (time <= t_max) && (timeOverThreshold >= tot_min) && (timeOverThreshold <= tot_max) && (adcOffset >= ped_min) && (adcOffset <= ped_max)) || sim) { double doca = p0 + p1*Math.pow(time,1.0) + p2*Math.pow(time,2.0) + p3*Math.pow(time,3.0) + p4*Math.pow(time,4.0) + p5*Math.pow(time, 5.0); + if (sim) { + time += 5; // correction from mctime - systematic error of the decoding + doca = -0.0497 - 0.00667*Math.pow(time,1.0) + 0.389*Math.pow(time,1.0/2) - 0.189*Math.pow(time,1.0/3); + } + if (time < 0) doca = 0; Hit h = new Hit(id, superlayer, layer, wire, doca, adc, time); h.setWirePosition(detector); hits.add(h);