Skip to content

Commit

Permalink
Rename MCParticle relations to particle
Browse files Browse the repository at this point in the history
Avoids clash with type-name
  • Loading branch information
tmadlener committed Jan 23, 2024
1 parent 132e62f commit ead35ff
Showing 1 changed file with 9 additions and 2 deletions.
11 changes: 9 additions & 2 deletions edm4hep.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -233,13 +233,14 @@ 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 <cmath>"
declaration: "
int32_t set_bit(int32_t val, int num, bool bitval){ return (val & ~(1<<num)) | (bitval << num); }\n
void setOverlay(bool val) { setQuality( set_bit( getQuality() , BITOverlay , val ) ) ; }\n
void setProducedBySecondary(bool val) { setQuality( set_bit( getQuality() , BITProducedBySecondary , val ) ) ; }\n
void setMCParticle(edm4hep::MCParticle particle) { setParticle(std::move(particle)); }\n
"
ExtraCode:
declaration: "
Expand All @@ -251,6 +252,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
"


Expand Down Expand Up @@ -540,7 +542,12 @@ 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:
declaration: "void setMCParticle(edm4hep::MCParticle particle) { setParticle(std::move(particle)); }\n"

ExtraCode:
declaration: "edm4hep::MCParticle getMCParticle() const { return getParticle(); }\n"

#---------- TrackerPulse
edm4hep::TrackerPulse:
Expand Down

0 comments on commit ead35ff

Please sign in to comment.