Using C++ libraries

Hi everyone.

It just did not became clear to me if we can use c++ normal libraries when building our applications in Geant4 without generating later issues. As we use Geant4 variables such as G4floats, G4int, etc, I thought this might be an issue, but I could not find the G4 library for mathematical functions and I need to use the math function cosine and sine . So I added the #include “cmath” to the my code and used their functions. Is it a problem? What are the G4 equivalent for cmath? Thank you.

Yes, you can use all of the normal C++ libraries. The G4 types are defined in $G4INCLUDE/G4types.h, and they are simply typedefs.

1 Like