I am totally new to Geant4 and I’d like to apologize in advance for the very basic question I am about to ask.
I am building my simulations from ExampleB1 and I’m at a point where I want to simulate different particle gun energies in a single run and create/save an n-tuple for each of the energy. I have been doing the simulations individually but this takes a lot of time.
How can I specify the different energies and loop through each of them. Can multithreading the run solve this problem and how can I implement it for about 10 different energies?
The foreach loop works but I discovered that only the last n-tuple (i.e. 10240 keV in this case) has entries. I am guessing this may be due to an overwrite because of how my RunAction.cc is setup and needs to modified to create a distinct ntuple at each step. Here’s a snippet from the RunAction file:
Thank you SO much @weller That worked perfectly and I can’t really express how grateful I am. You have saved me a ton of time and I really appreciate it!
Future readers: Every response solves a specific problem but I could only mark one response as a solution.