Hello, I know that this isn’t the Geant4 help forum and I also know the Geant4 help forum` but, unfortunately, it isn’t so active as the ROOT forum is; so please, is there someone able to use Geant4?
I’m writing my first simulation program in Geant and I’ve to finish it asap otherwise, I can’t do simulations and I need them to be admitted to next PhD year.
I have to simulate a positron beam 45GeV hitting 2 circular targets, each one having diameter d=1.5cm, thickness 3mm and a distance between them 2cm. I have to store in a ROOT file
- Released energy
- The PDG Id (I mean the number 11 for electrons, -11 for positrons, etc) of the particle relasing energy in the targets
- The kinetic energy of the particle releasing energy
- The directions of the particle releasing energy.
Moreover, I want to store also information about the outgoing particles from the second target (to see which particles I produce) i.e.
- The PDG Id of the outgoing particles
- The kinetic energy of the outgoing particles
At the moment:
- I simulated the 2 circular targets
- I created the Ntuple to store in the ROOT file to store the information about the released energy inside the two targets and about the particles that relase this energy! But I’ve a problem
By the verbosity tracker I read there are 7 steps in the first target and 7 in the second one, but when I open the ROOT event and I plot the released energy, I read 12 events in the target 1 and 12 events in the target 2! To get just 7 events, I tried to move the lines
analysisManager->FillNtupleDColumn(0,5, fEdep); analysisManager->FillNtupleDColumn(1,5, fEdep2Tar);
from the B1EventAction.cc to the B1SteppingAction.cc , but in this way I get 7 events (according to the tracking verbosity) but plotting the released energy I get a released energy 0 GeV (instead if these lines are in the B1EventAction, I get no zero energy).
Please, can someone help me to solve this problem and to finish the simulation program?
This is the simulation B1.zip (269.3 KB)
Notice that I run by using the macro run1.mac