Message: Re: Automatically run example N06 for multiple energies Not Logged In (login)
 Next-in-Thread Next-in-Thread
 Next-in-Forum Next-in-Forum

None Re: Automatically run example N06 for multiple energies 

Forum: Run Management
Re: Question Automatically run example N06 for multiple energies (Brian)
Date: 02 Oct, 2014
From: Makoto Asai <Makoto Asai>

You can do all you want by a few built-in UI commands.
Assuming the default file name as "output.dat", what you should do is the following.

Create a macro file (let's say "singleRun.mac") that contains just three lines

/gun/evergy {eKin} MeV
/run/beamOn 100000
/control/shell mv output.dat output_{eKin}.dat

N.B. 100000 could be any number of events you need for each primary energy.

Then, either on the interactive terminal or in the another macro, execute one UI command.

/control/loop singleRun.mac eKin 10 100 5

N.B. This loop command execute the macro file "singleRun.mac" with changing the value of an alias "eKin" from the initial value (10 in above case) to the final value (100) with the increment (5).

You may find some more description of alias and loop command at, for example, pages 8-9 of User Interface #1 presentation in the recent SLAC Geant4 tutorial.
http://geant4.slac.stanford.edu/SLACTutorial14/UserInterface1.pdf

 Add Message Add Message
to: "Re: Automatically run example N06 for multiple energies"

 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 ]