Modules/SdSimulation/G4StationSimulator/G4OutputHandler.h
Go to the documentation of this file.
1 #ifndef _G4StationSimulatorOG_G4OutputHandler_h_
2 #define _G4StationSimulatorOG_G4OutputHandler_h_
3 
4 #include <utl/ErrorLogger.h>
5 #include <G4UIsession.hh>
6 #include <G4UImanager.hh>
7 #include <G4String.hh>
8 #include <boost/algorithm/string/trim.hpp>
9 
10 
11 namespace G4StationSimulatorOG {
12 
20  class G4OutputHandler : public G4UIsession {
21 
22  public:
23  G4OutputHandler() { G4UImanager::GetUIpointer()->SetCoutDestination(this); }
24 
25  virtual ~G4OutputHandler() { G4UImanager::GetUIpointer()->SetCoutDestination(nullptr); }
26 
27  G4int
28  ReceiveG4cout(const G4String& str)
29  override
30  {
31  G4String s = str;
33  LOGG4COUT(s);
34  return 0;
35  }
36 
37  G4int
38  ReceiveG4cerr(const G4String& str)
39  override
40  {
41  G4String s = str;
42  boost::algorithm::trim_right(s);
43  LOGG4CERR(s);
44  return 0;
45  }
46 
47  };
48 
49 }
50 
51 
52 #endif
constexpr double s
Definition: AugerUnits.h:163

, generated on Tue Sep 26 2023.