Skip to content

Commit 6aa4a4c

Browse files
committed
added guard for tpcID
1 parent deb9088 commit 6aa4a4c

1 file changed

Lines changed: 7 additions & 5 deletions

File tree

sbncode/CAFMaker/CAFMaker_module.cc

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -2080,11 +2080,13 @@ void CAFMaker::produce(art::Event& evt) noexcept {
20802080

20812081
if (vertex != NULL) {
20822082
auto const& tpcID = geom->FindTPCAtPosition(vertex->position());
2083-
for (geo::PlaneID const& p : wireReadout.Iterate<geo::PlaneID>()) {
2084-
auto const& planeID = geo::PlaneID{tpcID, p.Plane};
2085-
const geo::PlaneGeo& planeGeo = wireReadout.Plane(planeID);
2086-
vtx_wire[p.Plane] = planeGeo.WireCoordinate(vertex->position()); ///< wire projection
2087-
vtx_tick[p.Plane] = dprop.ConvertXToTicks(vertex->position().X(), planeID); ///< drift projection
2083+
if (tpcID.isValid) {
2084+
for (geo::PlaneID const& p : wireReadout.Iterate<geo::PlaneID>()) {
2085+
auto const& planeID = geo::PlaneID{tpcID, p.Plane};
2086+
const geo::PlaneGeo& planeGeo = wireReadout.Plane(planeID);
2087+
vtx_wire[p.Plane] = planeGeo.WireCoordinate(vertex->position()); ///< wire projection
2088+
vtx_tick[p.Plane] = dprop.ConvertXToTicks(vertex->position().X(), planeID); ///< drift projection
2089+
}
20882090
}
20892091
}
20902092

0 commit comments

Comments
 (0)