diff --git a/Reconstruction/egamma/egammaAlgs/src/electronSuperClusterBuilder.cxx b/Reconstruction/egamma/egammaAlgs/src/electronSuperClusterBuilder.cxx index 927f46c806f56ae6692d4b946ec18064070fd53a..9f2356a698a2d50a5939de578cb338fbc2d6efb6 100644 --- a/Reconstruction/egamma/egammaAlgs/src/electronSuperClusterBuilder.cxx +++ b/Reconstruction/egamma/egammaAlgs/src/electronSuperClusterBuilder.cxx @@ -187,16 +187,16 @@ StatusCode electronSuperClusterBuilder::execute(){ // ////////////////////////////////////////////////////////////////// //Push back the new cluster into the output container. - outputClusterContainer->push_back(newClus.release()); + outputClusterContainer->push_back(std::move(newClus)); ElementLink< xAOD::CaloClusterContainer > clusterLink(*outputClusterContainer, outputClusterContainer->size() - 1); std::vector< ElementLink<xAOD::CaloClusterContainer> > elClusters {clusterLink}; // //////////////////////////////////////////////////////////////////// //Make egammaRec object, and push it back into output container. - egammaRec *newEgRec = new egammaRec(*egRec); + auto newEgRec = std::make_unique<egammaRec>(*egRec); if (newEgRec) { newEgRec->setCaloClusters (elClusters); - newEgammaRecs->push_back(newEgRec); + newEgammaRecs->push_back(std::move(newEgRec)); ATH_MSG_DEBUG("Made new egammaRec object"); } else { ATH_MSG_FATAL("Couldn't make an egammaRec object"); diff --git a/Reconstruction/egamma/egammaAlgs/src/photonSuperClusterBuilder.cxx b/Reconstruction/egamma/egammaAlgs/src/photonSuperClusterBuilder.cxx index ac8c98da33324a095c118e535b730df85410f33e..59b01bce62d7fceb9b2d08a70bb1412bb6fedc5f 100644 --- a/Reconstruction/egamma/egammaAlgs/src/photonSuperClusterBuilder.cxx +++ b/Reconstruction/egamma/egammaAlgs/src/photonSuperClusterBuilder.cxx @@ -151,7 +151,7 @@ StatusCode photonSuperClusterBuilder::execute(){ ATH_MSG_DEBUG("extra clusters: " << nExtraClusters); //push back the new photon super cluster - outputClusterContainer->push_back(newCluster.release()); + outputClusterContainer->push_back(std::move(newCluster)); //Add the cluster link to the super cluster ElementLink< xAOD::CaloClusterContainer > clusterLink(*outputClusterContainer, outputClusterContainer->size() - 1); @@ -159,11 +159,11 @@ StatusCode photonSuperClusterBuilder::execute(){ /////////////////////////////////////////////////////// //Now create the new eg Rec - egammaRec *newEgRec = new egammaRec(*egRec); + auto newEgRec = std::make_unique<egammaRec>(*egRec); if (newEgRec) { newEgRec->setCaloClusters(phCluster); //push it back - newEgammaRecs->push_back(newEgRec); + newEgammaRecs->push_back(std::move(newEgRec)); ATH_MSG_DEBUG("Finished making photon egammaRec object"); } else { ATH_MSG_FATAL("Couldn't make an egammaRec object");