From b8721f607addb92acfa9414c4ca81cddd9d6f46d Mon Sep 17 00:00:00 2001 From: tmadlener Date: Wed, 17 Jul 2024 10:31:04 +0200 Subject: [PATCH 01/13] Rename association relations and add extra code for compatibility --- edm4hep.yaml | 140 +++++++++++++++++++++++++++++++++++++++++++++------ 1 file changed, 126 insertions(+), 14 deletions(-) diff --git a/edm4hep.yaml b/edm4hep.yaml index 34a358e39..004e978a9 100644 --- a/edm4hep.yaml +++ b/edm4hep.yaml @@ -619,8 +619,24 @@ datatypes: Members: - float weight // weight of this association 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: + includes: " + #include \n + #include \n" + declarationFile: "edm4hep/extra_code/AssociationGetters.ipp" + MutableExtraCode: + includes: " + #include \n + #include \n" + + declaration: " + [[deprecated(\"use setFrom instead\")]]\n + void setRec(edm4hep::ReconstructedParticle rec) {setFrom(rec);}\n + [[deprecated(\"use setSim instead\")]]\n + void setSim(edm4hep::MCParticle sim) {setTo(sim);}\n + " edm4hep::MCRecoCaloAssociation: Description: "Association between a CalorimeterHit and the corresponding SimCalorimeterHit" @@ -628,8 +644,24 @@ datatypes: Members: - float weight // weight of this association 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: + includes: " + #include \n + #include \n" + declarationFile: "edm4hep/extra_code/AssociationGetters.ipp" + MutableExtraCode: + includes: " + #include \n + #include \n" + declaration: " + [[deprecated(\"use setFrom instead\")]]\n + void setRec(edm4hep::CalorimeterHit rec) {setFrom(rec);}\n + [[deprecated(\"use setSim instead\")]]\n + void setSim(edm4hep::SimCalorimeterHit sim) {setTo(sim);}\n + " + edm4hep::MCRecoTrackerAssociation: Description: "Association between a TrackerHit and the corresponding SimTrackerHit" @@ -637,8 +669,23 @@ datatypes: Members: - float weight // weight of this association 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: + includes: " + #include \n + #include \n" + declarationFile: "edm4hep/extra_code/AssociationGetters.ipp" + MutableExtraCode: + includes: " + #include \n + #include \n" + declaration: " + [[deprecated(\"use setFrom instead\")]]\n + void setRec(edm4hep::TrackerHit rec) {setFrom(rec);}\n + [[deprecated(\"use setSim instead\")]]\n + void setSim(edm4hep::SimTrackerHit sim) {setTo(sim);}\n + " edm4hep::MCRecoCaloParticleAssociation: Description: "Association between a CalorimeterHit and the corresponding MCParticle" @@ -646,8 +693,23 @@ datatypes: Members: - float weight // weight of this association 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: + includes: " + #include \n + #include \n" + declarationFile: "edm4hep/extra_code/AssociationGetters.ipp" + MutableExtraCode: + includes: " + #include \n + #include \n" + declaration: " + [[deprecated(\"use setFrom instead\")]]\n + void setRec(edm4hep::CalorimeterHit rec) {setFrom(rec);}\n + [[deprecated(\"use setSim instead\")]]\n + void setSim(edm4hep::MCParticle sim) {setTo(sim);}\n + " edm4hep::MCRecoClusterParticleAssociation: Description: "Association between a Cluster and the corresponding MCParticle" @@ -655,8 +717,23 @@ datatypes: Members: - float weight // weight of this association 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: + includes: " + #include \n + #include \n" + declarationFile: "edm4hep/extra_code/AssociationGetters.ipp" + MutableExtraCode: + includes: " + #include \n + #include \n" + declaration: " + [[deprecated(\"use setFrom instead\")]]\n + void setRec(edm4hep::Cluster rec) {setFrom(rec);}\n + [[deprecated(\"use setSim instead\")]]\n + void setSim(edm4hep::MCParticle sim) {setTo(sim);}\n + " edm4hep::MCRecoTrackParticleAssociation: Description: "Association between a Track and the corresponding MCParticle" @@ -664,8 +741,23 @@ datatypes: Members: - float weight // weight of this association 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: + includes: " + #include \n + #include \n" + declarationFile: "edm4hep/extra_code/AssociationGetters.ipp" + MutableExtraCode: + includes: " + #include \n + #include \n" + declaration: " + [[deprecated(\"use setFrom instead\")]]\n + void setRec(edm4hep::Track rec) {setFrom(rec);}\n + [[deprecated(\"use setSim instead\")]]\n + void setSim(edm4hep::MCParticle sim) {setTo(sim);}\n + " edm4hep::RecoParticleVertexAssociation: Description: "Association between a ReconstructedParticle and a Vertex" @@ -673,8 +765,28 @@ datatypes: Members: - float weight // weight of this association 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: + includes: " + #include \n + #include \n" + declaration: " + [[deprecated(\"use getTo instead\")]]\n + auto getRec() const { return getTo(); }\n + [[deprecated(\"use getFrom instead\")]]\n + auto getVertex() const { return getFrom(); }\n + " + MutableExtraCode: + includes: " + #include \n + #include \n" + declaration: " + [[deprecated(\"use setFrom instead\")]]\n + void setRec(edm4hep::Vertex rec) {setFrom(rec);}\n + [[deprecated(\"use setSim instead\")]]\n + void setSim(edm4hep::ReconstructedParticle sim) {setTo(sim);}\n + " #---------- TimeSeries edm4hep::TimeSeries: From e93638206c9e3214a40f61c9d6d0e9e27e851ecd Mon Sep 17 00:00:00 2001 From: tmadlener Date: Wed, 17 Jul 2024 14:20:14 +0200 Subject: [PATCH 02/13] Proper names of getters and setters --- edm4hep.yaml | 46 ++++++++++++++++++++++++++-------------------- 1 file changed, 26 insertions(+), 20 deletions(-) diff --git a/edm4hep.yaml b/edm4hep.yaml index 004e978a9..7d792ec49 100644 --- a/edm4hep.yaml +++ b/edm4hep.yaml @@ -625,7 +625,8 @@ datatypes: includes: " #include \n #include \n" - declarationFile: "edm4hep/extra_code/AssociationGetters.ipp" + declarationFile: "edm4hep/extra_code/AssociationGetters.h.ipp" + implementationFile: "edm4hep/extra_code/AssociationGetters.cc.ipp" MutableExtraCode: includes: " #include \n @@ -633,9 +634,9 @@ datatypes: declaration: " [[deprecated(\"use setFrom instead\")]]\n - void setRec(edm4hep::ReconstructedParticle rec) {setFrom(rec);}\n + void setRec(const edm4hep::ReconstructedParticle& rec) {setFrom(rec);}\n [[deprecated(\"use setSim instead\")]]\n - void setSim(edm4hep::MCParticle sim) {setTo(sim);}\n + void setSim(const edm4hep::MCParticle& sim) {setTo(sim);}\n " edm4hep::MCRecoCaloAssociation: @@ -650,16 +651,17 @@ datatypes: includes: " #include \n #include \n" - declarationFile: "edm4hep/extra_code/AssociationGetters.ipp" + declarationFile: "edm4hep/extra_code/AssociationGetters.h.ipp" + implementationFile: "edm4hep/extra_code/AssociationGetters.cc.ipp" MutableExtraCode: includes: " #include \n #include \n" declaration: " [[deprecated(\"use setFrom instead\")]]\n - void setRec(edm4hep::CalorimeterHit rec) {setFrom(rec);}\n + void setRec(const edm4hep::CalorimeterHit& rec) {setFrom(rec);}\n [[deprecated(\"use setSim instead\")]]\n - void setSim(edm4hep::SimCalorimeterHit sim) {setTo(sim);}\n + void setSim(const edm4hep::SimCalorimeterHit& sim) {setTo(sim);}\n " @@ -675,16 +677,17 @@ datatypes: includes: " #include \n #include \n" - declarationFile: "edm4hep/extra_code/AssociationGetters.ipp" + declarationFile: "edm4hep/extra_code/AssociationGetters.h.ipp" + implementationFile: "edm4hep/extra_code/AssociationGetters.cc.ipp" MutableExtraCode: includes: " #include \n #include \n" declaration: " [[deprecated(\"use setFrom instead\")]]\n - void setRec(edm4hep::TrackerHit rec) {setFrom(rec);}\n + void setRec(const edm4hep::TrackerHit& rec) {setFrom(rec);}\n [[deprecated(\"use setSim instead\")]]\n - void setSim(edm4hep::SimTrackerHit sim) {setTo(sim);}\n + void setSim(const edm4hep::SimTrackerHit& sim) {setTo(sim);}\n " edm4hep::MCRecoCaloParticleAssociation: @@ -699,16 +702,17 @@ datatypes: includes: " #include \n #include \n" - declarationFile: "edm4hep/extra_code/AssociationGetters.ipp" + declarationFile: "edm4hep/extra_code/AssociationGetters.h.ipp" + implementationFile: "edm4hep/extra_code/AssociationGetters.cc.ipp" MutableExtraCode: includes: " #include \n #include \n" declaration: " [[deprecated(\"use setFrom instead\")]]\n - void setRec(edm4hep::CalorimeterHit rec) {setFrom(rec);}\n + void setRec(const edm4hep::CalorimeterHit& rec) {setFrom(rec);}\n [[deprecated(\"use setSim instead\")]]\n - void setSim(edm4hep::MCParticle sim) {setTo(sim);}\n + void setSim(const edm4hep::MCParticle& sim) {setTo(sim);}\n " edm4hep::MCRecoClusterParticleAssociation: @@ -723,16 +727,17 @@ datatypes: includes: " #include \n #include \n" - declarationFile: "edm4hep/extra_code/AssociationGetters.ipp" + declarationFile: "edm4hep/extra_code/AssociationGetters.h.ipp" + implementationFile: "edm4hep/extra_code/AssociationGetters.cc.ipp" MutableExtraCode: includes: " #include \n #include \n" declaration: " [[deprecated(\"use setFrom instead\")]]\n - void setRec(edm4hep::Cluster rec) {setFrom(rec);}\n + void inline setRec(const edm4hep::Cluster& rec) {setFrom(rec);}\n [[deprecated(\"use setSim instead\")]]\n - void setSim(edm4hep::MCParticle sim) {setTo(sim);}\n + void inline setSim(const edm4hep::MCParticle& sim) {setTo(sim);}\n " edm4hep::MCRecoTrackParticleAssociation: @@ -747,16 +752,17 @@ datatypes: includes: " #include \n #include \n" - declarationFile: "edm4hep/extra_code/AssociationGetters.ipp" + declarationFile: "edm4hep/extra_code/AssociationGetters.h.ipp" + implementationFile: "edm4hep/extra_code/AssociationGetters.cc.ipp" MutableExtraCode: includes: " #include \n #include \n" declaration: " [[deprecated(\"use setFrom instead\")]]\n - void setRec(edm4hep::Track rec) {setFrom(rec);}\n + void setRec(const edm4hep::Track& rec) {setFrom(rec);}\n [[deprecated(\"use setSim instead\")]]\n - void setSim(edm4hep::MCParticle sim) {setTo(sim);}\n + void setSim(const edm4hep::MCParticle& sim) {setTo(sim);}\n " edm4hep::RecoParticleVertexAssociation: @@ -783,9 +789,9 @@ datatypes: #include \n" declaration: " [[deprecated(\"use setFrom instead\")]]\n - void setRec(edm4hep::Vertex rec) {setFrom(rec);}\n + void setVertex(const edm4hep::Vertex& rec) {setFrom(rec);}\n [[deprecated(\"use setSim instead\")]]\n - void setSim(edm4hep::ReconstructedParticle sim) {setTo(sim);}\n + void setRec(const edm4hep::ReconstructedParticle& sim) {setTo(sim);}\n " #---------- TimeSeries From 3bec4fb1a10260713a8b9e8f8b8da50218d46198 Mon Sep 17 00:00:00 2001 From: tmadlener Date: Thu, 18 Jul 2024 10:51:37 +0200 Subject: [PATCH 03/13] Split declartaion and implementation to avoid inlining Inlining will omit creating symbols for these functions which leads to issues when dynamically loading a library that uses these methods --- edm4hep.yaml | 106 ++++++++----------- edm4hep/extra_code/AssociationGetters.cc.ipp | 7 ++ edm4hep/extra_code/AssociationGetters.h.ipp | 3 + 3 files changed, 57 insertions(+), 59 deletions(-) create mode 100644 edm4hep/extra_code/AssociationGetters.cc.ipp create mode 100644 edm4hep/extra_code/AssociationGetters.h.ipp diff --git a/edm4hep.yaml b/edm4hep.yaml index 7d792ec49..2b6ba096a 100644 --- a/edm4hep.yaml +++ b/edm4hep.yaml @@ -622,21 +622,18 @@ datatypes: - edm4hep::ReconstructedParticle from // reference to the reconstructed particle - edm4hep::MCParticle to // reference to the Monte-Carlo particle ExtraCode: - includes: " - #include \n - #include \n" declarationFile: "edm4hep/extra_code/AssociationGetters.h.ipp" implementationFile: "edm4hep/extra_code/AssociationGetters.cc.ipp" MutableExtraCode: - includes: " - #include \n - #include \n" - declaration: " [[deprecated(\"use setFrom instead\")]]\n - void setRec(const edm4hep::ReconstructedParticle& rec) {setFrom(rec);}\n + void setRec(const edm4hep::ReconstructedParticle& rec);\n [[deprecated(\"use setSim instead\")]]\n - void setSim(const edm4hep::MCParticle& sim) {setTo(sim);}\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: @@ -648,20 +645,18 @@ datatypes: - edm4hep::CalorimeterHit from // reference to the reconstructed hit - edm4hep::SimCalorimeterHit to // reference to the simulated hit ExtraCode: - includes: " - #include \n - #include \n" declarationFile: "edm4hep/extra_code/AssociationGetters.h.ipp" implementationFile: "edm4hep/extra_code/AssociationGetters.cc.ipp" MutableExtraCode: - includes: " - #include \n - #include \n" declaration: " [[deprecated(\"use setFrom instead\")]]\n - void setRec(const edm4hep::CalorimeterHit& rec) {setFrom(rec);}\n + void setRec(const edm4hep::CalorimeterHit& rec);\n [[deprecated(\"use setSim instead\")]]\n - void setSim(const edm4hep::SimCalorimeterHit& sim) {setTo(sim);}\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 " @@ -674,20 +669,18 @@ datatypes: - edm4hep::TrackerHit from // reference to the reconstructed hit - edm4hep::SimTrackerHit to // reference to the simulated hit ExtraCode: - includes: " - #include \n - #include \n" declarationFile: "edm4hep/extra_code/AssociationGetters.h.ipp" implementationFile: "edm4hep/extra_code/AssociationGetters.cc.ipp" MutableExtraCode: - includes: " - #include \n - #include \n" declaration: " [[deprecated(\"use setFrom instead\")]]\n - void setRec(const edm4hep::TrackerHit& rec) {setFrom(rec);}\n + void setRec(const edm4hep::TrackerHit& rec);\n [[deprecated(\"use setSim instead\")]]\n - void setSim(const edm4hep::SimTrackerHit& sim) {setTo(sim);}\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: @@ -699,20 +692,18 @@ datatypes: - edm4hep::CalorimeterHit from // reference to the reconstructed hit - edm4hep::MCParticle to // reference to the Monte-Carlo particle ExtraCode: - includes: " - #include \n - #include \n" declarationFile: "edm4hep/extra_code/AssociationGetters.h.ipp" implementationFile: "edm4hep/extra_code/AssociationGetters.cc.ipp" MutableExtraCode: - includes: " - #include \n - #include \n" declaration: " [[deprecated(\"use setFrom instead\")]]\n - void setRec(const edm4hep::CalorimeterHit& rec) {setFrom(rec);}\n + void setRec(const edm4hep::CalorimeterHit& rec);\n [[deprecated(\"use setSim instead\")]]\n - void setSim(const edm4hep::MCParticle& sim) {setTo(sim);}\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: @@ -724,20 +715,18 @@ datatypes: - edm4hep::Cluster from // reference to the cluster - edm4hep::MCParticle to // reference to the Monte-Carlo particle ExtraCode: - includes: " - #include \n - #include \n" declarationFile: "edm4hep/extra_code/AssociationGetters.h.ipp" implementationFile: "edm4hep/extra_code/AssociationGetters.cc.ipp" MutableExtraCode: - includes: " - #include \n - #include \n" declaration: " [[deprecated(\"use setFrom instead\")]]\n - void inline setRec(const edm4hep::Cluster& rec) {setFrom(rec);}\n + void inline setRec(const edm4hep::Cluster& rec);\n [[deprecated(\"use setSim instead\")]]\n - void inline setSim(const edm4hep::MCParticle& sim) {setTo(sim);}\n + void inline 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: @@ -749,20 +738,18 @@ datatypes: - edm4hep::Track from // reference to the track - edm4hep::MCParticle to // reference to the Monte-Carlo particle ExtraCode: - includes: " - #include \n - #include \n" declarationFile: "edm4hep/extra_code/AssociationGetters.h.ipp" implementationFile: "edm4hep/extra_code/AssociationGetters.cc.ipp" MutableExtraCode: - includes: " - #include \n - #include \n" declaration: " [[deprecated(\"use setFrom instead\")]]\n - void setRec(const edm4hep::Track& rec) {setFrom(rec);}\n + void setRec(const edm4hep::Track& rec);\n [[deprecated(\"use setSim instead\")]]\n - void setSim(const edm4hep::MCParticle& sim) {setTo(sim);}\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: @@ -774,24 +761,25 @@ datatypes: - edm4hep::ReconstructedParticle to // reference to the reconstructed particle - edm4hep::Vertex from // reference to the vertex ExtraCode: - includes: " - #include \n - #include \n" declaration: " [[deprecated(\"use getTo instead\")]]\n - auto getRec() const { return getTo(); }\n + auto getRec() const;\n [[deprecated(\"use getFrom instead\")]]\n - auto getVertex() const { return getFrom(); }\n + auto getVertex()const ;\n " + implementation: " + auto {name}::getRec() const { return getTo(); }\n + auto {name}::getVertex() const { return getFrom(); }\n" MutableExtraCode: - includes: " - #include \n - #include \n" declaration: " [[deprecated(\"use setFrom instead\")]]\n - void setVertex(const edm4hep::Vertex& rec) {setFrom(rec);}\n + void setVertex(const edm4hep::Vertex& rec);\n [[deprecated(\"use setSim instead\")]]\n - void setRec(const edm4hep::ReconstructedParticle& sim) {setTo(sim);}\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 diff --git a/edm4hep/extra_code/AssociationGetters.cc.ipp b/edm4hep/extra_code/AssociationGetters.cc.ipp new file mode 100644 index 000000000..7fee4f7f9 --- /dev/null +++ b/edm4hep/extra_code/AssociationGetters.cc.ipp @@ -0,0 +1,7 @@ +auto {name}::getRec() const { + return getFrom(); +} + +auto {name}::getSim() const { + return getTo(); +} diff --git a/edm4hep/extra_code/AssociationGetters.h.ipp b/edm4hep/extra_code/AssociationGetters.h.ipp new file mode 100644 index 000000000..73b061730 --- /dev/null +++ b/edm4hep/extra_code/AssociationGetters.h.ipp @@ -0,0 +1,3 @@ +[[deprecated("use getFrom instead")]] auto getRec() const; + +[[deprecated("use getTo instead")]] auto getSim() const; From aaf95ee4fda6fea1230bd18320da7db3b848a737 Mon Sep 17 00:00:00 2001 From: tmadlener Date: Thu, 18 Jul 2024 11:47:05 +0200 Subject: [PATCH 04/13] Propose the correct replacement --- edm4hep.yaml | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/edm4hep.yaml b/edm4hep.yaml index 2b6ba096a..a1ae5d0b5 100644 --- a/edm4hep.yaml +++ b/edm4hep.yaml @@ -628,7 +628,7 @@ datatypes: declaration: " [[deprecated(\"use setFrom instead\")]]\n void setRec(const edm4hep::ReconstructedParticle& rec);\n - [[deprecated(\"use setSim instead\")]]\n + [[deprecated(\"use setTo instead\")]]\n void setSim(const edm4hep::MCParticle& sim);\n " implementation: " @@ -651,7 +651,7 @@ datatypes: declaration: " [[deprecated(\"use setFrom instead\")]]\n void setRec(const edm4hep::CalorimeterHit& rec);\n - [[deprecated(\"use setSim instead\")]]\n + [[deprecated(\"use setTo instead\")]]\n void setSim(const edm4hep::SimCalorimeterHit& sim);\n " implementation: " @@ -675,7 +675,7 @@ datatypes: declaration: " [[deprecated(\"use setFrom instead\")]]\n void setRec(const edm4hep::TrackerHit& rec);\n - [[deprecated(\"use setSim instead\")]]\n + [[deprecated(\"use setTo instead\")]]\n void setSim(const edm4hep::SimTrackerHit& sim);\n " implementation: " @@ -698,7 +698,7 @@ datatypes: declaration: " [[deprecated(\"use setFrom instead\")]]\n void setRec(const edm4hep::CalorimeterHit& rec);\n - [[deprecated(\"use setSim instead\")]]\n + [[deprecated(\"use setTo instead\")]]\n void setSim(const edm4hep::MCParticle& sim);\n " implementation: " @@ -721,7 +721,7 @@ datatypes: declaration: " [[deprecated(\"use setFrom instead\")]]\n void inline setRec(const edm4hep::Cluster& rec);\n - [[deprecated(\"use setSim instead\")]]\n + [[deprecated(\"use setTo instead\")]]\n void inline setSim(const edm4hep::MCParticle& sim);\n " implementation: " @@ -744,7 +744,7 @@ datatypes: declaration: " [[deprecated(\"use setFrom instead\")]]\n void setRec(const edm4hep::Track& rec);\n - [[deprecated(\"use setSim instead\")]]\n + [[deprecated(\"use setTo instead\")]]\n void setSim(const edm4hep::MCParticle& sim);\n " implementation: " @@ -774,7 +774,7 @@ datatypes: declaration: " [[deprecated(\"use setFrom instead\")]]\n void setVertex(const edm4hep::Vertex& rec);\n - [[deprecated(\"use setSim instead\")]]\n + [[deprecated(\"use setTo instead\")]]\n void setRec(const edm4hep::ReconstructedParticle& sim);\n " implementation: " From e339fe744d7d993b66b249fca6784162904748a0 Mon Sep 17 00:00:00 2001 From: tmadlener Date: Thu, 25 Jul 2024 14:59:44 +0200 Subject: [PATCH 05/13] Rename Associations to Links --- edm4hep.yaml | 66 +++++++++---------- ...ationGetters.cc.ipp => LinkGetters.cc.ipp} | 0 ...ciationGetters.h.ipp => LinkGetters.h.ipp} | 0 3 files changed, 33 insertions(+), 33 deletions(-) rename edm4hep/extra_code/{AssociationGetters.cc.ipp => LinkGetters.cc.ipp} (100%) rename edm4hep/extra_code/{AssociationGetters.h.ipp => LinkGetters.h.ipp} (100%) diff --git a/edm4hep.yaml b/edm4hep.yaml index a1ae5d0b5..d53fc2708 100644 --- a/edm4hep.yaml +++ b/edm4hep.yaml @@ -613,17 +613,17 @@ 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::MCRecoParticleLink: + 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 from // reference to the reconstructed particle - edm4hep::MCParticle to // reference to the Monte-Carlo particle ExtraCode: - declarationFile: "edm4hep/extra_code/AssociationGetters.h.ipp" - implementationFile: "edm4hep/extra_code/AssociationGetters.cc.ipp" + declarationFile: "edm4hep/extra_code/LinkGetters.h.ipp" + implementationFile: "edm4hep/extra_code/LinkGetters.cc.ipp" MutableExtraCode: declaration: " [[deprecated(\"use setFrom instead\")]]\n @@ -636,17 +636,17 @@ datatypes: void {name}::setRec(const edm4hep::ReconstructedParticle& rec) { setFrom(rec); }\n " - edm4hep::MCRecoCaloAssociation: - Description: "Association between a CalorimeterHit and the corresponding SimCalorimeterHit" + edm4hep::MCRecoCaloLink: + 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 from // reference to the reconstructed hit - edm4hep::SimCalorimeterHit to // reference to the simulated hit ExtraCode: - declarationFile: "edm4hep/extra_code/AssociationGetters.h.ipp" - implementationFile: "edm4hep/extra_code/AssociationGetters.cc.ipp" + declarationFile: "edm4hep/extra_code/LinkGetters.h.ipp" + implementationFile: "edm4hep/extra_code/LinkGetters.cc.ipp" MutableExtraCode: declaration: " [[deprecated(\"use setFrom instead\")]]\n @@ -660,17 +660,17 @@ datatypes: " - edm4hep::MCRecoTrackerAssociation: - Description: "Association between a TrackerHit and the corresponding SimTrackerHit" + edm4hep::MCRecoTrackerLink: + 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 from // reference to the reconstructed hit - edm4hep::SimTrackerHit to // reference to the simulated hit ExtraCode: - declarationFile: "edm4hep/extra_code/AssociationGetters.h.ipp" - implementationFile: "edm4hep/extra_code/AssociationGetters.cc.ipp" + declarationFile: "edm4hep/extra_code/LinkGetters.h.ipp" + implementationFile: "edm4hep/extra_code/LinkGetters.cc.ipp" MutableExtraCode: declaration: " [[deprecated(\"use setFrom instead\")]]\n @@ -683,17 +683,17 @@ datatypes: void {name}::setRec(const edm4hep::TrackerHit& rec) { setFrom(rec); }\n " - edm4hep::MCRecoCaloParticleAssociation: - Description: "Association between a CalorimeterHit and the corresponding MCParticle" + edm4hep::MCRecoCaloParticleLink: + 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 from // reference to the reconstructed hit - edm4hep::MCParticle to // reference to the Monte-Carlo particle ExtraCode: - declarationFile: "edm4hep/extra_code/AssociationGetters.h.ipp" - implementationFile: "edm4hep/extra_code/AssociationGetters.cc.ipp" + declarationFile: "edm4hep/extra_code/LinkGetters.h.ipp" + implementationFile: "edm4hep/extra_code/LinkGetters.cc.ipp" MutableExtraCode: declaration: " [[deprecated(\"use setFrom instead\")]]\n @@ -706,17 +706,17 @@ datatypes: void {name}::setRec(const edm4hep::CalorimeterHit& rec) { setFrom(rec); }\n " - edm4hep::MCRecoClusterParticleAssociation: - Description: "Association between a Cluster and the corresponding MCParticle" + edm4hep::MCRecoClusterParticleLink: + 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 from // reference to the cluster - edm4hep::MCParticle to // reference to the Monte-Carlo particle ExtraCode: - declarationFile: "edm4hep/extra_code/AssociationGetters.h.ipp" - implementationFile: "edm4hep/extra_code/AssociationGetters.cc.ipp" + declarationFile: "edm4hep/extra_code/LinkGetters.h.ipp" + implementationFile: "edm4hep/extra_code/LinkGetters.cc.ipp" MutableExtraCode: declaration: " [[deprecated(\"use setFrom instead\")]]\n @@ -729,17 +729,17 @@ datatypes: void {name}::setRec(const edm4hep::Cluster& rec) { setFrom(rec); }\n " - edm4hep::MCRecoTrackParticleAssociation: - Description: "Association between a Track and the corresponding MCParticle" + edm4hep::MCRecoTrackParticleLink: + 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 from // reference to the track - edm4hep::MCParticle to // reference to the Monte-Carlo particle ExtraCode: - declarationFile: "edm4hep/extra_code/AssociationGetters.h.ipp" - implementationFile: "edm4hep/extra_code/AssociationGetters.cc.ipp" + declarationFile: "edm4hep/extra_code/LinkGetters.h.ipp" + implementationFile: "edm4hep/extra_code/LinkGetters.cc.ipp" MutableExtraCode: declaration: " [[deprecated(\"use setFrom instead\")]]\n @@ -752,11 +752,11 @@ datatypes: void {name}::setRec(const edm4hep::Track& rec) { setFrom(rec); }\n " - edm4hep::RecoParticleVertexAssociation: - Description: "Association between a ReconstructedParticle and a Vertex" + edm4hep::RecoParticleVertexLink: + Description: "Link between a ReconstructedParticle and a Vertex" Author: "EDM4hep authors" Members: - - float weight // weight of this association + - float weight // weight of this link OneToOneRelations: - edm4hep::ReconstructedParticle to // reference to the reconstructed particle - edm4hep::Vertex from // reference to the vertex diff --git a/edm4hep/extra_code/AssociationGetters.cc.ipp b/edm4hep/extra_code/LinkGetters.cc.ipp similarity index 100% rename from edm4hep/extra_code/AssociationGetters.cc.ipp rename to edm4hep/extra_code/LinkGetters.cc.ipp diff --git a/edm4hep/extra_code/AssociationGetters.h.ipp b/edm4hep/extra_code/LinkGetters.h.ipp similarity index 100% rename from edm4hep/extra_code/AssociationGetters.h.ipp rename to edm4hep/extra_code/LinkGetters.h.ipp From 46f5b3da9dbbd5564175d0e8e99dffa2eea7e811 Mon Sep 17 00:00:00 2001 From: tmadlener Date: Thu, 25 Jul 2024 15:03:02 +0200 Subject: [PATCH 06/13] Rename the links for more clarity --- edm4hep.yaml | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/edm4hep.yaml b/edm4hep.yaml index d53fc2708..5890a0732 100644 --- a/edm4hep.yaml +++ b/edm4hep.yaml @@ -613,7 +613,7 @@ datatypes: void setCovMatrix(float value, edm4hep::FourMomCoords dimI, edm4hep::FourMomCoords dimJ) { getCovMatrix().setValue(value, dimI, dimJ); }\n " - edm4hep::MCRecoParticleLink: + edm4hep::RecoMCParticleLink: Description: "Link between a ReconstructedParticle and the corresponding MCParticle" Author: "EDM4hep authors" Members: @@ -636,7 +636,7 @@ datatypes: void {name}::setRec(const edm4hep::ReconstructedParticle& rec) { setFrom(rec); }\n " - edm4hep::MCRecoCaloLink: + edm4hep::CaloHitSimCaloHitLink: Description: "Link between a CalorimeterHit and the corresponding SimCalorimeterHit" Author: "EDM4hep authors" Members: @@ -660,7 +660,7 @@ datatypes: " - edm4hep::MCRecoTrackerLink: + edm4hep::TrackerHitSimTrackerHitLink: Description: "Link between a TrackerHit and the corresponding SimTrackerHit" Author: "EDM4hep authors" Members: @@ -683,7 +683,7 @@ datatypes: void {name}::setRec(const edm4hep::TrackerHit& rec) { setFrom(rec); }\n " - edm4hep::MCRecoCaloParticleLink: + edm4hep::CaloHitMCParticleLink: Description: "Link between a CalorimeterHit and the corresponding MCParticle" Author: "EDM4hep authors" Members: @@ -706,7 +706,7 @@ datatypes: void {name}::setRec(const edm4hep::CalorimeterHit& rec) { setFrom(rec); }\n " - edm4hep::MCRecoClusterParticleLink: + edm4hep::ClusterMCParticleLink: Description: "Link between a Cluster and the corresponding MCParticle" Author: "EDM4hep authors" Members: @@ -729,7 +729,7 @@ datatypes: void {name}::setRec(const edm4hep::Cluster& rec) { setFrom(rec); }\n " - edm4hep::MCRecoTrackParticleLink: + edm4hep::TrackMCParticleLink: Description: "Link between a Track and the corresponding MCParticle" Author: "EDM4hep authors" Members: @@ -752,8 +752,8 @@ datatypes: void {name}::setRec(const edm4hep::Track& rec) { setFrom(rec); }\n " - edm4hep::RecoParticleVertexLink: - Description: "Link 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 link From 661a3e7bb67be242336b1107ab7552ae96a689d8 Mon Sep 17 00:00:00 2001 From: tmadlener Date: Thu, 25 Jul 2024 16:18:10 +0200 Subject: [PATCH 07/13] Add compatibility headers with deprecation warnings --- include/edm4hep/MCRecoCaloAssociation.h | 10 ++++++++++ include/edm4hep/MCRecoCaloAssociationCollection.h | 11 +++++++++++ include/edm4hep/MCRecoCaloParticleAssociation.h | 10 ++++++++++ .../edm4hep/MCRecoCaloParticleAssociationCollection.h | 11 +++++++++++ include/edm4hep/MCRecoClusterParticleAssociation.h | 10 ++++++++++ .../MCRecoClusterParticleAssociationCollection.h | 11 +++++++++++ include/edm4hep/MCRecoParticleAssociation.h | 10 ++++++++++ include/edm4hep/MCRecoParticleAssociationCollection.h | 11 +++++++++++ include/edm4hep/MCRecoTrackParticleAssociation.h | 10 ++++++++++ .../MCRecoTrackParticleAssociationCollection.h | 11 +++++++++++ include/edm4hep/MCRecoTrackerAssociation.h | 10 ++++++++++ include/edm4hep/MCRecoTrackerAssociationCollection.h | 11 +++++++++++ include/edm4hep/MutableMCRecoCaloAssociation.h | 11 +++++++++++ .../edm4hep/MutableMCRecoCaloParticleAssociation.h | 11 +++++++++++ .../edm4hep/MutableMCRecoClusterParticleAssociation.h | 11 +++++++++++ include/edm4hep/MutableMCRecoParticleAssociation.h | 11 +++++++++++ .../edm4hep/MutableMCRecoTrackParticleAssociation.h | 11 +++++++++++ include/edm4hep/MutableMCRecoTrackerAssociation.h | 11 +++++++++++ .../edm4hep/MutableRecoParticleVertexAssociation.h | 11 +++++++++++ include/edm4hep/RecoParticleVertexAssociation.h | 10 ++++++++++ .../edm4hep/RecoParticleVertexAssociationCollection.h | 11 +++++++++++ 21 files changed, 224 insertions(+) create mode 100644 include/edm4hep/MCRecoCaloAssociation.h create mode 100644 include/edm4hep/MCRecoCaloAssociationCollection.h create mode 100644 include/edm4hep/MCRecoCaloParticleAssociation.h create mode 100644 include/edm4hep/MCRecoCaloParticleAssociationCollection.h create mode 100644 include/edm4hep/MCRecoClusterParticleAssociation.h create mode 100644 include/edm4hep/MCRecoClusterParticleAssociationCollection.h create mode 100644 include/edm4hep/MCRecoParticleAssociation.h create mode 100644 include/edm4hep/MCRecoParticleAssociationCollection.h create mode 100644 include/edm4hep/MCRecoTrackParticleAssociation.h create mode 100644 include/edm4hep/MCRecoTrackParticleAssociationCollection.h create mode 100644 include/edm4hep/MCRecoTrackerAssociation.h create mode 100644 include/edm4hep/MCRecoTrackerAssociationCollection.h create mode 100644 include/edm4hep/MutableMCRecoCaloAssociation.h create mode 100644 include/edm4hep/MutableMCRecoCaloParticleAssociation.h create mode 100644 include/edm4hep/MutableMCRecoClusterParticleAssociation.h create mode 100644 include/edm4hep/MutableMCRecoParticleAssociation.h create mode 100644 include/edm4hep/MutableMCRecoTrackParticleAssociation.h create mode 100644 include/edm4hep/MutableMCRecoTrackerAssociation.h create mode 100644 include/edm4hep/MutableRecoParticleVertexAssociation.h create mode 100644 include/edm4hep/RecoParticleVertexAssociation.h create mode 100644 include/edm4hep/RecoParticleVertexAssociationCollection.h diff --git a/include/edm4hep/MCRecoCaloAssociation.h b/include/edm4hep/MCRecoCaloAssociation.h new file mode 100644 index 000000000..cddcf29a5 --- /dev/null +++ b/include/edm4hep/MCRecoCaloAssociation.h @@ -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 diff --git a/include/edm4hep/MCRecoCaloAssociationCollection.h b/include/edm4hep/MCRecoCaloAssociationCollection.h new file mode 100644 index 000000000..e315858e5 --- /dev/null +++ b/include/edm4hep/MCRecoCaloAssociationCollection.h @@ -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 diff --git a/include/edm4hep/MCRecoCaloParticleAssociation.h b/include/edm4hep/MCRecoCaloParticleAssociation.h new file mode 100644 index 000000000..959fa8fd9 --- /dev/null +++ b/include/edm4hep/MCRecoCaloParticleAssociation.h @@ -0,0 +1,10 @@ +#ifndef EDM4HEP_MCRecoCaloParticleAssociation_H +#define EDM4HEP_MCRecoCaloParticleAssociation_H + +#include "edm4hep/CaloHitMCParticleLink.h" + +namespace edm4hep { +using MCRecoCaloParticleAssociation [[deprecated("use CaloHitMCParticleLink instead")]] = edm4hep::CaloHitMCParticleLink; +} + +#endif diff --git a/include/edm4hep/MCRecoCaloParticleAssociationCollection.h b/include/edm4hep/MCRecoCaloParticleAssociationCollection.h new file mode 100644 index 000000000..0975c80e0 --- /dev/null +++ b/include/edm4hep/MCRecoCaloParticleAssociationCollection.h @@ -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 diff --git a/include/edm4hep/MCRecoClusterParticleAssociation.h b/include/edm4hep/MCRecoClusterParticleAssociation.h new file mode 100644 index 000000000..c0829eeed --- /dev/null +++ b/include/edm4hep/MCRecoClusterParticleAssociation.h @@ -0,0 +1,10 @@ +#ifndef EDM4HEP_MCRecoClusterParticleAssociation_H +#define EDM4HEP_MCRecoClusterParticleAssociation_H + +#include "edm4hep/ClusterMCParticleLink.h" + +namespace edm4hep { +using MCRecoClusterParticleAssociation [[deprecated("use ClusterMCParticleLink instead")]] = edm4hep::ClusterMCParticleLink; +} + +#endif diff --git a/include/edm4hep/MCRecoClusterParticleAssociationCollection.h b/include/edm4hep/MCRecoClusterParticleAssociationCollection.h new file mode 100644 index 000000000..b36c57501 --- /dev/null +++ b/include/edm4hep/MCRecoClusterParticleAssociationCollection.h @@ -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 diff --git a/include/edm4hep/MCRecoParticleAssociation.h b/include/edm4hep/MCRecoParticleAssociation.h new file mode 100644 index 000000000..ff3e6a6d8 --- /dev/null +++ b/include/edm4hep/MCRecoParticleAssociation.h @@ -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 diff --git a/include/edm4hep/MCRecoParticleAssociationCollection.h b/include/edm4hep/MCRecoParticleAssociationCollection.h new file mode 100644 index 000000000..6c214380d --- /dev/null +++ b/include/edm4hep/MCRecoParticleAssociationCollection.h @@ -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 diff --git a/include/edm4hep/MCRecoTrackParticleAssociation.h b/include/edm4hep/MCRecoTrackParticleAssociation.h new file mode 100644 index 000000000..abb25b0b2 --- /dev/null +++ b/include/edm4hep/MCRecoTrackParticleAssociation.h @@ -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 diff --git a/include/edm4hep/MCRecoTrackParticleAssociationCollection.h b/include/edm4hep/MCRecoTrackParticleAssociationCollection.h new file mode 100644 index 000000000..7a321fa95 --- /dev/null +++ b/include/edm4hep/MCRecoTrackParticleAssociationCollection.h @@ -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 diff --git a/include/edm4hep/MCRecoTrackerAssociation.h b/include/edm4hep/MCRecoTrackerAssociation.h new file mode 100644 index 000000000..71e9adb7f --- /dev/null +++ b/include/edm4hep/MCRecoTrackerAssociation.h @@ -0,0 +1,10 @@ +#ifndef EDM4HEP_MCRecoTrackerAssociation_H +#define EDM4HEP_MCRecoTrackerAssociation_H + +#include "edm4hep/TrackerHitSimTrackerHitLink.h" + +namespace edm4hep { +using MCRecoTrackerAssociation [[deprecated("use TrackerHitSimTrackerHitLink instead")]] = edm4hep::TrackerHitSimTrackerHitLink; +} + +#endif diff --git a/include/edm4hep/MCRecoTrackerAssociationCollection.h b/include/edm4hep/MCRecoTrackerAssociationCollection.h new file mode 100644 index 000000000..669ff2359 --- /dev/null +++ b/include/edm4hep/MCRecoTrackerAssociationCollection.h @@ -0,0 +1,11 @@ +#ifndef EDM4HEP_MCRecoTrackerAssociationCollection_H +#define EDM4HEP_MCRecoTrackerAssociationCollection_H + +#include "edm4hep/TrackerHitSimTrackerHitLinkCollection.h" + +namespace edm4hep { +using MCRecoTrackerAssociationCollection [[deprecated("use TrackerHitSimTrackerHitLinkCollection instead")]] = + edm4hep::TrackerHitSimTrackerHitLinkCollection; +} + +#endif diff --git a/include/edm4hep/MutableMCRecoCaloAssociation.h b/include/edm4hep/MutableMCRecoCaloAssociation.h new file mode 100644 index 000000000..36733bab0 --- /dev/null +++ b/include/edm4hep/MutableMCRecoCaloAssociation.h @@ -0,0 +1,11 @@ +#ifndef EDM4HEP_MutableMCRecoCaloAssociation_H +#define EDM4HEP_MutableMCRecoCaloAssociation_H + +#include "edm4hep/CaloHitSimCaloHitLink.h" + +namespace edm4hep { +using MutableMCRecoCaloAssociation [[deprecated("use MutableCaloHitSimCaloHitLink instead")]] = + edm4hep::MutableCaloHitSimCaloHitLink; +} + +#endif diff --git a/include/edm4hep/MutableMCRecoCaloParticleAssociation.h b/include/edm4hep/MutableMCRecoCaloParticleAssociation.h new file mode 100644 index 000000000..9d92223bd --- /dev/null +++ b/include/edm4hep/MutableMCRecoCaloParticleAssociation.h @@ -0,0 +1,11 @@ +#ifndef EDM4HEP_MutableMCRecoCaloParticleAssociation_H +#define EDM4HEP_MutableMCRecoCaloParticleAssociation_H + +#include "edm4hep/CaloHitMCParticleLink.h" + +namespace edm4hep { +using MutableMCRecoCaloParticleAssociation [[deprecated("use MutableCaloHitMCParticleLink instead")]] = + edm4hep::MutableCaloHitMCParticleLink; +} + +#endif diff --git a/include/edm4hep/MutableMCRecoClusterParticleAssociation.h b/include/edm4hep/MutableMCRecoClusterParticleAssociation.h new file mode 100644 index 000000000..12c9c9823 --- /dev/null +++ b/include/edm4hep/MutableMCRecoClusterParticleAssociation.h @@ -0,0 +1,11 @@ +#ifndef EDM4HEP_MutableMCRecoClusterParticleAssociation_H +#define EDM4HEP_MutableMCRecoClusterParticleAssociation_H + +#include "edm4hep/ClusterMCParticleLink.h" + +namespace edm4hep { +using MutableMCRecoClusterParticleAssociation [[deprecated("use MutableClusterMCParticleLink instead")]] = + edm4hep::MutableClusterMCParticleLink; +} + +#endif diff --git a/include/edm4hep/MutableMCRecoParticleAssociation.h b/include/edm4hep/MutableMCRecoParticleAssociation.h new file mode 100644 index 000000000..0231fdfa3 --- /dev/null +++ b/include/edm4hep/MutableMCRecoParticleAssociation.h @@ -0,0 +1,11 @@ +#ifndef EDM4HEP_MutableMCRecoParticleAssociation_H +#define EDM4HEP_MutableMCRecoParticleAssociation_H + +#include "edm4hep/RecoMCParticleLink.h" + +namespace edm4hep { +using MutableMCRecoParticleAssociation [[deprecated("use MutableRecoMCParticleLink instead")]] = + edm4hep::MutableRecoMCParticleLink; +} + +#endif diff --git a/include/edm4hep/MutableMCRecoTrackParticleAssociation.h b/include/edm4hep/MutableMCRecoTrackParticleAssociation.h new file mode 100644 index 000000000..f40377894 --- /dev/null +++ b/include/edm4hep/MutableMCRecoTrackParticleAssociation.h @@ -0,0 +1,11 @@ +#ifndef EDM4HEP_MutableMCRecoTrackParticleAssociation_H +#define EDM4HEP_MutableMCRecoTrackParticleAssociation_H + +#include "edm4hep/TrackMCParticleLink.h" + +namespace edm4hep { +using MutableMCRecoTrackParticleAssociation [[deprecated("use MutableTrackMCParticleLink instead")]] = + edm4hep::MutableTrackMCParticleLink; +} + +#endif diff --git a/include/edm4hep/MutableMCRecoTrackerAssociation.h b/include/edm4hep/MutableMCRecoTrackerAssociation.h new file mode 100644 index 000000000..fc4b9e5e8 --- /dev/null +++ b/include/edm4hep/MutableMCRecoTrackerAssociation.h @@ -0,0 +1,11 @@ +#ifndef EDM4HEP_MutableMCRecoTrackerAssociation_H +#define EDM4HEP_MutableMCRecoTrackerAssociation_H + +#include "edm4hep/TrackerHitSimTrackerHitLink.h" + +namespace edm4hep { +using MutableMCRecoTrackerAssociation [[deprecated("use MutableTrackerHitSimTrackerHitLink instead")]] = + edm4hep::MutableTrackerHitSimTrackerHitLink; +} + +#endif diff --git a/include/edm4hep/MutableRecoParticleVertexAssociation.h b/include/edm4hep/MutableRecoParticleVertexAssociation.h new file mode 100644 index 000000000..33aefaade --- /dev/null +++ b/include/edm4hep/MutableRecoParticleVertexAssociation.h @@ -0,0 +1,11 @@ +#ifndef EDM4HEP_MutableRecoParticleVertexAssociation_H +#define EDM4HEP_MutableRecoParticleVertexAssociation_H + +#include "edm4hep/VertexRecoParticleLink.h" + +namespace edm4hep { +using MutableRecoParticleVertexAssociation [[deprecated("use MutableVertexRecoParticleLink instead")]] = + edm4hep::MutableVertexRecoParticleLink; +} + +#endif diff --git a/include/edm4hep/RecoParticleVertexAssociation.h b/include/edm4hep/RecoParticleVertexAssociation.h new file mode 100644 index 000000000..83ccc4d3b --- /dev/null +++ b/include/edm4hep/RecoParticleVertexAssociation.h @@ -0,0 +1,10 @@ +#ifndef EDM4HEP_RecoParticleVertexAssociation_H +#define EDM4HEP_RecoParticleVertexAssociation_H + +#include "edm4hep/VertexRecoParticleLink.h" + +namespace edm4hep { +using RecoParticleVertexAssociation [[deprecated("use VertexRecoParticleLink instead")]] = edm4hep::VertexRecoParticleLink; +} + +#endif diff --git a/include/edm4hep/RecoParticleVertexAssociationCollection.h b/include/edm4hep/RecoParticleVertexAssociationCollection.h new file mode 100644 index 000000000..98ef50efc --- /dev/null +++ b/include/edm4hep/RecoParticleVertexAssociationCollection.h @@ -0,0 +1,11 @@ +#ifndef EDM4HEP_RecoParticleVertexAssociationCollection_H +#define EDM4HEP_RecoParticleVertexAssociationCollection_H + +#include "edm4hep/VertexRecoParticleLinkCollection.h" + +namespace edm4hep { +using RecoParticleVertexAssociationCollection [[deprecated("use VertexRecoParticleLinkCollection instead")]] = + edm4hep::VertexRecoParticleLinkCollection; +} + +#endif From 6f57cffb07b15c8948cb4b1d79509e0c75ca41ec Mon Sep 17 00:00:00 2001 From: tmadlener Date: Thu, 25 Jul 2024 16:20:21 +0200 Subject: [PATCH 08/13] Use non-deprecated types --- tools/include/edm4hep2json.hxx | 42 +++++++++++++++++----------------- 1 file changed, 21 insertions(+), 21 deletions(-) diff --git a/tools/include/edm4hep2json.hxx b/tools/include/edm4hep2json.hxx index 615a24ea7..71a296a65 100644 --- a/tools/include/edm4hep2json.hxx +++ b/tools/include/edm4hep2json.hxx @@ -22,13 +22,13 @@ #include "edm4hep/TrackerHitPlaneCollection.h" #include "edm4hep/VertexCollection.h" -#include "edm4hep/MCRecoCaloAssociationCollection.h" -#include "edm4hep/MCRecoCaloParticleAssociationCollection.h" -#include "edm4hep/MCRecoClusterParticleAssociationCollection.h" -#include "edm4hep/MCRecoParticleAssociationCollection.h" -#include "edm4hep/MCRecoTrackParticleAssociationCollection.h" -#include "edm4hep/MCRecoTrackerAssociationCollection.h" -#include "edm4hep/RecoParticleVertexAssociationCollection.h" +#include "edm4hep/CaloHitMCParticleLinkCollection.h" +#include "edm4hep/CaloHitSimCaloHitLinkCollection.h" +#include "edm4hep/ClusterMCParticleLinkCollection.h" +#include "edm4hep/RecoMCParticleLinkCollection.h" +#include "edm4hep/TrackMCParticleLinkCollection.h" +#include "edm4hep/TrackerHitSimTrackerHitLinkCollection.h" +#include "edm4hep/VertexRecoParticleLinkCollection.h" #include "edm4hep/EDM4hepVersion.h" @@ -108,20 +108,20 @@ nlohmann::json processEvent(const podio::Frame& frame, std::vector& insertIntoJson(jsonDict, coll, collList[i]); } // Associations - else if (coll->getTypeName() == "edm4hep::MCRecoParticleAssociationCollection") { - insertIntoJson(jsonDict, coll, collList[i]); - } else if (coll->getTypeName() == "edm4hep::MCRecoCaloAssociationCollection") { - insertIntoJson(jsonDict, coll, collList[i]); - } else if (coll->getTypeName() == "edm4hep::MCRecoTrackerAssociationCollection") { - insertIntoJson(jsonDict, coll, collList[i]); - } else if (coll->getTypeName() == "edm4hep::MCRecoCaloParticleAssociationCollection") { - insertIntoJson(jsonDict, coll, collList[i]); - } else if (coll->getTypeName() == "edm4hep::MCRecoClusterParticleAssociationCollection") { - insertIntoJson(jsonDict, coll, collList[i]); - } else if (coll->getTypeName() == "edm4hep::MCRecoTrackParticleAssociationCollection") { - insertIntoJson(jsonDict, coll, collList[i]); - } else if (coll->getTypeName() == "edm4hep::RecoParticleVertexAssociationCollection") { - insertIntoJson(jsonDict, coll, collList[i]); + else if (coll->getTypeName() == "edm4hep::RecoMCParticleLinkCollection") { + insertIntoJson(jsonDict, coll, collList[i]); + } else if (coll->getTypeName() == "edm4hep::CaloHitSimCaloHitLinkCollection") { + insertIntoJson(jsonDict, coll, collList[i]); + } else if (coll->getTypeName() == "edm4hep::TrackerHitSimTrackerHitLinkCollection") { + insertIntoJson(jsonDict, coll, collList[i]); + } else if (coll->getTypeName() == "edm4hep::CaloHitMCParticleLinkCollection") { + insertIntoJson(jsonDict, coll, collList[i]); + } else if (coll->getTypeName() == "edm4hep::ClusterMCParticleLinkCollection") { + insertIntoJson(jsonDict, coll, collList[i]); + } else if (coll->getTypeName() == "edm4hep::TrackMCParticleLinkCollection") { + insertIntoJson(jsonDict, coll, collList[i]); + } else if (coll->getTypeName() == "edm4hep::VertexRecoParticleLinkCollection") { + insertIntoJson(jsonDict, coll, collList[i]); } // Podio user data else if (coll->getTypeName() == "podio::UserDataCollection") { From 21c30702854e474e45e3286f5e09d9b9221bf5a9 Mon Sep 17 00:00:00 2001 From: tmadlener Date: Mon, 29 Jul 2024 17:32:30 +0200 Subject: [PATCH 09/13] Move ExtraCode into yaml file --- edm4hep.yaml | 59 ++++++++++++++++++--------- edm4hep/extra_code/LinkGetters.cc.ipp | 7 ---- edm4hep/extra_code/LinkGetters.h.ipp | 3 -- 3 files changed, 40 insertions(+), 29 deletions(-) delete mode 100644 edm4hep/extra_code/LinkGetters.cc.ipp delete mode 100644 edm4hep/extra_code/LinkGetters.h.ipp diff --git a/edm4hep.yaml b/edm4hep.yaml index 5890a0732..9b789fb23 100644 --- a/edm4hep.yaml +++ b/edm4hep.yaml @@ -622,8 +622,12 @@ datatypes: - edm4hep::ReconstructedParticle from // reference to the reconstructed particle - edm4hep::MCParticle to // reference to the Monte-Carlo particle ExtraCode: - declarationFile: "edm4hep/extra_code/LinkGetters.h.ipp" - implementationFile: "edm4hep/extra_code/LinkGetters.cc.ipp" + 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 @@ -645,8 +649,12 @@ datatypes: - edm4hep::CalorimeterHit from // reference to the reconstructed hit - edm4hep::SimCalorimeterHit to // reference to the simulated hit ExtraCode: - declarationFile: "edm4hep/extra_code/LinkGetters.h.ipp" - implementationFile: "edm4hep/extra_code/LinkGetters.cc.ipp" + 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 @@ -669,8 +677,12 @@ datatypes: - edm4hep::TrackerHit from // reference to the reconstructed hit - edm4hep::SimTrackerHit to // reference to the simulated hit ExtraCode: - declarationFile: "edm4hep/extra_code/LinkGetters.h.ipp" - implementationFile: "edm4hep/extra_code/LinkGetters.cc.ipp" + 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 @@ -692,8 +704,12 @@ datatypes: - edm4hep::CalorimeterHit from // reference to the reconstructed hit - edm4hep::MCParticle to // reference to the Monte-Carlo particle ExtraCode: - declarationFile: "edm4hep/extra_code/LinkGetters.h.ipp" - implementationFile: "edm4hep/extra_code/LinkGetters.cc.ipp" + 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 @@ -715,8 +731,12 @@ datatypes: - edm4hep::Cluster from // reference to the cluster - edm4hep::MCParticle to // reference to the Monte-Carlo particle ExtraCode: - declarationFile: "edm4hep/extra_code/LinkGetters.h.ipp" - implementationFile: "edm4hep/extra_code/LinkGetters.cc.ipp" + 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 @@ -738,8 +758,12 @@ datatypes: - edm4hep::Track from // reference to the track - edm4hep::MCParticle to // reference to the Monte-Carlo particle ExtraCode: - declarationFile: "edm4hep/extra_code/LinkGetters.h.ipp" - implementationFile: "edm4hep/extra_code/LinkGetters.cc.ipp" + 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 @@ -762,14 +786,11 @@ datatypes: - edm4hep::Vertex from // reference to the vertex ExtraCode: declaration: " - [[deprecated(\"use getTo instead\")]]\n - auto getRec() const;\n - [[deprecated(\"use getFrom instead\")]]\n - auto getVertex()const ;\n - " + [[deprecated(\"use getTo instead\")]] edm4hep::ReconstructedParticle getRec() const;\n + [[deprecated(\"use getFrom instead\")]] edm4hep::Vertex getVertex() const;\n" implementation: " - auto {name}::getRec() const { return getTo(); }\n - auto {name}::getVertex() const { return getFrom(); }\n" + edm4hep::ReconstructedParticle {name}::getRec() const { return getTo(); }\n + edm4hep::Vertex {name}::getVertex() const { return getFrom(); }\n" MutableExtraCode: declaration: " [[deprecated(\"use setFrom instead\")]]\n diff --git a/edm4hep/extra_code/LinkGetters.cc.ipp b/edm4hep/extra_code/LinkGetters.cc.ipp deleted file mode 100644 index 7fee4f7f9..000000000 --- a/edm4hep/extra_code/LinkGetters.cc.ipp +++ /dev/null @@ -1,7 +0,0 @@ -auto {name}::getRec() const { - return getFrom(); -} - -auto {name}::getSim() const { - return getTo(); -} diff --git a/edm4hep/extra_code/LinkGetters.h.ipp b/edm4hep/extra_code/LinkGetters.h.ipp deleted file mode 100644 index 73b061730..000000000 --- a/edm4hep/extra_code/LinkGetters.h.ipp +++ /dev/null @@ -1,3 +0,0 @@ -[[deprecated("use getFrom instead")]] auto getRec() const; - -[[deprecated("use getTo instead")]] auto getSim() const; From 0a537f8f9cb70a33157c888f6330d71ab32958bb Mon Sep 17 00:00:00 2001 From: tmadlener Date: Mon, 29 Jul 2024 17:39:04 +0200 Subject: [PATCH 10/13] Remove inline to force symbol generation --- edm4hep.yaml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/edm4hep.yaml b/edm4hep.yaml index 9b789fb23..431bf9025 100644 --- a/edm4hep.yaml +++ b/edm4hep.yaml @@ -740,9 +740,9 @@ datatypes: MutableExtraCode: declaration: " [[deprecated(\"use setFrom instead\")]]\n - void inline setRec(const edm4hep::Cluster& rec);\n + void setRec(const edm4hep::Cluster& rec);\n [[deprecated(\"use setTo instead\")]]\n - void inline setSim(const edm4hep::MCParticle& sim);\n + void setSim(const edm4hep::MCParticle& sim);\n " implementation: " void {name}::setSim(const edm4hep::MCParticle& sim) { setTo(sim); }\n From e506497aa2b1ecbab818d2e851ba0b45734ce4f8 Mon Sep 17 00:00:00 2001 From: tmadlener Date: Mon, 29 Jul 2024 17:48:21 +0200 Subject: [PATCH 11/13] Fix names in python script creating all types --- scripts/createEDM4hepFile.py | 96 ++++++++++++++++++------------------ 1 file changed, 48 insertions(+), 48 deletions(-) diff --git a/scripts/createEDM4hepFile.py b/scripts/createEDM4hepFile.py index f838adeed..9ade63cf0 100644 --- a/scripts/createEDM4hepFile.py +++ b/scripts/createEDM4hepFile.py @@ -269,54 +269,54 @@ # if not args.use_pre1: # pid.setParticle(reco_particle) - assocs = edm4hep.MCRecoParticleAssociationCollection() - assoc = assocs.create() - assoc.setWeight(next(counter)) - assoc.setRec(reco_particle) - assoc.setSim(particle) - frame.put(assocs, "MCRecoParticleAssociationCollection") - - assocs = edm4hep.MCRecoCaloAssociationCollection() - assoc = assocs.create() - assoc.setWeight(next(counter)) - assoc.setRec(calo_hit) - assoc.setSim(simcalo_hit) - frame.put(assocs, "MCRecoCaloAssociationCollection") - - assocs = edm4hep.MCRecoTrackerAssociationCollection() - assoc = assocs.create() - assoc.setWeight(next(counter)) - assoc.setRec(tracker_hit) - assoc.setSim(simtracker_hit) - frame.put(assocs, "MCRecoTrackerAssociationCollection") - - assocs = edm4hep.MCRecoCaloParticleAssociationCollection() - assoc = assocs.create() - assoc.setWeight(next(counter)) - assoc.setRec(calo_hit) - assoc.setSim(particle) - frame.put(assocs, "MCRecoCaloParticleAssociationCollection") - - assocs = edm4hep.MCRecoClusterParticleAssociationCollection() - assoc = assocs.create() - assoc.setWeight(next(counter)) - assoc.setRec(cluster) - assoc.setSim(particle) - frame.put(assocs, "MCRecoClusterParticleAssociationCollection") - - assocs = edm4hep.MCRecoTrackParticleAssociationCollection() - assoc = assocs.create() - assoc.setWeight(next(counter)) - assoc.setRec(track) - assoc.setSim(particle) - frame.put(assocs, "MCRecoTrackParticleAssociationCollection") - - assocs = edm4hep.RecoParticleVertexAssociationCollection() - assoc = assocs.create() - assoc.setWeight(next(counter)) - assoc.setRec(reco_particle) - assoc.setVertex(v) - frame.put(assocs, "MCRecoParticleVertexAssociationCollection") + links = edm4hep.RecoMCParticleLinkCollection() + link = links.create() + link.setWeight(next(counter)) + link.setRec(reco_particle) + link.setSim(particle) + frame.put(links, "RecoMCParticleLinkCollection") + + links = edm4hep.CaloHitSimCaloHitLinkCollection() + link = links.create() + link.setWeight(next(counter)) + link.setRec(calo_hit) + link.setSim(simcalo_hit) + frame.put(links, "CaloHitSimCaloHitLinkCollection") + + links = edm4hep.TrackerHitSimTrackerHitLinkCollection() + link = links.create() + link.setWeight(next(counter)) + link.setRec(tracker_hit) + link.setSim(simtracker_hit) + frame.put(links, "TrackerHitSimTrackerHitLinkCollection") + + links = edm4hep.CaloHitMCParticleLinkCollection() + link = links.create() + link.setWeight(next(counter)) + link.setRec(calo_hit) + link.setSim(particle) + frame.put(links, "CaloHitMCParticleLinkCollection") + + links = edm4hep.ClusterMCParticleLinkCollection() + link = links.create() + link.setWeight(next(counter)) + link.setRec(cluster) + link.setSim(particle) + frame.put(links, "ClusterMCParticleLinkCollection") + + links = edm4hep.TrackMCParticleLinkCollection() + link = links.create() + link.setWeight(next(counter)) + link.setRec(track) + link.setSim(particle) + frame.put(links, "TrackMCParticleLinkCollection") + + links = edm4hep.VertexRecoParticleLinkCollection() + link = links.create() + link.setWeight(next(counter)) + link.setRec(reco_particle) + link.setVertex(v) + frame.put(links, "MCVertexRecoParticleLinkCollection") timeseries = edm4hep.TimeSeriesCollection() serie = timeseries.create() From 2bf91805b3b3c5d4d506b44a034de51a96997a47 Mon Sep 17 00:00:00 2001 From: tmadlener Date: Mon, 29 Jul 2024 17:50:17 +0200 Subject: [PATCH 12/13] Fix README links and names --- README.md | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/README.md b/README.md index 9ada0c31e..04936c148 100644 --- a/README.md +++ b/README.md @@ -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. From 33143728d2c6c408bc083f242560df26c971afea Mon Sep 17 00:00:00 2001 From: tmadlener Date: Mon, 29 Jul 2024 17:55:06 +0200 Subject: [PATCH 13/13] Fix formatting for pre-commit --- include/edm4hep/MCRecoCaloParticleAssociation.h | 3 ++- include/edm4hep/MCRecoClusterParticleAssociation.h | 3 ++- include/edm4hep/MCRecoTrackerAssociation.h | 3 ++- include/edm4hep/RecoParticleVertexAssociation.h | 3 ++- 4 files changed, 8 insertions(+), 4 deletions(-) diff --git a/include/edm4hep/MCRecoCaloParticleAssociation.h b/include/edm4hep/MCRecoCaloParticleAssociation.h index 959fa8fd9..348c16a9a 100644 --- a/include/edm4hep/MCRecoCaloParticleAssociation.h +++ b/include/edm4hep/MCRecoCaloParticleAssociation.h @@ -4,7 +4,8 @@ #include "edm4hep/CaloHitMCParticleLink.h" namespace edm4hep { -using MCRecoCaloParticleAssociation [[deprecated("use CaloHitMCParticleLink instead")]] = edm4hep::CaloHitMCParticleLink; +using MCRecoCaloParticleAssociation [[deprecated("use CaloHitMCParticleLink instead")]] = + edm4hep::CaloHitMCParticleLink; } #endif diff --git a/include/edm4hep/MCRecoClusterParticleAssociation.h b/include/edm4hep/MCRecoClusterParticleAssociation.h index c0829eeed..ffca3d8c1 100644 --- a/include/edm4hep/MCRecoClusterParticleAssociation.h +++ b/include/edm4hep/MCRecoClusterParticleAssociation.h @@ -4,7 +4,8 @@ #include "edm4hep/ClusterMCParticleLink.h" namespace edm4hep { -using MCRecoClusterParticleAssociation [[deprecated("use ClusterMCParticleLink instead")]] = edm4hep::ClusterMCParticleLink; +using MCRecoClusterParticleAssociation [[deprecated("use ClusterMCParticleLink instead")]] = + edm4hep::ClusterMCParticleLink; } #endif diff --git a/include/edm4hep/MCRecoTrackerAssociation.h b/include/edm4hep/MCRecoTrackerAssociation.h index 71e9adb7f..7f0146155 100644 --- a/include/edm4hep/MCRecoTrackerAssociation.h +++ b/include/edm4hep/MCRecoTrackerAssociation.h @@ -4,7 +4,8 @@ #include "edm4hep/TrackerHitSimTrackerHitLink.h" namespace edm4hep { -using MCRecoTrackerAssociation [[deprecated("use TrackerHitSimTrackerHitLink instead")]] = edm4hep::TrackerHitSimTrackerHitLink; +using MCRecoTrackerAssociation [[deprecated("use TrackerHitSimTrackerHitLink instead")]] = + edm4hep::TrackerHitSimTrackerHitLink; } #endif diff --git a/include/edm4hep/RecoParticleVertexAssociation.h b/include/edm4hep/RecoParticleVertexAssociation.h index 83ccc4d3b..47129e6fc 100644 --- a/include/edm4hep/RecoParticleVertexAssociation.h +++ b/include/edm4hep/RecoParticleVertexAssociation.h @@ -4,7 +4,8 @@ #include "edm4hep/VertexRecoParticleLink.h" namespace edm4hep { -using RecoParticleVertexAssociation [[deprecated("use VertexRecoParticleLink instead")]] = edm4hep::VertexRecoParticleLink; +using RecoParticleVertexAssociation [[deprecated("use VertexRecoParticleLink instead")]] = + edm4hep::VertexRecoParticleLink; } #endif