Skip to content

Commit e6bc22a

Browse files
baltzelltongtongcao
authored andcommitted
Revert "Change geometry for the hits to match reality. (90 shift + conterclock)"
This reverts commit 2f0322b.
1 parent 1fa0e01 commit e6bc22a

File tree

2 files changed

+40
-40
lines changed
  • common-tools/clas-geometry/src/main/java/org/jlab/geom/detector/alert/AHDC
  • reconstruction/alert/src/main/java/org/jlab/rec/ahdc/KalmanFilter

2 files changed

+40
-40
lines changed

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

Lines changed: 28 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -132,13 +132,13 @@ public AlertDCLayer createLayer(ConstantProvider cp, int sectorId, int superlaye
132132
for (int wireId = 0; wireId < numWires; wireId++) {
133133

134134
// The point given by (wx, wy, wz) is the midpoint of the current wire.
135-
double wx = R_layer * Math.cos(alphaW_layer * wireId);
136-
double wy = R_layer * Math.sin(alphaW_layer * wireId);
135+
double wx = -R_layer * Math.sin(alphaW_layer * wireId);
136+
double wy = -R_layer * Math.cos(alphaW_layer * wireId);
137137

138138
// Find the interesection of the current wire with the end-plate
139139
// planes by construciting a long line that passes through the midpoint
140-
double wx_end = R_layer * Math.cos(alphaW_layer * wireId + thster * (Math.pow(-1, superlayerId)));
141-
double wy_end = R_layer * Math.sin(alphaW_layer * wireId + thster * (Math.pow(-1, superlayerId)));
140+
double wx_end = -R_layer * Math.sin(alphaW_layer * wireId + thster * (Math.pow(-1, superlayerId)));
141+
double wy_end = -R_layer * Math.cos(alphaW_layer * wireId + thster * (Math.pow(-1, superlayerId)));
142142
Line3D line = new Line3D(wx, wy, 0, wx_end, wy_end, zl);
143143

144144
Point3D lPoint = new Point3D();
@@ -150,31 +150,31 @@ public AlertDCLayer createLayer(ConstantProvider cp, int sectorId, int superlaye
150150
// Do not change the code above. It is for signal wires positioning
151151

152152
// Construct the cell around the signal wires created above top
153-
double px_0 = (R_layer + 2) * Math.cos(alphaW_layer * wireId);
154-
double py_0 = (R_layer + 2) * Math.sin(alphaW_layer * wireId);
155-
double px_1 = (R_layer + 2) * Math.cos(alphaW_layer * wireId + alphaW_layer / 2);
156-
double py_1 = (R_layer + 2) * Math.sin(alphaW_layer * wireId + alphaW_layer / 2);
157-
double px_2 = (R_layer - 2) * Math.cos(alphaW_layer * wireId + alphaW_layer / 2);
158-
double py_2 = (R_layer - 2) * Math.sin(alphaW_layer * wireId + alphaW_layer / 2);
159-
double px_3 = (R_layer - 2) * Math.cos(alphaW_layer * wireId);
160-
double py_3 = (R_layer - 2) * Math.sin(alphaW_layer * wireId);
161-
double px_4 = (R_layer - 2) * Math.cos(alphaW_layer * wireId - alphaW_layer / 2);
162-
double py_4 = (R_layer - 2) * Math.sin(alphaW_layer * wireId - alphaW_layer / 2);
163-
double px_5 = (R_layer + 2) * Math.cos(alphaW_layer * wireId - alphaW_layer / 2);
164-
double py_5 = (R_layer + 2) * Math.sin(alphaW_layer * wireId - alphaW_layer / 2);
153+
double px_0 = -(R_layer + 2) * Math.sin(alphaW_layer * wireId);
154+
double py_0 = -(R_layer + 2) * Math.cos(alphaW_layer * wireId);
155+
double px_1 = -(R_layer + 2) * Math.sin(alphaW_layer * wireId + alphaW_layer / 2);
156+
double py_1 = -(R_layer + 2) * Math.cos(alphaW_layer * wireId + alphaW_layer / 2);
157+
double px_2 = -(R_layer - 2) * Math.sin(alphaW_layer * wireId + alphaW_layer / 2);
158+
double py_2 = -(R_layer - 2) * Math.cos(alphaW_layer * wireId + alphaW_layer / 2);
159+
double px_3 = -(R_layer - 2) * Math.sin(alphaW_layer * wireId);
160+
double py_3 = -(R_layer - 2) * Math.cos(alphaW_layer * wireId);
161+
double px_4 = -(R_layer - 2) * Math.sin(alphaW_layer * wireId - alphaW_layer / 2);
162+
double py_4 = -(R_layer - 2) * Math.cos(alphaW_layer * wireId - alphaW_layer / 2);
163+
double px_5 = -(R_layer + 2) * Math.sin(alphaW_layer * wireId - alphaW_layer / 2);
164+
double py_5 = -(R_layer + 2) * Math.cos(alphaW_layer * wireId - alphaW_layer / 2);
165165
// bottom (do not forget to add the +20 deg. twist respect to the "straight" version)
166-
double px_6 = (R_layer + 2) * Math.cos(alphaW_layer * wireId + thster * (Math.pow(-1, superlayerId)));
167-
double py_6 = (R_layer + 2) * Math.sin(alphaW_layer * wireId + thster * (Math.pow(-1, superlayerId)));
168-
double px_7 = (R_layer + 2) * Math.cos(alphaW_layer * wireId + alphaW_layer / 2 + thster * (Math.pow(-1, superlayerId)));
169-
double py_7 = (R_layer + 2) * Math.sin(alphaW_layer * wireId + alphaW_layer / 2 + thster * (Math.pow(-1, superlayerId)));
170-
double px_8 = (R_layer - 2) * Math.cos(alphaW_layer * wireId + alphaW_layer / 2 + thster * (Math.pow(-1, superlayerId)));
171-
double py_8 = (R_layer - 2) * Math.sin(alphaW_layer * wireId + alphaW_layer / 2 + thster * (Math.pow(-1, superlayerId)));
172-
double px_9 = (R_layer - 2) * Math.cos(alphaW_layer * wireId + thster * (Math.pow(-1, superlayerId)));
173-
double py_9 = (R_layer - 2) * Math.sin(alphaW_layer * wireId + thster * (Math.pow(-1, superlayerId)));
174-
double px_10 = (R_layer - 2) * Math.cos(alphaW_layer * wireId - alphaW_layer / 2 + thster * (Math.pow(-1, superlayerId)));
175-
double py_10 = (R_layer - 2) * Math.sin(alphaW_layer * wireId - alphaW_layer / 2 + thster * (Math.pow(-1, superlayerId)));
176-
double px_11 = (R_layer + 2) * Math.cos(alphaW_layer * wireId - alphaW_layer / 2 + thster * (Math.pow(-1, superlayerId)));
177-
double py_11 = (R_layer + 2) * Math.sin(alphaW_layer * wireId - alphaW_layer / 2 + thster * (Math.pow(-1, superlayerId)));
166+
double px_6 = -(R_layer + 2) * Math.sin(alphaW_layer * wireId + thster * (Math.pow(-1, superlayerId)));
167+
double py_6 = -(R_layer + 2) * Math.cos(alphaW_layer * wireId + thster * (Math.pow(-1, superlayerId)));
168+
double px_7 = -(R_layer + 2) * Math.sin(alphaW_layer * wireId + alphaW_layer / 2 + thster * (Math.pow(-1, superlayerId)));
169+
double py_7 = -(R_layer + 2) * Math.cos(alphaW_layer * wireId + alphaW_layer / 2 + thster * (Math.pow(-1, superlayerId)));
170+
double px_8 = -(R_layer - 2) * Math.sin(alphaW_layer * wireId + alphaW_layer / 2 + thster * (Math.pow(-1, superlayerId)));
171+
double py_8 = -(R_layer - 2) * Math.cos(alphaW_layer * wireId + alphaW_layer / 2 + thster * (Math.pow(-1, superlayerId)));
172+
double px_9 = -(R_layer - 2) * Math.sin(alphaW_layer * wireId + thster * (Math.pow(-1, superlayerId)));
173+
double py_9 = -(R_layer - 2) * Math.cos(alphaW_layer * wireId + thster * (Math.pow(-1, superlayerId)));
174+
double px_10 = -(R_layer - 2) * Math.sin(alphaW_layer * wireId - alphaW_layer / 2 + thster * (Math.pow(-1, superlayerId)));
175+
double py_10 = -(R_layer - 2) * Math.cos(alphaW_layer * wireId - alphaW_layer / 2 + thster * (Math.pow(-1, superlayerId)));
176+
double px_11 = -(R_layer + 2) * Math.sin(alphaW_layer * wireId - alphaW_layer / 2 + thster * (Math.pow(-1, superlayerId)));
177+
double py_11 = -(R_layer + 2) * Math.cos(alphaW_layer * wireId - alphaW_layer / 2 + thster * (Math.pow(-1, superlayerId)));
178178

179179
// Group into points with (x,y,z) coordinates
180180
List<Point3D> firstF = new ArrayList<>();

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

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -88,11 +88,11 @@ public Hit(int superLayer, int layer, int wire, int numWire, double r, double do
8888

8989
R_layer = R_layer + DR_layer * (this.layer-1);//OK
9090
double alphaW_layer = Math.toRadians(round / (numWires));//OK
91-
double wx = R_layer * Math.cos(alphaW_layer * (this.wire-1));//OK
92-
double wy = R_layer * Math.sin(alphaW_layer * (this.wire-1));//OK
91+
double wx = -R_layer * Math.sin(alphaW_layer * (this.wire-1));//OK
92+
double wy = -R_layer * Math.cos(alphaW_layer * (this.wire-1));//OK
9393

94-
double wx_end = R_layer * Math.cos(alphaW_layer * (this.wire-1) + thster * (Math.pow(-1, this.superLayer-1)));//OK
95-
double wy_end = R_layer * Math.sin(alphaW_layer * (this.wire-1) + thster * (Math.pow(-1, this.superLayer-1)));//OK
94+
double wx_end = -R_layer * Math.sin(alphaW_layer * (this.wire-1) + thster * (Math.pow(-1, this.superLayer-1)));//OK
95+
double wy_end = -R_layer * Math.cos(alphaW_layer * (this.wire-1) + thster * (Math.pow(-1, this.superLayer-1)));//OK
9696

9797
this.phi = Math.atan2( (wy+wy_end)*0.5, (wx+wx_end)*0.5 );
9898
//System.out.println(" superlayer " + this.superLayer + " layer " + this.layer + " wire " + this.wire + " wx " + wx + " wy " + wy + " wx_end " + wx_end + " wy_end " + wy_end + " phi " + this.phi);
@@ -113,11 +113,11 @@ public Hit(int superLayer, int layer, int wire, int numWire, double r, double do
113113

114114
//calculate the "virtual" left and right wires accounting for the DOCA
115115
double deltaphi = Math.asin(this.doca/R_layer);
116-
double wx_plus = R_layer * Math.cos( alphaW_layer * (this.wire-1) - deltaphi );//OK
117-
double wy_plus = R_layer * Math.sin( alphaW_layer * (this.wire-1) - deltaphi );//OK
116+
double wx_plus = -R_layer * Math.sin( alphaW_layer * (this.wire-1) - deltaphi );//OK
117+
double wy_plus = -R_layer * Math.cos( alphaW_layer * (this.wire-1) - deltaphi );//OK
118118

119-
double wx_plus_end = R_layer * Math.cos( alphaW_layer * (this.wire-1) + thster * (Math.pow(-1, this.superLayer-1)) - deltaphi );//OK
120-
double wy_plus_end = R_layer * Math.sin( alphaW_layer * (this.wire-1) + thster * (Math.pow(-1, this.superLayer-1)) - deltaphi );//OK
119+
double wx_plus_end = -R_layer * Math.sin( alphaW_layer * (this.wire-1) + thster * (Math.pow(-1, this.superLayer-1)) - deltaphi );//OK
120+
double wy_plus_end = -R_layer * Math.cos( alphaW_layer * (this.wire-1) + thster * (Math.pow(-1, this.superLayer-1)) - deltaphi );//OK
121121

122122
line = new Line3D(wx_plus, wy_plus, -zl/2, wx_plus_end, wy_plus_end, zl/2);
123123
lPoint = new Point3D();
@@ -128,11 +128,11 @@ public Hit(int superLayer, int layer, int wire, int numWire, double r, double do
128128
wireLine = new Line3D(lPoint, rPoint);
129129
this.line3D_plus = wireLine;
130130

131-
double wx_minus = R_layer * Math.cos( alphaW_layer * (this.wire-1) + deltaphi );//OK
132-
double wy_minus = R_layer * Math.sin( alphaW_layer * (this.wire-1) + deltaphi );//OK
131+
double wx_minus = -R_layer * Math.sin( alphaW_layer * (this.wire-1) + deltaphi );//OK
132+
double wy_minus = -R_layer * Math.cos( alphaW_layer * (this.wire-1) + deltaphi );//OK
133133

134-
double wx_minus_end = R_layer * Math.cos( alphaW_layer * (this.wire-1) + thster * (Math.pow(-1, this.superLayer-1)) + deltaphi );//OK
135-
double wy_minus_end = R_layer * Math.sin( alphaW_layer * (this.wire-1) + thster * (Math.pow(-1, this.superLayer-1)) + deltaphi );//OK
134+
double wx_minus_end = -R_layer * Math.sin( alphaW_layer * (this.wire-1) + thster * (Math.pow(-1, this.superLayer-1)) + deltaphi );//OK
135+
double wy_minus_end = -R_layer * Math.cos( alphaW_layer * (this.wire-1) + thster * (Math.pow(-1, this.superLayer-1)) + deltaphi );//OK
136136

137137
line = new Line3D(wx_minus, wy_minus, -zl/2, wx_minus_end, wy_minus_end, zl/2);
138138
lPoint = new Point3D();

0 commit comments

Comments
 (0)