Commit 1f404145 authored by Chao Peng's avatar Chao Peng
Browse files

fix an issue with non-existing tracking geometry

parent 8aebe6a3
......@@ -128,22 +128,22 @@ StatusCode GeoSvc::initialize() {
Acts::equidistant, Acts::equidistant));
if (m_trackingGeo) {
draw_surfaces(m_trackingGeo, "tracking_geometry.obj");
}
debug() << "visiting all the surfaces " << endmsg;
m_trackingGeo->visitSurfaces([this](const Acts::Surface* surface) {
// for now we just require a valid surface
if (not surface) {
return;
}
auto det_element =
dynamic_cast<const Acts::DD4hepDetectorElement*>(surface->associatedDetectorElement());
if (!det_element) {
debug() << "invalid det_element!!! " << endmsg;
return;
}
this->m_surfaces.insert_or_assign(det_element->identifier(), surface);
});
debug() << "visiting all the surfaces " << endmsg;
m_trackingGeo->visitSurfaces([this](const Acts::Surface* surface) {
// for now we just require a valid surface
if (not surface) {
return;
}
auto det_element =
dynamic_cast<const Acts::DD4hepDetectorElement*>(surface->associatedDetectorElement());
if (!det_element) {
debug() << "invalid det_element!!! " << endmsg;
return;
}
this->m_surfaces.insert_or_assign(det_element->identifier(), surface);
});
}
return StatusCode::SUCCESS;
}
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment