Skip to content

Commit

Permalink
Move ExtraCode into yaml file
Browse files Browse the repository at this point in the history
  • Loading branch information
tmadlener committed Jul 29, 2024
1 parent 3d235a8 commit 46065fd
Show file tree
Hide file tree
Showing 3 changed files with 40 additions and 29 deletions.
59 changes: 40 additions & 19 deletions edm4hep.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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
Expand All @@ -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
Expand All @@ -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
Expand All @@ -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
Expand All @@ -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
Expand All @@ -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
Expand Down
7 changes: 0 additions & 7 deletions edm4hep/extra_code/LinkGetters.cc.ipp

This file was deleted.

3 changes: 0 additions & 3 deletions edm4hep/extra_code/LinkGetters.h.ipp

This file was deleted.

0 comments on commit 46065fd

Please sign in to comment.