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()
{
SetVerboseLevel(1);
// 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
}
//…oooOO0OOooo…oooOO0OOooo…oooOO0OOooo…oooOO0OOooo…
void PhysicsList::SetCuts()
{
G4VUserPhysicsList::SetCuts();
SetCutValue(0.1um, “gamma”); // Set cut value
SetCutValue(0.1um, “e-”);
SetCutValue(0.1um, “e+”);
G4EmParameters 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)
{}
MySensitiveDetector::~MySensitiveDetector()
{}
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);
analysisManager->AddNtupleRow(0);
}
return true;
}‘’’
Any help would be very much appreciated, thank you!