diff --git a/reconstruction/dc/src/main/java/org/jlab/rec/dc/track/TrackCandListFinder.java b/reconstruction/dc/src/main/java/org/jlab/rec/dc/track/TrackCandListFinder.java index c3d248a1bf..a9e1cd866c 100644 --- a/reconstruction/dc/src/main/java/org/jlab/rec/dc/track/TrackCandListFinder.java +++ b/reconstruction/dc/src/main/java/org/jlab/rec/dc/track/TrackCandListFinder.java @@ -926,11 +926,13 @@ private List findStraightTracks(CrossList crossList, DCGeant4Factory DcDe cand.set_Id(cands.size() + 1); cand.set_CovMat(kFZRef.finalStateVec.CM); - Point3D VTCS = cand.get(cand.size()-1).getCoordsInTiltedSector(cand.get_Vtx0().x(), cand.get_Vtx0().y(), cand.get_Vtx0().z()); - double deltaPathToVtx = kFZRef.getDeltaPathToVtx(cand.get(cand.size()-1).get_Sector(), VTCS.z()); + if (cand.get_Vtx0() != null) { + Point3D VTCS = cand.get(cand.size()-1).getCoordsInTiltedSector(cand.get_Vtx0().x(), cand.get_Vtx0().y(), cand.get_Vtx0().z()); + double deltaPathToVtx = kFZRef.getDeltaPathToVtx(cand.get(cand.size()-1).get_Sector(), VTCS.z()); - List kfStateVecsAlongTrajectory = setKFStateVecsAlongTrajectory(kFZRef, deltaPathToVtx); - cand.setStateVecs(kfStateVecsAlongTrajectory); + List kfStateVecsAlongTrajectory = setKFStateVecsAlongTrajectory(kFZRef, deltaPathToVtx); + cand.setStateVecs(kfStateVecsAlongTrajectory); + } // add candidate to list of tracks cands.add(cand); @@ -1103,12 +1105,14 @@ private List findCurvedTracks(CrossList crossList, DCGeant4Factory DcDete trjFind, fitStateVec, fitStateVec.getZ(), DcDetector, dcSwim); + + if (cand.get_Vtx0() != null) { + Point3D VTCS = cand.get(cand.size()-1).getCoordsInTiltedSector(cand.get_Vtx0().x(), cand.get_Vtx0().y(), cand.get_Vtx0().z()); + double deltaPathToVtx = kFZRef.getDeltaPathToVtx(cand.get(cand.size()-1).get_Sector(), VTCS.z()); - Point3D VTCS = cand.get(cand.size()-1).getCoordsInTiltedSector(cand.get_Vtx0().x(), cand.get_Vtx0().y(), cand.get_Vtx0().z()); - double deltaPathToVtx = kFZRef.getDeltaPathToVtx(cand.get(cand.size()-1).get_Sector(), VTCS.z()); - - List kfStateVecsAlongTrajectory = setKFStateVecsAlongTrajectory(kFZRef, deltaPathToVtx); - cand.setStateVecs(kfStateVecsAlongTrajectory); + List kfStateVecsAlongTrajectory = setKFStateVecsAlongTrajectory(kFZRef, deltaPathToVtx); + cand.setStateVecs(kfStateVecsAlongTrajectory); + } // add candidate to list of tracks if (cand.fit_Successful = true) {