Batch simulation

Hey guys. I am a newer in Geant4 and I wrote a simple program recently. In this program I want to change the thickness of a model in the DetectorConstruction.cc for each run. I wonder that if I can write some thing in the run1.mac so that I don’t need to manually adjust the thickness and re-enter the command line “./exampleB1 run1.mac”(For example, I enter “./exampleB1 run1.mac” and there will be 50 run with different thickness.)
When I read B2b_run1.mac I see the command"/B2/det/setTargetMaterial". But I don’t know how to write a circle in run1.mac.

Looping like this was discussed a bit in this post: How to change the geometry in each loop? which should provide a good starting point.

As you want to modify the geometry between runs, the first thing to do is ensure your program supports changing the geometry between runs. See @mkelsey’s comments on the appropriate UI commands in that post on how to do this.

Thank you for your reply, I will study it ! :grinning: