No other point except the peak value in the X-ray simulation

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.
5E7
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:
image

Hello Jiaoqiang

Did you set the vacuum inside the X-ray tube?

You can try adding these lines to the MAC file:

/process/em/fluo true
/process/em/auger true
/run/setCut  1 nm
/process/em/augerCascade true
/process/em/deexcitationIgnoreCut true

Hello BobLeeAbc, thank you for your reply!
I have set vacuum inside the X-ray tube. The vacuum is defined as follows:

G4Material* Va = 
  new G4Material("Galactic", z= 1., a= 1.01*g/mole, density= 0.00000001*g/cm3);

I tried to add them in the MAC file when the physics list is G4EmPenelopePhysics.
But the results are similar.
image
This is my MAC file:


/process/em/fluo true
/process/em/auger true
/run/setCut  1 nm
/process/em/augerCascade true
/process/em/deexcitationIgnoreCut true

/cuts/setLowEdge  10 eV
/run/initialize

/control/verbose 2
/run/verbose 2

/gun/particle e-
/gun/energy 50 keV

/run/printProgress 10000
/run/beamOn 10000000

Hello Jiaoqiang,could you share your code?I am also new to geant4, I may be able to help you by looking at the code