Skip to content

Commit 527d42e

Browse files
zieglervzieglerraffaelladevita
authored
Iss153 cvt straight trk angle (#351)
* The updating of the cross position is shifted by -yB because the trajectory was using the helix method to compute the position at the cylinder radius and it was not accounting for the beam spot. Actually this computation was not needed because the KF already reports the trajectory. Both these issues have been fixed. The hemisphere was wrong in the making of the surfaces, as it took the middle of the cluster strip which for BMT C gives the wrong hemisphere for events in a particular phi range. This has been fixed by using the afore mentioned method to get the point from the seed and get the hemisphere from there. * version bump * Modified getMeasurements to account for hemisphere. --------- Co-authored-by: ziegler <[email protected]> Co-authored-by: raffaelladevita <[email protected]>
1 parent 3225119 commit 527d42e

3 files changed

Lines changed: 44 additions & 18 deletions

File tree

reconstruction/cvt/src/main/java/org/jlab/rec/cvt/measurement/Measurements.java

Lines changed: 37 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@
1616
import org.jlab.rec.cvt.Constants;
1717
import org.jlab.rec.cvt.Geometry;
1818
import org.jlab.rec.cvt.bmt.BMTGeometry;
19+
import org.jlab.rec.cvt.bmt.BMTType;
1920
import org.jlab.rec.cvt.cluster.Cluster;
2021
import org.jlab.rec.cvt.svt.SVTGeometry;
2122
import org.jlab.rec.cvt.track.Seed;
@@ -37,7 +38,7 @@ public class Measurements {
3738
private boolean cosmic = false;
3839
private Surface[] cvtSurfaces;
3940
private boolean debug = false;
40-
41+
private Seed _seed;
4142
public Measurements(double xbeam, double ybeam, boolean beamSpot) {
4243
this.initTargetSurfaces(xbeam, ybeam, beamSpot);
4344
}
@@ -254,12 +255,12 @@ public List<Surface> getActiveMeasurements(StraightTrack cosmic) {
254255
}
255256

256257
private void addClusters(Seed seed) {
257-
this.addClusters(DetectorType.BST, this.getClusterSurfaces(DetectorType.BST, seed.getClusters()));
258-
this.addClusters(DetectorType.BMT, this.getClusterSurfaces(DetectorType.BMT, seed.getClusters()));
258+
this.addClusters(DetectorType.BST, this.getClusterSurfaces(DetectorType.BST, seed.getClusters(), seed));
259+
this.addClusters(DetectorType.BMT, this.getClusterSurfaces(DetectorType.BMT, seed.getClusters(), seed));
259260
}
260261

261262
private void addClusters(StraightTrack cosmic) {
262-
this.addClusters(DetectorType.BST, this.getClusterSurfaces(DetectorType.BST, cosmic.getClusters()));
263+
this.addClusters(DetectorType.BST, this.getClusterSurfaces(DetectorType.BST, cosmic.getClusters(), cosmic.getRay()));
263264
this.addClusters(DetectorType.BMT, this.getClusterSurfaces(DetectorType.BMT, cosmic.getClusters(), cosmic.getRay()));
264265
}
265266

@@ -283,27 +284,33 @@ private void addClusters(DetectorType type, List<Surface> clusters) {
283284

284285
private List<Surface> getClusterSurfaces(DetectorType type, List<Cluster> clusters, Ray ray) {
285286

286-
List<Surface> surfaces = this.getClusterSurfaces(type, clusters);
287+
List<Surface> surfaces = this.getClusterSurfaces(type, clusters, ray);
287288
for(Surface surf : surfaces) {
288-
surf.hemisphere = this.getHemisphere(ray, surf);
289+
surf.hemisphere = this.getHemisphere(ray, surf);
289290
}
290291
return surfaces;
291292
}
292293

293-
private List<Surface> getClusterSurfaces(DetectorType type, List<Cluster> clusters) {
294-
List<Surface> surfaces = new ArrayList<>();
294+
private List<Surface> getClusterSurfaces(DetectorType type, List<Cluster> clusters, Seed seed) {
295295

296+
List<Surface> surfaces = new ArrayList<>();
296297
for(Cluster cluster : clusters) {
297-
if(cluster.getDetector()!=type) continue;
298-
int layer = MLayer.getType(type, cluster.getLayer()).getCVTLayer();
299-
Surface measure = cluster.measurement();
300-
measure.hemisphere = Math.signum(cluster.center().y());
301-
if((int)Constants.getInstance().getUsedLayers().get(layer)<1)
302-
measure.passive=true;
303-
surfaces.add(measure);
298+
Surface surf = this.getClusterSurface(type, cluster);
299+
if(surf!=null) {
300+
surf.hemisphere = this.getHemisphere(cluster, seed, surf);
301+
surfaces.add(surf);
302+
}
304303
}
305304
return surfaces;
306305
}
306+
private Surface getClusterSurface(DetectorType type, Cluster cluster) {
307+
if(cluster.getDetector()!=type) return null;
308+
int layer = MLayer.getType(type, cluster.getLayer()).getCVTLayer();
309+
Surface surface = cluster.measurement();
310+
if((int)Constants.getInstance().getUsedLayers().get(layer)<1)
311+
surface.passive=true;
312+
return surface;
313+
}
307314

308315
private void addMissing(Seed seed) {
309316
for(int i=0; i<cvtSurfaces.length; i++) {
@@ -437,7 +444,19 @@ private int getHemisphere(Ray ray, Surface surface){
437444
else
438445
return 0;
439446
}
440-
447+
private int getHemisphere(Cluster cluster, Seed seed, Surface surface) {
448+
if(surface.cylinder==null)
449+
return 0;
450+
if(cluster.getType()==BMTType.C) {
451+
if(seed==null)
452+
return 0;
453+
double r = cluster.getRadius();
454+
Point3D vAtR = seed.getHelix().getPointAtRadius(r);
455+
return (int) Math.signum(vAtR.y());
456+
} else {
457+
return (int) Math.signum(cluster.center().y());
458+
}
459+
}
441460
private void reset() {
442461
for(int i=0; i<cvtSurfaces.length; i++) {
443462
int hemisphere = MLayer.getHemisphere(i);
@@ -450,4 +469,6 @@ private void reset() {
450469
}
451470
}
452471
}
472+
473+
453474
}

reconstruction/cvt/src/main/java/org/jlab/rec/cvt/services/TracksFromTargetRec.java

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -198,8 +198,11 @@ public List<Track> getTracks(DataEvent event, boolean initFromMc, boolean kfFilt
198198
List<Surface> surfaces = measure.getMeasurements(seed);
199199

200200
if(pid==0) pid = this.getTrackPid(event, seed.getId());
201-
Point3D v = seed.getHelix().getVertex();
201+
Point3D v = seed.getHelix().getVertex();
202202
Vector3D p = seed.getHelix().getPXYZ(solenoidValue);
203+
if(Constants.getInstance().seedingDebugMode)
204+
System.out.println("Seed vtx = "+v.toString()+" Seed p = "+p.toString());
205+
203206
if(Constants.getInstance().preElossCorrection && pid!=Constants.DEFAULTPID) {
204207
double pcorr = measure.getELoss(p.mag(), PDGDatabase.getParticleMass(pid));
205208
p.scale(pcorr/p.mag());
@@ -238,6 +241,8 @@ public List<Track> getTracks(DataEvent event, boolean initFromMc, boolean kfFilt
238241
c.getCluster2().setAssociatedTrackID(0);
239242
}
240243
}
244+
if(Constants.getInstance().seedingDebugMode)
245+
System.out.println("KF vtx = "+fittedTrack.getSecondaryHelix().getVertex().toString());
241246
if (searchMissingCls) {
242247
//refit adding missing clusters
243248
List<Cluster> clsOnTrack = recUtil.findClustersOnTrk(this.SVTclusters, seed.getClusters(), fittedTrack, swimmer); //VZ: finds missing clusters; RDV fix 0 error

reconstruction/cvt/src/main/java/org/jlab/rec/cvt/track/Track.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -224,7 +224,7 @@ public void update_Crosses(int trackId, double xb, double yb) {
224224
cross.setAssociatedTrackID(trackId);
225225
Point3D trackPos = null;
226226
Vector3D trackDir = null;
227-
if(this.getKFTrajectories()!=null && Math.abs(this.getHelix().B)>0.0001) {
227+
if(this.getKFTrajectories()!=null ) {
228228
int layer = cross.getCluster1().getLayer();
229229
int index = MLayer.getType(cross.getDetector(), layer).getIndex();
230230
HitOnTrack traj = this.getKFTrajectories().get(index);

0 commit comments

Comments
 (0)