Message: Help on User Guide 7.2.4 - cannot get G4cout to write to log file Not Logged In (login)
 Next-in-Thread Next-in-Thread
 Next-in-Forum Next-in-Forum

Question Help on User Guide 7.2.4 - cannot get G4cout to write to log file 

Forum: Documentation and Examples
Date: 26 Jul, 2005
From: Blair Smith <bmsmith@lsu.edu>

Hi,

Not being the greatest C++ programmer I had trouble getting G4cout to write to a log file. This is possible according to the G4 User Guide section 7.2.4 but for the life of me I could not get it to work.

Is there some other way to send a session output to a file?

A while back a user suggested that I just use std::cout redirection, but I wanted to try to use G4cout if possible. But the insubstantial instruction in Section 7.2.4 just was not sufficient for me. When I tried making my own object (using my own class derived from G4UIsession) I could not make it into a G4UIterminal for an interactive mode session. So I tried deriving a second class, this time from G4UIterminal.

So I did everything Section 7.2.4 says to do, but this time in my derived class:

class CZTUIterminal : public G4UIterminal {

  // etc.,...

  // ReceiveG4cout and ReceiveG4cerr implemented to write to a log file.

}

But inheriting and using my own "CZTUIterminal" class like this proved too complicated, I could not get it to compile.

In main() I intended to try,

G4UIsession * loggedSession = new CZTUIterminal;

UI->SetCoutDestination(loggedSession);

loggedSession->SessionStart();

But since I could not compile my "CZTUIterminal" class this strategy has not worked.

Is there not some UI command to log a terminal session output?

If not then why not?

How do users routinely write log files or print tables?

Any help would be greatly appreciated.

Inline Depth:
 1 1
 All All
Outline Depth:
 1 1
 2 2
 All All
Add message: (add)

3 Idea: Re: Help on User Guide 7.2.4 - cannot get G4cout to write to log file   (bmsmith@lsu.edu - 26 Jul, 2005)
 Add Message Add Message
to: "Help on User Guide 7.2.4 - cannot get G4cout to write to log file"

 Subscribe Subscribe

This site runs SLAC HyperNews version 1.11-slac-98, derived from the original HyperNews


[ Geant 4 Home | Geant 4 HyperNews | Search | Request New Forum | Feedback ]