Time window for coincidence detection

Hello everyone
I am constructing a PET scanner made from NaI(Tl) scintillation detectors. This detector has a time resolution or time constant factor with it which I think I need to implement by defining time window for the detection (Kindly let me know if there is other method to do the same). I am using global time to store the time information but the values of global time are absurd in e+13 terms. What is the default unit of global time? How can I use it to compare between two hits?

Any answer will be highly appreciated.
Thank you so much

I also have simular question.

may be you can store the difference time about global time. I think you want to know the e+ time and e- time, so the value of( e+ time - global time) and vlalueo of(e- time -global time ) may be more important than global time.

Thank you for the reply @Ziyang_He .
I need the global time for the photons that hit the detectors. So for that I don’t know the units of time it gives. Could you explain in this regard?

Thank you so much

my teacher tells me the unit is ns for time


When using Geant4 the user is expected to always use units. You must divide your G4float by the unit you want the quantity to be displayed.

auto global_time = step->GetPostStepPoint()->GetGlobalTime();
G4cout << " Time in seconds " << global_time / s << G4endl;
G4cout << " Time in nanoseconds " << global_time / ns << G4endl;

P.S: If you look in the file /usr/include/Geant4/CLHEP/Units/SystemOfUnits.h you will see the following

  static constexpr double nanosecond  = 1.;
  static constexpr double second      = 1.e+9 *nanosecond;

so technically the teacher is right. However the teacher should have pointed out that the users are expected to use the units they want/need.

Thank you very much.

I have a similar problem about it.

Is there any way to achieve Flow intensity about beam, such as I need 20 na proton , lasting for 2 minutes in Geant4. Thanks

Geant4 events are primary-by-primary so you have to the homework yourself.

  • Just do the math and use that number as the amout of primaries to be used.

  • It is possible to have more than one primary but they are tracked one at a time, so there is no interference or anything like that. If you want to set up a (prompt) coincidences in your detectors is possible but you have to code it yourself.

Also, in case you would like to do some offline time (delay) pile-up analysis of sorts you may want to modify their initial time such that if you have, say 1 particle per second (1 Hz), the first particle starts with time 0s the second one with time 1s, etc… something like

  G4double rate = 1*Hz;
  G4double time= (G4double)(evn_ctr / rate);   // evn_ctr is the number of the event

This should work for both, G4GeneralParticleSource and G4GeneralParticleSource


Thank you very much
As you mentioned,I want to do some offline time analysis, but I don’t know how to do it (because the reaction will generate some long-lived nuclides)
To use this api , I think I can do it quickly.