Skip to content

Commit

Permalink
feat: remove special treatment of cylindrical grids (acts-project#3154)
Browse files Browse the repository at this point in the history
This PR removes the special treatment of cylindrical grids for Detray json support, as there was a downstream change to detray.
  • Loading branch information
asalzburger committed May 21, 2024
1 parent f3f6927 commit 83da30d
Showing 1 changed file with 0 additions and 17 deletions.
17 changes: 0 additions & 17 deletions Plugins/Json/src/DetectorJsonConverter.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -149,23 +149,6 @@ nlohmann::json Acts::DetectorJsonConverter::toJsonDetray(
if (jSurfacesDelegate.is_null()) {
continue;
}
// Patch axes for cylindrical grid surfaces, axes are swapped
// at this point
auto jAccLink = jSurfacesDelegate["acc_link"];
std::size_t accLinkType = jAccLink["type"];
if (accLinkType == 4u) {
// Radial value to transfer phi to rphi
std::vector<ActsScalar> bValues = volume->volumeBounds().values();
ActsScalar rRef = 0.5 * (bValues[1] + bValues[0]);
// Get the axes
auto& jAxes = jSurfacesDelegate["axes"];
// r*phi axis is the first one
std::vector<ActsScalar> jAxesEdges = jAxes[0u]["edges"];
std::for_each(jAxesEdges.begin(), jAxesEdges.end(),
[rRef](ActsScalar& phi) { phi *= rRef; });
// Write back the patches axis edges
jSurfacesDelegate["axes"][0u]["edges"] = jAxesEdges;
}
// Colplete the grid json for detray usage
jSurfacesDelegate["volume_link"] = iv;
// jSurfacesDelegate["acc_link"] =
Expand Down

0 comments on commit 83da30d

Please sign in to comment.