|
ACTS
Experiment-independent tracking
|
Run a scan on detector object by shooting test particles through it. More...
Functions | |
| template<dindex invalid_value = dindex_invalid, typename entry_type = std::pair<dindex, dindex>> | |
| auto | build_adjacency (const std::vector< std::pair< entry_type, entry_type > > &portal_trace, const std::vector< entry_type > &module_trace, dvector< dindex > &adj_matrix, std::unordered_set< dindex > &obj_hashes) |
| Build an adjacency list from intersection traces. | |
| template<dindex invalid_value = dindex_invalid, typename entry_type = std::pair<dindex, dindex>> | |
| auto | build_adjacency (const std::vector< std::pair< entry_type, entry_type > > &portal_trace, const std::vector< entry_type > &module_trace, std::map< dindex, std::map< dindex, dindex > > &adj_list, std::unordered_set< dindex > &obj_hashes) |
| Build an adjacency list from intersection traces. | |
| template<dindex invalid_value = dindex_invalid, bool check_sorted_trace = true, typename entry_type = std::pair<dindex, dindex>> | |
| bool | check_connectivity (std::vector< std::pair< entry_type, entry_type > > trace, dindex start_volume=0u) |
| Check if a set of volume indices from portal intersections from a path (works even if the pairs are not sorted). | |
| template<concepts::detector detector_t> | |
| bool | check_trace (const dvector< intersection_record< detector_t > > &intersection_trace, const dindex start_index, dvector< dindex > &adj_mat_scan, std::unordered_set< dindex > &obj_hashes) |
| Run all checks on an intersection trace. | |
| template<concepts::detector detector_t, typename trajectory_t> | |
| void | display_error (const typename detector_t::geometry_context gctx, const detector_t &det, const typename detector_t::name_map &vol_names, const std::string &test_name, const trajectory_t &test_track, const dvector< intersection_record< detector_t > > &truth_trace, const detray::svgtools::styling::style &svg_style, const std::size_t i_track, const std::size_t n_tracks, const dvector< intersection_record< detector_t > > &recorded_trace={}, const dindex_range overlap_idx={detray::detail::invalid_value< dindex >(), detray::detail::invalid_value< dindex >()}, const bool verbose=true) |
| Print the failed intersection trace as svg (dumped to files). | |
| template<concepts::detector detector_t> | |
| dindex_range | overlaps_removal (dvector< intersection_record< detector_t > > &intersection_records, const float tol=1e-4f *unit< float >::mm) |
| Filter the intersection trace for overlapping surfaces and remove duplicates. | |
| std::string | print_adj (const dvector< dindex > &adjacency_matrix) |
| Print an adjacency list. | |
| template<concepts::detector detector_t> | |
| std::string | print_trace (const dvector< intersection_record< detector_t > > &truth_trace, std::size_t n) |
| Print an intersection trace. | |
| template<concepts::detector detector_t, typename allocator_t> | |
| auto | read (const std::string &intersection_file_name, const std::string &track_param_file_name, std::vector< std::vector< intersection_record< detector_t >, allocator_t > > &intersection_traces) |
| Read the intersection_record from file. | |
| template<template< typename > class scan_type, concepts::detector detector_t, typename trajectory_t, typename... Args> | |
| auto | run (const typename detector_t::geometry_context gctx, const detector_t &detector, const trajectory_t &traj, Args &&...args) |
| Run a scan on detector object by shooting test particles through it. | |
| template<concepts::detector detector_t> | |
| auto | trace_intersections (const dvector< intersection_record< detector_t > > &intersection_records, dindex start_volume=0u) |
| Check if a recording of portal/module intersections form a coherent trace through a geometry. | |
| template<concepts::detector detector_t, typename allocator_t> | |
| auto | write_intersections (const std::string &intersection_file_name, const std::vector< dvector< intersection_record< detector_t > >, allocator_t > &intersection_traces) |
| Write the intersection_traces to file. | |
| template<concepts::detector detector_t, typename allocator_t> | |
| auto | write_tracks (const std::string &track_param_file_name, const std::vector< dvector< intersection_record< detector_t > >, allocator_t > &intersection_traces) |
| Write the intersection_traces to file. | |
Run a scan on detector object by shooting test particles through it.
| auto detray::detector_scanner::build_adjacency | ( | const std::vector< std::pair< entry_type, entry_type > > & | portal_trace, |
| const std::vector< entry_type > & | module_trace, | ||
| dvector< dindex > & | adj_matrix, | ||
| std::unordered_set< dindex > & | obj_hashes ) |
Build an adjacency list from intersection traces.
| invalid_value | to keep the implementation simple, all indices are of type dindex here, but that does not need to be the case in the intersection code, so we need to know what the invalid value is interpreted as a dindex |
| entry_type | the record entry, which must contain the portal index and the volume index the portal was discovered in. |
| portal_trace | the portal indices and their volume links (in adjacent portal pairs) |
| module_trace | the module indices and their volume links |
| adj_matrix | adjacency matrix to populate |
| obj_hashes | record which modules/portals were already added |
| auto detray::detector_scanner::build_adjacency | ( | const std::vector< std::pair< entry_type, entry_type > > & | portal_trace, |
| const std::vector< entry_type > & | module_trace, | ||
| std::map< dindex, std::map< dindex, dindex > > & | adj_list, | ||
| std::unordered_set< dindex > & | obj_hashes ) |
Build an adjacency list from intersection traces.
| invalid_value | to keep the implementation simple, all indices are of type dindex here, but that does not need to be the case in the intersection code, so we need to know what the invalid value is interpreted as a dindex |
| entry_type | the record entry, which must contain the portal index and the volume index the portal was discovered in. |
| portal_trace | the portal indices and their volume links (in adjacent portal pairs) |
| module_trace | the module indices and their volume links |
| adj_list | adjacency list to populate |
| obj_hashes | record which modules/portals were already added |
| bool detray::detector_scanner::check_connectivity | ( | std::vector< std::pair< entry_type, entry_type > > | trace, |
| dindex | start_volume = 0u ) |
Check if a set of volume indices from portal intersections from a path (works even if the pairs are not sorted).
That the volume links of the portals at a single boundary crossing match was already checked by the trace_intersections function at this point.
For example, with (a, b) modeling a valid portal crossing between volume 'a' and 'b' (leaving out the portal indices that are also in those pairs), then: (0, 1)(1, 16)(16, 17) is valid, (0, 1)(1, 15)(16, 17) is not |__| |__| |_ |__| | x | |_
Also checks that the first portal that was found, lies in the start volume.
| invalid_value | to keep the implementation simple, all indices are of type dindex here, but that does not need to be the case in the intersection code, so we need to know what the invalid value is interpreted as a dindex |
| check_sorted_trace | if the trace is not sorted, perform a search for a fitting record across the trace. |
| entry_type | the record entry, which must contain the portal index and the volume index the portal was discovered in. |
| trace | the recorded portal crossings between volumes |
| start_volume | where the ray started |
| bool detray::detector_scanner::check_trace | ( | const dvector< intersection_record< detector_t > > & | intersection_trace, |
| const dindex | start_index, | ||
| dvector< dindex > & | adj_mat_scan, | ||
| std::unordered_set< dindex > & | obj_hashes ) |
Run all checks on an intersection trace.
| [in] | intersection_trace | the intersection records along the track |
| [in] | start_index | the index of the intended start volume |
| [out] | adj_mat_scan | adjacency matrix to be filled for the detector |
| [out] | obj_hashes | objects in a volume that were already visisted |
| void detray::detector_scanner::display_error | ( | const typename detector_t::geometry_context | gctx, |
| const detector_t & | det, | ||
| const typename detector_t::name_map & | vol_names, | ||
| const std::string & | test_name, | ||
| const trajectory_t & | test_track, | ||
| const dvector< intersection_record< detector_t > > & | truth_trace, | ||
| const detray::svgtools::styling::style & | svg_style, | ||
| const std::size_t | i_track, | ||
| const std::size_t | n_tracks, | ||
| const dvector< intersection_record< detector_t > > & | recorded_trace = {}, | ||
| const dindex_range | overlap_idx = {detray::detail::invalid_value<dindex>(), detray::detail::invalid_value<dindex>()}, | ||
| const bool | verbose = true ) |
Print the failed intersection trace as svg (dumped to files).
| gctx | current geometry context |
| det | the detector object |
| vol_names | the volume name map of the detector |
| test_name | the name of the test for which to print the error |
| test_track | trajectory that was used for the scan (ray or helix) |
| truth_trace | the intersection records along the test track |
| svg_style | svgtools style for the detector display |
| i_track | index of the test track |
| n_tracks | total number of test tracks |
| recorded_trace | recorded intersection trace, if available |
| overlap_idx | range of overlapping surfaces |
| verbose | whether to print failure details |
| dindex_range detray::detector_scanner::overlaps_removal | ( | dvector< intersection_record< detector_t > > & | intersection_records, |
| const float | tol = 1e-4f * unit<float>::mm ) |
Filter the intersection trace for overlapping surfaces and remove duplicates.
ACTS geometries can produce multiple overlapping portals, since some portals are larger than the volumes they belong to. This leads to duplicate intersections in the traces.
| [in,out] | intersection_records | Intersection trace to filter. |
| [in] | tol | Maximum path difference treated as an overlap. |
Print an adjacency list.
| adjacency_matrix | Adjacency matrix to print. |
| std::string detray::detector_scanner::print_trace | ( | const dvector< intersection_record< detector_t > > & | truth_trace, |
| std::size_t | n ) |
Print an intersection trace.
| truth_trace | Intersection trace to print. |
| n | Track number. |
| auto detray::detector_scanner::read | ( | const std::string & | intersection_file_name, |
| const std::string & | track_param_file_name, | ||
| std::vector< std::vector< intersection_record< detector_t >, allocator_t > > & | intersection_traces ) |
Read the intersection_record from file.
| intersection_file_name | Intersection input file name. |
| track_param_file_name | Track parameter input file name. |
| intersection_traces | Destination for the read traces. |
| auto detray::detector_scanner::run | ( | const typename detector_t::geometry_context | gctx, |
| const detector_t & | detector, | ||
| const trajectory_t & | traj, | ||
| Args &&... | args ) |
Run a scan on detector object by shooting test particles through it.
| gctx | Geometry context for the scan. |
| detector | Detector to scan. |
| traj | Trajectory to scan through the detector. |
| args | Additional arguments forwarded to the scan. |
| auto detray::detector_scanner::trace_intersections | ( | const dvector< intersection_record< detector_t > > & | intersection_records, |
| dindex | start_volume = 0u ) |
Check if a recording of portal/module intersections form a coherent trace through a geometry.
Various consistency checks are performed on the trace:
| detector_t | different detector types for different metadata |
| intersection_records | the recorded portal crossings between volumes |
| start_volume | where the ray started |
| auto detray::detector_scanner::write_intersections | ( | const std::string & | intersection_file_name, |
| const std::vector< dvector< intersection_record< detector_t > >, allocator_t > & | intersection_traces ) |
Write the intersection_traces to file.
| intersection_file_name | Output file name. |
| intersection_traces | Intersection traces to write. |
| auto detray::detector_scanner::write_tracks | ( | const std::string & | track_param_file_name, |
| const std::vector< dvector< intersection_record< detector_t > >, allocator_t > & | intersection_traces ) |
Write the intersection_traces to file.
| track_param_file_name | Output file name. |
| intersection_traces | Traces containing the track parameters. |