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

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

Hi @mkelsey, Is the total energy of the track just the energy of the particle in that track?

Yes. The particle is the track, in Geant4 language :slight_smile: This comes from a high-energy physics perspective: the “particle” is the hypothetical entity that is travelling through our detector; the “track” is the thing we reconstruct from the measurements in our detector.

Hi @mkelsey ,
I got it now. G4double edepStep=step->GetPreStepPoint()->GetTotalEnergy();this line code return the energy of the track. It seems that this is energy of x-ray after interacting with the detector material, because my obtained x-ray spectrum contains the characteristic peaks of detector material. How can I recond the energy of photons just after its generation in the tungstern target?

What was said above. If you want to collect the energy in the target, then you should have an SD (or scorer, or whatever) attached to the target. If you want to estimate what a real detector is going to tell you, that’s what you’re doing.

Hi,
I had a brief look at this eRosita example and as I want to perform studies on x-rays as well, I wonder about the entire different approach there. To be precise, so far, I’m using just:

RegisterPhysics(new G4EmStandardPhysics_option4());
RegisterPhysics(new G4EmLowEPPhysics());

to deal with physics whereas in the given example it looks like they care about every detail by defining it specificially.

Am I’m on a (total) wrong path or is it valid (but the same?)?

Dear Benjamin,

you can either use the pre-built Geant4 EM constructors or define the processes and models one by one as done in eRosita.

As you are doing, it seems to me you are activating the physics list twice. G4EmLowEPPhysics models the processes of polarised photons. Is that what you want? if not, please delete RegisterPhysics(new G4EmLowEPPhysics());

Cheers
Susanna

1 Like

Hi @BenjaminW,
You can use #include "G4EmLivermorePhysics.hh" or
#include "G4EmPenelopePhysics.hh" . Both of them can generate x-ray, but I noticed one literature claimed that the Penelope is more consistent with experiment.

1 Like

Hi @mkelsey and @guatelli,
I print the energy in PreStepPoint and PostStepPoint, and compare with the total energy deposite. The energy difference of PreStepPoint and PostStepPoint is not equal with the deposite energy. Why they are not equal? Even if the enery in PostStepPoint is zero, sometimes the depsotie energy is still small. Where is the energy of the incident particle going?

Are you getting secondary particles produced in the interactions? The energy that is transferred to secondaries is not included in “energy deposit.” Those secondaries themselves go off and have their own energy deposits, and you don’t want to double count.

Hi @mkelsey,
thanks. I got it now. there are secondary particles. I think I didn’t get the deposite energy of the secondary paritcles. I just apply codes and compare their output. G4double deposite=step->GetTotalEnergyDeposit(); G4double edepStep=step->GetPreStepPoint()>GetTotalEnergy(); G4double energy_PostStep=step->GetPostStepPoint()->GetTotalEnergy(); Now I am trying to get the energy spectrum of x-ray generated in x-ray tube simulation.

Hi repan,I am working a similar topic, would you share your code once more. It is not on github anymore.