Message: Re: How to create ASCII output? Not Logged In (login)
 Next-in-Thread Next-in-Thread
 Next-in-Forum Next-in-Forum

None Re: How to create ASCII output? 

Keywords: ASCII
Forum: (Graphical) User Interfaces
Re: None How to create ASCII output? (Anil)
Date: 14 Dec, 2007
From: John Allison <John Allison>

Anything you write to G4cout, e.g.,

  G4cout << "Hello" << G4endl;

goes to the UI terminal. If you have specified G4UIterminal, this is the normal terminal from which you start your Geant4 job. In principle, therefore, you can capture the output with

  $ script
  $ exampleN02
  $ exit

(See "man script" for the manual that explains how script works.)

However, if, like me, you want particular information in a separate file, in your BeginOfRunAction you could open a file, then in your EndOfEventAction, write something to it, then close it in your EndOfRunAction. I have an "analysis manager" that handles the file opening, writing and closing as required by the above actions; the analysis manager is a "singleton" that simplyfies access from the different action classes. How to create actions is described in the documentation. examples/extended/analysis/A01 shows how to make a singleton analysis manager, It uses AIDA, but you could just use a file.

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

1 None: Re: How to create ASCII output?   (David Oxley - 16 Dec, 2007)
(_ None: Re: How to create ASCII output?   (John Allison - 16 Dec, 2007)
(_ None: Re: How to create ASCII output?   (David Oxley - 17 Dec, 2007)
(_ None: Re: How to create ASCII output?   (Anil - 02 Feb, 2008)
 Add Message Add Message
to: "Re: How to create ASCII output?"

 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 ]