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 e72e1c9
Showing 1 changed file with 19 additions and 3 deletions.
22 changes: 19 additions & 3 deletions edm4hep.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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 <cmath>"
includes: "
#include <cmath>\n
#include <edm4hep/MCParticle.h>\n
"
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:
includes: "#include <edm4hep/MCParticle.h>\n"
declaration: "
static const int BITOverlay = 31;\n
static const int BITProducedBySecondary = 30;\n
Expand All @@ -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
"


Expand Down Expand Up @@ -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 <cmath>\n
#include <edm4hep/MCParticle.h>\n
"
declaration: "void setMCParticle(edm4hep::MCParticle particle) { setParticle(std::move(particle)); }\n"

ExtraCode:
includes: "#include <edm4hep/MCParticle.h>\n"
declaration: "edm4hep::MCParticle getMCParticle() const { return getParticle(); }\n"

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

0 comments on commit e72e1c9

Please sign in to comment.