  Using a time-dependent one-zone leptonic model that incorporates both shock
acceleration and stochastic acceleration processes, we investigate the
formation of the narrow spectral feature at $\sim3$ TeV of Mrk 501 which was
observed during the X-ray and TeV flaring activity in July 2014. It is found
that the broadband spectral energy distribution (SED) can be well interpreted
as the synchrotron and synchrotron-self-Compton emission from the electron
energy distribution (EED) that is composed by a power-law (PL) branch and a
pileup branch. The PL branch produces synchrotron photons which are scattered
by the electrons of the pileup branch via inverse-Compton scattering and form
the narrow spectral feature observed at the TeV energies. The EED is produced
by two injection episodes, and the pileup branch in EED is caused by shock
acceleration rather than stochastic acceleration.
