*2.2. Relativistic Shock Acceleration*

The spectral shape of the afterglow emission is well described by power-laws over a wide energy range (from radio to GeV-TeV). This is the clear manifestation of the presence of an electron population that has been accelerated in a power-law energy distribution. In GRB afterglows, the main candidate to explain the accelerated non-thermal particles is a Fermi-like mechanism that operates with similar general principles as the non-relativistic diffusive shock acceleration: particles are scattered back and forth across the shock front by magnetic turbulence and gain energy at each shock crossing. The particles themselves are thought to be responsible for triggering the magnetic instability that produces the turbulent field governing their acceleration. The outcome of this acceleration process is determined by the composition of the ambient medium (electron-proton plasma in the case of GRB forward shocks), the fluid Lorentz factor (Γ*GRB* >> 1, decreasing to non-relativistic velocity only after several weeks or months) and the magnetization *σ* (i.e., the ratio between Poynting and kinetic flux in the pre-shocked fluid, *σ* = *B* <sup>2</sup>/(4*π m<sup>p</sup> n c*<sup>2</sup> )), with *B* being the magnetic field strength. For GRB forward shocks, the magnetization is low, around 10−<sup>9</sup> in the interstellar medium and in any case below 10−<sup>5</sup> even for a magnetized circumstellar wind.

In this section, we summarize the present understanding of particle acceleration and magnetic field generation in electron-proton, ultra-relativistic, weakly magnetized shocks. The statements and considerations reported in this section refer specifically to this case (which is the one relevant for forward external shocks in GRBs) and might not be valid for magnetized plasma and/or mildly-relativistic flows and/or electron-positron plasma.

In general, the information that one would extract from theoretical/numerical investigations and compare with observations are: (i) the spectral shape of the emitting electrons (i.e., the minimum and maximum Lorentz factor *γmin*/*max* and the spectral index *p*), (ii) the acceleration efficiency (i.e., the fraction of electrons *ξ<sup>e</sup>* and the fraction of energy *e<sup>e</sup>* in the non-thermal population) and (iii) the strength of the self-generated magnetic field, usually quantified in terms of fraction *e<sup>B</sup>* of the shock-dissipated energy conveyed in the magnetic field. In particular, in order to compare with observations, the relevant *e<sup>B</sup>* is the one in the downstream, in the region where radiative cooling takes place and the emission is produced.

After revisiting the state-of-the-art of the theoretical understanding (for recent reviews, see [40,60]), we discuss how particle acceleration and magnetic field amplification are incorporated in GRB afterglow modeling, and then we comment on the constraints on the above-mentioned parameters as inferred from the comparison between the model and the observations.
