18 namespace DetrayJsonHelper {
42 inline static std::tuple<unsigned int, std::vector<ActsScalar>>
maskFromBounds(
44 auto bType = sBounds.
type();
45 auto bValues = sBounds.
values();
47 unsigned int type = 13
u;
48 std::vector<double> boundaries = bValues;
50 if (portal and bType == SurfaceBounds::BoundsType::eCylinder) {
51 boundaries = {bValues[0
u], -bValues[1
u], bValues[1
u]};
55 case SurfaceBounds::BoundsType::eAnnulus: {
58 case SurfaceBounds::BoundsType::eRectangle: {
62 boundaries = {0.5 * (bValues[2] - bValues[0]),
63 0.5 * (bValues[3] - bValues[1])};
65 case SurfaceBounds::BoundsType::eCylinder: {
66 boundaries = {bValues[0
u], -bValues[1
u], bValues[1
u]};
69 case SurfaceBounds::BoundsType::eTrapezoid: {
71 boundaries = {bValues[0
u], bValues[1
u], bValues[2
u],
72 1 / (2 * bValues[2
u])};
74 case SurfaceBounds::BoundsType::eDisc: {
75 boundaries = {bValues[0
u], bValues[1
u]};
82 return std::tie(type, boundaries);
90 jSurface[
"volume_link"] = vLink;