Confused by changing the thickness of scintillator

I changed the thickness of the scintillator, but the number of luminescent photons of the scintillator did not change.
And no matter how much the energy of the incident particles is, even if the thickness is changed in a large range, the number of luminescent photons still didn’t change.
This really confused me.

As in, the number of photons per event? Or total number of photons?

You would not expect the number of photons per event to change as a function of thickness, unless the thickness is small enough that the energy deposited by the charge particle decreases.

If you expect the energy deposited to decrease due to thinness of your scintillator, have you confirmed that it does? Look at the edep first before simulating photons. Once you hit a thickness where the energy of your charged particle is fully absorbed, the number of photons will not increase with more thickness

This problem is caused by my wrong setting of the command in .mac
But I still see that the incident particle will only have one energy deposition in the scintillator. Does this mean that the energy is lost only during one scintillation process ?

The Geant4 scintillation process does not contribute to energy loss. Rather, for each step the energy losses of the other processes is found. The number of scintillation photons is proportional to this energy loss, using the value in your material properties table.