Geant4 Simulation to ROOT file

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

  1. Released energy
  2. The PDG Id (I mean the number 11 for electrons, -11 for positrons, etc) of the particle relasing energy in the targets
  3. The kinetic energy of the particle releasing energy
  4. 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.

  1. The PDG Id of the outgoing particles
  2. The kinetic energy of the outgoing particles

At the moment:

  1. I simulated the 2 circular targets
  2. 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
Thank you

Yes, but that’s really a GEANT4 question.

I know it @couet…but as I wrote…in the Geant4 forum, the help team isn’t so active as you and the others ROOT help team are…so I wrote this topic hoping that here someone knows Geant4 too.

I understand the reason why your posted you question here. But that’s really a GEANT4 question. I will ask some people in the GEANT4 team.

I know it @couet, indeed, I opened the topic in the Geant4 forum, but really they don’t answer so much…otherwise, I really would never have opened this topic here! Then please, excuse me for that!
Yes, if you know someone of Geant4 team, please, ask them if they can help me to finish this simulation…! They can reply in the Geant4 forum topic!

Thank you

I just crossed check with my GEANT4 colleagues. They are answering your questions. One of your thread got 85 posts on the GEANT 4 forum ! You are in contact with Anna there. She is answering you including via private messages. So please keep the GEANT4 questions on the GEANT4 forum and the ROOT questions on the ROOT forum. Sometimes the distinction is not easy to do between GEANT4 and ROOT questions, but in this particular you are clearly making the difference !

Yes @couet I said you that I opened the post in the Geant4 forum…but in that forum the support don’t reply everyday as in the ROOT forum you do…(I think the ROOT forum is really more active than the Geant4 forum is). Anyway, now Anna just replied…so now I try to follow her help

You cannot compare the two forums. The ROOT forum has 10387 users whereas the Geant4 forum has 892. So it is normal you get faster answers on the ROOT forum simply because there is more users.

I’m sorry, I didn’t know there is so much difference between the users number in the 2 forum!

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.