Failing in generating gamma in electron-tungsten interaction

Hello everyone,

I am fairly new to Geant4 and I am trying to measure the X-ray spectrum produced by 40 keV electrons hitting a tungsten target. I have created an electron particle gun and a tungsten target in vacuum. I created a sensitive detector and associated it with the tungsten target, then I am measuring the energy deposition using GetTotalEnergyDeposit and entering this value into an Ntuple. The PhysicsList I am using looks as follows:
‘’’ PhysicsList::PhysicsList()

// Default physics
RegisterPhysics(new G4DecayPhysics());

// EM physics
RegisterPhysics(new G4EmStandardPhysics_option4());

//Additional EM physics for low-energy processess

// Radioactive decay
RegisterPhysics(new G4RadioactiveDecayPhysics());

G4EmParameters* param = G4EmParameters::Instance();
param->SetFluo(true); // Enable fluorescence
param->SetAuger(true); // Enable Auger electron production
param->SetDeexcitationIgnoreCut(true); // Ensure de-excitation



void PhysicsList::SetCuts()

SetCutValue(0.1um, “gamma”); // Set cut value
um, “e-”);
SetCutValue(0.1um, “e+”);
emParams = G4EmParameters::Instance();
emParams->SetBremsstrahlungTh(1 * keV);

} ‘’’
My problem is that I do not see much gamma-ray production despite the fact that all the relevant physics are turned on. I have also tried changing the depth of the target but nothing changes. I collect the energy deposited by the gamma rays produced in the tungsten like this:
‘’’ MySensitiveDetector::MySensitiveDetector(G4String name) : G4VSensitiveDetector(name)


G4bool MySensitiveDetector::ProcessHits(G4Step *aStep, G4TouchableHistory *R0hist)

G4Track* track = aStep->GetTrack();

const G4ParticleDefinition* particle = track->GetParticleDefinition();

if (particle == G4Gamma::Definition()) {
// Get energy deposition
G4double edep = aStep->GetTotalEnergyDeposit();
G4String pname = track->GetDefinition()->GetParticleName();
//G4cout << "Particle: " << pname<< G4endl;
//G4cout << “Energy deposited: " << edep / keV << " keV” << G4endl;

       G4int evt = G4RunManager::GetRunManager()->GetCurrentEvent()->GetEventID();

auto analysisManager = G4AnalysisManager::Instance();

 analysisManager->FillNtupleIColumn(0, evt);
 analysisManager->FillNtupleDColumn(1, edep / keV);

return true;
Any help would be very much appreciated, thank you!

Here, a macro for example TestEm1, its printout and the plot of histogram 6

gtermo.mac.txt (529 Bytes)
gtermo.out.txt (5.3 KB)

To see the cross-section values, you can also run TestEm0 with the following macro :
em0.mac.txt (318 Bytes)