Skip to content

Commit

Permalink
SimG4SaveTrackerHits: Eliminate m_readoutNames from saveOutput method (
Browse files Browse the repository at this point in the history
  • Loading branch information
kjvbrt authored Oct 4, 2023
1 parent 3ae4c42 commit 3724bf9
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions SimG4Components/src/SimG4SaveTrackerHits.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -51,10 +51,11 @@ StatusCode SimG4SaveTrackerHits::initialize() {

if (!m_readoutNames.empty()) {
warning() << "Providing multiple readout names deprecated." << endmsg;
warning() << "Please use \"readoutName\" parameter instead." << endmsg;
warning() << "Please, use \"readoutName\" property instead." << endmsg;

if (m_readoutNames.size() > 1) {
error() << "More than one readout name provided. Exiting..." << endmsg;
return StatusCode::FAILURE;
}

m_readoutName = m_readoutNames[0];
Expand Down Expand Up @@ -97,7 +98,7 @@ StatusCode SimG4SaveTrackerHits::saveOutput(const G4Event& aEvent) {
edm4hep::SimTrackerHitCollection* edmHits = m_trackHits.createAndPut();
for (int iter_coll = 0; iter_coll < collections->GetNumberOfCollections(); iter_coll++) {
collect = collections->GetHC(iter_coll);
if (std::find(m_readoutNames.begin(), m_readoutNames.end(), collect->GetName()) != m_readoutNames.end()) {
if (m_readoutName == collect->GetName()) {
size_t n_hit = collect->GetSize();
verbose() << "\t" << n_hit << " hits are stored in a tracker collection #" << iter_coll << ": "
<< collect->GetName() << endmsg;
Expand Down

0 comments on commit 3724bf9

Please sign in to comment.