Modelling the prompt optical emission of GRB 180325A: the evolution of a spike from the optical to gamma-rays

The transition from prompt to the afterglow emission is one of the most exciting and least understood phases in gamma-ray bursts (GRBs). Correlations among optical, X-ray and gamma-ray emission in GRBs have been explored, to attempt to answer whether the earliest optical emission comes from internal and/or external shocks. We present optical photometric observations of GRB 180325A collected with the TAROT and RATIR ground-based telescopes. These observations show two strong optical flashes with separate peaks at $\sim50\;$s and $\sim120\;$s, followed by a temporally extended optical emission. We also present X-rays and gamma-ray observations of GRB 180325A, detected by the Burst Alert Telescope (BAT) and X-ray Telescope (XRT), on the Neil Gehrels Swift observatory, which both observed a narrow flash at $\sim80\;$s. We show that the prompt gamma- and X-ray early emission shares similar temporal and spectral features consistent with internal dissipation within the relativistic outflow (e.g. by internal shocks or magnetic reconnection), while the early optical flashes are likely generated by the reverse shock that decelerates the ejecta as it sweeps up the external medium.


INTRODUCTION
Gamma-ray bursts (GRBs) are the most luminous events in the Universe. GRBs are classified according to their duration: short GRBs have a duration T 90 2 s (where T 90 is defined as the time over which 90% of the gamma-ray photons are detected) and are associated with the coalescence of compact objects (two neu-tron stars or a neutron star/black hole binary system; Paczynski 1986;Eichler et al. 1989;Abbott et al. 2017), while long GRBs are associated with the collapse of massive stars and the formation of a black hole or a magnetar, and have a typical duration 2 s (Woosley 1993;MacFadyen & Woosley 1999;Hjorth et al. 2003).
One of main features of the prompt GRB phase is its large variability. In the "standard fireball model" of GRBs, the central engine powers a jet with variable velocity. This leads to the formation of internal shocks in which collisions give rise to the observed rapid variability (e.g., Kobayashi et al. 1997). An alternative dissipation mechanism is magnetic reconnection in a Poynting-flux dominated outflow. In addition to this short timescale variability, about 30% of GRBs show X-rays flares (e.g., Chincarini et al. 2007;Falcone et al. 2007;Burrows et al. 2005) which are not associated with bright high-energy (MeV to GeV) emission (Troja et al. 2015). These Xray flares share several temporal and spectral properties with the gamma-ray pulses observed during the prompt emission (e.g. Krimm et al. 2007;Margutti et al. 2011), suggesting that they may be produced by late engine activity. For instance, both gamma-ray and X-ray sharp peaks are asymmetric, with fast rise and a slower decay. They both follow a similar hard-to-soft evolution, have spectra typically well fitted by a Band function and present a similar spectral lag ). In addition, the observed small values of ∆t/t p ≈ 0.1 (in which ∆t is the duration of the pulse and t p the time of the peak, see, e.g., Ioka et al. 2005) and the presence of a continuum with a similar slope before and after the X-ray flare, while distinguishing them from the prompt GRB emission, imply that they are not typically associated with the external shock that is produced when the outflow is decelerated by the surrounding medium. An alternative scenario is that the X-ray flare originate in late-time sporadic magnetic reconnection events (Giannios 2006).
According to the fireball model, when the outflow interacts with the circumstellar medium, a forward and a reverse shock are formed (Meszaros & Rees 1993;Sari & Piran 1995). While the long-lasting "afterglow" emission in wavelengths ranging usually from radio bands to X-rays is attributed to synchrotron radiation from the forward shock, the main observational signature of the reverse shock is typically a strong optical flash observable in the very early stages of the afterglow (e.g., Sari & Piran 1999b;Kobayashi 2000;Fraija 2015). This flash is due to synchrotron emission from the shocked ejecta and is typically expected to produce a single peak in the light curve (e.g., see Fraija et al. 2016;Fraija and Veres 2018;Becerra et al. 2019b). Bright emission requires a moderately magnetised ejecta. Optical flashes or flares are much less common (e.g., Krühler et al. 2009;Li et al. 2012) and typically not correlated with X-ray sharp peaks (e.g., Troja et al. 2015).
In this paper, we present optical observations of GRB 180325A with the TAROT and RATIR ground-based robotic telescopes. These observations show strong optical flashes with two distinct peaks at ∼ 50 s and ∼ 120 s, followed by temporally extended optical emission.
In order to analyse our optical data, we present other optical observations, as well as X-ray and gamma-ray observations with the Burst Alert Telescope (BAT) and X-Ray Telescope (XRT), on the Neil Gehrels Swift Observatory Gehrels et al. (2004). The gamma-ray and X-ray emission show narrow peaks at ∼ 80 s. Using a semi-analytic model we show that the gamma-and Xray early emission that shares temporal and spectral features is consistent with production by internal shocks, while the the early optical flash is likely generated by the reverse shock. We also discuss the possibility the the multi-wavelength peaks have a common origin. We show that this possibility is very unlikely for both observational and theoretical reasons, although it cannot be completely excluded.
This paper is organised as follows. In §2, we present the observations made by Swift, TAROT, RATIR, and other telescopes. In §3 we present a temporal and spectral analysis of the data. In §4 we outline different scenarios to try to explain the observed spikes, using a semianalytic model for internal shocks. In §5 we summarise our results and discuss their implications.
The Swift/UVOT began settled observations of the field of GRB 180325A at T + 82 s and detected a fading source consistent with the enhanced XRT position (Marshall & Troja 2018).

TAROT Observations
The TAROT Calern telescope (Klotz et al. 2008) received the BAT GRB position GCN alert packet at 2018 March 25 01:53:17.52 UTC (T +14.68 s). It immediately slewed to the BAT position, and began its first exposure at 01:53:28.94 UTC (T +26.10 s). The observations were taken in the C filter which is fairly close to r for sources with neutral colours.
The first TAROT image was exposed from T + 26 to T + 86 s with the tracking speed adjusted to obtain a small trail eleven pixels long. This technique is used to obtain continuous temporal information during the exposure (see, e.g., Klotz et al. 2006). The spatial sampling was 3.29 arcsec/pixel and the FWHM of stars (perpendicular to the trail) was 2.8 pixels. Subsequent images were taken with standard sidereal tracking.
To calibrate the photometry we use NOMAD-1 1144-0181764 as reference star and adopted r = 14.53 and r − i = +0.41 from SDSS DR9. This star was chosen because its color is very close to the color index r − i = +0.39 of the optical counterpart measured about one hour after the trigger by Schweyer & Kann (2018) and Watson et al. (2018). The r magnitude for the reference star was converted into flux density F ref = 5.60 mJy. The flux ratio between the afterglow and the reference star was determined by subtracting a scaled and shifted subframe around the reference star from a subframe around the optical counterpart and minimising the RMS residual. Table 1 gives TAROT photometry. For each exposure, it gives the initial time t i and the final time t f (relative to T ), the AB r magnitude (not corrected for Galactic extinction), and the 1σ total uncertainties (including both statistical and systematic contributions). For TAROT, the exposure time is simply t f − t i .
The TAROT data show non-detections from 26 to 42 seconds, followed by detections of a flash from 42 to 53 seconds, followed again by non-detections from 53 to 69 seconds. After 69 seconds, TAROT detects a rapidlyrising flash with then fades more slowly.
The first optical flash is not seen in the BAT light curve and unfortunately occurs before the start of XRT observations. The second optical flash is nearly simultanous with flashes seen in both the BAT and XRT light curves.

RATIR Observations
RATIR is a four-channel simultaneous optical and near-infrared imager mounted on the 1.5 meter Harold L. Johnson Telescope at the Observatorio Astronómico Nacional on Sierra San Pedro Mártir in Baja California, Mexico. RATIR responds autonomously to GRB triggers from the Swift satellite and obtains simultaneous photometry in riZJ or riY H (Butler et al. 2012;Watson et al. 2012;Littlejohns et al. 2015). Unfortunately, the ZY JH detectors were not in service during our observations. Therefore, we only report the observations carried on by r and i filters.
GRB 180325A occurred just before local sunset at the Observatorio Astronómico Nacional, and our observations with RATIR did not start until the end of nautical twilight (Watson et al. 2018). On the first night of 2018 March 25 we observed from 02:54 UTC to 10:55 UTC (T + 1.02 to T + 9.03 hours) and obtained 288 pairs of simultaneous exposures each of 80 s in r and i. On the second night of 2018 March 26 we observed from 03:02 UTC to 10:47 UTC (T + 25.17 to T + 32.90 hours) and obtained 272 pairs of simultaneous exposures each of 80 s in r and i.
Our reduction pipeline performs bias subtraction and flat-field correction, followed by astrometric calibration using the astrometry.net software (Lang et al. 2010), iterative sky-subtraction, coaddition using SWARP (Bertin et al. 2002), and source detection using SEX-TRACTOR (Bertin & Arnouts 1996). We calibrate against SDSS. The systematic calibration error is about 1%.  Table 2 gives our RATIR photometry. For each image it gives the initial time t i , the final time t f , the total exposure time t exp , the r and i AB magnitudes (not corrected for Galactic extinction), and their 1σ total uncertainties (including both statistical and systematic contributions). Figure 1 shows the light curve of GRB 180325A from TAROT and RATIR. Heintz et al. (2018) obtained spectroscopy with NOT/ALFOSC. They identified several absorption features, including Mg II, Fe II, Al II, C IV, Si II and determined a common redshift of z = 2.25 for them. D'Avanzo et al. (2018) obtained spectroscopy with VLT/X-Shooter. They identified absorption and emission lines at z = 2.248 and confirmed the presence of a strong double intervening system at z = 2.041/2.043. Zafar et al. (2018) determined that the host galaxy is from the main-sequence of star-forming galaxies using observations at four different epochs with NOT, VLT/Xshooter, and GROND. Frederiks et al. (2018) estimated the following restframe parameters using Konus-Wind: the isotropic photon energy release E iso is about 2.3 × 10 53 erg, the peak luminosity L iso is about 3.2 × 10 53 erg/s, and the rest-frame peak energy of the time-integrated spectrum, E p,z , is 995 keV.

Spectral Analysis
We constructed the spectral energy distribution (SED) at T + 10000 s (just after the start of the afterglow phase) by retrieving the Swift/XRT X-ray from the online repository 1 (Evans et al. 2009). We added optical observations in the r and i filters of RATIR at T + 10000 s. Figure 2 shows the resulting SED.
We fitted the SED with a spectral power-law F ν ∝ ν −β , in which F ν is the flux density, ν is the frequency, and β is the spectral index. From the X-ray to the optical, the SED can be fitted with a simple power law with a spectral index of β = 0.45±0.01. Under our assumption of a thin-shell evolving in the slow-cooling regime with the cooling break above the X-rays (Kobayashi 2000), we would expect the spectral index to be (p − 1)/2 or 0.65±0.13 for p = 2.32±0.30; this value of p is explained in more detail in next section. Figure 2 also shows the Xspec model fit which takes into account the effects of reddening and absorption by the dust (Arnaud 1996). We use a reddening of E(B-V)=0.02 (Marshall & Troja 2018), the redshift of z = 2.25 , and the column density of 1.77 × 10 20 cm −2 (Page et al. 2018). We obtained a reduced χ 2 = 0.86 with 490 degrees of freedom. The β derived from the photon index with Xspec is β = 0.48±0.01 which is consistent with the β obtained from the simple fit.

Temporal Analysis
The prompt emission from the GRB detected by Swift/BAT lasted until about T + 120 s . The earliest data from Swift/XRT started at T + 61 s. Our optical observations from TAROT and RATIR began at T + 26.10 and T + 3674 s, respectively, after the end of prompt emission. Therefore, we focus our analysis on the end of prompt emission and the early afterglow of GRB 180325A. Figure 3 shows the early emission in gamma-rays, Xrays, and in the optical for t < 200 s. We fitted these light curves using a model which reproduce the asymmetric shape of the pulses, with a sharper rising phase and a shallower decaying phase. This model, proposed I II Gamma X-rays Optical-i Optical-r Figure 1. Light curves and broken power-law fits of GRB 180325A in r from TAROT (blue points), in r and i from RATIR (blue and green stars), X-rays from Swift/XRT (black points) at 1 keV and gamma-rays from Swift/BAT (red points). We divide the light curve of GRB 180325A in different epochs. Epoch I (t < 7000 s) is related with late central activity for the spike and the subsequent plateau. On the other hand, Epoch II (t > 7000 s) is a typical afterglow decay.

Fitting the pulses
by Norris et al. (2005), includes an asymmetric exponential rise and exponential-decay profile, and is given by We notice that the lack of observational points at T + 70 < t < T +100 s makes hard to predict the exact slope of the rising part in the X-rays.
Although, as discussed in section 4, the optical emission is likely coming from a reverse shock while the Xand gamma-ray emission originates from internal shock, we fitted the temporal width w for the pulse in the optical, X-rays, and gamma-rays bands using the FWHM. The results are shown in Figure 4. Then, we fitted the relationship w(E) ∝ E −α and found α = 0.22 ± 0.03 in agreement with α = 0.3 to 0.4 found by Norris et al. (2005) for pulses observed during the prompt emission (between X-rays and gamma rays), and reported by Margutti et al. (2010) for X-ray flares. If all three pulses have a common origin, then our optical observations would extend this empirical relation down by about three orders of magnitude in frequency. Figure 3 also shows that at ∼ 50 s there is an earlier optical pulse lasting about 10 s and dimmer by a factor of ∼ 2 with respect to the late optical peak.

X-rays and Optical afterglow
For the analysis of the afterglow, we use mainly TAROT and RATIR r-band data. The RATIR r and i filters have effective wavelengths of 618 and 760 nm respectively. We observe very similar behaviour between  the data for the RATIR r and i filters in Figures 1. We complement our data set with data of the Swift/XRT instrument. Figure 1 shows the optical and X-ray light curves for GRB 180325A . We fit the light curves with segments of temporal power-laws F ν ∝ t −α , in which F ν is the flux density, t is the time since the BAT trigger, and α is the temporal index. Fits are summarised in Table 4. We can summarise the main stages as: • The light curve for t < 200 s. For t < 200 s, we see bright spikes in gamma rays, X-rays, and the optical with a peak at about T + 100 s (Figure 3). This emission started during the prompt emission phase. Although there is not a completely accepted model to explain these spikes; empirically, we fit two broken power-law segments to the X-ray light curve in order to obtain parameters to describe its behavior. We chose this band because it is the best sampled. The rise has a temporal index of α X,rise = −7.11 for 70 < t < 100 s and the decay has a temporal index of α X,decay = 5.42 ± 0.26 for 100 < t < 200 s. Qualitatively, we note the broadening of the spike as a function of the wavelength. These phenomena were previously discussed by Margutti et al. (2010) for X-ray and gamma-ray flares, with the result that high-energy flare profiles rise faster and decay faster. This spike is discussed in more detail in § 4.
• The optical curve for t > 7000 s. We observed a power-law segment described by F ∝ t −α f,r/i with α f,r = 1.48 ± 0.38 for r and α f,i = 1.49 ± 0.01 for i. These temporal indexes can be explained under the assumption of a stellar wind medium where the normal decay segment is described by F ∝ t −α f,r/i with α f,r/i = (1 − 3p)/4. Taking p = 2.32 ± 0.30 (see Section 4.1), the expected value is α f,r/i = 1.52 ± 0.07 which is in a good agreement with our observed α f,r/i .
• The X-ray light curve for t > 7000 s. We observed a power-law segment described by F ∝ t −α f,X with α f,X = 1.84 ± 0.09 for the Swift/XRT data. We interpret this as the post jet-break decay phase. In this interval, the optical and X-rays light curves decrease steeper than in the plateau phase. We assumed that a non-thermal population of electrons is accelerated by shocks, with a distribution N (γ) ∝ γ −p . We analysed this epoch in order to provide a restriction on the power-law index p. We then assumed continuity in this population to explain the optical emission during the earlier phase.
Furthermore, from the SED T + 10000 s, the spectrum can be fitted with a simple power-law with a spectral index of β = 0.45 ± 0.01. We suggest that this optical emission arises above the cooling break (ν c < ν) in a slow-cooling scenario (Sari et al. 1998), and so expect F ν ∝ ν (1−p/2) t (1−3p)/4 . Our observed value of α f,r = 1.49 ± 0.22 implies p = 2.32 ± 0.30 and subsequently β = 0.66 ± 0.25. The value of p is consistent with the range of values typically for GRB afterglows and the predicted value of β is consistent with our observation of β = 0.45 ± 0.01.
• For 300 < t < 7000 s, the optical light curve exhibits a plateau with a temporal index of α 0,plateau = 0.46 ± 0.01. The plateau phase is usually interpreted as evidence of late time centralengine activity (see e.g. Kumar & Zhang 2015;Becerra et al. 2019a,c).

THE ORIGIN OF THE SPIKE
4.1. Do the optical, X-ray, and gamma-ray spikes have a common origin?
As we see in Figure 3, the sharp peaks become wider at lower frequencies and show a spectral lag, with the high energy light curve rising/dropping on a shorter timescale with respect to the low energy counterpart. This effect has been observed previously in X-ray/γ frequencies in X-ray flares (e.g., Chincarini et al. 2010;Margutti et al. 2010) and in gamma-ray pulses during the prompt emission (e.g., Fenimore et al. 1995;Norris et al. 1996). If the spikes at different frequencies share a common ori-10 2 10 1 10 0 10 1 10 2 10 3 10 4 10 5 10 6 Energy (eV) Nevertheless, as shown in Figure 5, when the optical emission is included the spectrum is concave at 80 s after the trigger (near the peak of the light curve in X-rays and gamma-rays), which is not consistent with standard synchrotron radiation. This suggests that the optical spike and the high energy spikes have different origins. Furthermore, we show below that there is no simple model that can explain the extension of the spectral lag and broadening relations to the optical. In order to explain the spike we consider the following scenarios.
High-latitude emission: Spectral lag and broadening have been explained by considering high-latitude emission (e.g., Ioka & Nakamura 2001;Norris 2002;Dermer 2004;Shen et al. 2005;Genet & Granot 2009;Shenoy et al. 2013). A salient feature of high-latitude emission (e.g., Kumar & Panaitescu 2000;Genet & Granot 2009;Uhm & Zhang 2016) is that the low-energy flux (at energies well below the E p of the emission along the line of sight) is much lower than the high-energy flux, as it comes from a region of the shock wave in which the flow is moving slightly off-axis with respect to the observer. Observations of GRB 180325A show that the peak in the flux density, F ν,p , is at a remarkably similar amplitude over four orders of magnitude in frequency. This excludes high latitude emission as a possible explanation.
Internal shocks: We assume here that the emission is due to synchrotron radiation in the fast-cooling regime, with F ν ∝ ν −α for ν c < ν < ν m , and F ν ∝ ν −p/2 for ν > ν m . As discussed by, e.g., Daigne et al. (2011) and Bošnjak & Daigne (2014), there are three possibilities: 1) Synchrotron emission in the fast cooling regime, with α = 1/2. 2) Fast cooling with B e in the Klein-Nishina (KN) regime 2 , where less energetic electrons suffer less KN suppression and radiate more of their energy into the SSC component (that we do not see) and less of their energy into the synchrotron component (that we do see), resulting in a lower flux at lower frequencies compared to case 1, i.e., a lower α: 0 α ≤ 1/2. 3) Marginally fast cooling, ν c ≈ ν m , with α = 1/3 corresponding to a different power-law segment of the synchrotron spectrum. In all these cases, the flux typically shows some spectral lag and broadening in the X-rays and gamma-rays range. However, it is unclear if this behaviour can be extended to the optical range, as a drop in the peak energy (due, e.g., to a drop in the microphysical parameters e , B , or to the shock Lorentz factor, or adiabatic cooling) should lead to a dramatic drop in the flux density. Moreover, the optical emission may also be self-absorbed, leading to a further suppression in its flux 3 .
An accelerating jet coupled with a decaying magnetic field: Uhm & Zhang (2016) interpreted the spectral lag and broadening as due to a decaying magnetic field in an accelerating emitting region (and with a curved emitted photon spectrum in the proper frame). They point out that this is consistent with a Poyntingflux dominated jet accelerated far away from the source (e.g. Drenkhahn & Spruit 2002;Granot, Komissarov & Spitkovsky 2011). As the synchrotron flux drops with the magnetic field, an increase in the shock velocity keeps the low-energy flux density at a level comparable with the high-energy component.
Following Uhm & Zhang (2016), the peak energy of the observed synchrotron spectrum is E p ∝ ΓB (where Γ is the Lorentz factor of the radiating material), and the peak flux scales as F ν,p ∝ N ΓB, where N (∝ r/Γ 2 ) is the number of electrons assumed to be constantly injected in the emitting region. Thus, considering a magnetic field in the comoving frame dropping as B ∝ r −b , and a Lorentz factor increasing as Γ ∝ r s , Uhm & Zhang (2016) (where, to derive the last proportionality we employed the relation t obs ∝ t/Γ 2 ∝ r/Γ 2 ∝ r 1−2s ) and F ν,p ∝ t . As the peak energy should drop by about five orders of magnitude in the emitting region (going from ∼ 200 keV to ∼ 2 eV), the exponent (1 − b)/(s − b) ≈ 0 to get a nearly constant flux density as was observed. This implies that b ≈ 1. For such a drop in the comoving magnetic field, E p ∝ ΓB ∝ r s−1 or E p ∝ r −2/3 ∝ Γ −2 for s = 1/3 that is expected in Poynting-flux dominated models, which implies that the emitting region should extend over ∼ 7.5 decades (e.g., from 10 10.5 cm to 10 18 cm), while Γ increases by a factor of ∼ 10 2.5 . Given that even at the initial radius Γ 10 2 is typically required because of compactness arguments, this would require an unreasonably large Γ 10 4.5 near the peak time of the optical emission.
In conclusion, while the possibility that the optical emission shares a common origin with X-and gammarays cannot be completely ruled out, it is hard to explain with synchrotron emission. There are further difficulties in explaining the broadening over such a large frequency range. Moreover, a common origin does not naturally explain the convex spectrum shown in Fig. 5, which suggests a distinct spectral component in the optical.

Optical, X-rays and gamma-rays originated from reverse and internal shocks
Finally, we consider the possibility that the optical emission originates from the external reverse shock 4 that decelerates the ejecta as it sweeps up the external medium, while the X-rays and gamma-rays are from prompt emission (e.g., produced by internal shocks or magnetic reconnection within the ejecta).
A reverse shock component is expected as the expanding relativistic ejecta encounters the circumburst matter (CBM; be it the ISM for short-hard GRBs or the stellar wind of the massive progenitor star for long-soft GRBs). A forward shock is driven into the CBM, a reverse shock is driven upstream into the unshocked part of the ejecta, and the two shocked regions are separated by a contact discontinuity. A reverse shock is predicted to produce a single peak in the light curve, which may appear similar to a flare (see, e.g., Sari & Piran 1999b;Kobayashi et al. 2007), as the electrons are heated and cool primarily by synchrotron radiation and inverse-Compton scattering of the synchrotron photons (synchrotron self-Compton; SSC). Kobayashi et al. (2007) study the variability and the temporal indexes expected in a X-ray emission created in the reverse shock region. A reverse shock must display a time variability scale of ∆t/t ∼ 1 (Kobayashi et al. 2007) and varies as F ν ∝ t 5(p−1)/4 before the peak and ∝ t −(3p+1)/3 after the peak. We observe a ∆t = 130 s and t = 100 s in the optical band and therefore ∆t/t ∼ 1.3, consistent with a reverse shock component.
It is useful to compare the temporal indices expected for this model to our observations in X-and gammarays. We divide the X-ray sharp peak in two regions to fit them with power-law segments. From T + 70 s to T +200 s with a peak in T +100 s, we found temporal indexes of α X,rise = −7.11±2.77 and α X,decay = 5.42±2.54 for the rise and decay respectively. Using the value of p described in § 3 of p = 2.32±0.30 for the afterglow phase, we expect a F ν ∝ t 5(p−1)/4 = t 1.65 before the peak and ∝ t −(3p+1)/3 = t −2.65 after the peak. The observed values are quite different to those expected theoretically for α X,rise and α X,decay . Therefore, we can conclude that a reverse shock (at the jet head) is not a plausible mechanism for the X-ray sharp peak of GRB 180325A, which likely originated from internal shocks.
On the other hand, early optical afterglows often have an external reverse shock (RS) origin (Meszaros & Rees 1993). In addition, a RS may explain the temporal behaviour of the optical light curve in GRB 180325A. In particular, a peak on a time comparable to and slightly longer than the duration of the prompt GRB emission is expected for a reverse shock that is at least mildly relativistic -the "thick shell" case, and the observed optical light curve may correspond to a mildly relativistic RS (see, e.g., Nakar & Piran 2004).
To reproduce the observations, we assume synchrotron radiation and consider the emission of the two components, i.e. internal and external shocks. We employ the formalism of Cantó et al. (2013) for the dynamics of internal shocks in relativistic jets with a time-dependent injection velocity and mass-loss rate. This formalism takes into account the loss of energy and momentum due to radiation. Cantó et al. (2013) found an analytic solution for the dynamics of the internal shocks in the case where the material is ejected from the central engine with a step function velocity variation. Upper panel: Light curves (in three energy bands) emitted from the working surface as result of the interaction between two internal shocks (solid lines) and by the (external) reverse shock (dashed lines). Synchrotron emission is assumed in all the cases. X-and gamma-rays produced by the RS are negligible, and the optical emission produced by the IS is smaller than the corresponding RS component. The observed increase in flux associated with the IS is likely due to the shells not being uniform in density as assumed in our model. Bottom panel: Spectra emitted by the reverse and forward shock formed by internal shocks (at t = 82 s, "RS IS" and "FS IS" in the figure), and by the reverse and forward shock at the jet head (at t = 120 s, "RS" and "FS" in the figure). The RS dominates the emission in both cases.
We consider the interaction between two shells with normalised velocities β = v/c, where c is the speed of light, and Lorentz factors γ. We assume that the first shell is ejected with a slow velocity β s during a time interval ∆τ s , with a mass injection rateṁ s . After a time interval ∆τ 0 a second shell, with a fast velocity β f > β s and mass injection rateṁ f , is injected during a time interval ∆τ f . The two shells collide after a time t coll = β f ∆τ 0 /(β f − β s ) ≈ 2γ 2 s ∆τ 0 /(1 − γ 2 s /γ 2 f ) (mea-sured from the time when the ejection of the first shell ended) at a distance x coll = cβ s t coll . At this moment, a two shock structure (the working surface, WS hereafter), is formed at x coll . A forward shock propagates into the slow medium incorporating this material into the WS, and a reverse shock decelerates and incorporates the fast material. In addition, by assuming β s 1, the same formalism allows us to study the propagation of the jet head (with the WS made in this case by the forward and reverse shocks). To apply this formalism, one has to substitute in their equations the injection time of the fast material τ f by τ f − ∆τ 0 . This change does not affect the shell dynamics and is equivalent to a reference frame where x coll = t coll = 0, and the gas particles are injected at x coll = 0 with a velocity distribution shown in Figure 7. In Appendix A.1 we summarise their solution.
Light curves computed by employing the semi-analytic model described above (see Appendix A.2) are shown in Figure 6. We take χ e = 0.1 (internal shocks) and ξ e = 10 −3 (external shocks), being ξ e the fraction of electrons accelerated at the shock front. The light curves are produced by considering standard synchrotron theory with e = 0.1, B = 10 −2 and p = 2.32 for both components, RS and forwards shock (FS).
The high-energy component is due to internal shocks, with a Lorentz factors of γ f = 200 and γ s = 30 for the fast and slow shell respectively. We consider an isotropic energy E = 2.8 × 10 53 erg for both the slow and fast shell. The shells are injected during a time ∆τ f = ∆τ s = 2 s, with mass-loss rateṡ m s =ṁ f (sub indices s and f refer to slow and fast components respectively). The shells collide at R ∼ 10 15 cm and form a working surface which moves with a Lorentz factor ∼ 100. The energy of the fast and slow shells is (2) Given the values of ∆τ (s,f ) and γ (s,f ) specified above, this equation gives the explicit values oḟ m (s,f ) . On the other hand, the low-energy component is due to the reverse shock. The slow-moving material has γ s = 1.0017 (corresponding to a typical Wolf-Rayet wind velocity of v w = 10 8 cm s −1 ), γ f = 30,ṁ s = 10 −6 M yr −1 , ∆t s = ∞, ∆t f = 1, In the slow cooling regime, the synchrotron emission depends strongly on the value of ν m (i.e. the peak frequency). Then, to explain the observations with our model we need to choose fitting parameters such that ν m peaks close to optical frequencies in the reverse shock and to gamma frequencies in internal shocks (see Figure 6, bottom panel). That implies that: 1) the fraction of accelerated electrons ξ e in the RS is much larger in IS than in external shocks (as ν m ∝ 1/ξ 2 e ); or 2) the jet luminosity/ejecta energy is much larger in the IS than in the RS. In the first case, different values of ξ e in the IS and RS are typically considered in the literature. Both IS and the RS propagate in the ejecta, but shocks in IS are relativistic while the RS is only mildly relativistic. Nevertheless, it is not clear why the particle acceleration process is so inefficient in RS with respect to IS.
While the optical light curve shown in Figure 6 accounts for the main optical peak at ∼ 120 s, it does not account for the earlier optical peak at ∼ 50 s and the associated temporal variability that is reflected in these two peaks. This variability may potentially arise from the density structure within the ejecta that is encountered by the reverse shock, which is caused by the collision and merger of the original shells that produced the internal shocks responsible for the X-ray and gammaray prompt emission. This is in contrast to the model described above for the reverse shock, which assumes a perfectly uniform ejecta shell and therefore leads to a single peak in the light curve. An additional contribution to the time variability of the optical emission from the reverse shock may arise from a variation of the magnetization within the ejecta, where strongly magnetized portions suppress the reverse shock and its emission while mildly magnetized portions lead to a strong reverse shock with prominent emission.

SUMMARY AND DISCUSSION
We have presented optical photometry of the very early afterglow of GRB 180325A with the TAROT instrument from T +26 s. We complement these data with RATIR observations up to 30 hours after the burst.
We compare the optical light curve with gamma-and X-ray light curves from Swift/BAT and Swift/XRT respectively. We see an early gamma/X-ray/optical spike from T + 70 s, with a peak at about T + 100 s, and lasting until about T + 200 s. The peak at different times and with not the same duration, turns to GRB 180325A in a very special case of study.
By discussing possible scenarios for its origin we show that the X-ray/gamma-ray spike is likely have been generated by an internal shock while the optical spike is likely to have been generated by an external reverse shock. Interestingly, optical observations show an earlier flare, lasting about 10 s, which is also not associated with the high energy emission and is possibly also the result of a reverse shock. Observations of fluctuations in the optical reverse shock emission is atypical and might be the result of density/velocity fluctuations in the material crossing the reverse shock.

ACKNOWLEDGMENTS
We thank the referee for useful comments that helped to improve this article. We thank Fréderic Daigne for useful discussions. We thank the staff of the Observatorio Astronómico Nacional on Sierra San Pedro Mártir. RATIR is a collaboration between the University of California, the Universidad Nacional Autonóma de México, NASA Goddard Space Flight Center, and Arizona State University, benefiting from the loan of an H2RG detector and hardware and software support from Teledyne Scientific and Imaging. RATIR, the automation of the Harold L.

A. CALCULATION OF LIGHT CURVE AND SPECTRUM
Given the dynamical evolution of the forward and reverse shocks, we compute the multi-wavelength emission by assuming that it is produced by synchrotron radiation. We discuss here the dynamical evolution of the working surface, and how it is used to compute the emitted radiation.  Figure 8. Qualitative temporal evolution of the working surface Lorentz factor for Case I (green line) and Case II (red line). The initial constant velocity for the two cases is shown in blue.
In case II, the constant velocity phase ends when the slow material is completely incorporated into the WS, at a time t II c given by The WS then accelerates such that the Lorentz factor γ II ws (t) is where T (t) is given by the transcendental equation (35) in Cantó et al. (2013), wheret = t/∆τ s . The acceleration phase ends at a time t f , when the WS completely engulfs the fast moving material, i.e. when v f (t f − ∆τ f ) = R ws (t s ).
Finally, the velocity of the WS becomes constant when all the material has been incorporated (see Figure 8 for a schematic representation of the evolution of the Lorentz factor of the WS).
In the case of a fast shell that runs into a static medium with a density ρ s and β s = 0, since the mass-loss-rate iṡ m ∝ ρβ , the parameter λ can be written as λ = (ρ f γ f /ρ s ) 1/2 . Then, the phase of constant velocity has γ ws0 = λ + 1 (λ/γ f ) 2 + 2λ + 1 .
This phase ends at the time t I c when all the fast material has been incorporated to the WS. From then on, the WS decelerates continuously with a Lorentz factor given by eq. (7) and approaches asymptotically to rest (see case I in Fig. 3 of Cantó et al. 2013).

A.2. Synchrotron emission
We solve the Taub relativistic shock-jump conditions and compute the post-shock energy density e ps , density ρ ps and velocity v ps as a function of the WS velocity, the pre-shock densities and the velocities of the fast and slow material ejected from the central engine. Thus, the post-shock physical variables will evolve with time as the working surface accelerates or decelerates as discussed in Appendix A.1.
To compute the synchrotron radiation, we assume that a fraction χ e of the post-shock electrons are accelerated to relativistic speeds, forming a population of electrons N (γ e ) ∝ γ −p e , where p is the powerindex of the population of non-thermal electrons accelerated by the shock. The energy of the accelerated electrons and the post-shock magnetic field are taken as a fraction e and B of the post-shock thermal