Message: loops with control/foreach Not Logged In (login)
 Next-in-Thread Next-in-Thread
 Next-in-Forum Next-in-Forum

Question loops with control/foreach 

Forum: Run Management
Date: 06 Nov, 2011
From: Rachel Black <Rachel Black>

Hi, So any help would be greatly appreciated on this. I'm trying to use the control/foreach and I've read the literature I could find from google but I'm not sure I have this. I have a histos.mac file and the command lines for the parameters I want to change(loop) are as follows:

#/testem/phys/addPhysics polarized
#/testem/phys/addPhysics standard
/polarization/volume/set theBox 0. 0. 0.
/gun/polarization 0. 0. -1.
/gun/particle gamma
/gun/energy 0.2 MeV
/testem/histo/setFileName pol01-gamma-polarized-0.2MeV

So I understand that I would have to change these command lines to set the variables, i.e.
/gun/energy/ {GunE} MeV
/gun/particle {ptype}
/testem/histo/setFileName {ptype}{GunE}{pysics}MeV

Then I have another file run.mac where I have the loops and this is where I get confused. I am not sure what's better to use the /control/foreach or /control/loop or if I can use both at once.

I have started with control/foreach:
control/foreach histos.mac ptype "e- gamma"
/control/foreach histos.mac physics "polarized standard".... I do not believe I can do this for the energy since there is no step size given for this command.

Can I do this loop for saving the file name so I have all the different names based on combinations? In principle I feel like I should be able to...

I'm not sure if this is correct? And also I was wondering if I could loop changing the polarization states for different combinations not sure if I can do this.
 Just trying to see if this is close to correct. And finally I would execute the run.mac file which would in turn execute the histos.mac file???
Thanks for any feedback.

 Add Message Add Message
to: "loops with control/foreach"

 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 ]