Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: Identifier can be customized for sensitive surfaces #1452

Merged
merged 11 commits into from
Aug 31, 2022

Conversation

paulgessinger
Copy link
Member

@paulgessinger paulgessinger commented Aug 19, 2022

This PR reduces the width of the sensitive part of the geometry identifier from 28bits to 20bits, to make room for an 8bit extra identifier part. The idea is that this can be used by experiments to label sensitive elements. The bit masks after the change look like:

static constexpr Value kVolumeMask    = 0xff00000000000000; // (2^8)-1 = 255 volumes
static constexpr Value kBoundaryMask  = 0x00ff000000000000; // (2^8)-1 = 255 boundaries
static constexpr Value kLayerMask     = 0x0000fff000000000; // (2^12)-1 = 4096 layers
static constexpr Value kApproachMask  = 0x0000000ff0000000; // (2^8)-1 = 255 approach surfaces
static constexpr Value kSensitiveMask = 0x000000000fffff00; // (2^20)-1 sensitive surfaces
static constexpr Value kExtraMask     = 0x00000000000000ff; // (2^8)-1 extra values

In addition, it adds a hook function to the geometry closure of signature

GeometryIdentifier(GeometryIdentifier orig, const Surface& surface);

to customize the geometry identifier. Technically, this hook can be used to also reset the volume and layer ids, but is primarily intended to set the extra components.

@paulgessinger paulgessinger added this to the next milestone Aug 19, 2022
@paulgessinger
Copy link
Member Author

/cc @andiwand @asalzburger

Copy link
Contributor

@andiwand andiwand left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I like it 👍

Core/include/Acts/Geometry/GeometryIdentifier.hpp Outdated Show resolved Hide resolved
Core/include/Acts/Geometry/GeometryIdentifier.hpp Outdated Show resolved Hide resolved
@asalzburger
Copy link
Contributor

So, if we had lets say 20 surfaces front size and 20 surfaces backside, would you do 0-20 and a side bit, but 0-40 and a side bit ?

@codecov
Copy link

codecov bot commented Aug 19, 2022

Codecov Report

Merging #1452 (396517f) into main (7135dc8) will increase coverage by 0.01%.
The diff coverage is 46.66%.

@@            Coverage Diff             @@
##             main    #1452      +/-   ##
==========================================
+ Coverage   48.59%   48.60%   +0.01%     
==========================================
  Files         380      380              
  Lines       20589    20595       +6     
  Branches     9431     9433       +2     
==========================================
+ Hits        10005    10010       +5     
  Misses       4097     4097              
- Partials     6487     6488       +1     
Impacted Files Coverage Δ
Core/include/Acts/Geometry/Layer.hpp 100.00% <ø> (ø)
Core/include/Acts/Geometry/TrackingGeometry.hpp 100.00% <ø> (ø)
.../include/Acts/Geometry/TrackingGeometryBuilder.hpp 100.00% <ø> (ø)
Core/include/Acts/Geometry/TrackingVolume.hpp 70.73% <ø> (ø)
Core/src/Geometry/TrackingVolume.cpp 44.87% <0.00%> (ø)
Core/src/Geometry/GeometryIdentifier.cpp 64.28% <33.33%> (+2.74%) ⬆️
Core/src/Geometry/Layer.cpp 57.77% <50.00%> (-0.12%) ⬇️
Core/src/Geometry/TrackingGeometry.cpp 47.36% <50.00%> (ø)
Core/src/Geometry/TrackingGeometryBuilder.cpp 65.00% <50.00%> (ø)
Core/include/Acts/Geometry/GeometryIdentifier.hpp 100.00% <100.00%> (ø)
... and 1 more

📣 We’re building smart automated test selection to slash your CI/CD build times. Learn more

@asalzburger asalzburger self-requested a review August 22, 2022 07:42
Copy link
Contributor

@asalzburger asalzburger left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good thing.

@paulgessinger
Copy link
Member Author

I addressed @andiwand's comments. Can one of you approve again?

@paulgessinger paulgessinger added automerge backport develop/v19.x Backport this PR to the v19.x series and removed automerge labels Aug 22, 2022
@paulgessinger
Copy link
Member Author

Hmm. I didn't see hash failures locally...

@paulgessinger
Copy link
Member Author

The fast-test right after FATRAS only already fails. I'll have to investigate. I'm taking this WIP again.

@paulgessinger paulgessinger added the 🚧 WIP Work-in-progress label Aug 22, 2022
paulgessinger and others added 3 commits August 31, 2022 14:50
Co-authored-by: Alexander J. Pfleger <70842573+AJPfleger@users.noreply.github.com>
@paulgessinger
Copy link
Member Author

paulgessinger commented Aug 31, 2022

Ok I think the hash changes come from the fact that we write the actual geometry id 64bit integer value to the outputs, which clearly changes if we reduce the bit width of the sensitive id.

Can you reapprove @andiwand?

@paulgessinger paulgessinger removed the 🚧 WIP Work-in-progress label Aug 31, 2022
@kodiakhq kodiakhq bot merged commit a5df559 into acts-project:main Aug 31, 2022
acts-project-service pushed a commit that referenced this pull request Aug 31, 2022
This PR reduces the width of the sensitive part of the geometry identifier from 28bits to 20bits, to make room for an 8bit *extra* identifier part. The idea is that this can be used by experiments to label sensitive elements. The bit masks after the change look like:

```cpp
static constexpr Value kVolumeMask    = 0xff00000000000000; // (2^8)-1 = 255 volumes
static constexpr Value kBoundaryMask  = 0x00ff000000000000; // (2^8)-1 = 255 boundaries
static constexpr Value kLayerMask     = 0x0000fff000000000; // (2^12)-1 = 4096 layers
static constexpr Value kApproachMask  = 0x0000000ff0000000; // (2^8)-1 = 255 approach surfaces
static constexpr Value kSensitiveMask = 0x000000000fffff00; // (2^20)-1 sensitive surfaces
static constexpr Value kExtraMask     = 0x00000000000000ff; // (2^8)-1 extra values
```

In addition, it adds a hook function to the geometry closure of signature

```cpp
GeometryIdentifier(GeometryIdentifier orig, const Surface& surface);
```

to customize the geometry identifier. Technically, this hook can be used to also reset the volume and layer ids, but is primarily intended to set the *extra* components.

(cherry picked from commit a5df559)
kodiakhq bot pushed a commit that referenced this pull request Aug 31, 2022
…1452 to develop/v19.x] (#1479)

Backport a5df559 from #1452.
---
This PR reduces the width of the sensitive part of the geometry identifier from 28bits to 20bits, to make room for an 8bit *extra* identifier part. The idea is that this can be used by experiments to label sensitive elements. The bit masks after the change look like:

```cpp
static constexpr Value kVolumeMask    = 0xff00000000000000; // (2^8)-1 = 255 volumes
static constexpr Value kBoundaryMask  = 0x00ff000000000000; // (2^8)-1 = 255 boundaries
static constexpr Value kLayerMask     = 0x0000fff000000000; // (2^12)-1 = 4096 layers
static constexpr Value kApproachMask  = 0x0000000ff0000000; // (2^8)-1 = 255 approach surfaces
static constexpr Value kSensitiveMask = 0x000000000fffff00; // (2^20)-1 sensitive surfaces
static constexpr Value kExtraMask     = 0x00000000000000ff; // (2^8)-1 extra values
```



In addition, it adds a hook function to the geometry closure of signature

```cpp
GeometryIdentifier(GeometryIdentifier orig, const Surface& surface);
```

to customize the geometry identifier. Technically, this hook can be used to also reset the volume and layer ids, but is primarily intended to set the *extra* components.
@paulgessinger paulgessinger modified the milestones: next, v20.1.0 Sep 2, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
backport develop/v19.x Backport this PR to the v19.x series
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants