i am simulating a X-ray tube, so i use EMF-BIAS card to improve interaction statistics, and i have a idea to reduce the calculating time by using the results of USRBDX （including energy & direction ）rather than electron as Beam Source.
i don’t know whether the idea correctly and what should i do if it’s work.
Thanks and regards,
thank you for your question.
Not knowing the details of your study (in this regard an
*.flair would be useful for next time), I will try to give you a general answer.
Going straight to the conclusion, yes, your idea works and it is actually quite often used (usually it is referred as a 2-steps simulation, you can search it in the forum).
Now, let me expand a bit on this introducing also some technicalities which you could find following this method.
2-steps simulation, simplifying, consists in:
- step-1: simulating a rare event (in your case the production of photon coming from the electron beam interaction) and scoring the results of this rare event once (in your case, scoring the photon spectrum with
USRBDX or the photon phase space distribution using
mgdraw.f), such that you don’t need to repeat this time-consuming process every time you launch a simulation.
- step-2: using the result of the step-1 as source, to continue the transport focusing on the wished study.
Just for you as a reference, I am attaching an example for a 2-steps simulation:
2-step_simulation_example.zip (118.6 KB)
In the example, at step-1 the simulation uses electron as beam and it scores the photon exiting from the TARGET region. The informations of the photons are saved in
*.fort.90 thanks to the
The step-2, instead, starts from the phase space distribution scored at step-1. Thanks to the
source_newgen.f routine, the scored distribution is loaded and the primary photon, tracked in the geometry (empty in the example), is selected randomly between one of the multiple lines present in the file.
The difference between the use of
mgdraw.f is that using the first you have information only related to the energy-intensity of the photon produced. Instead with the latter, you have also the position and direction of the exiting photon.
Regarding the normalization of the results obtained from step-2, I suggest to read some of the threads related to this topic present in the forum (one and two). Keep in mind that applying biasing in the step-1 will require a careful normalization of the results in step-2, since in this case you are modifying the number of photon produced in one event.
I hope this helps you in understanding how a 2-steps simulation works.
thank you for your carefully answer,and it’s very helpful to my solve the problem.
i have some unclear about SDUM of EMF-BIAS, i don’t know LAMBEMF whether including X-FLUO(likes k-α,k-beta… ) or not, because manual just say " Mean free path biasing is applied only to electron and positron bremsstrahlung" . LAMBEMF may better and coincident with reality?
in the input I attached in the last reply, I have added for step-1 the
EMF-BIAS card with
SDUM=LAMBBREM just to have a reference. Indeed the card should be set depending on your need.
Although, let me say that to this day in FLUKA the characteristic x-rays are not produced after direct ionization of inner shells by primary electron (the relative model is missing in FLUKA). They are produced from electron doing bremsstrahlung, then photons eventually being absorbed and invested in ripping an electron from a shell ending in the emission of the characteristic fluorescence lines.
For this reason, a slight underestimation of the intensity of characteristic lines might been foreseen and it is reasonable to bias only the bremsstrahlung process in the material of target region.
Finally, let me just point out again the last point in the previous reply. Applying biasing in step-1 will require careful normalization of the results in step-2.
as your suggestions i have get a
*.fort.90 files, and i used it as source by
source_newgen.f successfully. i have some abuse about the normalization formula,
Please correct me if I am wrong.
Total weight(recorded) = sum all weight value of
*.fort.90 file, and
Total weight(step1)= total weight at the end of
*.out file to step-1,just like 1e+4 for " Total number of primaries run: 10000 for a weight of: 1.000000E+04"
sorry for the slight delay, but yes what you are saying works as normalization of the results obtained in step-2 even if you are using the biasing in step-1.
Be aware that with this kind of normalization, even if correct, you lose the correlation between photons that can be produced in the same event in step-1 (meaning photons produced by the same electron). If you are interested in fluence scorings, this is not relevant, instead it is relevant in case of event by event analysis or using the
Finally let me point out that for the step-1 is important to be sure to not recount photons. This is possible setting the region where you are scoring the photon as blackhole.
Thank you for the detailed reply as well as those source files.