Skip to content
Snippets Groups Projects
Commit 1c8c2b67 authored by Johannes Junggeburth's avatar Johannes Junggeburth :dog2:
Browse files

Switch towards smart pointers

parent eaa67d33
4 merge requests!58791DataQualityConfigurations: Modify L1Calo config for web display,!46784MuonCondInterface: Enable thread-safety checking.,!46776Updated LArMonitoring config file for WD to match new files produced using MT,!42200Muon clean up - Remove hardcoded station numbers where possible
......@@ -165,7 +165,7 @@ private:
const RpcIdHelper* m_idHelper{};
RpcHitIdHelper* m_muonHelper{};
std::list<RPCSimHitCollection*> m_RPCHitCollList;
TimedHitCollection<RPCSimHit>* m_thpcRPC{};
std::unique_ptr<TimedHitCollection<RPCSimHit>> m_thpcRPC{};
SG::ReadCondHandleKey<RpcCondDbData> m_readKey{this, "ReadKey", "RpcCondDbData", "Key of RpcCondDbData"};
std::map<Identifier,std::vector<MuonSimData::Deposit> > m_sdo_tmp_map;
Gaudi::Property<int> m_deadTime{this, "DeadTime", 100. , "dead time"};
......
......@@ -285,7 +285,7 @@ StatusCode RpcDigitizationTool::prepareEvent(const EventContext& /*ctx*/, unsign
//John's Hacks START
m_RPCHitCollList.clear();
m_thpcRPC = new TimedHitCollection<RPCSimHit>();
m_thpcRPC =std::make_unique<TimedHitCollection<RPCSimHit>>();
//John's Hacks END
return StatusCode::SUCCESS;
......@@ -343,7 +343,7 @@ StatusCode RpcDigitizationTool::getNextEvent(const EventContext& ctx)
ATH_MSG_DEBUG ( "RpcDigitizationTool::getNextEvent()" );
// initialize pointer
m_thpcRPC = nullptr;
m_thpcRPC.reset();
// get the container(s)
typedef PileUpMergeSvc::TimedList<RPCSimHitCollection>::type TimedHitCollList;
......@@ -357,7 +357,7 @@ StatusCode RpcDigitizationTool::getNextEvent(const EventContext& ctx)
}
// create a new hits collection
m_thpcRPC = new TimedHitCollection<RPCSimHit>{1};
m_thpcRPC = std::make_unique<TimedHitCollection<RPCSimHit>>(1);;
m_thpcRPC->insert(0, hitCollection.cptr());
ATH_MSG_DEBUG("RPCSimHitCollection found with " << hitCollection->size() << " hits");
......@@ -379,7 +379,7 @@ StatusCode RpcDigitizationTool::getNextEvent(const EventContext& ctx)
}
// create a new hits collection
m_thpcRPC = new TimedHitCollection<RPCSimHit>() ;
m_thpcRPC = std::make_unique<TimedHitCollection<RPCSimHit>>() ;
//now merge all collections into one
TimedHitCollList::iterator iColl(hitCollList.begin());
......@@ -468,7 +468,7 @@ StatusCode RpcDigitizationTool::processAllSubEvents(const EventContext& ctx) {
m_sdo_tmp_map.clear();
/////////////////////////
if (0 == m_thpcRPC ) {
if (!m_thpcRPC ) {
status = getNextEvent(ctx);
if (StatusCode::FAILURE == status) {
ATH_MSG_INFO ( "There are no RPC hits in this event" );
......@@ -494,7 +494,7 @@ StatusCode RpcDigitizationTool::doDigitization(const EventContext& ctx, RpcDigit
int nKilledStrips = 0;
int nToBeKilledStrips = 0;
RPCSimHitCollection* inputSimHitColl=NULL;
RPCSimHitCollection* inputSimHitColl=nullptr;
if (m_validationSetup)
{
......@@ -936,10 +936,7 @@ StatusCode RpcDigitizationTool::doDigitization(const EventContext& ctx, RpcDigit
}// loop to suppress digits too close in time ended
// reset the pointer if it not null
if (m_thpcRPC) {
delete m_thpcRPC;
m_thpcRPC=0;
}
m_thpcRPC.reset();
ATH_MSG_DEBUG ("EndOf Digitize() n. of strips Killed (dead) in the DB = "<<nKilledStrips<<" ("<<nToBeKilledStrips<<")");
return StatusCode::SUCCESS;
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment