diff --git a/LArCalorimeter/LArCalibTools/src/CaloCondBlob2Ntuple.cxx b/LArCalorimeter/LArCalibTools/src/CaloCondBlob2Ntuple.cxx index f18e89b974f7be65bc39f8f5766ed233def4ee49..e3f9ead31e41dd903b960cb360cb57b845fb5ce2 100644 --- a/LArCalorimeter/LArCalibTools/src/CaloCondBlob2Ntuple.cxx +++ b/LArCalorimeter/LArCalibTools/src/CaloCondBlob2Ntuple.cxx @@ -62,7 +62,7 @@ StatusCode CaloCondBlob2Ntuple::stop () { return StatusCode::SUCCESS; } - const CaloCondBlobFlt* condBlob=CaloCondBlobFlt::getInstance(blob); + std::unique_ptr<const CaloCondBlobFlt> condBlob (CaloCondBlobFlt::getInstance(blob)); ATH_MSG_INFO("Database folder has values for " << condBlob->getNChans() << " channels and " << condBlob->getNGains() << " gains."); diff --git a/LArCalorimeter/LArCalibTools/src/LArAutoCorrFromStdNtuple.cxx b/LArCalorimeter/LArCalibTools/src/LArAutoCorrFromStdNtuple.cxx index a3edaa584afc81c058dca1cc18cde19d847f2853..4241500eb2fef112b8630e9cb56b6ead9d1350bf 100755 --- a/LArCalorimeter/LArCalibTools/src/LArAutoCorrFromStdNtuple.cxx +++ b/LArCalorimeter/LArCalibTools/src/LArAutoCorrFromStdNtuple.cxx @@ -121,15 +121,15 @@ StatusCode LArAutoCorrFromStdNtuple::stop() outfit->SetBranchAddress("covr", covr); // Create new LArAutocorrContainer - LArAutoCorrComplete* larAutoCorrComplete = NULL ; - LArAutoCorrMC* larAutoCorrMC = NULL ; + std::unique_ptr<LArAutoCorrComplete> larAutoCorrComplete; + std::unique_ptr<LArAutoCorrMC> larAutoCorrMC; if(m_isComplete) { - larAutoCorrComplete = new LArAutoCorrComplete(); + larAutoCorrComplete = std::make_unique<LArAutoCorrComplete>(); ATH_CHECK( larAutoCorrComplete->setGroupingType(m_groupingType, msg()) ); ATH_CHECK( larAutoCorrComplete->initialize() ); } else { - larAutoCorrMC = new LArAutoCorrMC(); + larAutoCorrMC = std::make_unique<LArAutoCorrMC>(); ATH_CHECK( larAutoCorrMC->setGroupingType(m_groupingType, msg()) ); ATH_CHECK( larAutoCorrMC->initialize() ); } @@ -248,12 +248,10 @@ StatusCode LArAutoCorrFromStdNtuple::stop() } if(m_isComplete) { - ATH_CHECK( detStore()->record(larAutoCorrComplete,m_store_key) ); - ATH_CHECK( detStore()->symLink(larAutoCorrComplete,(ILArAutoCorr*)larAutoCorrComplete) ); + ATH_CHECK( detStore()->record(std::move(larAutoCorrComplete),m_store_key) ); } else { - ATH_CHECK( detStore()->record(larAutoCorrMC,m_store_key) ); - ATH_CHECK( detStore()->symLink(larAutoCorrMC,(ILArAutoCorr*)larAutoCorrMC) ); ATH_MSG_INFO ( "Stored container " << larAutoCorrMC->nGains() << "gains, " << larAutoCorrMC->totalNumberOfConditions() << " conditions, key: " << m_store_key ); + ATH_CHECK( detStore()->record(std::move(larAutoCorrMC),m_store_key) ); } return StatusCode::SUCCESS; diff --git a/LArCalorimeter/LArCalibTools/src/LArShapeFromStdNtuple.cxx b/LArCalorimeter/LArCalibTools/src/LArShapeFromStdNtuple.cxx index 392e929af00c1393a131cef0e405e29d220b22a6..b1f92f3e095ec3a971e15ba9c09e83ca4dc2cc05 100755 --- a/LArCalorimeter/LArCalibTools/src/LArShapeFromStdNtuple.cxx +++ b/LArCalorimeter/LArCalibTools/src/LArShapeFromStdNtuple.cxx @@ -94,15 +94,15 @@ StatusCode LArShapeFromStdNtuple::stop() Int_t prevPhase=-1; // Create new LArShapeContainer - LArShapeComplete* larShapeComplete = NULL ; - LArShape32MC* larShapeMC = NULL ; + std::unique_ptr<LArShapeComplete> larShapeComplete; + std::unique_ptr<LArShape32MC> larShapeMC; if(m_isComplete) { - larShapeComplete = new LArShapeComplete(); + larShapeComplete = std::make_unique<LArShapeComplete>(); ATH_CHECK( larShapeComplete->setGroupingType(m_groupingType, msg()) ); ATH_CHECK( larShapeComplete->initialize() ); } else { - larShapeMC = new LArShape32MC(); + larShapeMC = std::make_unique<LArShape32MC>(); ATH_CHECK( larShapeMC->setGroupingType(m_groupingType, msg()) ); ATH_CHECK( larShapeMC->initialize() ); } @@ -225,13 +225,10 @@ StatusCode LArShapeFromStdNtuple::stop() } } - const ILArShape* larShape = NULL ; if(m_isComplete) { - ATH_CHECK( detStore()->record(larShapeComplete,m_store_key) ); - ATH_CHECK( detStore()->symLink(larShapeComplete,larShape) ); + ATH_CHECK( detStore()->record(std::move(larShapeComplete),m_store_key) ); } else { - ATH_CHECK( detStore()->record(larShapeMC,m_store_key) ); - ATH_CHECK( detStore()->symLink(larShapeMC,larShape) ); + ATH_CHECK( detStore()->record(std::move(larShapeMC),m_store_key) ); } return StatusCode::SUCCESS; }