How to understand the code: gun->SetParticleTime

void myPrimaryGeneratorAction::GeneratePrimaries(G4Event *anEvent)

double Time = 10;
fParticleGun->SetParticleTime(Time );


i do not understand the sentence :fParticleGun->SetParticleTime(Time );

how to explain the meaning , thanks !

  1. You should be using units with your time variable.
  2. SetParticleTime assigns the value you give it to the starting time of the particle (i.e., of the event). Everything else will be assigned timestamps after that value.

i get it , and thank you very much!