Skip to content

Commit

Permalink
fix: rm obsolete draw_surfaces which only supports Acts::PlanarBounds
Browse files Browse the repository at this point in the history
  • Loading branch information
wdconinc committed Jul 26, 2024
1 parent 71badeb commit 400d0cb
Show file tree
Hide file tree
Showing 2 changed files with 0 additions and 42 deletions.
36 changes: 0 additions & 36 deletions JugTrack/src/components/ActsGeoSvc.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -26,41 +26,6 @@ static const std::map<int, Acts::Logging::Level> s_msgMap = {
{MSG::ALWAYS, Acts::Logging::MAX},
};

void draw_surfaces(std::shared_ptr<const Acts::TrackingGeometry> trk_geo, const Acts::GeometryContext geo_ctx, const std::string& fname)
{
using namespace Acts;
std::vector<const Surface*> surfaces;

trk_geo->visitSurfaces([&](const Acts::Surface* surface) {
// for now we just require a valid surface
if (surface == nullptr) {
std::cout << " Not a surface \n";
return;
}
surfaces.push_back(surface);
});
std::ofstream os;
os.open(fname);
os << std::fixed << std::setprecision(6);
size_t nVtx = 0;
for (const auto& srfx : surfaces) {
const auto* srf = dynamic_cast<const PlaneSurface*>(srfx);
const auto* bounds = dynamic_cast<const PlanarBounds*>(&srf->bounds());
for (const auto& vtxloc : bounds->vertices()) {
Vector3 vtx = srf->transform(geo_ctx) * Vector3(vtxloc.x(), vtxloc.y(), 0);
os << "v " << vtx.x() << " " << vtx.y() << " " << vtx.z() << "\n";
}
// connect them
os << "f";
for (size_t i = 1; i <= bounds->vertices().size(); ++i) {
os << " " << nVtx + i;
}
os << "\n";
nVtx += bounds->vertices().size();
}
os.close();
}

using namespace Gaudi;

namespace Jug::Reco {
Expand Down Expand Up @@ -139,7 +104,6 @@ StatusCode ActsGeoSvc::initialize() {
m_materialDeco);
// Visit surfaces
if (m_trackingGeo) {
draw_surfaces(m_trackingGeo, m_trackingGeoCtx, "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
Expand Down
6 changes: 0 additions & 6 deletions JugTrack/src/components/ActsGeoSvc.h
Original file line number Diff line number Diff line change
Expand Up @@ -39,12 +39,6 @@
#include "JugTrack/DD4hepBField.h"


/** Draw the surfaces and save to obj file.
* This is useful for debugging the ACTS geometry. The obj file can
* be loaded into various tools, such as FreeCAD, for inspection.
*/
void draw_surfaces(std::shared_ptr<const Acts::TrackingGeometry> trk_geo, const std::string& fname);

namespace Jug::Reco {

class ActsGeoSvc : public extends<Service, IActsGeoSvc> {
Expand Down

0 comments on commit 400d0cb

Please sign in to comment.