acts-project / acts-project/acts

Gen3 geometry

未關閉
#3,502 2 則留言 2 個 reaction 已指派 0 人 在 GitHub 檢視
Stale
主要語言
C++
星號
131
分支
276
平均合併
3 天 13 小時
30 天內合併 PR
112

描述

Umbrella issue for the project to unify Gen1 (layer-based) and Gen2 (initial layer-less) geometry paradigms into a Gen3 (final) geometry.

See [this presentation](https://indico.cern.ch/event/1367908/contributions/5856261/attachments/2816681/4917402/2024-03-11_geometry-strategy_v1.pdf) for details.

## Associated PRs:

### Blueprint construction
- https://github.com/acts-project/acts/pull/3869

### Navigation policies
- https://github.com/acts-project/acts/pull/3760

### Portal shells
- https://github.com/acts-project/acts/pull/3820
- https://github.com/acts-project/acts/pull/3564

### Portals
- https://github.com/acts-project/acts/pull/3501

### Portal links
- #3531
- https://github.com/acts-project/acts/pull/3718

### Preparation
- https://github.com/acts-project/acts/pull/3819
- https://github.com/acts-project/acts/pull/3818
- https://github.com/acts-project/acts/pull/3717
- https://github.com/acts-project/acts/pull/3716
- https://github.com/acts-project/acts/pull/3715
- https://github.com/acts-project/acts/pull/3697
- https://github.com/acts-project/acts/pull/3696
- https://github.com/acts-project/acts/pull/3678
- https://github.com/acts-project/acts/pull/3675
- https://github.com/acts-project/acts/pull/3673
- https://github.com/acts-project/acts/pull/3544
- https://github.com/acts-project/acts/pull/3542
- https://github.com/acts-project/acts/pull/3500
- https://github.com/acts-project/acts/pull/3337
- https://github.com/acts-project/acts/pull/3334
- https://github.com/acts-project/acts/pull/3250
- https://github.com/acts-project/acts/pull/3257
- https://github.com/acts-project/acts/pull/3065
- https://github.com/acts-project/acts/pull/3288
- https://github.com/acts-project/acts/pull/3064
- https://github.com/acts-project/acts/pull/3060
- https://github.com/acts-project/acts/pull/3057
- https://github.com/acts-project/acts/pull/3032
- https://github.com/acts-project/acts/pull/3029
- https://github.com/acts-project/acts/pull/3030
- https://github.com/acts-project/acts/pull/3037
- https://github.com/acts-project/acts/pull/3053
- https://github.com/acts-project/acts/pull/3031
- https://github.com/acts-project/acts/pull/3026

## Initial strategy

```cpp

class Node {

virtual std::shared_ptr build();

virtual std::vector connect(
const std::shared_ptr& volume);

};
```

- Stack Volumes: `CylinderVolumeStack`, `CuboidVolumeStack`
- Associated `CylinderContainerNode` and `CuboidContainerNode`
- `Volume::assignVolumeBounds()` becomes `virtual`
- Overridden by stacks, used to resize child volumes
- Portal fusing + Portal stitching
- Special nodes called explicitly `CylinderLayer` etc?
- Could also just be functions on `Node` for building purposes

```cpp
class CylinderContainerNode : public Node {
...
};
```

Two passes:

1. Recursively call `build()` on all children
- Can build internal structure as configured
- Can attach navigation delegate as configured
- Returns a *representing volume* that can be a straight `TrackingVolume` or a *composite volume* like `CylinderVolumeStack`
- Resizing `CylinderVolumeStack` resizes it's components, can create gaps on the outside if configured
- Container nodes synchronize the representing volumes they receive, which propagates down the tree

2. Recursively call `connect()` with the current parent volume (starting from the root volume) as an argument
- Regular nodes:
- Register their `TrackingVolume` with the parent for ownership
- Create a vector of `Portal` indexed by the common enum
- Register the portals with their `TrackingVolume` for ownership and navigation
- Containers nodes:
- Call `connect()` on their children, but pass through their own parent `TrackingVolume`
- No *real* volume is created for containers
- They collect the portals, perform internal portal fusing + external portal stitching, then return the stitched portals
- No portals / volumes need to be resized at this point
- Portals are overwritten on child volumes using `PortalHandle`, internal registration remains valid, only outer registrations is delegated up the tree
- When children have completed `connect()`, child `TrackingVolume`s have been registered: can create volume-local acceleration structure for finding

3. Root node receives `Volume` from `build()` used as world volume + portal vector which are not connected *outside*, signaling navigation termination.

Benefits:

- No size synchronization from parent needed: parents size their children
- Containers in containers are supported, portal flattening during stitching should reduce depth

### Construction API:

```cpp
auto root = std::make_shared();

auto cyl = std::make_shared(
Acts::binZ,
CylinderVolumeStack::AttachmentStrategy::Midpoint
);

cyl->addChild(makeLayerNode());
cyl->addChild(makeLayerNode());

// Wraps cyl in a material decorator Node
cyl = addMaterial(std::move(cyl),
Acts::tubeOuterCover,
materialProperties());

root->addChild(std::move(cyl));

auto tg = root->construct();
```

Simplified:

```cpp
auto root = std::make_shared();
root->addCylinderContainer(Acts::binZ,
CylinderVolumeStack::AttachmentStrategy::Gap,
[](std::shared_ptr cyl) {
cyl->addChild(makeLayerNode());
cyl->addChild(makeLayerNode());
// Wraps cyl in a material decorator Node
return addMaterial(std::move(cyl),
Acts::tubeOuterCover,
materialProperties());
});
auto tg = root->construct();
```

And **maybe** in python like this (modulo `unique_ptr` not being usable)

```python
root = Node()

@root.addCylinderContainer(
direction=acts.binZ,
strategy=acts.CylinderVolumeStack.AttachmentStrategy.Gap
)
def cyl(cyl):
cyl.addChild(makeLayerNode())
cyl.addChild(makeLayerNode())
return addMaterial(cyl,
acts.tubeOuterCover,
materialProperties())

tg = root.construct()
```

貢獻指南

開啟貢獻指南

評估

這個 Issue 還沒有評估資料。

把新 issue 寄到你的電子郵件信箱

精選適合新手參與的 GitHub issue 摘要。