Skip to content

Commit 1b4f94e

Browse files
committed
check for null
1 parent 8b232c1 commit 1b4f94e

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
@@ -1103,13 +1103,15 @@ private List<Track> findCurvedTracks(CrossList crossList, DCGeant4Factory DcDete
11031103
trjFind, fitStateVec,
11041104
fitStateVec.getZ(),
11051105
DcDetector, dcSwim);
1106+
1107+
Point3D vtx = cand.get_Vtx0();
1108+
if (vtx != null) {
1109+
Point3D VTCS = cand.get(cand.size()-1).getCoordsInTiltedSector(cand.get_Vtx0().x(), cand.get_Vtx0().y(), cand.get_Vtx0().z());
1110+
double deltaPathToVtx = kFZRef.getDeltaPathToVtx(cand.get(cand.size()-1).get_Sector(), VTCS.z());
11061111

1107-
Point3D VTCS = cand.get(cand.size()-1).getCoordsInTiltedSector(cand.get_Vtx0().x(), cand.get_Vtx0().y(), cand.get_Vtx0().z());
1108-
double deltaPathToVtx = kFZRef.getDeltaPathToVtx(cand.get(cand.size()-1).get_Sector(), VTCS.z());
1109-
1110-
List<org.jlab.rec.dc.trajectory.StateVec> kfStateVecsAlongTrajectory = setKFStateVecsAlongTrajectory(kFZRef, deltaPathToVtx);
1111-
cand.setStateVecs(kfStateVecsAlongTrajectory);
1112-
1112+
List<org.jlab.rec.dc.trajectory.StateVec> kfStateVecsAlongTrajectory = setKFStateVecsAlongTrajectory(kFZRef, deltaPathToVtx);
1113+
cand.setStateVecs(kfStateVecsAlongTrajectory);
1114+
}
11131115
// add candidate to list of tracks
11141116
if (cand.fit_Successful = true) {
11151117
cands.add(cand);

0 commit comments

Comments
 (0)