Skip to content

Commit a896a2c

Browse files
ftouchtetongtongcao
authored andcommitted
Make the reconstruction to work with the modifications in simulation (clas12Tags) (#805)
* use a specific time to distance for simulation and if time < 0 then distance is 0 * compute leadingEdgeTime even if the type may seem bad
1 parent ff2a985 commit a896a2c

2 files changed

Lines changed: 8 additions & 2 deletions

File tree

  • common-tools/clas-detector/src/main/java/org/jlab/detector/pulse
  • reconstruction/alert/src/main/java/org/jlab/rec/ahdc/Hit

common-tools/clas-detector/src/main/java/org/jlab/detector/pulse/ModeAHDC.java

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -221,7 +221,8 @@ public int waveformCFAprocessing(){
221221
this.pulse.timeOverThreshold = -9999;
222222

223223
//Waveforms for which timing cannot be defined
224-
if(this.pulse.wftype == -1 || this.pulse.wftype>=4) return 0;
224+
//compute the values even if the type may seem bad
225+
//if(this.pulse.wftype == -1 || this.pulse.wftype>=4) return 0;
225226

226227
//Set the CFA threshold
227228
float threshold = this.amplitudeFractionCFA*this.pulse.adcMax;

reconstruction/alert/src/main/java/org/jlab/rec/ahdc/Hit/HitReader.java

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -74,12 +74,17 @@ public final void fetch_AHDCHits(DataEvent event, AlertDCDetector detector) {
7474
// Apply time calibration
7575
// We may need adc calibration too
7676
// Remark: leadingEdgeTime already has the fine timestamp correction
77-
double time = leadingEdgeTime - t0 - startTime;
77+
double time = leadingEdgeTime - t0 - startTime;
7878

7979
if ((bankDGTZ.getShort("wfType", i) <= 1) || sim) {
8080
// Apply raw hit cuts
8181
//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) {
8282
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);
83+
if (sim) {
84+
time += 5; // correction from mctime - systematic error of the decoding
85+
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);
86+
}
87+
if (time < 0) doca = 0;
8388
Hit h = new Hit(id, superlayer, layer, wire, doca, adc, time);
8489
h.setWirePosition(detector);
8590
hits.add(h);

0 commit comments

Comments
 (0)