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
Fixed Sim exceptions and printouts #14550
Conversation
A new Pull Request was created by @civanch (Vladimir Ivantchenko) for CMSSW_8_1_X. It involves the following packages: SimG4Core/Generators @cmsbuild, @civanch, @mdhildreth, @davidlange6 can you please review it and eventually sign? Thanks. cms-bot commands are list here #13028 |
please test |
+1 |
The tests are being triggered in jenkins. |
This pull request is fully signed and it will be integrated in one of the next CMSSW_8_1_X IBs after it passes the integration tests. This pull request requires discussion in the ORP meeting before it's merged. @slava77, @davidlange6, @Degano, @smuzaffar |
@@ -119,13 +118,9 @@ void SensitiveDetector::NaNTrap( G4Step* aStep ) | |||
edm::isNotFinite(xyz[0]) != 0 || edm::isNotFinite(xyz[1]) != 0 || | |||
edm::isNotFinite(xyz[2]) != 0 ) | |||
{ | |||
std::cout << " NaN detected in volume " << NameOfVol << std::endl ; | |||
throw SimG4Exception( "SimG4CoreSensitiveDetector: Corrupted Event - NaN detected (3-momentum)" ) ; | |||
throw SimG4Exception( "SimG4CoreSensitiveDetector: Corrupted Event - NaN detected (3-momentum) in volume " + NameOfVol); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@civanch - why leave a SimG4Exception in places while you remove it (using a cms::Exception) elsewhere?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@davidlange6 , because it is within Geant4 event loop it is useful to apply SimG4Exception, I change this file only in order to remove cout.
@davidlange6 , here the same approach is implemented as in the base classes of SimG4Core: SimG4Exception is used only within event loop in classes called by Geant4. SimG4Exception is removed from beginRun, endRun and calls outside Geant4 event loop. |
+1 |
Substitute G4cout by edm::LogInfo in Generator.
Substitute SimG4Exceptions by cms::Exception at initialisation.
Minor code clean-up.