Dear Allpix Squared expert:
The emission rate of photons from source can typically be approximated by a Poisson distribution, that is, P(X = k) = \frac{\lambda^k e^{-\lambda}}{k!}. How should I use Allpix Squared to adjust the value of \lambda, which represents the average rate of photon emission over a period of time? Are there any parameters related to it?
Thank you very much!
lincy
Dear @lincy,
I presume you are using DepositionGeant4
or similar, using Geant4 as the tracking code. By default, individual events are considered independent and just one particle per event is generated. What you could do is to define your own Geant4 particle source and put that into a macro which you load as source.
Alternatively, you could simulate one particle per event and combine them appropriately afterwards if this is something your application allows.
Best,
Simon
Hi!
Joining in cause i was having a similar problem. So if i understand correctly allpix environment does not “care” about the source activity, intensity or emission rate depending on the case, because it will simulate one event (one particle) at a time.
If then i need to, for example, determine if there are time coincidences in my detector i can combine afterwards the interactions from different events, knowing the relative time in each event + the activity, intensity or emission rate of my source, right?
Bests
Luca
Correct - to phrase it differently, right now, the simulated events do not share a common clock but are independent in time.
If it is a necessity to include this already at an early stage to simulate e.g. occupancy-limited situations, this is certainly something we would be open to work on or guide contributors in.
Best,
Simon
Dear allpix squared experts:
I am trying to define my own geant4 particle source, but have not found any direct command about the activity, intensity or emission rate of source at Geant4 particle source, all of which are about the position, energy, direction… of the source.
Is this because i missed something? Are there other ways to control the emission rate of source?
I would greatly appreciate it if you could provide more detailed guidance.
Best,
Lincy
Hi @lincy
I am no expert but i have been playing a bit around with it. I think what you are looking for could be related to table 3 in the linked Geant4 page you sent.
For example from my playing around i did
# Point Source 1
/gps/source/intensity 5.
/gps/particle gamma
/gps/pos/type Point
/gps/pos/centre 0.0 0.0 100.0 mm
/gps/ene/type Mono
/gps/ene/mono 511 keV
/gps/ang/type iso
# Point Source 2
/gps/source/add 10.
/gps/particle gamma
/gps/pos/type Point
/gps/pos/centre 50.0 0.0 100.0 mm
/gps/ene/type Mono
/gps/ene/mono 511 keV
/gps/ang/type iso
to define 2 sources with different activity. In the first source you specify the intensity and in the second, third or so on you use the command
/gps/source/add 10.
To specify its intensity. This way when you will run allpix and ask to have 1000 events, the second source in the example will emit twice as many events as the first one (so emitting around 666 events while the first emits 333). This gives you the correct proportion of events between the two sources but still each event is then simulated by allpix independently in time (meaning that the clock in each event starts from 0ns).
In the case you want to have only one source, you could also specify its intensity as in the example but allpix would still simulates each event independently as previously mentioned in the discussion.
Therefore in the case in which you are interested in using the information on the intensity to put a relation between interactions of different events the best thing to do in my opinion would be to combine events afterwards.
For example if in the first event the photon interacts with the detector at time t_1=5 ns and in the second event the photon interacts at time t_2 = 3 ns, then knowing the intensity/activity of the source when you process the data you can “manually” calculate and add a dt to t_2 to keep account of this (I.E. how much time passed between the emission of the first and second event). So following the example you would have now a clock starting at t=0ns for the first event, then have t_1=5ns, the second event would start at t=dt and the interaction of the second event would take place at t_2=3ns+dt, where dt is computed form the activity or intensity of the source. You can get the number of photon emitted per second (and therefore a constant dt) knowing the intensity and the energy of the photons, or you could also use Poisson distribution to get a more realistic distribution of dt between one event and the next one for example.
Hope it makes sense and i didn’t make any mistake in understanding and explaining all this
Bests
Luca
Dear @luca_tero and @simonspa
Thank you very much for your kind reply, but I still have some questions.
My goal is to simulate pile-ups under occupancy-limited situations. Specifically, the inter-arrival times between photons can be shorter than the durations of generated electrical pulses after amplification, thus creating clusters of pulses, known as pile-ups. An example of pile-ups is presented in Fig. 1. To this end, I need to increase the activity/intensity of the source.
Firstly, regarding the first method mentioned by @luca_tero , I guess the mechanism of the command /gps/source/add intensity works as follows:
/gps/source/add x1
/gps/source/add x2
number_of_events = n
If these n events are completed within time t, the intensity of the first source can be expressed as \frac{x_1*n}{(x_1+x_2)*t}, and the intensity of the second source can be expressed as \frac{x_2*n}{(x_1+x_2)*t}.
I have the following two questions:
- I cannot control t; this command only controls the relative intensity of multiple sources, but not the absolute intensity of a single source.
- In the case of only one source, gps//source/add/ intensity seems to have no significance.
Secondly, regarding the second method mentioned by Luca:
Do you mean adding intensity information during data processing afterward? However, in my experimental scenario, the intensity information needs to be added when photons interact with the detector.
Thanks again for your reply!
Best,
Lincy
Hi
i see now your goal. To my (limited) knowledge there is no module on allpix2 yet that deals with pile-up but there is one group that worked on germanium detectors and used allpix2 for their work and were interested in pile-up effects.
They mentioned in a paper (Paper), that they modeled in offline analysis the dead time and time resolution (from which the pile-up is modeled) of the detector since they are not yet modeled in allpix2.
From my understanding this means that for example you can get from each event the induced signal in the pixels in the detector, and the relative time this take place with respect to beginning of the event. Then knowing the intensity information of the source you can, in post-processing, add a dt between the events, effectively turning the relative time information on signal arriving to the pixels into a global one.
I am not exactly sure how then you can make such plots as the one you showed (also cause i never worked yet with pileup), but this was my 2 cents on it, maybe people with more experience will have more insights than me.
Regarding your questions:
- yes i agree. if you set an intensity A or an intensity 1000*A, and ask for 10 events allpix will still simulate one event at a time.
- yes i also agree
And yes this is what i meant. In your case i am not super sure how to get the plot for the piled up signals but i think it might involve something like what i mentioned above. For example, taking the time stamps that allpix2 give you of photon interactions with the detector in relative time with respect to when the event X started (t=0), then doing the same for event Y, and turn them into “global” time stamps in which you add the intensity information to know how much time passed in between events X and Y (therefore what dt do you need to sum to the time stamps from event Y, assuming the beginning of event X as the 0 in the global time reference). Then you could check if the photon interactions from events X and Y were too close in time with respect to the time resolution of your detector for example.
Hope this helps a bit otherwise let’s see wait for the more expert people on allpix2.
Bests
Luca
Dear @luca_tero ,
Thank you very much for your response! Your suggestions have been helpful for me , and I will continue to work on it and hope to see further improvements.
Thanks again!
Best,
lincy
Dear @simonspa ,
I am wondering if you are open to making improvements about controlling the intensity of the source in the scenario I described.
If you are currently busy, I would greatly appreciate any suggestions or guidance you can provide to help me work on the improvements myself.
Looking forward to your response. Thank you for your time!
Best regards,
lincy