From a311943db2ba8c23150e16fa29e24a629770ecea Mon Sep 17 00:00:00 2001 From: Wouter Deconinck Date: Mon, 20 Jan 2025 10:47:05 -0600 Subject: [PATCH 1/2] feat: deprecate simID and recID accessors --- edm4eic.yaml | 52 ++++++++++++++++++++++++++++++++++++++++++++-------- 1 file changed, 44 insertions(+), 8 deletions(-) diff --git a/edm4eic.yaml b/edm4eic.yaml index d12d41a..b5b4c20 100644 --- a/edm4eic.yaml +++ b/edm4eic.yaml @@ -513,45 +513,81 @@ datatypes: Description: "Used to keep track of the correspondence between MC and reconstructed particles" Author: "S. Joosten" Members: - - uint32_t simID // Index of corresponding MCParticle (position in MCParticles array) - - uint32_t recID // Index of corresponding ReconstructedParticle (position in ReconstructedParticles array) - float weight // weight of this association OneToOneRelations : - edm4eic::ReconstructedParticle rec // reference to the reconstructed particle - edm4hep::MCParticle sim // reference to the Monte-Carlo particle + ExtraCode: + includes: " + #include \n + #include \n + " + declaration: " + [[deprecated(\"use getSim().getObjectID().index instead\")]] + int getSimID() const { return getSim().getObjectID().index; }\n + [[deprecated(\"use getRec().getObjectID().index instead\")]] + int getRecID() const { return getRec().getObjectID().index; }\n + " edm4eic::MCRecoClusterParticleAssociation: Description: "Association between a Cluster and a MCParticle" Author : "S. Joosten" Members: - - uint32_t simID // Index of corresponding MCParticle (position in MCParticles array) - - uint32_t recID // Index of corresponding Cluster (position in Clusters array) - float weight // weight of this association OneToOneRelations: - edm4eic::Cluster rec // reference to the cluster - edm4hep::MCParticle sim // reference to the Monte-Carlo particle + ExtraCode: + includes: " + #include \n + #include \n + " + declaration: " + [[deprecated(\"use getSim().getObjectID().index instead\")]] + int getSimID() const { return getSim().getObjectID().index; }\n + [[deprecated(\"use getRec().getObjectID().index instead\")]] + int getRecID() const { return getRec().getObjectID().index; }\n + " edm4eic::MCRecoTrackParticleAssociation: Description: "Association between a Track and a MCParticle" Author : "S. Joosten" Members: - - uint32_t simID // Index of corresponding MCParticle (position in MCParticles array) - - uint32_t recID // Index of corresponding Track (position in Tracks array) - float weight // weight of this association OneToOneRelations: - edm4eic::Track rec // reference to the track - edm4hep::MCParticle sim // reference to the Monte-Carlo particle + ExtraCode: + includes: " + #include \n + #include \n + " + declaration: " + [[deprecated(\"use getSim().getObjectID().index instead\")]] + int getSimID() const { return getSim().getObjectID().index; }\n + [[deprecated(\"use getRec().getObjectID().index instead\")]] + int getRecID() const { return getRec().getObjectID().index; }\n + " edm4eic::MCRecoVertexParticleAssociation: Description: "Association between a Vertex and a MCParticle" Author : "S. Joosten" Members: - - uint32_t simID // Index of corresponding MCParticle (position in MCParticles array) - - uint32_t recID // Index of corresponding Vertex (position in Vertices array) - float weight // weight of this association OneToOneRelations: - edm4eic::Vertex rec // reference to the vertex - edm4hep::MCParticle sim // reference to the Monte-Carlo particle + ExtraCode: + includes: " + #include \n + #include \n + " + declaration: " + [[deprecated(\"use getSim().getObjectID().index instead\")]] + int getSimID() const { return getSim().getObjectID().index; }\n + [[deprecated(\"use getRec().getObjectID().index instead\")]] + int getRecID() const { return getRec().getObjectID().index; }\n + " edm4eic::MCRecoTrackerHitAssociation: Description: "Association between a RawTrackerHit and a SimTrackerHit" From 8dff4ff53d18f78243b57a413f17b935d99df423 Mon Sep 17 00:00:00 2001 From: Wouter Deconinck Date: Mon, 20 Jan 2025 15:58:15 -0600 Subject: [PATCH 2/2] feat: also provide deprecated setters (which don't set anything) --- edm4eic.yaml | 44 ++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 44 insertions(+) diff --git a/edm4eic.yaml b/edm4eic.yaml index b5b4c20..a9f7a45 100644 --- a/edm4eic.yaml +++ b/edm4eic.yaml @@ -528,6 +528,17 @@ datatypes: [[deprecated(\"use getRec().getObjectID().index instead\")]] int getRecID() const { return getRec().getObjectID().index; }\n " + MutableExtraCode: + includes: " + #include \n + #include \n + " + declaration: " + [[deprecated(\"use setSim() instead; this function does nothing\")]] + void setSimID(int) { }\n + [[deprecated(\"use setRec() instead; this function does nothing\")]] + void setRecID(int) { }\n + " edm4eic::MCRecoClusterParticleAssociation: Description: "Association between a Cluster and a MCParticle" @@ -548,6 +559,17 @@ datatypes: [[deprecated(\"use getRec().getObjectID().index instead\")]] int getRecID() const { return getRec().getObjectID().index; }\n " + MutableExtraCode: + includes: " + #include \n + #include \n + " + declaration: " + [[deprecated(\"use setSim() instead; this function does nothing\")]] + void setSimID(int) { }\n + [[deprecated(\"use setRec() instead; this function does nothing\")]] + void setRecID(int) { }\n + " edm4eic::MCRecoTrackParticleAssociation: Description: "Association between a Track and a MCParticle" @@ -568,6 +590,17 @@ datatypes: [[deprecated(\"use getRec().getObjectID().index instead\")]] int getRecID() const { return getRec().getObjectID().index; }\n " + MutableExtraCode: + includes: " + #include \n + #include \n + " + declaration: " + [[deprecated(\"use setSim() instead; this function does nothing\")]] + void setSimID(int) { }\n + [[deprecated(\"use setRec() instead; this function does nothing\")]] + void setRecID(int) { }\n + " edm4eic::MCRecoVertexParticleAssociation: Description: "Association between a Vertex and a MCParticle" @@ -588,6 +621,17 @@ datatypes: [[deprecated(\"use getRec().getObjectID().index instead\")]] int getRecID() const { return getRec().getObjectID().index; }\n " + MutableExtraCode: + includes: " + #include \n + #include \n + " + declaration: " + [[deprecated(\"use setSim() instead; this function does nothing\")]] + void setSimID(int) { }\n + [[deprecated(\"use setRec() instead; this function does nothing\")]] + void setRecID(int) { }\n + " edm4eic::MCRecoTrackerHitAssociation: Description: "Association between a RawTrackerHit and a SimTrackerHit"