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

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*>
    fScoringVolume = detConstruction->GetScoringVolume();

  // get volume of the current step
  G4LogicalVolume* volume
    = step->GetPreStepPoint()->GetTouchableHandle()
  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();

	partial_vector = track->GetMomentumDirection();
				if(step->GetTrack()->GetDynamicParticle()->GetDefinition()->GetParticleName() == "gamma")
					gamma_count ++;
					gamma_energy = step->GetTrack()->GetDynamicParticle()->GetTotalEnergy ();


This is a similar model I built:

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.
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

/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