Skip to content
Snippets Groups Projects

eflowRec: Fix use of invalid iterators.

Merged Scott Snyder requested to merge ssnyder/athena:iter24.eflowRec-20241214 into 24.0
1 file
+ 3
8
Compare changes
  • Side-by-side
  • Inline
  • ce627cf4
    eflowRec: Fix use of invalid iterators. · ce627cf4
    sss authored
    annihilateCluster was looping though a vector, erasing each element in turn,
    in order to clear the vector.
    Not only is this ineffient, it ends up using invalid iterators.
    This was causing a crash with gcc15.
    Just change to using clear().
/*
Copyright (C) 2002-2022 CERN for the benefit of the ATLAS collaboration
Copyright (C) 2002-2024 CERN for the benefit of the ATLAS collaboration
*/
/*
@@ -91,13 +91,8 @@ Subtractor::annihilateCluster(xAOD::CaloCluster* cluster)
{
CaloClusterCellLink* theCellLink = cluster->getOwnCellLinks();
CaloClusterCellLink::iterator theFirstCell = theCellLink->begin();
CaloClusterCellLink::iterator theLastCell = theCellLink->end();
for (; theFirstCell != theLastCell; ++theFirstCell)
theCellLink->removeCell(theFirstCell);
theCellLink->clear();
cluster->setE(0.0);
cluster->setRawE(0.0);
CaloClusterKineHelper::calculateKine(cluster, true, true);
Loading