Can't generate X-ray in x-ray tube simualation

Could you please share your code?

hi, I upload my code in github: GitHub - renqipan/xray_tube: xray generation from electrons hitting the tungstun target. Please have a look. thanks for your help.

1 Like

Thanks a lot, I’ll have a look into it!

Hi@BenjaminW,
Can you generate the xray in xray tube simulation, especially the peaks of the L and K series characteristic lines. What’s your physcisList?

I’m not sure if I can help out but I just began working on a very similar topic. That’s why I’m interested in the code but I’m in an earlier stage at the moment.
However, I’ll check within the next days.

Failed to simulate X-ray generation from X-ray tube

Check this topic

Hi, there should be no problem to use Geant4 to model X-ray tubes.

Hi @guatelli and @idrissi_abdelghani,
Now I can generate x-ray using the physicsList as examples/advanced/eRosita/application/src/eRositaPhysicsList.cc. But the results doesn’t have characteristic lines. the x-ray of tungsten target is expected to have peaks at 8.39, 8.33, 57.98, 59.32,67.24, 69.10 keV. But my results didn’t have the peaks at 57.98, 59.32,67.24, 69.10 keV, which are the K-characteristic lines. The first two plots are my results, the third plot is the expected results in literature. How can I generate the K-characteristic lines?


Hi, probably you need to use a UI command to ignore the cut. Please check the UI commands in macros used in TestEm5.

Hi @guatelli,
TestEm5 has lots of .mac files and different files have different cuts, so I didn’t find useful information in their macros.

you have to ignore the cut. There is a UI command to do that

Hi @guatelli, thanks for your help. I find it. it’s /process/em/deexcitationIgnoreCut true
I use 100 keV electrons hit a tungsten target to simulate the x-ray generation as the real x-ray tube. Now I have tryied G4EmPenelopePhysics and examples/advanced/eRosita/application/src/eRositaPhysicsList.cc. Do I need to open the fluo or pixe flag through UI commands ? /process/em/fluo true /process/em/pixe true
Are these two process should be all open or just one?

only the X-ray fluorescence. You do not need PIXE ( this is for incident heavy ions).
/process/em/fluo true
/process/em/deexcitationIgnoreCut true

Hi @guatelli, I got it now. thanks for your help. I wanna set the cut range as 0.001 mm through UI commnad /run/setCut 0.001 mm . Is this cut range reasonable? what is the production cut commanded?

The cut should be fixed depending on your specific simulation set-up, so difficult to say. Sorry

Here, a macro for TestEm14

atomicDeexcitation.mac.txt (879 Bytes)

Hi @maire @guatelli @idrissi_abdelghani,
Thanks for your help. Now I can generate the x-ray spectrum with characteristic peaks. But except the characteristic peaks of tungsten targets currect results also contain the characteristic peaks of detector material. As the plot shown the spectrum has characteristic peaks of tungsten and it has a peak at 43 keV, which is the characteristic peaks of detector material(Gd). How can I avoid the characteristic peaks of the detector materail.

Hi @repan,

I am not sure I get the point. Are you showing the spectrum of what? Energy deposited inside the detector? If the detector contains Gd, you should also expect lines from the detector, or am I wrong?

If you care only about emission in Tungsten, you should change your way of scoring accordingly, e.g. you forget about your detector and you build the distribution of the energy of the gamma-rays leaving your Tungsten volume…

Ciao,
Luciano

Hi @pandola,
I get the energy deposite of the logicalVolume of detector through G4double edepStep=step->GetPreStepPoint()->GetTotalEnergy();. So I think what’s shown is the energy deposit inside the detector.
If I want to obtain the energy of gamma-rays just leaving tungsten target. How can I do it? Can I get it through G4double enegy_gamma=step->GetPostStepPoint()->GetTotalEnergy(); in the logicalVolume of the tungsten?

That’s not right. G4StepPoint::GetTotalEnergy() is (as specified in GetStepPoint.hh) the total energy of the track, not the amount of deposited energy. For the energy deposit, you should be using step->GetTotalEnergyDeposit(). If you are dealing with nuclear recoils, then you may also want step->GetNonIonizingEnergyDeposit().

1 Like