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

Add a LinkNavigator utility #646

Open
wants to merge 61 commits into
base: master
Choose a base branch
from
Open

Add a LinkNavigator utility #646

wants to merge 61 commits into from

Conversation

tmadlener
Copy link
Collaborator

@tmadlener tmadlener commented Jul 24, 2024

BEGINRELEASENOTES

  • Add an LinkNavigator utility class that facilitates the lookup of associated objects

ENDRELEASENOTES

The main working principle is:

// From MC to reco particles
auto& mc2recoAssocs = event.get<MCRecoParticleAssociationCollection>("MCRecoTruthLink");
auto mc2reco = LinkNavigator{mc2recoAssocs};

auto& mcps = event.get<MCParticle>("MCParticles");
for (const auto p : mcps) {
  const auto recos = mc2reco.getAssociated(p);
}

recos in this case is a std::vector<WeightedObject<ReconstructedParticle>>, which effectively just couples an object and a relation weight together. The foreseen usage is something like this:

for (const auto p : mcps) {
  for (const auto& [reco, weight] : mc2reco.getAssociated(p)) {
    // do something with reco and the weight
  }
}

This makes it easy for the users but compile times explode for the
dictionaries as we are instantiating N**2 templates in static variables
in order for dictionary generation to pick them up properly.
Similar to root dictionary generation to make them available to the SIO
backend. Same caveats and concerns as with ROOT in this case.
@tmadlener tmadlener changed the title Add an AssociationNavigator utility Add a LinkNavigator utility Jul 31, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant