Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

SimG4SaveTrackerHits: Eliminate m_readoutNames from saveOutput method #52

Merged
merged 1 commit into from
Oct 4, 2023
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading