Skip to content

Commit f0cbc39

Browse files
baltzellraffaelladevita
authored andcommitted
one more modification to AHDC wire numbering to have first wire either at phi=0 or +half cell, set wirelines in HitReader (#571)
Co-authored-by: Raffaella De Vita <[email protected]>
1 parent fb44e9a commit f0cbc39

File tree

3 files changed

+16
-15
lines changed

3 files changed

+16
-15
lines changed

common-tools/clas-geometry/src/main/java/org/jlab/geom/detector/alert/AHDC/AlertDCFactory.java

Lines changed: 5 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -129,14 +129,12 @@ public AlertDCLayer createLayer(ConstantProvider cp, int sectorId, int superlaye
129129
double zl = 300.0d;
130130

131131
// Create AHDC sense wires
132-
for (int iw = 0; iw < numWires; iw++) {
132+
for (int wireId = 0; wireId < numWires; wireId++) {
133133

134-
// start at phi=180
135-
double wirePhiIndex = (numWires/2) + iw - 0.5*(layerId-1);
136-
137-
// the wire id is such that the wire number = (wireId+1) is the first wqual or greater than numWires/2
138-
int wireId = iw + (int) (numWires/2);
139-
if(wireId>numWires-1) wireId -= numWires;
134+
// start at phi=0
135+
// in each layer the first wire is the first at phi>=0, i.e.
136+
// 0.5 0 0.5 0 0.5 0.5 0 0.5 for layer 1 to 8
137+
double wirePhiIndex = wireId + 0.5*(numWires%2) + 0.5*layerId*(1-2*(numWires%2));
140138

141139
// The point given by (wx, wy, wz) is the origin of the current wire.
142140
double wx = R_layer * Math.cos(alphaW_layer * wirePhiIndex);

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

Lines changed: 8 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -5,19 +5,20 @@
55
import org.jlab.io.base.DataBank;
66
import org.jlab.io.base.DataEvent;
77
import org.jlab.detector.banks.RawDataBank;
8+
import org.jlab.geom.detector.alert.AHDC.AlertDCDetector;
89
import org.jlab.rec.alert.constants.CalibrationConstantsLoader;
910

1011
public class HitReader {
1112

1213
private ArrayList<Hit> _AHDCHits;
1314
private ArrayList<TrueHit> _TrueAHDCHits;
1415

15-
public HitReader(DataEvent event, boolean simulation) {
16-
fetch_AHDCHits(event);
16+
public HitReader(DataEvent event, AlertDCDetector detector, boolean simulation) {
17+
fetch_AHDCHits(event, detector);
1718
if (simulation) fetch_TrueAHDCHits(event);
1819
}
1920

20-
public void fetch_AHDCHits(DataEvent event) {
21+
public final void fetch_AHDCHits(DataEvent event, AlertDCDetector detector) {
2122
ArrayList<Hit> hits = new ArrayList<>();
2223

2324
if (event.hasBank("AHDC::adc")) {
@@ -58,14 +59,16 @@ public void fetch_AHDCHits(DataEvent event) {
5859
// TO BE DONE
5960
//double doca = bankDGTZ.getShort("ped", i) / 1000.0;
6061
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);
61-
hits.add(new Hit(id, superlayer, layer, wire, doca, adc, time));
62+
Hit h = new Hit(id, superlayer, layer, wire, doca, adc, time);
63+
h.setWirePosition(detector);
64+
hits.add(h);
6265
}
6366
}
6467
}
6568
this.set_AHDCHits(hits);
6669
}
6770

68-
public void fetch_TrueAHDCHits(DataEvent event) {
71+
public final void fetch_TrueAHDCHits(DataEvent event) {
6972
ArrayList<TrueHit> truehits = new ArrayList<>();
7073

7174
DataBank bankSIMU = event.getBank("MC::True");

reconstruction/alert/src/main/java/org/jlab/service/ahdc/AHDCEngine.java

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@
2727
import java.io.File;
2828
import java.util.*;
2929
import org.jlab.detector.calib.utils.DatabaseConstantProvider;
30-
import org.jlab.geom.base.Detector;
30+
import org.jlab.geom.detector.alert.AHDC.AlertDCDetector;
3131
import org.jlab.geom.detector.alert.AHDC.AlertDCFactory;
3232

3333
/** AHDCEngine reconstruction service.
@@ -61,7 +61,7 @@ public class AHDCEngine extends ReconstructionEngine {
6161
/// \todo better name... mode for what?
6262
private Mode mode = Mode.CV_Track_Finding;
6363

64-
private Detector factory = null;
64+
private AlertDCDetector factory = null;
6565

6666
public AHDCEngine() {
6767
super("ALERT", "ouillon", "1.0.1");
@@ -146,7 +146,7 @@ public boolean processDataEvent(DataEvent event) {
146146

147147
if (event.hasBank("AHDC::adc")) {
148148
// I) Read raw hit
149-
HitReader hitRead = new HitReader(event, simulation);
149+
HitReader hitRead = new HitReader(event, factory, simulation);
150150

151151
ArrayList<Hit> AHDC_Hits = hitRead.get_AHDCHits();
152152
if(simulation){

0 commit comments

Comments
 (0)