Skip to content
Snippets Groups Projects

Add protection for duplicate index when cloning MCVertex

Merged Marco Cattaneo requested to merge protectDuplicateIndex into stripping21-patches
2 files
+ 5
9
Compare changes
  • Side-by-side
  • Inline
Files
2
// $Id: MCVertexCloner.cpp,v 1.6 2010-08-11 12:52:52 jpalac Exp $
// Include files
// from Gaudi
@@ -81,15 +80,15 @@ MCVertexCloner::cloneDecayProducts(const SmartRefVector<LHCb::MCParticle>& produ
if ( productClone )
{
productClone->setOriginVertex( clonedVertex );
clonedVertex->addToProducts( productClone );
const bool found = std::any_of( clonedVertex->products().begin(),
clonedVertex->products().end(),
[&productClone]( const SmartRef<LHCb::MCParticle> mcP )
{ return mcP.target() == productClone; } );
if ( !found ) { clonedVertex->addToProducts( productClone ); }
}
}
}
//=============================================================================
// Destructor
//=============================================================================
MCVertexCloner::~MCVertexCloner() {}
//=============================================================================
Loading