Message: Running multiple runs in a loop Not Logged In (login)
 Next-in-Thread Next-in-Thread
 Next-in-Forum Next-in-Forum

Question Running multiple runs in a loop 

Forum: Run Management
Date: 11 Oct, 2015
From: Leonardo Ghizoni <Leonardo Ghizoni>

Hello,

I'm running a couple of validation simulations, so I can later simulate a more complex system. I'm simulating the stopping power of protons and electrons on materials and the results are all in agreement with NIST data. For that, I throw 1.000 beam electron or proton for an interval of energies and calculate the stopping power. I just want to automatize my simulation...currently, I have a lot of macros on the following way:

/gps/particle e-

/gps/energy 4 MeV

/gps/position -410. 0. 0. m

/gps/direction 1. 0. 0.

/run/beamOn 1000

And I just change the energy. I have 37 macros for the energies I want. To run all these at once, I created a sh. file:

for ((k=1;k<=9;k++))
do
   printf "./SCD run%d0keV.mac > Reports/run%d0keV.txt" $k $k | "sh"
   printf "./SCD run%d00keV.mac > Reports/run%d00keV.txt" $k $k | "sh"
   printf "./SCD run%dMeV.mac > Reports/run%dMeV.txt" $k $k | "sh"
   printf "./SCD run%d0MeV.mac > Reports/run%d0MeV.txt" $k $k | "sh"
done

My question is how do I create a loop in Geant4 syntax so I can run 1.000 beam for each of the energies and don't have to keep editing each one.

Thank you very much.

Leonardo.

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

1 None: Re: Running multiple runs in a loop   (Hilary Byrne - 23 Feb, 2016)
 Add Message Add Message
to: "Running multiple runs in a loop"

 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 ]