-
Notifications
You must be signed in to change notification settings - Fork 36
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
Names of association types #344
Comments
Should we have associations that have explicit directions in both directions? E.g. have an (equivalent of) edm4hep::MCRecoParticleAssociation:
OneToOneRelations:
- MCParticle from
- ReconstructedParticle to
edm4hep::RecoMCParticleAssociation:
OneToOneRelations:
- ReconstructedParticle from
- MCParticle to |
Should the names of the associations contain the full typenames? E.g. edm4hep::ReconstructedParticleMCParticleAssociation:
# ... (see next comment for an alternative) |
Should we keep the current shortened type names, but make them a bit more consistent and clear? A proposal (add a comment if you have a different suggestion for any of them)
|
This comment was marked as outdated.
This comment was marked as outdated.
As mentioned this morning, I believe that |
I am not sure we need a template</* the association collection type probably*/>
struct AssociationNavigator {
template<typename T>
std::vector<U> get(const T& obj); // maybe getAssociated?
}; where // From MC to reco particles
auto& mc2recoAssocs = event.get<MCRecoParticleAssociationCollection>("MCRecoTruthLink");
auto mc2reco = AssociationNavigator{mc2recoAssocs};
// From reco to MC particles
auto& reco2mcAssocs = event.get<MCRecoParticleAssociationCollection>("RecoMCTruthLink");
auto reco2mc = AssociationNavigator(reco2mcAssocs);
// Usage: First get reco & mc particle collections
auto& mcps = event.get<MCParticleCollection>("MCParticles");
auto& recos = event.get<ReconstructedParticleCollection>("PandoraPFOs");
// retrieve reco particles for a given mc particle
auto relRecs = mc2reco.get<ReconstructedParticle>(mcps[0]);
// retrieve mc particles for a given reco particle
auto relMCs = reco2mc.get<MCParticle>(recos[0]); The main reason why |
From a users perspective I found the |
There is a prototype implementation of the // retrieve reco particles for a given mc particle
auto relRecs = mc2reco.getAssociated(mcps[0]);
for (const auto& [rp, w] : relRecs) {
auto momentum = rp.getMomentum();
// w is the weight of the association that linked the MC and reco particle
} |
Should we switch from |
I put edit: Going from |
To bring this discussion to an end and in order to move forward, I think we more or less all agree on the following decisions. Please react to this comment if you are NOT happy with these proposed names.
Hence, I propose the following new names and will implement them in #341 for inclusion in the pre-release tag
This is I think the minimal change that let's us move forward. Longer term we can still introduce directed links and switch to the templated ones from podio. |
This is a discussion issue for settling the naming of the association types in EDM4hep. The names should be valid even after templated associations (AIDASoft/podio#257) are available. To facilitate decision making, I will put dedicated questions into comments, which can then be voted on via either 👍 or 👎. Feel free to add more questions if necessary.
As a brief overview, currently we have the following association types. In the following I assume that we have adopted the naming convention for
from
andto
that is proposed in #341)MCRecoParticleAssociation
ReconstructedParticle
MCParticle
MCRecoCaloAssociation
CalorimeterHit
SimCalorimeterHit
MCRecoTrackerAssociation
TrackerHit
SimTrackerHit
MCRecoCaloParticleAssociation
CalorimeterHit
MCParticle
MCRecoClusterParticleAssociation
Cluster
MCParticle
MCRecoTrackParticleAssociation
Track
MCParticle
RecoParticleVertexAssociation
Vertex
ReconstructedParticle
#341 would give all of these an expilcit direction. Once we have AIDASoft/podio#257 available, this direction would become much more implicit because people can do something like
If we want to keep the explicit directions meaningful we would need to introduce associations for both directions. (Note that previously we didn't need to do this, because
from
andto
weresim
andrec
, so there was no explicit direction).Tagging a few people for enagagement: @gaede @jmcarcell @BrieucF @andresailer @Zehvogel @hegner
The text was updated successfully, but these errors were encountered: