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

Make associations links and prepare them for a potential introduction of templated links #341

Merged
merged 13 commits into from
Jul 30, 2024
Merged
16 changes: 8 additions & 8 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -27,28 +27,28 @@ A generic event data model for future HEP collider experiments.
| [CalorimeterHit](https://github.com/key4hep/EDM4hep/blob/main/edm4hep.yaml#L388) | [ParticleID](https://github.com/key4hep/EDM4hep/blob/main/edm4hep.yaml#L400) | [Cluster](https://github.com/key4hep/EDM4hep/blob/main/edm4hep.yaml#L415) |
| [TrackerHit3D](https://github.com/key4hep/EDM4hep/blob/main/edm4hep.yaml#L447) | [TrackerHitPlane](https://github.com/key4hep/EDM4hep/blob/main/edm4hep.yaml#L473) | [RawTimeSeries](https://github.com/key4hep/EDM4hep/blob/main/edm4hep.yaml#L503) |
| [Track](https://github.com/key4hep/EDM4hep/blob/main/edm4hep.yaml#L517) | [Vertex](https://github.com/key4hep/EDM4hep/blob/main/edm4hep.yaml#L532) | [ReconstructedParticle](https://github.com/key4hep/EDM4hep/blob/main/edm4hep.yaml#L578) |
| [TimeSeries](https://github.com/key4hep/EDM4hep/blob/main/edm4hep.yaml#L680) | [RecDqdx](https://github.com/key4hep/EDM4hep/blob/main/edm4hep.yaml#L692) | |
| [TimeSeries](https://github.com/key4hep/EDM4hep/blob/main/edm4hep.yaml#L807) | [RecDqdx](https://github.com/key4hep/EDM4hep/blob/main/edm4hep.yaml#L819) | |

**Associations**
**Links**

| | | |
|-|-|-|
| [MCRecoParticleAssociation](https://github.com/key4hep/EDM4hep/blob/main/edm4hep.yaml#L616) | [MCRecoCaloAssociation](https://github.com/key4hep/EDM4hep/blob/main/edm4hep.yaml#L625) | [MCRecoTrackerAssociation](https://github.com/key4hep/EDM4hep/blob/main/edm4hep.yaml#L634) |
| [MCRecoCaloParticleAssociation](https://github.com/key4hep/EDM4hep/blob/main/edm4hep.yaml#L643) | [MCRecoClusterParticleAssociation](https://github.com/key4hep/EDM4hep/blob/main/edm4hep.yaml#L652) | [MCRecoTrackParticleAssociation](https://github.com/key4hep/EDM4hep/blob/main/edm4hep.yaml#L661) |
| [RecoParticleVertexAssociation](https://github.com/key4hep/EDM4hep/blob/main/edm4hep.yaml#L670) | | |
| [RecoMCParticleLink](https://github.com/key4hep/EDM4hep/blob/main/edm4hep.yaml#L616) | [CaloHitSimCaloHitLink](https://github.com/key4hep/EDM4hep/blob/main/edm4hep.yaml#L643) | [TrackerHitSimTrackerHitLink](https://github.com/key4hep/EDM4hep/blob/main/edm4hep.yaml#L671) |
| [CaloHitMCParticleLink](https://github.com/key4hep/EDM4hep/blob/main/edm4hep.yaml#L698) | [ClusterMCParticleLink](https://github.com/key4hep/EDM4hep/blob/main/edm4hep.yaml#L725) | [TrackMCParticleLink](https://github.com/key4hep/EDM4hep/blob/main/edm4hep.yaml#L752) |
| [VertexRecoParticleLink](https://github.com/key4hep/EDM4hep/blob/main/edm4hep.yaml#L779) | | |

**Generator related (meta-)data**

| | | |
|-|-|-|
| [GeneratorEventParameters](https://github.com/key4hep/EDM4hep/blob/main/edm4hep.yaml#L704) | | |
| [GeneratorPdfInfo](https://github.com/key4hep/EDM4hep/blob/main/edm4hep.yaml#L721) | | |
| [GeneratorEventParameters](https://github.com/key4hep/EDM4hep/blob/main/edm4hep.yaml#L831) | | |
| [GeneratorPdfInfo](https://github.com/key4hep/EDM4hep/blob/main/edm4hep.yaml#L848) | | |

**Interfaces**

| | | |
|-|-|-|
| [TrackerHit](https://github.com/key4hep/EDM4hep/blob/main/edm4hep.yaml#L732) | | |
| [TrackerHit](https://github.com/key4hep/EDM4hep/blob/main/edm4hep.yaml#L859) | | |

The tests and examples in the `tests` directory show how to read, write, and use these types in your code.

Expand Down
197 changes: 162 additions & 35 deletions edm4hep.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -613,68 +613,195 @@ datatypes:
void setCovMatrix(float value, edm4hep::FourMomCoords dimI, edm4hep::FourMomCoords dimJ) { getCovMatrix().setValue(value, dimI, dimJ); }\n
"

edm4hep::MCRecoParticleAssociation:
Description: "Association between a ReconstructedParticle and the corresponding MCParticle"
edm4hep::RecoMCParticleLink:
Description: "Link between a ReconstructedParticle and the corresponding MCParticle"
Author: "EDM4hep authors"
Members:
- float weight // weight of this association
- float weight // weight of this link
OneToOneRelations:
- edm4hep::ReconstructedParticle rec // reference to the reconstructed particle
- edm4hep::MCParticle sim // reference to the Monte-Carlo particle
- edm4hep::ReconstructedParticle from // reference to the reconstructed particle
- edm4hep::MCParticle to // reference to the Monte-Carlo particle
ExtraCode:
declaration: "
[[deprecated(\"use getFrom instead\")]] edm4hep::ReconstructedParticle getRec() const;\n
[[deprecated(\"use getTo instead\")]] edm4hep::MCParticle getSim() const;\n"
implementation: "
edm4hep::ReconstructedParticle {name}::getRec() const { return getFrom(); }\n
edm4hep::MCParticle {name}::getSim() const { return getTo(); }\n"
MutableExtraCode:
declaration: "
[[deprecated(\"use setFrom instead\")]]\n
void setRec(const edm4hep::ReconstructedParticle& rec);\n
[[deprecated(\"use setTo instead\")]]\n
void setSim(const edm4hep::MCParticle& sim);\n
"
implementation: "
void {name}::setSim(const edm4hep::MCParticle& sim) { setTo(sim); }\n
void {name}::setRec(const edm4hep::ReconstructedParticle& rec) { setFrom(rec); }\n
"

edm4hep::MCRecoCaloAssociation:
Description: "Association between a CalorimeterHit and the corresponding SimCalorimeterHit"
edm4hep::CaloHitSimCaloHitLink:
Description: "Link between a CalorimeterHit and the corresponding SimCalorimeterHit"
Author: "EDM4hep authors"
Members:
- float weight // weight of this association
- float weight // weight of this link
OneToOneRelations:
- edm4hep::CalorimeterHit rec // reference to the reconstructed hit
- edm4hep::SimCalorimeterHit sim // reference to the simulated hit
- edm4hep::CalorimeterHit from // reference to the reconstructed hit
- edm4hep::SimCalorimeterHit to // reference to the simulated hit
ExtraCode:
declaration: "
[[deprecated(\"use getFrom instead\")]] edm4hep::CalorimeterHit getRec() const;\n
[[deprecated(\"use getTo instead\")]] edm4hep::SimCalorimeterHit getSim() const;\n"
implementation: "
edm4hep::CalorimeterHit {name}::getRec() const { return getFrom(); }\n
edm4hep::SimCalorimeterHit {name}::getSim() const { return getTo(); }\n"
MutableExtraCode:
declaration: "
[[deprecated(\"use setFrom instead\")]]\n
void setRec(const edm4hep::CalorimeterHit& rec);\n
[[deprecated(\"use setTo instead\")]]\n
void setSim(const edm4hep::SimCalorimeterHit& sim);\n
"
implementation: "
void {name}::setSim(const edm4hep::SimCalorimeterHit& sim) { setTo(sim); }\n
void {name}::setRec(const edm4hep::CalorimeterHit& rec) { setFrom(rec); }\n
"


edm4hep::MCRecoTrackerAssociation:
Description: "Association between a TrackerHit and the corresponding SimTrackerHit"
edm4hep::TrackerHitSimTrackerHitLink:
Description: "Link between a TrackerHit and the corresponding SimTrackerHit"
Author: "EDM4hep authors"
Members:
- float weight // weight of this association
- float weight // weight of this link
OneToOneRelations:
- edm4hep::TrackerHit rec // reference to the reconstructed hit
- edm4hep::SimTrackerHit sim // reference to the simulated hit
- edm4hep::TrackerHit from // reference to the reconstructed hit
- edm4hep::SimTrackerHit to // reference to the simulated hit
ExtraCode:
declaration: "
[[deprecated(\"use getFrom instead\")]] edm4hep::TrackerHit getRec() const;\n
[[deprecated(\"use getTo instead\")]] edm4hep::SimTrackerHit getSim() const;\n"
implementation: "
edm4hep::TrackerHit {name}::getRec() const { return getFrom(); }\n
edm4hep::SimTrackerHit {name}::getSim() const { return getTo(); }\n"
MutableExtraCode:
declaration: "
[[deprecated(\"use setFrom instead\")]]\n
void setRec(const edm4hep::TrackerHit& rec);\n
[[deprecated(\"use setTo instead\")]]\n
void setSim(const edm4hep::SimTrackerHit& sim);\n
"
implementation: "
void {name}::setSim(const edm4hep::SimTrackerHit& sim) { setTo(sim); }\n
void {name}::setRec(const edm4hep::TrackerHit& rec) { setFrom(rec); }\n
"

edm4hep::MCRecoCaloParticleAssociation:
Description: "Association between a CalorimeterHit and the corresponding MCParticle"
edm4hep::CaloHitMCParticleLink:
Description: "Link between a CalorimeterHit and the corresponding MCParticle"
Author: "EDM4hep authors"
Members:
- float weight // weight of this association
- float weight // weight of this link
OneToOneRelations:
- edm4hep::CalorimeterHit rec // reference to the reconstructed hit
- edm4hep::MCParticle sim // reference to the Monte-Carlo particle
- edm4hep::CalorimeterHit from // reference to the reconstructed hit
- edm4hep::MCParticle to // reference to the Monte-Carlo particle
ExtraCode:
declaration: "
[[deprecated(\"use getFrom instead\")]] edm4hep::CalorimeterHit getRec() const;\n
[[deprecated(\"use getTo instead\")]] edm4hep::MCParticle getSim() const;\n"
implementation: "
edm4hep::CalorimeterHit {name}::getRec() const { return getFrom(); }\n
edm4hep::MCParticle {name}::getSim() const { return getTo(); }\n"
MutableExtraCode:
declaration: "
[[deprecated(\"use setFrom instead\")]]\n
void setRec(const edm4hep::CalorimeterHit& rec);\n
[[deprecated(\"use setTo instead\")]]\n
void setSim(const edm4hep::MCParticle& sim);\n
"
implementation: "
void {name}::setSim(const edm4hep::MCParticle& sim) { setTo(sim); }\n
void {name}::setRec(const edm4hep::CalorimeterHit& rec) { setFrom(rec); }\n
"

edm4hep::MCRecoClusterParticleAssociation:
Description: "Association between a Cluster and the corresponding MCParticle"
edm4hep::ClusterMCParticleLink:
Description: "Link between a Cluster and the corresponding MCParticle"
Author: "EDM4hep authors"
Members:
- float weight // weight of this association
- float weight // weight of this link
OneToOneRelations:
- edm4hep::Cluster rec // reference to the cluster
- edm4hep::MCParticle sim // reference to the Monte-Carlo particle
- edm4hep::Cluster from // reference to the cluster
- edm4hep::MCParticle to // reference to the Monte-Carlo particle
ExtraCode:
declaration: "
[[deprecated(\"use getFrom instead\")]] edm4hep::Cluster getRec() const;\n
[[deprecated(\"use getTo instead\")]] edm4hep::MCParticle getSim() const;\n"
implementation: "
edm4hep::Cluster {name}::getRec() const { return getFrom(); }\n
edm4hep::MCParticle {name}::getSim() const { return getTo(); }\n"
MutableExtraCode:
declaration: "
[[deprecated(\"use setFrom instead\")]]\n
void setRec(const edm4hep::Cluster& rec);\n
[[deprecated(\"use setTo instead\")]]\n
void setSim(const edm4hep::MCParticle& sim);\n
"
implementation: "
void {name}::setSim(const edm4hep::MCParticle& sim) { setTo(sim); }\n
void {name}::setRec(const edm4hep::Cluster& rec) { setFrom(rec); }\n
"

edm4hep::MCRecoTrackParticleAssociation:
Description: "Association between a Track and the corresponding MCParticle"
edm4hep::TrackMCParticleLink:
Description: "Link between a Track and the corresponding MCParticle"
Author: "EDM4hep authors"
Members:
- float weight // weight of this association
- float weight // weight of this link
OneToOneRelations:
- edm4hep::Track rec // reference to the track
- edm4hep::MCParticle sim // reference to the Monte-Carlo particle
- edm4hep::Track from // reference to the track
- edm4hep::MCParticle to // reference to the Monte-Carlo particle
ExtraCode:
declaration: "
[[deprecated(\"use getFrom instead\")]] edm4hep::Track getRec() const;\n
[[deprecated(\"use getTo instead\")]] edm4hep::MCParticle getSim() const;\n"
implementation: "
edm4hep::Track {name}::getRec() const { return getFrom(); }\n
edm4hep::MCParticle {name}::getSim() const { return getTo(); }\n"
MutableExtraCode:
declaration: "
[[deprecated(\"use setFrom instead\")]]\n
void setRec(const edm4hep::Track& rec);\n
[[deprecated(\"use setTo instead\")]]\n
void setSim(const edm4hep::MCParticle& sim);\n
"
implementation: "
void {name}::setSim(const edm4hep::MCParticle& sim) { setTo(sim); }\n
void {name}::setRec(const edm4hep::Track& rec) { setFrom(rec); }\n
"

edm4hep::RecoParticleVertexAssociation:
Description: "Association between a ReconstructedParticle and a Vertex"
edm4hep::VertexRecoParticleLink:
Description: "Link between a Vertex and a ReconstructedParticle"
Author: "EDM4hep authors"
Members:
- float weight // weight of this association
- float weight // weight of this link
OneToOneRelations:
- edm4hep::ReconstructedParticle rec // reference to the reconstructed particle
- edm4hep::Vertex vertex // reference to the vertex
- edm4hep::ReconstructedParticle to // reference to the reconstructed particle
- edm4hep::Vertex from // reference to the vertex
ExtraCode:
declaration: "
[[deprecated(\"use getTo instead\")]] edm4hep::ReconstructedParticle getRec() const;\n
[[deprecated(\"use getFrom instead\")]] edm4hep::Vertex getVertex() const;\n"
implementation: "
edm4hep::ReconstructedParticle {name}::getRec() const { return getTo(); }\n
edm4hep::Vertex {name}::getVertex() const { return getFrom(); }\n"
MutableExtraCode:
declaration: "
[[deprecated(\"use setFrom instead\")]]\n
void setVertex(const edm4hep::Vertex& rec);\n
[[deprecated(\"use setTo instead\")]]\n
void setRec(const edm4hep::ReconstructedParticle& sim);\n
"
implementation: "
void {name}::setVertex(const edm4hep::Vertex& vertex) { setFrom(vertex); }\n
void {name}::setRec(const edm4hep::ReconstructedParticle& rec) { setTo(rec); }\n
"

#---------- TimeSeries
edm4hep::TimeSeries:
Expand Down
10 changes: 10 additions & 0 deletions include/edm4hep/MCRecoCaloAssociation.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
#ifndef EDM4HEP_MCRecoCaloAssociation_H
#define EDM4HEP_MCRecoCaloAssociation_H

#include "edm4hep/CaloHitSimCaloHitLink.h"

namespace edm4hep {
using MCRecoCaloAssociation [[deprecated("use CaloHitSimCaloHitLink instead")]] = edm4hep::CaloHitSimCaloHitLink;
}

#endif
11 changes: 11 additions & 0 deletions include/edm4hep/MCRecoCaloAssociationCollection.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
#ifndef EDM4HEP_MCRecoCaloAssociationCollection_H
#define EDM4HEP_MCRecoCaloAssociationCollection_H

#include "edm4hep/CaloHitSimCaloHitLinkCollection.h"

namespace edm4hep {
using MCRecoCaloAssociationCollection [[deprecated("use CaloHitSimCaloHitLinkCollection instead")]] =
edm4hep::CaloHitSimCaloHitLinkCollection;
}

#endif
11 changes: 11 additions & 0 deletions include/edm4hep/MCRecoCaloParticleAssociation.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
#ifndef EDM4HEP_MCRecoCaloParticleAssociation_H
#define EDM4HEP_MCRecoCaloParticleAssociation_H

#include "edm4hep/CaloHitMCParticleLink.h"

namespace edm4hep {
using MCRecoCaloParticleAssociation [[deprecated("use CaloHitMCParticleLink instead")]] =
edm4hep::CaloHitMCParticleLink;
}

#endif
11 changes: 11 additions & 0 deletions include/edm4hep/MCRecoCaloParticleAssociationCollection.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
#ifndef EDM4HEP_MCRecoCaloParticleAssociationCollection_H
#define EDM4HEP_MCRecoCaloParticleAssociationCollection_H

#include "edm4hep/CaloHitMCParticleLinkCollection.h"

namespace edm4hep {
using MCRecoCaloParticleAssociationCollection [[deprecated("use CaloHitMCParticleLinkCollection instead")]] =
edm4hep::CaloHitMCParticleLinkCollection;
}

#endif
11 changes: 11 additions & 0 deletions include/edm4hep/MCRecoClusterParticleAssociation.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
#ifndef EDM4HEP_MCRecoClusterParticleAssociation_H
#define EDM4HEP_MCRecoClusterParticleAssociation_H

#include "edm4hep/ClusterMCParticleLink.h"

namespace edm4hep {
using MCRecoClusterParticleAssociation [[deprecated("use ClusterMCParticleLink instead")]] =
edm4hep::ClusterMCParticleLink;
}

#endif
11 changes: 11 additions & 0 deletions include/edm4hep/MCRecoClusterParticleAssociationCollection.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
#ifndef EDM4HEP_MCRecoClusterParticleAssociationCollection_H
#define EDM4HEP_MCRecoClusterParticleAssociationCollection_H

#include "edm4hep/ClusterMCParticleLinkCollection.h"

namespace edm4hep {
using MCRecoClusterParticleAssociationCollection [[deprecated("use ClusterMCParticleLinkCollection instead")]] =
edm4hep::ClusterMCParticleLinkCollection;
}

#endif
10 changes: 10 additions & 0 deletions include/edm4hep/MCRecoParticleAssociation.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
#ifndef EDM4HEP_MCRecoParticleAssociation_H
#define EDM4HEP_MCRecoParticleAssociation_H

#include "edm4hep/RecoMCParticleLink.h"

namespace edm4hep {
using MCRecoParticleAssociation [[deprecated("use RecoMCParticleLink instead")]] = edm4hep::RecoMCParticleLink;
}

#endif
11 changes: 11 additions & 0 deletions include/edm4hep/MCRecoParticleAssociationCollection.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
#ifndef EDM4HEP_MCRecoParticleAssociationCollection_H
#define EDM4HEP_MCRecoParticleAssociationCollection_H

#include "edm4hep/RecoMCParticleLinkCollection.h"

namespace edm4hep {
using MCRecoParticleAssociationCollection [[deprecated("use RecoMCParticleLinkCollection instead")]] =
edm4hep::RecoMCParticleLinkCollection;
}

#endif
10 changes: 10 additions & 0 deletions include/edm4hep/MCRecoTrackParticleAssociation.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
#ifndef EDM4HEP_MCRecoTrackParticleAssociation_H
#define EDM4HEP_MCRecoTrackParticleAssociation_H

#include "edm4hep/TrackMCParticleLink.h"

namespace edm4hep {
using MCRecoTrackParticleAssociation [[deprecated("use TrackMCParticleLink instead")]] = edm4hep::TrackMCParticleLink;
}

#endif
11 changes: 11 additions & 0 deletions include/edm4hep/MCRecoTrackParticleAssociationCollection.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
#ifndef EDM4HEP_MCRecoTrackParticleAssociationCollection_H
#define EDM4HEP_MCRecoTrackParticleAssociationCollection_H

#include "edm4hep/TrackMCParticleLinkCollection.h"

namespace edm4hep {
using MCRecoTrackParticleAssociationCollection [[deprecated("use TrackMCParticleLinkCollection instead")]] =
edm4hep::TrackMCParticleLinkCollection;
}

#endif
11 changes: 11 additions & 0 deletions include/edm4hep/MCRecoTrackerAssociation.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
#ifndef EDM4HEP_MCRecoTrackerAssociation_H
#define EDM4HEP_MCRecoTrackerAssociation_H

#include "edm4hep/TrackerHitSimTrackerHitLink.h"

namespace edm4hep {
using MCRecoTrackerAssociation [[deprecated("use TrackerHitSimTrackerHitLink instead")]] =
edm4hep::TrackerHitSimTrackerHitLink;
}

#endif
Loading
Loading