Skip to content

Commit 4a1f948

Browse files
fix strip numbering and orientation (#1135)
1 parent d1eaa84 commit 4a1f948

File tree

1 file changed

+12
-6
lines changed

1 file changed

+12
-6
lines changed

common-tools/clas-jcsg/src/main/java/org/jlab/detector/geant4/v2/MPGD/trapezoid/MPGDTrapezoidStripFactory.java

Lines changed: 12 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -337,7 +337,7 @@ protected static boolean buildStripSegment(int internalIndex, StripConstants c,
337337
Vector3d nXY = new Vector3d(ca, -sa, 0.0);
338338
double rhs = (internalIndex + 0.5) * c.pitch;
339339

340-
List<Vector3d> inters = new ArrayList<>(4);
340+
List<Vector3d> inters = new ArrayList<>();
341341

342342
for (Vector3d[] e : tr.edges()) {
343343
Vector3d P = new Vector3d(0, 0, 0);
@@ -360,8 +360,14 @@ protected static boolean buildStripSegment(int internalIndex, StripConstants c,
360360
double d2 = dx * dx + dy * dy;
361361
if (d2 > best) {
362362
best = d2;
363-
a = inters.get(i);
364-
b = inters.get(j);
363+
if(dy>0) {
364+
a = inters.get(i);
365+
b = inters.get(j);
366+
}
367+
else {
368+
a = inters.get(j);
369+
b = inters.get(i);
370+
}
365371
}
366372
}
367373
}
@@ -419,9 +425,9 @@ protected List<StripGeom> buildStripCache(StripConstants c) {
419425
tmp.add(s);
420426
}
421427

422-
tmp.sort(Comparator
423-
.comparingDouble((StripGeom s) -> s.orderXLocal)
424-
.thenComparingInt(s -> s.internalIndex));
428+
// tmp.sort(Comparator
429+
// .comparingDouble((StripGeom s) -> s.orderXLocal)
430+
// .thenComparingInt(s -> s.internalIndex));
425431

426432
int comp = 1;
427433
for (StripGeom s : tmp) {

0 commit comments

Comments
 (0)