acts-project / detray

Test library for detector surface intersection
Mozilla Public License 2.0
10 stars 18 forks source link

Implement Multitype Container #226

Closed niermann999 closed 1 year ago

niermann999 commented 2 years ago

In order to be able to reuse type unrolling for different parts of the geometry, i.e. masks, surface finders and material, we need a general unrollable 'multitype' container. It should follow the design of the current mask_store class and later replace it. The main issue is to make it available to device via vecmem, since the contained value_types might or might not come with their own implementation of get_data().

On that note, we should probably also consider to put the data_view creation behind a detail::get_data() now, or something like that?

beomki-yeo commented 2 years ago

While working on material_store, I started looking into this issue.

So do you want to find a generic container which can describe all sub containers?

transform_store = vector<transform3>
mask_store = tuple<vector<Ts>...>
material_store = tuple<array<Ts>...> // This is the plan...
surfaces_finder = tuple<array<Ts>...>
niermann999 commented 2 years ago

Not really. From what I understand, for the material it should be possible to simply re-use the mask store. For the grids in particular, I think I found an alternative solution, although that might not work for grid2. For grid2 I considered putting the view, data and buffer types directly into a tuple and keep the arrays for the different grid types in a struct.... However, that would mean that we basically loose the composition aspect of the grids, because even switching out the populator type makes a new grid type.

niermann999 commented 2 years ago

Maybe we want to write a grid_store which keeps both views and arrays in a tuple, but I am not sure I want to put much time into that right now

beomki-yeo commented 2 years ago

for the material it should be possible to simply re-use the mask store.

In ACTS, binned material contains Grid :/ Do we want to avoid it then? Edit: Um maybe not. Need to look into it carefully

beomki-yeo commented 2 years ago

Maybe we want to write a grid_store which keeps both views and arrays in a tuple, but I am not sure I want to put much time into that right now

Let me give it a try then

niermann999 commented 2 years ago

Let's ping @asalzburger on this