Hello everyone ,
currently i’m trying to run a simulation with a source of particles (e-), which i want to customize as following steps, pulses of 1 us width and frequency of 100 Hz,
I have look up to many doncumentation, nothing was found to reggarding the frequency and pulses duration on GEANT4.
Geant4 doesn’t operate that way. Each event is a separate entity, caused by one incident particle, like an electron. If your readout system is slow enough that each of your 1 us pulses appears as “one event”, then you can generate N primary electrons and have them all interact in the same event.
If you wanted to get really fancy, you could write your own custom PrimaryGeneratorAction, throw a random time (flat, Gaussian, whatever you like) in a window from 0 to 1 us, and assign that time to one of the N primary electrons. If you record the time of hits via your SD into an N-tuple, then you can look at temporal distributions in your analysis.
As for the pulse frequency, Geant4 neither knows nor cares about that. It knows and reports the number of events you generated. You need to translate that into real world information (number of pulses, incident dose/energy, whatever).
thank you mkelsey for your replay,
when i didn’t found anything related pulses or time frequency, i expected that geant4 doesn’t operat like that, so if i get it write, i can creat PrimaryGeneratorAction with radom distribution by specifing a time window (even i don’t know how to do it) and assign it to the primaries , and for the frequency how can translate the events to inciden dose for example .
In Geant4, you can set a time_zero to an event.
See examples/extended/radioactivedecay/Activation : PrimaryGeneratorAction.cc, line 105
Thank you maire for the seggustion,
bassicaly my goual is to acheave higher doses, thats why i want to deliever primeries into pulses, with highier frequency, i can do it with geant4 ,???
Hej,
since there is no concept of pulses/intensity in Geant4, we only know event-by-event, what you can do is to add a time profile to your initial particles which then you can store and use at a later stage in analysis to group them together and get what you want.
hello Pico, thank you, My appreciation, could you please elaborate more on how I can do it, an example which adapting similar things
So, I’ m thinking something as follows:
- Running the simulation where your primaries have a defined time structure, something like: 3 primaries with starting time 0s, 1 particle with starting time 1s, 3 particles with starting time 2s, … this in a sense mimics a “pulsating” source
- Store the hits/digits into a outfile file, CSV, ROOT, etc.
Once you are done with the simulation you can analyze the stored hits in the output file, something like:
- read the hits one-by-one. By construction we made them in ascending time order so this is easy.
- if the time of the hits is within 1s (for this example) they belong to the same pulse and can be threated as such, maybe added them together, or whatever else you have in mind like producing a picture.
Creating your own time profile is relatively simple using the ParticleGun. If you use the General Particle Source you can sample for time profiles… in this case however the output file will not be time ordered so an additional step of time ordering the output file might be needed.
Have fun,
/Pico