Hello,
I’m trying to simulate X-ray detection. To verify whether my simulation is correct, I refer to a topic in the forum:
This topic is about the simulation of X-ray tube, the target of the tube is made of Ag.
I’m new about GEANT4.I made a similar model with reference to his model, I used his physics list, and I also tried G4EmPenelope Physics. The number of my primary electrons is 5E7.The energy is 50keV, but only the peak part of the curve is obtained.
Where did I make a mistake? How can I get the same curve as him? the following is the curve in his topic:
These are the detection parts I built on the basis of Example B1:
void SteppingAction::UserSteppingAction(const G4Step* step)
{
if (!fScoringVolume) {
const DetectorConstruction* detConstruction
= static_cast<const DetectorConstruction*>
(G4RunManager::GetRunManager()->GetUserDetectorConstruction());
fScoringVolume = detConstruction->GetScoringVolume();
}
// get volume of the current step
G4LogicalVolume* volume
= step->GetPreStepPoint()->GetTouchableHandle()
->GetVolume()->GetLogicalVolume();
G4Track* track = step->GetTrack();
partial_name = track->GetParticleDefinition()->GetParticleName();
// check if we are in scoring volume
if (volume != fScoringVolume) return;
// collect energy deposited in this step
G4double edepStep = step->GetTotalEnergyDeposit();
fEventAction->AddEdep(edepStep);
partial_vector = track->GetMomentumDirection();
track->SetTrackStatus(fStopAndKill);
if(step->GetTrack()->GetDynamicParticle()->GetDefinition()->GetParticleName() == "gamma")
{
//G4DynamicParticle::SetVerboseLevel(2);
gamma_count ++;
fEventAction->Add_gamma_num(one);
gamma_energy = step->GetTrack()->GetDynamicParticle()->GetTotalEnergy ();
G4AnalysisManager::Instance()->FillH1(0,gamma_energy);
G4AnalysisManager::Instance()->FillH1(1,step->GetTotalEnergyDeposit());
G4AnalysisManager::Instance()->FillH1(2,step->GetPreStepPoint()->GetKineticEnergy(),step->GetPreStepPoint()->GetWeight());
}
}
This is a similar model I built: