Skip to content

Commit 79da243

Browse files
tongtongcaobaltzell
authored andcommitted
also add check for null for straight tracking
1 parent 1b4f94e commit 79da243

File tree

1 file changed

+8
-6
lines changed

1 file changed

+8
-6
lines changed

reconstruction/dc/src/main/java/org/jlab/rec/dc/track/TrackCandListFinder.java

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -926,11 +926,13 @@ private List<Track> findStraightTracks(CrossList crossList, DCGeant4Factory DcDe
926926
cand.set_Id(cands.size() + 1);
927927
cand.set_CovMat(kFZRef.finalStateVec.CM);
928928

929-
Point3D VTCS = cand.get(cand.size()-1).getCoordsInTiltedSector(cand.get_Vtx0().x(), cand.get_Vtx0().y(), cand.get_Vtx0().z());
930-
double deltaPathToVtx = kFZRef.getDeltaPathToVtx(cand.get(cand.size()-1).get_Sector(), VTCS.z());
929+
if (cand.get_Vtx0() != null) {
930+
Point3D VTCS = cand.get(cand.size()-1).getCoordsInTiltedSector(cand.get_Vtx0().x(), cand.get_Vtx0().y(), cand.get_Vtx0().z());
931+
double deltaPathToVtx = kFZRef.getDeltaPathToVtx(cand.get(cand.size()-1).get_Sector(), VTCS.z());
931932

932-
List<org.jlab.rec.dc.trajectory.StateVec> kfStateVecsAlongTrajectory = setKFStateVecsAlongTrajectory(kFZRef, deltaPathToVtx);
933-
cand.setStateVecs(kfStateVecsAlongTrajectory);
933+
List<org.jlab.rec.dc.trajectory.StateVec> kfStateVecsAlongTrajectory = setKFStateVecsAlongTrajectory(kFZRef, deltaPathToVtx);
934+
cand.setStateVecs(kfStateVecsAlongTrajectory);
935+
}
934936

935937
// add candidate to list of tracks
936938
cands.add(cand);
@@ -1104,14 +1106,14 @@ private List<Track> findCurvedTracks(CrossList crossList, DCGeant4Factory DcDete
11041106
fitStateVec.getZ(),
11051107
DcDetector, dcSwim);
11061108

1107-
Point3D vtx = cand.get_Vtx0();
1108-
if (vtx != null) {
1109+
if (cand.get_Vtx0() != null) {
11091110
Point3D VTCS = cand.get(cand.size()-1).getCoordsInTiltedSector(cand.get_Vtx0().x(), cand.get_Vtx0().y(), cand.get_Vtx0().z());
11101111
double deltaPathToVtx = kFZRef.getDeltaPathToVtx(cand.get(cand.size()-1).get_Sector(), VTCS.z());
11111112

11121113
List<org.jlab.rec.dc.trajectory.StateVec> kfStateVecsAlongTrajectory = setKFStateVecsAlongTrajectory(kFZRef, deltaPathToVtx);
11131114
cand.setStateVecs(kfStateVecsAlongTrajectory);
11141115
}
1116+
11151117
// add candidate to list of tracks
11161118
if (cand.fit_Successful = true) {
11171119
cands.add(cand);

0 commit comments

Comments
 (0)