-
Notifications
You must be signed in to change notification settings - Fork 168
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: Track parameters lookup estimation examples #3823
base: main
Are you sure you want to change the base?
Conversation
Important Review skippedAuto reviews are limited to specific labels. 🏷️ Labels to auto review (1)
Please check the settings in the CodeRabbit UI or the You can disable this status message by setting the Thank you for using CodeRabbit. We offer it for free to the OSS community and would appreciate your support in helping us grow. If you find it useful, would you consider giving us a shout-out on your favorite social media? 🪧 TipsChatThere are 3 ways to chat with CodeRabbit:
Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments. CodeRabbit Commands (Invoked using PR comments)
Other keywords and placeholders
CodeRabbit Configuration File (
|
Quality Gate failedFailed conditions See analysis details on SonarCloud Catch issues before they fail your Quality Gate with our IDE extension SonarLint |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is really could. A few thoughts:
- Could the logic be split up so that the accumulation code itself is reusable and in Core and the orchestration is in the examples?
- this is not tied to the gen2 geometry is it?
- Can this be generalized to bound parameters or do you need it to be curvilinear? In particular I imagine this could be useful in non-telescope setups, where you might want to use e.g. perigee parameters
|
||
/// @brief Lookup table for track parameters estimation | ||
/// in the track estimation algorithm | ||
using Lookup = std::unordered_map<Acts::GeometryIdentifier, LookupGrid>; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is a fairly generic name.
|
||
void ActsExamples::TrackParamsLookupAccumulator::addTrack( | ||
const Acts::CurvilinearTrackParameters& ipTrackParameters, | ||
const Acts::CurvilinearTrackParameters& refTrackParameters, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Do these need to be restricted to curvilinear? I guess they need to be consistent across all tracks being averaged, but they couldn't they be any type of bound parameters?
/// reference layer track parameters for a given position | ||
/// in the track estimation algorithm | ||
using LookupAccumGrid = | ||
Acts::Grid<std::vector<Acts::CurvilinearTrackParameters>, LookupAxis, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You could avoid storing all individual tracks by having one grid where you sum up all of the parameters and one where you count the number of tracks.
m_cfg(std::move(config)) { | ||
// Iterate over the reference layers and create | ||
// track parameter accumulators | ||
for (const auto& [geoId, refSurface] : m_cfg.refLayers) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Could you check the surface type in the constructor as well?
m_inputSimHits.initialize(m_cfg.inputHits); | ||
} | ||
|
||
ActsExamples::TrackParamsLookupEstimation::~TrackParamsLookupEstimation() { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can you do this in the finalize
method instead of the destructor?
/// Virtual destructor | ||
~JsonTrackParamsLookupWriter() override = default; | ||
|
||
/// Write out the material map |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
material map?
Acts::Vector4 fourPosition = Acts::Vector4::Zero(); | ||
Acts::Vector3 direction = Acts::Vector3::Zero(); | ||
Acts::ActsScalar qOverP = 0; | ||
for (const auto& track : tracks) { | ||
fourPosition += track.fourPosition(); | ||
direction += track.direction(); | ||
qOverP += track.qOverP(); | ||
} | ||
fourPosition /= tracks.size(); | ||
direction /= tracks.size(); | ||
qOverP /= tracks.size(); | ||
|
||
return Acts::CurvilinearTrackParameters( | ||
fourPosition, direction, qOverP, std::nullopt, | ||
tracks.front().particleHypothesis()); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I am always a bit skeptical about plain averaging track parameters
- direction will not be normalized anymore
- does it really mean something to average qOverP?
The PR adding the simulation based track parameter estimation.
The algorithm runs the
Fatras
simulation of the detector setup. A set of grids is imposed onto the user-defined reference layers of the tracking detector (e.g. first tracking layers sensitive surfaces).CurvilinearTrackParameters
at the vertex and the reference tracking layers are recorded for the simulated particles and stored into the bins of the grids.After the simulation is finished, the contents of the grids' bins are averaged and the grids containing the correspondence between the particles' intersection points at the reference layers, track parameters at the vertex and track parameters at the reference layers are constructed.
The constructed grids are stored into the json files. The grids are then readout and used for track parameters estimation in seeding algorithms, e.g. connected to the
PathSeeder
.This PR contains the lookup generation part of the algorithm. When the interfaces, realisation and the general idea are agreed upon, the second part with the validation of the estimated lookups is going to be put up.