Skip to content

Commit

Permalink
Integrate svg tools into the validation suite. The ray and helix scans
Browse files Browse the repository at this point in the history
will dump the geometry, intersections and trajectory to an xy and
rz view.
  • Loading branch information
niermann999 committed Oct 29, 2023
1 parent 4bd5b98 commit abfa1c1
Show file tree
Hide file tree
Showing 19 changed files with 516 additions and 211 deletions.
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
/** Detray library, part of the ACTS project (R&D line)
*
* (c) 2023 CERN for the benefit of the ACTS project
*
* Mozilla Public License Version 2.0
*/

#pragma once

// Project include(s)
#include "detray/intersection/intersection.hpp"
#include "detray/plugins/svgtools/conversion/landmark.hpp"
#include "detray/plugins/svgtools/meta/proto/intersection_record.hpp"

// System include(s)
#include <vector>

namespace detray::svgtools::conversion {

/// @returns The proto intersection of a detray intersection.
template <typename point3_t, typename detector_t, typename intersection_t>
inline auto intersection(
const detector_t& detector, const dvector<intersection_t>& intersections,
const typename detector_t::vector3& dir = {},
const typename detector_t::geometry_context& gctx = {}) {
using p_intersection_t = svgtools::meta::proto::intersection<point3_t>;
p_intersection_t p_ir;

std::vector<typename p_intersection_t::landmark_type> landmarks;
for (const auto& intr : intersections) {
const detray::surface surface{detector, intr.sf_desc};
const auto position = surface.local_to_global(gctx, intr.local, dir);
const auto p_lm = svgtools::conversion::landmark<point3_t>(position);
landmarks.push_back(p_lm);
}

p_ir._landmarks = std::move(landmarks);
return p_ir;
}

} // namespace detray::svgtools::conversion

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -12,29 +12,16 @@
#include "detray/intersection/intersection.hpp"
#include "detray/plugins/svgtools/conversion/point.hpp"
#include "detray/plugins/svgtools/meta/proto/landmark.hpp"
#include "detray/plugins/svgtools/utils/intersection_utils.hpp"

namespace detray::svgtools::conversion {

/// @returns The proto landmark of a detray intersection.
template <typename point3_t, typename detector_t>
inline auto landmark(
const typename detector_t::geometry_context& context,
const detector_t& detector,
const detray::intersection2D<typename detector_t::surface_type,
typename detector_t::transform3>&
d_intersection) {
const auto position =
svgtools::utils::intersection_point(context, detector, d_intersection);
return svgtools::conversion::landmark<point3_t>(position);
}

/// @returns The proto landmark of a detray point.
template <typename point3_t, typename d_point3_t>
inline auto landmark(d_point3_t& position) {
using p_landmark_t = svgtools::meta::proto::landmark<point3_t>;
p_landmark_t p_lm;
p_lm._position = svgtools::conversion::point<point3_t>(position);

return p_lm;
}

Expand Down
Loading

0 comments on commit abfa1c1

Please sign in to comment.