Skip to content
Snippets Groups Projects
Commit 47625e75 authored by Adam Edward Barton's avatar Adam Edward Barton
Browse files

Merge branch 'ATLASRECTS-6001' into 'master'

Terminate execute method if collection is empty

Closes ATLASRECTS-6001

See merge request atlas/athena!41883
parents 253d8348 ebbe3a3a
No related branches found
No related tags found
No related merge requests found
......@@ -52,13 +52,22 @@ namespace Muon {
return StatusCode::SUCCESS;
}
if(!muonTruthSegments.isValid()){
ATH_MSG_WARNING("Muon truth segments not valid");
ATH_MSG_ERROR("Muon truth segments not valid");
return StatusCode::FAILURE;
}
if(!segments.isValid()){
ATH_MSG_WARNING("Muon segments not valid");
ATH_MSG_ERROR("Muon segments not valid");
return StatusCode::FAILURE;
}
SG::ReadHandle<TrackRecordCollection> truthTrackCol(m_trackRecord);
if (!truthTrackCol.isValid()){
ATH_MSG_ERROR("Track collection "<<m_trackRecord.key()<<" is not present");
return StatusCode::FAILURE;
}
if (truthTrackCol.cptr()->empty()){
ATH_MSG_DEBUG("Track collection "<<m_trackRecord.key()<<" is empty. Skip the rest of the alg");
return StatusCode::SUCCESS;
}
std::string truthSegmentContainerName=m_muonTruthSegmentContainerName.key();
int ppos=truthSegmentContainerName.find(".");
......@@ -85,7 +94,6 @@ namespace Muon {
++segIndex;
}
SG::ReadHandle<TrackRecordCollection> truthTrackCol(m_trackRecord);
SG::ReadHandle<McEventCollection> mcEventCollection(m_mcEventColl);
std::vector<const MuonSimDataCollection*> muonSimData;
for(SG::ReadHandle<MuonSimDataCollection>& simDataMap : m_muonSimData.makeHandles()){
......
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