diff --git a/Event/MCEvent/include/Event/MCVertex.h b/Event/MCEvent/include/Event/MCVertex.h index 4123dd29b7a298db2bedfee5bcd586ea2342f9af..2e6afc363e05aece05d1ea85f33c81caef29b3da 100644 --- a/Event/MCEvent/include/Event/MCVertex.h +++ b/Event/MCEvent/include/Event/MCVertex.h @@ -80,8 +80,8 @@ namespace LHCb { }; friend std::ostream& operator<<( std::ostream&, MCVertexType ); - /// Copy Constructor - MCVertex( const LHCb::MCVertex* right ) + /// BUGGY not-a-Copy Constructor + [[deprecated]] explicit MCVertex( const LHCb::MCVertex* right ) : KeyedObject<int>() // note: key is _not_ copied... , m_position( right->position() ) , m_time( right->time() ) @@ -89,6 +89,15 @@ namespace LHCb { , m_mother( right->mother() ) , m_products( right->products() ) {} + // Copy Constructor + MCVertex( const LHCb::MCVertex& right ) + : KeyedObject<int>() // note: key is _not_ copied... + , m_position( right.position() ) + , m_time( right.time() ) + , m_type( right.type() ) + , m_mother( right.mother() ) + , m_products( right.products() ) {} + /// Default Constructor MCVertex() = default; @@ -97,11 +106,11 @@ namespace LHCb { static const CLID& classID() { return CLID_MCVertex; } /// Clone this MCVertex. Returns a pointer to a new MCVertex (user must take ownership) - [[nodiscard]] MCVertex* clone() const { return new LHCb::MCVertex( this ); } + [[nodiscard]] MCVertex* clone() const { return new LHCb::MCVertex( *this ); } /// Clone this MCVertex including key. Returns a pointer to a new MCVertex (user must take ownership) [[nodiscard]] MCVertex* cloneWithKey() const { - auto* clone = new LHCb::MCVertex( this ); + auto* clone = new LHCb::MCVertex( *this ); clone->setKey( key() ); return clone; }