Skip to content
Snippets Groups Projects
Commit cb93a6b4 authored by Walter Lampl's avatar Walter Lampl
Browse files

Merge branch 'HepMCuniqueID_main' into 'main'

HepMC::uniqueID should return id rather than barcode for HepMC3.

See merge request atlas/athena!69737
parents b603ae37 2517d6cb
No related branches found
No related tags found
No related merge requests found
......@@ -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();
}
//
/////////////////////////////////////////////////////////////////////////////
......
......@@ -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
......
......@@ -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.
......
......@@ -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.
......
......@@ -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
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment