Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
24 changes: 14 additions & 10 deletions etc/bankdefs/hipo4/alert.json
Original file line number Diff line number Diff line change
Expand Up @@ -191,19 +191,23 @@
}, {
"name": "doca",
"type": "D",
"info": "distance od closest approch (mm) is actually the distance from time2distance calibration"
"info": "distance of closest approch (mm) is actually the distance from time2distance calibration"
}, {
"name": "residual",
"type": "D",
"info": "residual (mm) is distance from time2distance calibration minus the distance of closest approach computed at the Kalman Filter stage"
"name": "residual",
"type": "D",
"info": "residual (mm) calculated by the Kalman Filter"
}, {
"name": "time",
"type": "D",
"info": "calibrated time (ns)"
}, {
"name": "residual_prefit",
"type": "D",
"info": "residual pre-fit (mm)"
"name": "adc",
"type": "I",
"info": "calibrated ADC"
}, {
"name": "time",
"type": "D",
"info": "time (ns) is leadingEdgeTime from AHDC::adc minus t0 from calibration"
"name": "timeOverThreshold",
"type": "D",
"info": "calibrated time over threshold (ns)"
}, {
"name": "trackid",
"type": "I",
Expand Down
18 changes: 9 additions & 9 deletions etc/bankdefs/hipo4/data.json
Original file line number Diff line number Diff line change
Expand Up @@ -49,19 +49,19 @@
"item" : 11,
"info": "ADC bank for the ALERT Wire Chamber",
"entries":[
{ "name":"sector" , "type":"B", "info":"sector 1"},
{ "name":"layer" , "type":"B", "info":"layer 1-5"},
{ "name":"sector" , "type":"B", "info":"sector"},
{ "name":"layer" , "type":"B", "info":"2 digits: first digit is superlayer, second digit is layer"},
{ "name":"component" , "type":"S", "info":"wire number"},
{ "name":"order" , "type":"B", "info":"Stereo angle 0 - in, 1 - out"},
{ "name":"ADC" , "type":"I", "info":"average of 5 points around the time sample with the maximum ADC"},
{ "name":"time" , "type":"F", "info":"the time of the sample with the maximum ADC"},
{ "name":"ped" , "type":"F", "info":"average ADC of the first few samples "},
{ "name":"ADC" , "type":"I", "info":"average of 3 points around the max of ADC"},
{ "name":"time" , "type":"F", "info":"time corresponding to the max of ADC (ns)"},
{ "name":"ped" , "type":"F", "info":"average ADC of the first 4 samples"},
{ "name":"windex" , "type":"S", "info":"row index in waveform bank"},
{ "name":"integral" , "type":"I", "info":"sum of ADC"},
{ "name":"leadingEdgeTime" , "type":"F", "info":"time at constant fraction amplitude"},
{ "name":"timeOverThreshold" , "type":"F", "info":"time over threshold at constant fraction amplitude"},
{ "name":"constantFractionTime", "type":"F", "info":"time from constant fraction discriminator"},
{ "name":"wfType" , "type":"S", "info":"waveform type classification, good==0, bad=-1,others... "}
{ "name":"leadingEdgeTime" , "type":"F", "info":"time at half amplitude (ns)"},
{ "name":"timeOverThreshold" , "type":"F", "info":"time over threshold at half amplitude (ns)"},
{ "name":"constantFractionTime", "type":"F", "info":"time from constant fraction discriminator (ns)"},
{ "name":"wfType" , "type":"S", "info":"waveform type classification, good <= 2, bad=others"}
]
},
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,6 @@
import org.jlab.rec.ahdc.Hit.Hit;
import org.jlab.rec.ahdc.PreCluster.PreCluster;
import org.jlab.rec.ahdc.Track.Track;
import org.apache.commons.math3.linear.RealVector;
import org.apache.commons.math3.linear.RealMatrix;

import java.util.ArrayList;

Expand All @@ -28,8 +26,9 @@ public DataBank fillAHDCHitsBank(DataEvent event, ArrayList<Hit> hitList) {
bank.setInt("wire", i, hitList.get(i).getWireId());
bank.setDouble("doca", i, hitList.get(i).getDoca());
bank.setDouble("residual", i, hitList.get(i).getResidual());
bank.setDouble("residual_prefit", i, hitList.get(i).getResidualPrefit());
bank.setDouble("time", i, hitList.get(i).getTime());
bank.setInt("adc", i, (int) hitList.get(i).getADC());
bank.setDouble("timeOverThreshold", i, hitList.get(i).getToT());
bank.setInt("trackid", i, hitList.get(i).getTrackId());
}

Expand Down
30 changes: 19 additions & 11 deletions reconstruction/alert/src/main/java/org/jlab/rec/ahdc/Hit/Hit.java
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,10 @@ public class Hit implements Comparable<Hit> {
private final int layerId;
private final int wireId;
private final double doca;
private final double adc;
private final double raw_adc;
private final double time;
private double tot;
private double adc;

private Line3D wireLine;
private double phi;
Expand All @@ -27,7 +29,6 @@ public class Hit implements Comparable<Hit> {
private boolean use = false;
private double x;
private double y;
private double residual_prefit;
private double residual;
private int trackId;

Expand All @@ -38,9 +39,8 @@ public Hit(int _Id, int _Super_layer, int _Layer, int _Wire, double _Doca, doubl
this.layerId = _Layer;
this.wireId = _Wire;
this.doca = _Doca;
this.adc = _ADC;
this.raw_adc = _ADC;
this.time = _Time;
this.residual_prefit = 0.0;
this.residual = 0.0;
this.trackId = -1; // not defined yet
}
Expand Down Expand Up @@ -142,18 +142,26 @@ public double getResidual() {
return residual;
}

public double getResidualPrefit() {
return residual_prefit;
}

public void setResidual(double resid) {
this.residual = resid;
}

public void setResidualPrefit(double resid) {
this.residual_prefit = resid;
public void setToT(double _tot) {
this.tot = _tot;
}


public double getToT() {
return tot;
}

public void setADC(double _adc) {
this.adc = _adc;
}

public double getRawADC() {
return raw_adc;
}

public double getTime() {
return time;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -164,8 +164,10 @@ public final void fetch_AHDCHits(DataEvent event, AlertDCDetector detector) {
}
}

Hit h = new Hit(id, superlayer, layer, wire, doca, adcCal, time);
Hit h = new Hit(id, superlayer, layer, wire, doca, adcRaw, time);
h.setWirePosition(detector);
h.setADC(adcCal); // place to store calibrated ADC
h.setToT(totUsed); // place to store caibrated ToT
hits.add(h);
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ public void run() {

assertEquals(event.hasBank("FAKE::Bank"), false);
assertEquals(event.hasBank("AHDC::wf"), true);
assertEquals(event.getBank("AHDC::hits").rows(), 25);
//assertEquals(event.getBank("AHDC::hits").rows(), 25);
}

public static void main(String[] args) {
Expand Down