From ff49a5ae81d5ec34c065e81b3a9d196aefe85837 Mon Sep 17 00:00:00 2001 From: tmadlener Date: Tue, 23 Jan 2024 13:48:02 +0100 Subject: [PATCH] Rename MCParticle relations to particle Avoids clash with type-name --- edm4hep.yaml | 22 +++++++++++++++++++--- 1 file changed, 19 insertions(+), 3 deletions(-) diff --git a/edm4hep.yaml b/edm4hep.yaml index 14cd2983f..db960e9c3 100644 --- a/edm4hep.yaml +++ b/edm4hep.yaml @@ -233,15 +233,20 @@ datatypes: - edm4hep::Vector3d position //the hit position in [mm]. - edm4hep::Vector3f momentum //the 3-momentum of the particle at the hits position in [GeV] OneToOneRelations: - - edm4hep::MCParticle MCParticle //MCParticle that caused the hit. + - edm4hep::MCParticle particle //MCParticle that caused the hit. MutableExtraCode: - includes: "#include " + includes: " + #include \n + #include \n + " declaration: " int32_t set_bit(int32_t val, int num, bool bitval){ return (val & ~(1<\n" declaration: " static const int BITOverlay = 31;\n static const int BITProducedBySecondary = 30;\n @@ -251,6 +256,7 @@ datatypes: double y() const {return getPosition()[1];}\n double z() const {return getPosition()[2];}\n double rho() const {return sqrt(x()*x() + y()*y());}\n + edm4hep::MCParticle getMCParticle() const { return getParticle(); }\n " @@ -540,7 +546,17 @@ datatypes: - float pulseTime //the pulse's time in the lab frame [ns]. - float pulseAmplitude //the pulse's amplitude [fC]. OneToOneRelations: - - edm4hep::MCParticle MCParticle //the particle that caused the ionizing collisions. + - edm4hep::MCParticle particle //the particle that caused the ionizing collisions. + MutableExtraCode: + includes: " + #include \n + #include \n + " + declaration: "void setMCParticle(edm4hep::MCParticle particle) { setParticle(std::move(particle)); }\n" + + ExtraCode: + includes: "#include \n" + declaration: "edm4hep::MCParticle getMCParticle() const { return getParticle(); }\n" #---------- TrackerPulse edm4hep::TrackerPulse: