Skip to content

Commit 42136f8

Browse files
authored
Merge pull request #1073 from JeffersonLab/swimtools-cleanup
Swimtools cleanup
2 parents 2e1407b + 4e92409 commit 42136f8

File tree

8 files changed

+302
-505
lines changed

8 files changed

+302
-505
lines changed

common-tools/clas-decay-tools/src/main/java/org/jlab/clas/decay/analysis/Particle.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -997,7 +997,7 @@ private double calcUncorrMass(Particle part1, Particle part2) { //momentum not c
997997
} else {
998998
swim.SetSwimParameters(vxch, vych, vzch,
999999
-pxch, -pych, -pzch, -q);
1000-
double[] tr1 = swim.SwimToPlaneBoundary((vzvo-buffer),new Vector3D(0,0,1), -1);
1000+
double[] tr1 = swim.SwimToPlaneBoundary((vzvo-buffer),new Vector3D(0,0,1));
10011001

10021002
swim.SetSwimParameters(tr1[0], tr1[1], tr1[2], -tr1[3], -tr1[4], -tr1[5], q);
10031003
}

common-tools/swim-tools/src/main/java/org/jlab/clas/swimtools/ASwim.java

Lines changed: 17 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -11,27 +11,31 @@
1111
public abstract class ASwim extends SwimPars implements ISwim {
1212

1313
@Override
14-
public double[] SwimToPlaneTiltSecSys(int sector, double z_cm) {
15-
throw new UnsupportedOperationException("Not supported yet.");
16-
}
17-
18-
@Override
19-
public double[] SwimToPlaneTiltSecSysBdlXZPlane(int sector, double z_cm) {
20-
throw new UnsupportedOperationException("Not supported yet.");
21-
}
22-
23-
@Override
24-
public double[] SwimToPlaneBoundary(double d_cm, Vector3D n, int dir) {
25-
throw new UnsupportedOperationException("Not supported yet.");
14+
public double[] SwimToPlaneBoundary(double d_cm, Vector3D n) {
15+
// Normalize the normal - should already be done, but just in case
16+
Vector3D nhat = n.asUnit();
17+
18+
// Point on the plane at distance d_cm from origin
19+
Point3D p = new Point3D(
20+
nhat.x() * d_cm,
21+
nhat.y() * d_cm,
22+
nhat.z() * d_cm
23+
);
24+
return SwimPlane(nhat, p, accuracy);
2625
}
2726

2827
@Override
2928
public double[] SwimToPlaneLab(double z_cm) {
3029
return SwimPlane(new Vector3D(0,0,1), new Point3D(0,0,z_cm), accuracy);
3130
}
3231

32+
//@Override
33+
//public double[] SwimToCylinder(double radius) {
34+
// return SwimGenCylinder(new Point3D(0,0,-1), new Point3D(0,0,1), radius, accuracy);
35+
//}
36+
3337
@Override
34-
public double[] SwimToCylinder(double radius) {
38+
public double[] SwimRho(double radius, double accuracy) {
3539
return SwimGenCylinder(new Point3D(0,0,-1), new Point3D(0,0,1), radius, accuracy);
3640
}
3741

common-tools/swim-tools/src/main/java/org/jlab/clas/swimtools/AdaptiveSwim.java

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -15,8 +15,6 @@
1515
import cnuphys.adaptiveSwim.AdaptiveSwimmer;
1616
import cnuphys.adaptiveSwim.geometry.Plane;
1717

18-
import cnuphys.swim.SwimTrajectory;
19-
2018
public class AdaptiveSwim extends ASwim {
2119

2220
private static double[] convert(AdaptiveSwimResult result, double p) {
@@ -135,9 +133,5 @@ public double[] SwimToLine(Line3D l) {
135133
return null;
136134
}
137135

138-
@Override
139-
public double[] SwimToDCA(SwimTrajectory trk2) {
140-
throw new UnsupportedOperationException("Not supported yet.");
141-
}
142136

143137
}
Lines changed: 2 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,24 +1,18 @@
11
package org.jlab.clas.swimtools;
22

3-
import cnuphys.swim.SwimTrajectory;
43
import org.jlab.geom.prim.Line3D;
54
import org.jlab.geom.prim.Point3D;
65
import org.jlab.geom.prim.Vector3D;
76

87
/**
9-
* FIXME: Can any of these be removed?
108
*
119
* @author baltzell
1210
*/
1311
interface ISwim {
1412

15-
public double[] SwimToPlaneTiltSecSys(int sector, double z_cm);
16-
17-
public double[] SwimToPlaneTiltSecSysBdlXZPlane(int sector, double z_cm);
18-
1913
public double[] SwimToPlaneLab(double z_cm);
2014

21-
public double[] SwimToCylinder(double Rad);
15+
//public double[] SwimToCylinder(double Rad);
2216

2317
public double[] SwimRho(double radius, double accuracy);
2418

@@ -28,14 +22,12 @@ interface ISwim {
2822

2923
public double[] SwimToSphere(double Rad);
3024

31-
public double[] SwimToPlaneBoundary(double d_cm, Vector3D n, int dir);
25+
public double[] SwimToPlaneBoundary(double d_cm, Vector3D n);
3226

3327
public double[] SwimToBeamLine(double xB, double yB);
3428

3529
public double[] SwimToLine(Line3D l);
3630

3731
public double[] SwimToZ(double Z, int dir);
3832

39-
public double[] SwimToDCA(SwimTrajectory trk2);
40-
4133
}

0 commit comments

Comments
 (0)