Skip to content

Commit

Permalink
Geant4RegexSensitivesConstruction: use regex_search so we do not have…
Browse files Browse the repository at this point in the history
… to fully match volume paths.

Speeds up by 50 percent the construction in fiber dual readout calorimeter with 580k volumes (108 s down to 68 s on my machine)
  • Loading branch information
andresailer committed Aug 9, 2024
1 parent 9f142b8 commit f0d9fcb
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion DDG4/plugins/Geant4RegexSensitivesConstruction.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -104,7 +104,7 @@ Geant4RegexSensitivesConstruction::collect_volumes(std::set<Volume>& volumes,
if( !path.empty() ) {
for( const auto& match : matches ) {
std::smatch sm;
bool stat = std::regex_match(path, sm, match);
bool stat = std::regex_search(path, sm, match);
if( stat ) {
volumes.insert(pv.volume());
++count;
Expand Down

0 comments on commit f0d9fcb

Please sign in to comment.