diff --git a/Event/xAOD/xAODTruth/Root/TruthParticle_v1.cxx b/Event/xAOD/xAODTruth/Root/TruthParticle_v1.cxx index 7e16be88534f052331e6920d726413208902206b..5bcf5c77aab9d870061a17136bb2291e68d681f9 100644 --- a/Event/xAOD/xAODTruth/Root/TruthParticle_v1.cxx +++ b/Event/xAOD/xAODTruth/Root/TruthParticle_v1.cxx @@ -51,6 +51,11 @@ namespace xAOD { AUXSTORE_PRIMITIVE_SETTER_AND_GETTER( TruthParticle_v1, int, status, setStatus ) + /// For now just an alias to barcode() - this will change in the future + int TruthParticle_v1::id() const { + return barcode(); + } + // ///////////////////////////////////////////////////////////////////////////// diff --git a/Event/xAOD/xAODTruth/xAODTruth/versions/TruthParticle_v1.h b/Event/xAOD/xAODTruth/xAODTruth/versions/TruthParticle_v1.h index a7aef3e6c1fc07b70e5374ed72fd39cfc1e733df..08dbdae6a660f82a919d01172c96255f9b2a4523 100644 --- a/Event/xAOD/xAODTruth/xAODTruth/versions/TruthParticle_v1.h +++ b/Event/xAOD/xAODTruth/xAODTruth/versions/TruthParticle_v1.h @@ -63,6 +63,10 @@ namespace xAOD { /// Set barcode void setBarcode( int value ); + /// Unique ID + /// @note For now just an alias to barcode() - this will change in the future + int id() const; + /// Status code int status() const; /// Set status code diff --git a/Generators/GeneratorObjects/GeneratorObjects/HepMcParticleLink.h b/Generators/GeneratorObjects/GeneratorObjects/HepMcParticleLink.h index 66752817233ab53ff9e5a96e3adee493d4e61092..0bebe13a6a979f45dc42958e709cee76b66ec857 100644 --- a/Generators/GeneratorObjects/GeneratorObjects/HepMcParticleLink.h +++ b/Generators/GeneratorObjects/GeneratorObjects/HepMcParticleLink.h @@ -454,6 +454,13 @@ public: int barcode() const; + /** + * @brief Eventually return the id of the referenced GenParticle. For + * now just return barcode() + */ + int id() const; + + /** * @brief Return the event number of the referenced GenEvent. * 0 means the first GenEvent in the collection. diff --git a/Generators/GeneratorObjects/src/HepMcParticleLink.cxx b/Generators/GeneratorObjects/src/HepMcParticleLink.cxx index 9217a6a73f01c0ab1c5937821aeddcd2b774b4c8..6548eef9103243faf026af5c6d2b63c7f1d980da 100644 --- a/Generators/GeneratorObjects/src/HepMcParticleLink.cxx +++ b/Generators/GeneratorObjects/src/HepMcParticleLink.cxx @@ -201,6 +201,17 @@ HepMC::ConstGenParticlePtr HepMcParticleLink::cptr() const } +/** + * @brief Eventually return the id of the referenced GenParticle. For + * now just return barcode() + */ +int HepMcParticleLink::id() const +{ + // Placeholder: for now just return barcode() + return barcode(); +} + + /** * @brief Return the event number of the referenced GenEvent. * 0 means the first GenEvent in the collection. diff --git a/Generators/TruthUtils/TruthUtils/MagicNumbers.h b/Generators/TruthUtils/TruthUtils/MagicNumbers.h index 43b5518ccd77a83f32cc20cadb2c18b76affc188..58f072b267b1ca0c210f62950d285f226cfcb085 100644 --- a/Generators/TruthUtils/TruthUtils/MagicNumbers.h +++ b/Generators/TruthUtils/TruthUtils/MagicNumbers.h @@ -112,7 +112,7 @@ template <class T1,class T2> inline bool is_sim_descendant(const T1& p1,const T2& p2) { int b1 = barcode(p1); int b2 = barcode(p2); return b1 % SIM_REGENERATION_INCREMENT == b2;} #if defined(HEPMC3) -template <class T> inline int uniqueID(const T& p) { return barcode(p); } +template <class T> inline int uniqueID(const T& p) { return p->id(); } #else template <class T> inline int uniqueID(const T* p) { return barcode(p); } #endif