CMS 3D CMS Logo

CustomUIsession.h
Go to the documentation of this file.
1 #ifndef SimG4Core_CustomUIsession_H
2 #define SimG4Core_CustomUIsession_H
3 
4 #include "G4UIsession.hh"
5 #include "G4UImanager.hh"
6 
8 
9 //#include <iostream>
10 //#include <iomanip>
11 #include <fstream>
12 
13 class CustomUIsession : public G4UIsession {
14 public:
16  ~CustomUIsession() override;
17 
18  G4int ReceiveG4cout(const G4String& coutString) override;
19  G4int ReceiveG4cerr(const G4String& cerrString) override;
20 
21  void sendToFile(std::ofstream*);
22  inline void stopSendToFile() { fout = nullptr; }
23 
24 protected:
26 
27 private:
28  std::ofstream* fout;
29 };
30 
31 #endif
MessageLogger.h
CustomUIsession::ReceiveG4cout
G4int ReceiveG4cout(const G4String &coutString) override
Definition: CustomUIsession.cc:13
CustomUIsession::trim
std::string trim(const std::string &str)
Definition: CustomUIsession.cc:29
CustomUIsession::CustomUIsession
CustomUIsession()
Definition: CustomUIsession.cc:3
str
#define str(s)
Definition: TestProcessor.cc:51
CustomUIsession::stopSendToFile
void stopSendToFile()
Definition: CustomUIsession.h:22
AlCaHLTBitMon_QueryRunRegistry.string
string
Definition: AlCaHLTBitMon_QueryRunRegistry.py:256
CustomUIsession::~CustomUIsession
~CustomUIsession() override
Definition: CustomUIsession.cc:8
CustomUIsession
Definition: CustomUIsession.h:13
CustomUIsession::sendToFile
void sendToFile(std::ofstream *)
Definition: CustomUIsession.cc:35
CustomUIsession::ReceiveG4cerr
G4int ReceiveG4cerr(const G4String &cerrString) override
Definition: CustomUIsession.cc:23
CustomUIsession::fout
std::ofstream * fout
Definition: CustomUIsession.h:28