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: Add method to return measurement indices #2028

Merged
merged 2 commits into from
Apr 19, 2023

Conversation

gagnonlg
Copy link
Contributor

@gagnonlg gagnonlg commented Apr 12, 2023

Add a method to return the measurement indices. This is useful to implement measurement calibration because to do this you basically need to 1) expand measurement parameters 2) calibrate 3) project back to the original subspace and 4) create a new measurement object. But, to create that object, we need to have the same ordering of the indices and it's cumbersome to obtain it without such a method. For instance, this is the best I could do:

	    std::array<Acts::BoundIndices, kSize> indices;
	    for (size_t i = 0; i < kSize; i++) {
		Eigen::Index _, c;
		double v = P.row(i).maxCoeff(&_, &c); // P is meas.projector()
		assert(v > 0 && "invalid indices");
		indices[i] = static_cast<Acts::BoundIndices>(c);
	    }

However, this probably needs a bit of discussion. For instance, currently the method will cast the subspace indices from uint8_t to the measurement indice type, and when the measurement is created they will just be cast back to uint8_t which seems wastefull. Not sure it's an issue but if we want to avoid this we could return the subspace itself and add a new constructor for Measurement. But that's more intrusive.

Thoughts, @asalzburger @paulgessinger ?

@gagnonlg gagnonlg added Component - Core Affects the Core module Improvement Changes to an existing feature Feature Development to integrate a new feature Needs Discussion labels Apr 12, 2023
@gagnonlg gagnonlg added this to the next milestone Apr 12, 2023
@codecov
Copy link

codecov bot commented Apr 12, 2023

Codecov Report

Merging #2028 (96ca027) into main (00e64ea) will not change coverage.
The diff coverage is n/a.

@@           Coverage Diff           @@
##             main    #2028   +/-   ##
=======================================
  Coverage   49.87%   49.87%           
=======================================
  Files         421      421           
  Lines       23898    23898           
  Branches    10843    10843           
=======================================
  Hits        11920    11920           
  Misses       4357     4357           
  Partials     7621     7621           
Impacted Files Coverage Δ
Core/include/Acts/EventData/Measurement.hpp 80.00% <ø> (ø)

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

@github-actions
Copy link

github-actions bot commented Apr 12, 2023

📊 Physics performance monitoring for 96ca027

Full report
Seeding: seeded, truth estimated, orthogonal
CKF: seeded, truth smeared, truth estimated, orthogonal
IVF: seeded, truth smeared, truth estimated, orthogonal
Ambiguity resolution: seeded, orthogonal
Truth tracking
Truth tracking (GSF)

Vertexing

Vertexing vs. mu
IVF seeded

IVF truth_smeared

IVF truth_estimated

IVF orthogonal

Seeding

Seeding seeded

Seeding truth_estimated

Seeding orthogonal

CKF

CKF seeded

CKF truth_smeared

CKF truth_estimated

CKF orthogonal

Ambiguity resolution

seeded

Truth tracking (Kalman Filter)

Truth tracking

Truth tracking (GSF)

Truth tracking

@kodiakhq kodiakhq bot merged commit 5868791 into acts-project:main Apr 19, 2023
36 checks passed
@paulgessinger paulgessinger modified the milestones: next, v25.0.0 Apr 21, 2023
paulgessinger pushed a commit to paulgessinger/acts that referenced this pull request Apr 25, 2023
Add a method to return the measurement indices. This is useful to implement measurement calibration because to do this you basically need to 1) expand measurement parameters 2) calibrate 3) project back to the original subspace and 4) create a new measurement object. But, to create that object, we need to have the same ordering of the indices and it's cumbersome to obtain it without such a method. For instance, this is the best I could do:

```
	    std::array<Acts::BoundIndices, kSize> indices;
	    for (size_t i = 0; i < kSize; i++) {
		Eigen::Index _, c;
		double v = P.row(i).maxCoeff(&_, &c); // P is meas.projector()
		assert(v > 0 && "invalid indices");
		indices[i] = static_cast<Acts::BoundIndices>(c);
	    }
```

However, this probably needs a bit of discussion. For instance, currently the method will cast the subspace indices from uint8_t to the measurement indice type, and when the measurement is created they will just be cast back to uint8_t which seems wastefull. Not sure it's an issue but if we want to avoid this we could return the subspace itself and add a new constructor for Measurement. But that's more intrusive.

Thoughts, @asalzburger @paulgessinger ?
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Component - Core Affects the Core module Feature Development to integrate a new feature Improvement Changes to an existing feature
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants