Back to home page

Project CMSSW displayed by LXR

 
 

    


File indexing completed on 2024-04-06 12:30:13

0001 #ifndef SimG4Core_CustomUIsessionThreadPrefix_H
0002 #define SimG4Core_CustomUIsessionThreadPrefix_H
0003 
0004 #include "SimG4Core/Geometry/interface/CustomUIsession.h"
0005 
0006 /**
0007  * This class is intended for debugging of multithreaded simulation
0008  * when the amount of output is small to moderate. The output of
0009  * Geant4 is forwarded to MessageLogger as in CustomUIsession, but a
0010  * thread-specific prefix is added before each line of output. This
0011  * makes it easier to grab the output of a specific thread.
0012  */
0013 class CustomUIsessionThreadPrefix : public CustomUIsession {
0014 public:
0015   explicit CustomUIsessionThreadPrefix(const std::string& threadPrefix, int threadId);
0016   ~CustomUIsessionThreadPrefix() override;
0017 
0018   G4int ReceiveG4cout(const G4String& coutString) override;
0019   G4int ReceiveG4cerr(const G4String& cerrString) override;
0020 
0021 private:
0022   const std::string m_threadPrefix;
0023 };
0024 
0025 #endif