From 9074f6b778fbac91a50e0d2cfe9a880b28873aea Mon Sep 17 00:00:00 2001 From: Raffaella De Vita Date: Sat, 1 Feb 2020 20:02:13 -0500 Subject: [PATCH 1/2] Swimmer: modified cylindrical stopper to cope with beam offset in CVT, optimization of swimming for CVT trajectories, correction to comments in json file --- .../java/org/jlab/clas/swimtools/Swim.java | 6 +- etc/bankdefs/hipo4/cvt.json | 6 +- .../rec/cvt/trajectory/TrajectoryFinder.java | 84 ++++++++++++------- 3 files changed, 58 insertions(+), 38 deletions(-) diff --git a/common-tools/swim-tools/src/main/java/org/jlab/clas/swimtools/Swim.java b/common-tools/swim-tools/src/main/java/org/jlab/clas/swimtools/Swim.java index 130cbd5b4d..c9f0ac9d4e 100644 --- a/common-tools/swim-tools/src/main/java/org/jlab/clas/swimtools/Swim.java +++ b/common-tools/swim-tools/src/main/java/org/jlab/clas/swimtools/Swim.java @@ -369,10 +369,10 @@ private CylindricalBoundarySwimStopper(double Rad) { @Override public boolean stopIntegration(double t, double[] y) { - + double r = Math.sqrt(y[0] * y[0] + y[1] * y[1]) * 100.; - if(r>max ) - max = r; +// if(r>max ) +// max = r; // else System.out.println(r + " " + max + " " + t); //if(cutOff) { return (r < max || r > _Rad); // stop intergration at closest distance to the cylinder diff --git a/etc/bankdefs/hipo4/cvt.json b/etc/bankdefs/hipo4/cvt.json index 1938d99ada..b7d736b774 100644 --- a/etc/bankdefs/hipo4/cvt.json +++ b/etc/bankdefs/hipo4/cvt.json @@ -94,9 +94,9 @@ {"name":"x", "type":"F", "info":"track x position at detector surface (cm)"}, {"name":"y", "type":"F", "info":"track y position at detector surface (cm)"}, {"name":"z", "type":"F", "info":"track z position at detector surface (cm)"}, - {"name":"phi", "type":"F", "info":"local phi at detector surface (deg)"}, - {"name":"theta", "type":"F", "info":"local theta at detector surface"}, - {"name":"langle", "type":"F", "info":"local angle with module surface"}, + {"name":"phi", "type":"F", "info":"local phi at detector surface (rad)"}, + {"name":"theta", "type":"F", "info":"local theta at detector surface (rad)"}, + {"name":"langle", "type":"F", "info":"local angle with module surface (rad)"}, {"name":"centroid", "type":"F", "info":"estimated strip centroid"}, {"name":"path", "type":"F", "info":"pathlength of the track from the track vertex to the detector surface (cm)"} ] diff --git a/reconstruction/cvt/src/main/java/org/jlab/rec/cvt/trajectory/TrajectoryFinder.java b/reconstruction/cvt/src/main/java/org/jlab/rec/cvt/trajectory/TrajectoryFinder.java index f85732b939..419dce6a1c 100644 --- a/reconstruction/cvt/src/main/java/org/jlab/rec/cvt/trajectory/TrajectoryFinder.java +++ b/reconstruction/cvt/src/main/java/org/jlab/rec/cvt/trajectory/TrajectoryFinder.java @@ -98,12 +98,22 @@ public Trajectory findTrajectory(int id, Track trk, traj.set_SVTSector(Sectors); ArrayList stateVecs = new ArrayList(); - // SVT + + // initialize swimmer starting from the track vertex + double maxPathLength = 1; swimmer.SetSwimParameters((trk.get_helix().xdca()+org.jlab.rec.cvt.Constants.getXb()) / 10, (trk.get_helix().ydca()+org.jlab.rec.cvt.Constants.getYb()) / 10, trk.get_helix().get_Z0() / 10, - Math.toDegrees(trk.get_helix().get_phi_at_dca()), Math.toDegrees(Math.acos(trk.get_helix().costheta())), - trk.get_P(), trk.get_Q(), - 5.0) ; + Math.toDegrees(trk.get_helix().get_phi_at_dca()), Math.toDegrees(Math.acos(trk.get_helix().costheta())), + trk.get_P(), trk.get_Q(), maxPathLength) ; + double[] inters = null; + double path = 0; + // SVT for (int l = 0; l < org.jlab.rec.cvt.svt.Constants.NLAYR; l++) { + // reinitilize swimmer from last surface +// if(inters!=null) { +// double intersPhi = Math.atan2(inters[4], inters[3]); +// double intersTheta = Math.acos(inters[5]/Math.sqrt(inters[3]*inters[3]+inters[4]*inters[4]+inters[5]*inters[5])); +// swimmer.SetSwimParameters(inters[0], inters[1], inters[2], Math.toDegrees(intersPhi), Math.toDegrees(intersTheta), trk.get_P(), trk.get_Q(), maxPathLength) ; +// } int layer = l + 1; int sector = Sectors[l]; @@ -124,22 +134,17 @@ public Trajectory findTrajectory(int id, Track trk, // // Vector3D n = svt_geo.findBSTPlaneNormal(sector, layer); - //Point3D p = svt_geo.intersectionOfHelixWithPlane(layer, sector, helix); Point3D p = svt_geo.getPlaneModuleOrigin(sector, layer); double d = n.dot(p.toVector3D()); -// swimmer.SetSwimParameters((trk.get_helix().xdca()+org.jlab.rec.cvt.Constants.getXb()) / 10, (trk.get_helix().ydca()+org.jlab.rec.cvt.Constants.getYb()) / 10, trk.get_helix().get_Z0() / 10, -// Math.toDegrees(trk.get_helix().get_phi_at_dca()), Math.toDegrees(Math.acos(trk.get_helix().costheta())), -// trk.get_P(), trk.get_Q(), -// 5.0) ; - double[] inters = swimmer.SwimToPlaneBoundary(d/10.0, n, 1); + inters = swimmer.SwimToPlaneBoundary(d/10.0, n, 1); + path = inters[6]; StateVec stVec = new StateVec(inters[0]*10, inters[1]*10, inters[2]*10, inters[3], inters[4], inters[5]); stVec.set_planeIdx(l); stVec.set_SurfaceDetector(DetectorType.CVT.getDetectorId()); stVec.set_SurfaceLayer(layer); stVec.set_SurfaceSector(sector); stVec.set_CalcCentroidStrip(svt_geo.calcNearestStrip(inters[0]*10, inters[1]*10, inters[2]*10, layer, sector)); - - stVec.set_Path(inters[6]*10); + stVec.set_Path(path*10); stVec.set_ID(id); stateVecs.add(stVec); @@ -169,15 +174,21 @@ public Trajectory findTrajectory(int id, Track trk, } } - // initialize swimmer starting from the track vertex - int charge = trk.get_Q(); - double maxPathLength = 5.0; + // reinitialize from vertex + maxPathLength = 1.5; swimmer.SetSwimParameters((trk.get_helix().xdca()+org.jlab.rec.cvt.Constants.getXb()) / 10, (trk.get_helix().ydca()+org.jlab.rec.cvt.Constants.getYb()) / 10, trk.get_helix().get_Z0() / 10, Math.toDegrees(trk.get_helix().get_phi_at_dca()), Math.toDegrees(Math.acos(trk.get_helix().costheta())), - trk.get_P(), charge, maxPathLength) ; - double[] inters = null; + trk.get_P(), trk.get_Q(), maxPathLength) ; + inters = null; + path = 0; //BMT for (int l = org.jlab.rec.cvt.svt.Constants.NLAYR; l < org.jlab.rec.cvt.svt.Constants.NLAYR + 2 * org.jlab.rec.cvt.bmt.Constants.NREGIONS; l++) { + // re-initilize swimmer from last surface + if(inters!=null) { + double intersPhi = Math.atan2(inters[4], inters[3]); + double intersTheta = Math.acos(inters[5]/Math.sqrt(inters[3]*inters[3]+inters[4]*inters[4]+inters[5]*inters[5])); + swimmer.SetSwimParameters(inters[0], inters[1], inters[2], Math.toDegrees(intersPhi), Math.toDegrees(intersTheta), trk.get_P(), trk.get_Q(), maxPathLength) ; + } if(inters!=null || l==org.jlab.rec.cvt.svt.Constants.NLAYR) { // don't swim if previous layers was not reached int BMTRegIdx = (l - org.jlab.rec.cvt.svt.Constants.NLAYR) / 2; @@ -199,6 +210,7 @@ public Trajectory findTrajectory(int id, Track trk, // 5.0) ; inters = swimmer.SwimToCylinder(R/10); double r = Math.sqrt(inters[0]*inters[0]+inters[1]*inters[1]); + path = path + inters[6]; if(r>R/10) { StateVec stVec = new StateVec(inters[0]*10, inters[1]*10, inters[2]*10, inters[3], inters[4], inters[5]); stVec.set_planeIdx(l); @@ -208,7 +220,7 @@ public Trajectory findTrajectory(int id, Track trk, stVec.set_SurfaceSector(sector); stVec.set_SurfaceLayer(l+1); stVec.set_ID(id); - stVec.set_Path(inters[6]*10); + stVec.set_Path(path*10); Vector3D dir = new Vector3D(inters[3], inters[4], inters[5]).asUnit(); //stateVecs.add(stVec); // calculate crosses on BMT layers using track information. These are used in the event display @@ -273,24 +285,27 @@ public Trajectory findTrajectory(int id, Track trk, } } // CTOF - double phi=0; - double theta=0; - double path=0; if(ctof_geo!=null && inters!=null) { // don't swim to CTOF if swimming to BMT failed + // reinitialize swimmer based on last BMT layer + double intersPhi = Math.atan2(inters[4], inters[3]); + double intersTheta = Math.acos(inters[5]/Math.sqrt(inters[3]*inters[3]+inters[4]*inters[4]+inters[5]*inters[5])); + swimmer.SetSwimParameters(inters[0], inters[1], inters[2], Math.toDegrees(intersPhi), Math.toDegrees(intersTheta), trk.get_P(), trk.get_Q(), maxPathLength) ; + // swim to CTOF double radius = ctof_geo.getRadius(1); inters = swimmer.SwimToCylinder(radius); + // update parameters double r = Math.sqrt(inters[0]*inters[0]+inters[1]*inters[1]); - phi = Math.atan2(inters[4], inters[3]); - theta = Math.acos(inters[5]/Math.sqrt(inters[3]*inters[3]+inters[4]*inters[4]+inters[5]*inters[5])); - path = inters[6]; + intersPhi = Math.atan2(inters[4], inters[3]); + intersTheta = Math.acos(inters[5]/Math.sqrt(inters[3]*inters[3]+inters[4]*inters[4]+inters[5]*inters[5])); + path = path + inters[6]; if(r>=radius) { StateVec stVec = new StateVec(inters[0]*10, inters[1]*10, inters[2]*10, inters[3], inters[4], inters[5]); stVec.set_SurfaceDetector(DetectorType.CTOF.getDetectorId()); stVec.set_SurfaceSector(1); stVec.set_SurfaceLayer(1); stVec.set_ID(id); - stVec.set_TrkPhiAtSurface(phi); - stVec.set_TrkThetaAtSurface(theta); + stVec.set_TrkPhiAtSurface(intersPhi); + stVec.set_TrkThetaAtSurface(intersTheta); stVec.set_TrkToModuleAngle(0); stVec.set_Path(path*10); stateVecs.add(stVec); @@ -300,16 +315,21 @@ public Trajectory findTrajectory(int id, Track trk, // CND if(cnd_geo!=null && inters!=null) { // don't swim to CND if swimming to CTOF failed for(int ilayer=0; ilayer Date: Sun, 2 Feb 2020 20:39:10 -0500 Subject: [PATCH 2/2] version bumped to 6b.5.1 --- common-tools/clas-analysis/pom.xml | 14 +++++++------- common-tools/clas-detector/pom.xml | 10 +++++----- common-tools/clas-eventmerger/pom.xml | 10 +++++----- common-tools/clas-geometry/pom.xml | 4 ++-- common-tools/clas-io/pom.xml | 6 +++--- common-tools/clas-jcsg/pom.xml | 8 ++++---- common-tools/clas-math/pom.xml | 4 ++-- common-tools/clas-physics/pom.xml | 4 ++-- common-tools/clas-reco/pom.xml | 14 +++++++------- common-tools/clas-utils/pom.xml | 4 ++-- common-tools/cnuphys/ced/pom.xml | 8 ++++---- common-tools/cnuphys/magfield/pom.xml | 2 +- common-tools/cnuphys/swimmer/pom.xml | 2 +- common-tools/coat-lib/deployDistribution.sh | 2 +- common-tools/coat-lib/pom.xml | 20 ++++++++++---------- common-tools/parent/pom.xml | 2 +- common-tools/pom.xml | 4 ++-- common-tools/swim-tools/pom.xml | 6 +++--- parent/pom.xml | 2 +- pom.xml | 4 ++-- reconstruction/band/pom.xml | 2 +- reconstruction/cnd/pom.xml | 2 +- reconstruction/cvt/pom.xml | 10 +++++----- reconstruction/dc/pom.xml | 12 ++++++------ reconstruction/eb/pom.xml | 10 +++++----- reconstruction/ec/pom.xml | 14 +++++++------- reconstruction/ft/pom.xml | 8 ++++---- reconstruction/fvt/pom.xml | 6 +++--- reconstruction/htcc/pom.xml | 8 ++++---- reconstruction/ltcc/pom.xml | 6 +++--- reconstruction/pom.xml | 4 ++-- reconstruction/rich/pom.xml | 8 ++++---- reconstruction/rtpc/pom.xml | 6 +++--- reconstruction/tof/pom.xml | 4 ++-- 34 files changed, 115 insertions(+), 115 deletions(-) diff --git a/common-tools/clas-analysis/pom.xml b/common-tools/clas-analysis/pom.xml index afe58281af..0b057359fb 100644 --- a/common-tools/clas-analysis/pom.xml +++ b/common-tools/clas-analysis/pom.xml @@ -3,14 +3,14 @@ 4.0.0 org.jlab.clas clas-analysis - 6b.5.0-SNAPSHOT + 6b.5.1-SNAPSHOT jar org.jlab.clas clas12rec ../../parent/pom.xml - 6b.5.0-SNAPSHOT + 6b.5.1-SNAPSHOT @@ -30,31 +30,31 @@ org.jlab.clas clas-utils - 6b.5.0-SNAPSHOT + 6b.5.1-SNAPSHOT org.jlab.clas clas-physics - 6b.5.0-SNAPSHOT + 6b.5.1-SNAPSHOT org.jlab.clas clas-io - 6b.5.0-SNAPSHOT + 6b.5.1-SNAPSHOT org.jlab.clas clas-geometry - 6b.5.0-SNAPSHOT + 6b.5.1-SNAPSHOT org.jlab.clas clas-detector - 6b.5.0-SNAPSHOT + 6b.5.1-SNAPSHOT diff --git a/common-tools/clas-detector/pom.xml b/common-tools/clas-detector/pom.xml index d6a58e38b0..c6bc6fec66 100644 --- a/common-tools/clas-detector/pom.xml +++ b/common-tools/clas-detector/pom.xml @@ -3,14 +3,14 @@ 4.0.0 org.jlab.clas clas-detector - 6b.5.0-SNAPSHOT + 6b.5.1-SNAPSHOT jar org.jlab.clas clas12rec ../../parent/pom.xml - 6b.5.0-SNAPSHOT + 6b.5.1-SNAPSHOT @@ -30,7 +30,7 @@ org.jlab.clas clas-utils - 6b.5.0-SNAPSHOT + 6b.5.1-SNAPSHOT @@ -42,13 +42,13 @@ org.jlab.clas clas-io - 6b.5.0-SNAPSHOT + 6b.5.1-SNAPSHOT org.jlab.clas clas-geometry - 6b.5.0-SNAPSHOT + 6b.5.1-SNAPSHOT diff --git a/common-tools/clas-eventmerger/pom.xml b/common-tools/clas-eventmerger/pom.xml index 3ff48b4412..d04a08b1dc 100644 --- a/common-tools/clas-eventmerger/pom.xml +++ b/common-tools/clas-eventmerger/pom.xml @@ -2,14 +2,14 @@ 4.0.0 clas-eventmerger - 6b.5.0-SNAPSHOT + 6b.5.1-SNAPSHOT jar org.jlab.clas clas12rec ../../parent/pom.xml - 6b.5.0-SNAPSHOT + 6b.5.1-SNAPSHOT @@ -29,19 +29,19 @@ org.jlab.clas clas-utils - 6b.5.0-SNAPSHOT + 6b.5.1-SNAPSHOT org.jlab.clas clas-io - 6b.5.0-SNAPSHOT + 6b.5.1-SNAPSHOT org.jlab.clas clas-geometry - 6b.5.0-SNAPSHOT + 6b.5.1-SNAPSHOT diff --git a/common-tools/clas-geometry/pom.xml b/common-tools/clas-geometry/pom.xml index 2e84173a69..7afb1eb8fc 100644 --- a/common-tools/clas-geometry/pom.xml +++ b/common-tools/clas-geometry/pom.xml @@ -3,14 +3,14 @@ 4.0.0 org.jlab.clas clas-geometry - 6b.5.0-SNAPSHOT + 6b.5.1-SNAPSHOT jar org.jlab.clas clas12rec ../../parent/pom.xml - 6b.5.0-SNAPSHOT + 6b.5.1-SNAPSHOT diff --git a/common-tools/clas-io/pom.xml b/common-tools/clas-io/pom.xml index 8cc5bafa41..a68621c5a7 100644 --- a/common-tools/clas-io/pom.xml +++ b/common-tools/clas-io/pom.xml @@ -3,14 +3,14 @@ 4.0.0 org.jlab.clas clas-io - 6b.5.0-SNAPSHOT + 6b.5.1-SNAPSHOT jar org.jlab.clas clas12rec ../../parent/pom.xml - 6b.5.0-SNAPSHOT + 6b.5.1-SNAPSHOT @@ -75,7 +75,7 @@ org.jlab.clas clas-utils - 6b.5.0-SNAPSHOT + 6b.5.1-SNAPSHOT diff --git a/common-tools/clas-jcsg/pom.xml b/common-tools/clas-jcsg/pom.xml index 0ee4856803..983aff52ca 100644 --- a/common-tools/clas-jcsg/pom.xml +++ b/common-tools/clas-jcsg/pom.xml @@ -3,14 +3,14 @@ 4.0.0 org.jlab.clas clas-jcsg - 6b.5.0-SNAPSHOT + 6b.5.1-SNAPSHOT jar org.jlab.clas clas12rec ../../parent/pom.xml - 6b.5.0-SNAPSHOT + 6b.5.1-SNAPSHOT @@ -40,12 +40,12 @@ org.jlab.clas clas-geometry - 6b.5.0-SNAPSHOT + 6b.5.1-SNAPSHOT org.jlab.clas clas-detector - 6b.5.0-SNAPSHOT + 6b.5.1-SNAPSHOT java3d diff --git a/common-tools/clas-math/pom.xml b/common-tools/clas-math/pom.xml index 6e7d0d6b3f..c2b02119b3 100644 --- a/common-tools/clas-math/pom.xml +++ b/common-tools/clas-math/pom.xml @@ -3,14 +3,14 @@ 4.0.0 org.jlab.clas clas-math - 6b.5.0-SNAPSHOT + 6b.5.1-SNAPSHOT jar org.jlab.clas clas12rec ../../parent/pom.xml - 6b.5.0-SNAPSHOT + 6b.5.1-SNAPSHOT diff --git a/common-tools/clas-physics/pom.xml b/common-tools/clas-physics/pom.xml index 096a96411f..6417657bf7 100644 --- a/common-tools/clas-physics/pom.xml +++ b/common-tools/clas-physics/pom.xml @@ -4,7 +4,7 @@ org.jlab.clas clas-physics - 6b.5.0-SNAPSHOT + 6b.5.1-SNAPSHOT jar @@ -23,7 +23,7 @@ org.jlab.clas clas12rec ../../parent/pom.xml - 6b.5.0-SNAPSHOT + 6b.5.1-SNAPSHOT diff --git a/common-tools/clas-reco/pom.xml b/common-tools/clas-reco/pom.xml index 06bc0c378b..d54ddc464c 100644 --- a/common-tools/clas-reco/pom.xml +++ b/common-tools/clas-reco/pom.xml @@ -3,14 +3,14 @@ 4.0.0 org.jlab.clas clas-reco - 6b.5.0-SNAPSHOT + 6b.5.1-SNAPSHOT jar org.jlab.clas clas12rec ../../parent/pom.xml - 6b.5.0-SNAPSHOT + 6b.5.1-SNAPSHOT @@ -67,7 +67,7 @@ org.jlab.clas clas-math - 6b.5.0-SNAPSHOT + 6b.5.1-SNAPSHOT