Skip to content

Commit 533964f

Browse files
authored
check for null (#1046)
1 parent 8b232c1 commit 533964f

File tree

1 file changed

+13
-9
lines changed

1 file changed

+13
-9
lines changed

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

Lines changed: 13 additions & 9 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);
@@ -1103,12 +1105,14 @@ private List<Track> findCurvedTracks(CrossList crossList, DCGeant4Factory DcDete
11031105
trjFind, fitStateVec,
11041106
fitStateVec.getZ(),
11051107
DcDetector, dcSwim);
1108+
1109+
if (cand.get_Vtx0() != null) {
1110+
Point3D VTCS = cand.get(cand.size()-1).getCoordsInTiltedSector(cand.get_Vtx0().x(), cand.get_Vtx0().y(), cand.get_Vtx0().z());
1111+
double deltaPathToVtx = kFZRef.getDeltaPathToVtx(cand.get(cand.size()-1).get_Sector(), VTCS.z());
11061112

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);
1113+
List<org.jlab.rec.dc.trajectory.StateVec> kfStateVecsAlongTrajectory = setKFStateVecsAlongTrajectory(kFZRef, deltaPathToVtx);
1114+
cand.setStateVecs(kfStateVecsAlongTrajectory);
1115+
}
11121116

11131117
// add candidate to list of tracks
11141118
if (cand.fit_Successful = true) {

0 commit comments

Comments
 (0)