The origin of X-ray coronae around simulated disc galaxies

The existence of hot, accreted gaseous coronae around massive galaxies is a long-standing central prediction of galaxy formation models in the $\Lambda$CDM cosmology. While observations now confirm that extraplanar hot gas is present around late-type galaxies, the origin of the gas is uncertain with suggestions that galactic feedback could be the dominant source of energy powering the emission. We investigate the origin and X-ray properties of the hot gas that surrounds galaxies of halo mass, $(10^{11}-10^{14}) \mathrm{M}_\odot$, in the cosmological hydrodynamical EAGLE simulations. We find that the central X-ray emission, $\leq 0.10 R_{\mathrm{vir}}$, of halos of mass $\leq 10^{13} \mathrm{M}_\odot$ originates from gas heated by supernovae (SNe). However, beyond this region, a quasi-hydrostatic, accreted atmosphere dominates the X-ray emission in halos of mass $\geq 10^{12} \mathrm{M}_\odot$. We predict that a dependence on halo mass of the hot gas to dark matter mass fraction can significantly change the slope of the $L_{\mathrm{X}}-M_{\mathrm{vir}}$ relation (which is typically assumed to be $4/3$ for clusters) and we derive the scaling law appropriate to this case. As the gas fraction in halos increases with halo mass, we find a steeper slope for the $L_{\mathrm{X}}-M_{\mathrm{vir}}$ in lower mass halos, $\leq 10^{14} \mathrm{M}_\odot$. This varying gas fraction is driven by active galactic nuclei (AGN) feedback. We also identify the physical origin of the so-called"missing feedback"problem, the apparently low X-ray luminosities observed from high star-forming, low-mass galaxies. This is explained by the ejection of SNe-heated gas from the central regions of the halo.


INTRODUCTION
A long-standing fundamental prediction of galaxy formation theories within the ΛCDM cosmological framework is that a significant fraction of the baryons in massive dark matter halos should reside in a hot atmosphere that surrounds the central galaxy (White & Frenk 1991). However, the limited detections of significant extraplanar X-ray emission around MW-mass galaxies challenge these models.
In the early galaxy formation models of White & Rees (1978) and White & Frenk (1991) gas is accreted from the intergalactic medium (IGM) and falls into a dark matter potential. The subsequent behaviour of the accreting gas depends on the 'cooling radius', which is the radius at which the cooling time of the gas is equal to the dynamical time of the halo. In low mass halos, the cooling radius extends well beyond the halo and, consequently, if inflowing gas is shock-heated, it can efficiently cool and rapidly accrete onto the central galaxy on a timescale comparable to the free-fall time of the halo. However, in halos of virial mass, M vir 10 12 M , the cooling radius lies deep within the halo. Thus, infalling gas shock-heats to the virial temperature of the halo and settles into a hot, quasi-hydrostatic atmosphere of gas (Larson 1974; the idea of an extended, hot gas corona around the Milky Way was E-mail: a.j.kelly@durham.ac.uk already suggested by Spitzer 1956). In the innermost regions, the density of the gas is typically high, and therefore gas can radiatively cool and supply fuel for star-formation within the galaxy.
Several methods can be used to probe the hot gas surrounding galaxies, such as observations of the thermal Sunyaev-Zel'dovich (SZ) effect (Sunyaev & Zeldovich 1970;Vanderlinde et al. 2010;Planck Collaboration et al. 2013;Anderson et al. 2015) and X-ray emission, on which we focus in this work. In the analytic model of White & Frenk (1991) the typical temperature of the gaseous atmosphere is T > 10 6 K in a halo of mass, 10 12 M . Therefore, the atmosphere radiates as it cools through line-emission and continuum, with significant emission in the soft X-ray energy band, 0.5 − 2.0 keV (see Putman et al. 2012, for a recent review).
The first attempts to detect soft X-ray emission from hot, gaseous, coronae around nearby, late-type galaxies were made with the ROSAT X-ray satellite, but no convincing evidence for it was found (Benson et al. 2000). These observations instead provided upper limits for the X-ray luminosity of the coronae, which were almost two orders of magnitude lower than the analytical predictions of White & Frenk (1991). The origin of the overestimate can be traced back to the assumption in that paper that the gas has an isothermal density profile whereas, as found by Crain et al. (2010) in the GIMIC cosmological hydrodynamics simulations, the gas is more diffuse due to the removal of low entropy gas by star forma-tion and, most importantly on galactic scales, energy injection from supernovae Advances in X-ray detector sensitivity in the XMM-Newton and Chandra telescopes led to the first detections of diffuse X-ray emission around nearby, late-type galaxies (Strickland et al. 2004;Wang et al. 2005;Tüllmann et al. 2006;Li et al. 2007;Owen & Warwick 2009;Sun et al. 2009). While detections of diffuse, Xray coronae are now commonplace, a variety of studies have found that they appear as thick discs (Strickland et al. 2004), trace galactic outflows of Hα (Tüllmann et al. 2006), and have total luminosities that correlate strongly, and positively, with the recent starformation rate (Li & Wang 2013b). Highly star-forming galaxies, such as M82, also exhibit filamentary X-ray structures above, and below, the galactic plane (Strickland et al. 2004;Li & Wang 2013a). These observations and inferred correlations suggest that the dominant source of the X-ray emission around local disc galaxies is gas heated by supernovae (SNe) feedback 1 , rather than gas cooling from an accreted quasi-hydrostatic atmosphere. This interpretation, however, is in conflict with more recent deep XMM-Newton observations of NGC 6753 (Bogdán et al. 2017), NGC 1961(Anderson et al. 2016) and NGC 891 (Hodges-Kluck et al. 2018. These data provide compelling evidence for the existence of hot, lowmetallicity atmospheres of gas that are consistent with accretion from the IGM and subsequent shock-heating to the virial temperature of the halo. Nevertheless, the source of X-ray emission around late-type galaxies, like the Milky Way (MW) and M31, remains controversial.
A further important unknown is the mass fraction in hot atmospheres. In galaxy clusters, the halos are almost 'baryonically closed' Vikhlinin et al. 2006;Pratt et al. 2009;Lin et al. 2012), such that their baryon-to-dark-matter mass ratios within the virial radius are approximately equal to the mean cosmic ratio, f b = ρ b /ρ m , where ρ b and ρ m are the baryonic and total matter density of the universe, respectively. This ratio is taken to be 0.157 (Planck Collaboration et al. 2013). However, the baryon fractions of halos around L * galaxies, appear to be much lower than this and thus a significant fraction of the baryons appear to be 'missing' from the haloes . In this paper we also study the gas fraction of halos, f gas , which we define as the ratio of the mass of hot gas to halo mass, normalised by the mean cosmic baryon fraction, f b . Galaxy halos also contain cold and warm, which is detectable in absorption studies of galaxies (Tumlinson et al. 2017), however in the halo mass range we focus on, hot gas dominates the total baryonic mass.
In this paper, we use the large volume, cosmological hydrodynamical simulation suite EAGLE (Schaye et al. 2015;Crain et al. 2015;McAlpine et al. 2016) to probe the origin, mass and X-ray properties of the hot gaseous atmospheres surrounding present-day disc galaxies. We use the simulations to investigate the relative contributions of the accreted shocked-heated gas and winds heated by feedback to the X-ray luminosity, L X , of hot gas atmospheres. We then compare the soft X-ray scaling relations L X − M vir and L X − M star for a large sample of simulated disc galaxies with observational data over a wide range of halo masses, (10 11 − 10 15 ) M . We further examine the effect of the varying gas fraction of halos on the slope and the normalisation of the L X − M vir relation.
The EAGLE simulations have previously been shown to reproduce a wide range of observations of real galaxies, such as low-redshift hydrogen abundances (Lagos et al. 2015;Bahé et al. 2016), evolution of galaxy stellar masses (Furlong et al. 2015) and sizes (Furlong et al. 2017), star-formation rates and colours (Trayford et al. 2015(Trayford et al. , 2017 along with black hole masses and AGN luminosities (Rosas-Guevara et al. 2016).
The paper is structured as follows. In Section 2 we discuss the simulations, the selection of our simulated disc galaxy sample, the method used to calculate the X-ray luminosities and present analytic predictions for the L X − M vir relation. In Section 3 we perform a baryon census of the EAGLE reference simulation. We then investigate the origin of the X-ray emission in Section 4.1 and attempt to understand how this depends on both the spatial region around the galaxy and the halo mass. In Section 4.3 we compare the results of the simulations to a range of observational data. We further investigate the effects of AGN feedback on the X-ray and gas properties of halos by comparing simulations with differing AGN models. In Section 4.2 we investigate the L X − M vir scaling relations in the EAGLE simulations and compare them to our analytical predictions. In Section 5 we discuss how to infer the gas fractions of halos from the measured L X − M vir relation. Section 6 we introduce the "missing feedback" problem and use high cadence simulation outputs to identify the physical origin in the simulations, before concluding in Section 7.

Numerical simulations
We make use of the large volume cosmological hydrodynamical simulations, EAGLE (Evolution and Assembly of GaLaxies and their Environments, Schaye et al. 2015;Crain et al. 2015;McAlpine et al. 2016), to follow the evolution of galaxies and their gaseous atmospheres. The EAGLE simulations adopt a ΛCDM cosmology with the parameters of Planck Collaboration et al. (2013) listed in Table 1 of Schaye et al. (2015).
The EAGLE simulations were performed with a highly modified version of the GADGET-3 (Springel 2005). The fluid properties are evolved using the particle-based smoothed particle hydrodynamics (SPH) method (Lucy 1977;Gingold & Monaghan 1977). The EAGLE simulations use a pressure-entropy formulation of SPH (Hopkins 2013), with artificial viscosity and conduction switches (Price 2008;Cullen & Dehnen 2010) which, when combined, are referred to as ANARCHY.
The EAGLE simulations include a variety of sub-resolution baryonic physics relevant to galaxy formation such as radiative gas cooling (Wiersma et al. 2009a), star formation (Schaye & Dalla Vecchia 2008), metal enrichment (Wiersma et al. 2009b), blackhole seeding, active galactic nuclei (AGN) feedback (Springel 2005;Rosas-Guevara et al. 2015) and feedback from stellar evolution (Dalla . The subgrid physics model has several parameters which were tuned to reproduce the presentday stellar mass function, the size distribution of disc galaxies and the relationship between galaxy stellar mass and central black hole mass. It is important to note that the gas properties of the simulations were not tuned to match any observations and, as a result they are genuine predictions of the galaxy formation model. The prescription for energy injection from SNe feedback is critically important as SNe can deposit large amounts of thermal and kinetic energy into the gas immediately surrounding the galaxy. Observations show that the energy feedback from SNe can heat the gas to temperatures, T ≥ 10 7 K, which is hot enough to contribute to the X-ray luminosity within the galactic halo (Strickland & Heckman 2007). Observations suggest that this hot gas is also able to drive winds via conversion of thermal to kinetic energy, which can propagate to large radii enriching and heating material (Rupke 2018). It is not currently possible to resolve individual stars or SNe within large volume cosmological simulations; instead, a single stellar particle of mass, ≈ 10 6 M , represents a population of stars. The simulations then require a prescription for energy deposition and metal enrichment from each star particle onto the surrounding gas which is tuned in order to reproduce a variety of observed galaxy properties.
Traditionally, hydrodynamical simulation codes have injected the energy from SNe events within a single stellar population (SSP), represented by a star particle, over a large mass of gas (Schaye & Dalla Vecchia 2008;Creasey et al. 2011;Keller et al. 2014). For a standard stellar initial mass function (IMF) there is ≈ 1 supernova per 100 M of initial stellar mass. Assuming the energy from SNe within this SSP is injected into a mass of gas equal to the initial stellar mass formed leads to high initial temperatures for the gas, T ≥ 10 7 K. In the case where the same amount of energy is distributed over a much larger mass of gas, the temperature increase experienced by the gas will be much lower, which reduces the cooling time. If the cooling time is significantly shorter than the sound-crossing time of the gas, the energy injection is no longer able to drive winds efficiently. Schaye & Dalla Vecchia (2008) showed that in this case, simulations are unable to reproduce observed star-formation rates and stellar masses of galaxies. There are several different SNe energy injection techniques that have been used to address this 'over-cooling' problem, including injecting energy in kinetic form, depositing the energy thermally while disabling radiative cooling for a short period and dumping the energy both thermally and kinetically (e.g. Hernquist & Springel 2003;Schaye & Dalla Vecchia 2008).
The EAGLE galaxy formation model injects the energy from SNe entirely thermally (Schaye et al. 2015). However, instead of distributing the energy evenly over all of the neighbouring gas particles, it is injected into a small number of neighbours stochastically (Dalla . This method allows the energy per unit mass, which corresponds to the temperature change of a gas particle, to be defined. In the simulations, each gas particle heated by SNe feedback is always subject to the same temperature increase, namely ∆T SN = 10 7.5 K. The AGN feedback proceeds in a very similar manner to the SNe feedback. In the EAGLE simulations black hole (BH) seeds are placed at the centre of halos with a mass greater than 6.7 × 10 9 M that do not already contain a BH. The rate of gas accretion by BHs is modelled using the local gas density, velocity and angular momentum, along with the mass of the BH. As the BH accretes gas, it accumulates a reservoir of energy equal to the energy of the gas mass accreted multiplied by the radiative efficiency, which is taken to be 10%. When the BH has stored sufficient energy, it can stochastically increase the temperature of some of the neighbouring gas particles by a temperature of ∆T AGN . In the reference simulations, particles are subject to a temperature change of ∆T AGN = 10 8.5 K; however this can be varied. A lower temperature change means particles are heated more often, a (higher) temperature change, less often. As previously mentioned, the parameters of the AGN and SNe feedback are calibrated so as to reproduce the galaxy stellar-to-halo mass relation.
In this work, we use several of the EAGLE simulations, described in Table 1 100 cMpc, populated with N = 1504 3 collisionless dark matter particles and an equal number of baryonic particles. The impact of AGN feedback is investigated by using two variants of the reference simulation. In the NoAGN simulation the AGN feedback has been disabled, whereas, in the AGNdT9 simulation, the AGN feedback has been modified such that each feedback event leads to a temperature change of ∆T AGN = 10 9 K. The remainder of the physical parameters, including mass resolution, remain the same. Further details of these different EAGLE simulations may be found in Crain et al. (2015).

Halo and galaxy identification
In this section we describe the procedure to identify galaxies in the EAGLE simulations at redshift, z = 0. We also describe the morphological criteria that we employ to select only galaxies with significant disc components. Dark matter halos are identified using a Friends-of-Friends (FoF) algorithm with a linking length of 0.2 times the mean dark matter interparticle separation (Davis et al. 1985). The gas, stars and BHs are associated with the FoF group of their nearest dark matter particle if it belongs to a FoF group. The constituent selfbound substructures (subhalos) within a FoF group are identified using the SUBFIND algorithm applied to both dark matter and baryonic particles (Springel et al. 2001;Dolag et al. 2009).
In this work we focus on centrals, which are the central galaxies in a dark matter halo. These are identified as the most massive individual subhalos with a centre of mass lying within a 20 proper kpc (pkpc) radius of the centre-of-mass of the host FoF group. If no such subhalo exists within the FoF group, we discard the halo. We further require that galaxies be subhalos containing at least 500 star particles, in order to ensure we have a large sample of star particles to use for morphological classification.
We compute the spherical overdensity mass (Lacey & Cole 1994) of each FoF halo about the deepest particle within the potential of the halo. We define the halo radius to be the spherical radius within which the mean enclosed density is ∆ times the critical density of the universe, ρ c . We generally adopt ∆ = 200 to define virial quantities but we also use ∆ = 500 in some analyses to allow a more appropriate comparison to the observational data of Anderson et al. (2016).

Morphological and isolation selection
We characterise the morphology of galaxies by means of the κ rot parameter introduced by Sales et al. (2012). The parameter is de-fined as, where K is the total kinetic energy of the stellar particles, m is the mass of each stellar particle, j i,z is the z-component of the specific angular momentum, R i is the 2D projected radius from the z-axis and the sum is performed over all stellar particles within the galaxy. The galaxy is oriented such that the total angular momentum of all stellar particles within the galaxy lies along the z-axis. We consider all stellar particles within a spherical radius of 30 pkpc around the most bound stellar particle to be associated with the galaxy. In general κ rot ≈ 1 for discs with perfect circular motions, whereas κ rot ≈ 1/3 for non-rotating systems. A visual inspection of the stellar projections, both edge-and face-on, of galaxies in Sales et al. (2012) suggests that κ rot ≥ 0.50 corresponds to galaxies that exhibit clear disc morphology. We also apply an isolation criterion to the sample of disc galaxies analysed. We only select galaxies in halos which do not intersect a sphere of radius, 3R 200 , spanned by any of their neighbouring halos. These galaxies are undesirable as their X-ray emission is often dominated by the hot gas associated with their (more) massive neighbours.
We can increase the stringency of the disc criterion by increasing the required threshold value of κ rot , but in this work, we define disc galaxies to be those with κ rot ≥ 0.50; this results in a sample of ≈ 5000 disc galaxies in the fiducial simulation, Ref-L100N1504. Increasing κ rot further reduces the size of our sample significantly, but does not change our main results; decreasing the value leads to the selection of a large number of galaxies that have no observable disc component in projection, e.g. elliptical and irregular galaxies which would not be appropriate for comparison with most of the observational samples considered here.
Galaxies with halo mass, ≥ 10 12.5 M , are not subject to any morphological criterion. This is because very few halos of this mass host disc galaxies in EAGLE and the primary observational data to which we compare in this mass range makes no selection for disc galaxies.

Computing the X-ray emission
The X-ray emission of galactic gas coronae is calculated in postprocessing. The X-ray luminosity of each gas particle is calculated independently using the precomputed lookup tables from the Astrophysical Plasma Emission Code APEC 3.0.1 data (Smith et al. 2001;Foster et al. 2012). The data assumes that the gas is an optically thin plasma in collisional ionisation equilibrium. The total cooling rate is computed for individual elements as a function of photon energy. The total cooling rate per element is computed by integrating over a given range of photon energies, 0.5 − 2.0 keV. We then calculate the total cooling rate by summing the overall contribution of each element, where X i is the ratio of the element abundance in the gas relative to the solar abundance, Λ X,i is the cooling rate of the gas in the X-ray band, 0.5 − 2.0 keV (hereafter, soft X-ray), assuming solar abundances, and Λ X is the total soft X-ray luminosity. We use the solar abundances of Anders & Grevesse (1989) to normalise the abundances in our simulations.
The summation in Eqn. 2 is performed over nine elements: hydrogen, helium, carbon, nitrogen, oxygen, neon, magnesium, silicon and iron, which are independently tracked within the simulation. The total X-ray luminosity from the hot halo is the sum of the X-ray emission of all the particles within a given spatial region. This X-ray calculation does not include contributions from nongaseous X-ray sources within galaxies, e.g. X-ray binaries. The effect of these sources is discussed when comparing to suitable datasets.
We calculate the projected coronal soft X-ray luminosity around a galaxy in the following way. We select all gas particles within a sphere of radius, R 200 , centred on the centre-of-mass of the halo. The total X-ray emission is then calculated by summing the X-ray emission from all the gas particles within a 2D annulus through the sphere.
The APEC software, used to generate the X-ray luminosity emission tables, was not used to generate the emission tables used for calculating cooling rates within the simulations; instead, the simulations used tables generated by CLOUDY. This use of two different emission tables can lead to an error in the computations of X-ray luminosities. For example, if the APEC emission tables predict higher emissivity than CLOUDY, then the X-ray luminosity will be overpredicted since a self-consistent simulation using the APEC cooling tables would have less gas at the same density and temperature due to the faster cooling. This effect is not important for gas with long cooling times, but it may be significant for gas with shorter cooling times. We expect this to be a small effect in this work as the X-ray emission is dominated by hotter, slower cooling gas ≈ 10 6 K.

L X − M vir relation
For gas in hydrostatic equilibrium in a dark matter halo, L X ∝ M α vir . If the bolometric X-ray emission is dominated by thermal bremsstrahlung radiation, halos have a constant gas fraction, and the gas density profiles are self-similar, then the slope of the scaling relation has the classical value, α = 4/3 (Kaiser 1986;Sarazin 1986). However, in the halo mass and energy range considered in this work, the first two of these assumptions are not valid.
We can derive the scaling relation in the halo mass range, 10 12.0 − 10 13.5 M , and energy band, 0.5 − 2.0 keV, following the work of Böhringer et al. (2012): where f gas is the gas fraction of the halo normalised by the cosmic baryon to total mass ratio; Λ(T vir ) is the cooling function of the gas as a function of the virial temperature, T vir ; and M vir is the virial mass 2 In the halo mass range, 10 11.5 − 10 13.5 M , the cooling rate, Λ X , is approximately proportional to the temperature of the gas, as demonstrated in Appendix B. As the virial temperature scales as T vir ∝ M 2/3 vir , then Λ ∝ M 2/3 vir . In the case when the baryon fraction can be expressed as a power law, f gas ∝ M This derivation assumes that the halo gas is at the virial temperature of the halo and that the gas density profiles are self-similar as a function of halo mass. We explore the validity of these assumptions in Appendix A. It is often common to consider the X-ray luminosity as a function of stellar mass, e.g. L X ∝ M α * star . When the gas fraction is constant as a function of halo mass, the slope of the L X − M vir relation is α = 5/3. The increased steepness, compared to the classical self-similar prediction, α = 4/3, is due to the scaling of the cooling function in this halo mass range and energy band considered. It is also clear from Eqn. 4 that an increase in the halo gas fraction, f gas , with increasing halo mass, will result in a steeper slope for the L X − M vir relation.

BARYON CENSUS
The baryon fraction of our sample of disc galaxies is shown in Fig. 1 as a function of halo mass. Here, we plot the baryon fraction of stars, cold gas (T ≤ 5 × 10 5 K), hot gas (T > 5 × 10 5 K) and total baryons. The distinction between hot and cold gas is motivated in Appendix B, where we show the X-ray cooling function as a function of gas temperature. In general, gas below a temperature of 5 × 10 5 K has negligible X-ray emission in the energy band range, 0.5 − 2.0 keV, on which we focus in this work. Fig. 1 demonstrates that the baryon content of low-mass halos, M 200 < 10 12 M , is dominated by stars and cold gas. The total baryon fraction within these halos is much lower than the mean cosmic baryon-to-dark matter ratio. This low baryon fraction is the consequence of the efficient feedback which heats gas and can eject it to distances well beyond the virial radius of the halo (Schaller et al. 2015;Mitchell et al. 2019). In low mass halos we see a negligible contribution of mass from hot gas. This is not surprising since even if these halos hosted gaseous halos of accreted gas, their typical temperature would be ≤ 5 × 10 5 K, which we classify as cold gas. Since our sample of galaxies was selected to be isolated, dynamical interactions, such as stripping, should not affect the baryon content of the halos.
As the halo mass increases above a critical mass, M 200 ≈ 10 12 M , we find a rapid increase in the contribution of hot gas and in the total baryon fraction. The increase in the amount of hot gas is due to the virial temperature of the halos increasing to a value that exceeds the threshold for our definition of hot gas, 5 × 10 5 K. The increase in total baryon fraction is likely due to the deepening of the gravitational potential well of the halo, which increases its ability to retain gas heated by feedback. As the halo mass increases further, to ≈ 3 × 10 12 M and above, the hot gas becomes the predominant mass component within the halo. The cooling time of the accreted gas is now so long that, after shock-heating, the gas forms a hot, quasi-hydrostatic atmosphere at (approximately) the virial temperature of the halo (Larson 1974;White & Rees 1978;White & Frenk 1991).
In the EAGLE simulations, the feedback efficiencies of SN and AGN, which regulate the stellar mass and halo baryon fractions, cannot be predicted from first principles. As discussed in Section 2, adjustable parameters are calibrated to match observed present-day galaxy properties, such as the galaxy stellar mass function. The simulations also broadly reproduce the stellar-to-halo mass relationship inferred from abundance matching (Behroozi et al. 2013;Moster et al. 2013). However, EAGLE slightly underpredicts the stellar mass at low halo mass and slightly overpredicts it at high stellar mass (see Fig. 8 of Schaye et al. 2015). In contrast to the galaxy stellar mass function, the baryon fraction of halos are direct, non-calibrated predictions of the subgrid physics model.
Unfortunately, the gas fractions in real halos, at a given halo or stellar mass, are uncertain. Previous studies of hot gas in the Milky Way have suggested that the mass of hot gas within the virial radius ranges between (2 − 13) × 10 10 M (Nicastro et al. 2016), with various other estimates falling within this large range (Gupta et al. 2012;Faerman et al. 2017;Bregman et al. 2018). These constraints suggest that hot gas can account for a fraction between (10 − 100)% of the baryon budget of the MW. In higher mass objects, e.g. clusters, the baryon fractions are better constrained and the hot gas makes up between (70 − 100)% of the total baryon budget (Vikhlinin et al. 2006;Pratt et al. 2009;Lin et al. 2012). The results of Fig. 1 are consistent with current observational constraints. Fig. 1 shows that galaxies in halos of mass ≥ 10 12 M in the EA-GLE simulations are surrounded by hot gaseous coronae. While these gaseous atmospheres make up the majority of the hot gas mass in the halo, it is not clear whether they are the primary source of X-ray emission in these halos. Winds driven by feedback may dominate the X-ray emission as they are typically very hot, dense and metal-rich. Therefore, we must first identify the origin of the dominant X-ray emitting gas before meaningful comparisons can be made between simulated and observed X-ray halo luminosities.

The origin of the X-ray emission
We analyse the contribution of wind and accreted gas to the total Xray emission by considering the history of every gas particle within the virial radius of the halos. This gas can be classified into two categories: interstellar medium (ISM) and circumgalactic medium (CGM). The ISM is typically the high-density star-forming gas within the galaxy, whereas the CGM is the surrounding halo gas. In the EAGLE simulations, the ISM is usually defined as gas with Wind Accreted Figure 2. The soft X-ray luminosity, 0.5-2.0 keV, within different annuli around the galactic centre at z = 0 for a sample simulated disc galaxies in the EAGLE simulation, Ref-L100N1504, as a function of the halo mass. The top left, top right, bottom left and bottom right show the X-ray luminosity in the annuli 0.05 < r/R 200 < 0.15, 0.15 < r/R 200 < 0.30, 0.01 < r/R 200 < 0.10 and 0.15 < r/R 500 < 1.00, respectively. In all panels the simulated median X-ray luminosity is calculated for both accreted gas (green) and wind (blue) in halo mass bins of 0.20 dex and shown with the solid line. The luminosities of halos in bins sampled by fewer than five galaxies are shown individually. The shaded bands enclose the 15th and 85th percentiles within the same mass bins. The halo mass in each panel is taken to be M 500 , except for the lower-left panel where we use M 200 , to provide the best comparison to the respective observations in Section 4. a physical atomic number density, n H > 0.1 cm −3 , while all other gas within the halo is considered to be part of the CGM.
The typical definition of "wind" is gas that has been ejected from the ISM into the CGM or beyond. We, therefore, distinguish "wind" from "accreted" gas particles according to their ISM and halo accretion histories. Specifically, we compare the time since the particle was last classified as ISM, t ISM , to the time since the particle was most recently accreted into any FoF halo, t accretion . We calculate t accretion using high-cadence (240 equally-spaced outputs from when the age of the universe is 1 Gyr to 13.85 Gyr) simulation outputs to calculate the time when each gas particle was most recently not associated with a FoF group, t accretion . The t ISM is tracked by the simulation code which stores the most recent time, if ever, when a gas particle was at an atomic number density higher than the threshold for star formation, n H ≈ 0.1 cm −3 .
The case t ISM > t accretion indicates that a gas particle was accreted by the present-day halo after it was last in the ISM of a galaxy. This suggests the gas particle was within the ISM of a galaxy at an earlier time and was then ejected from that halo before joining the IGM of a progenitor of the present-day halo. This gas, in the context of the present-day host halo, represents accretion. By contrast, t ISM < t accretion indicates the gas particle has been in the ISM of the galaxy since it was last accreted into a progenitor of the present-day halo. This gas was accreted, cooled and joined the ISM before being ejected, probably as a result of feedback, into the CGM. We, therefore, classify these particles as wind.
In Fig. 2 we plot the coronal soft X-ray luminosity within several 2D annuli for a sample of disc galaxies selected from the Ref-L100N1504 simulation, as a function of the halo mass. These annuli are chosen as they allow a direct comparison with observations which we present in Section 4.3. We show the X-ray luminosity contribution from gas particles classified as accretion and wind separately, in green and blue, respectively.
The largest contribution from wind is seen in the bottom-left panel of Fig. 2 which shows the central region of the halo. In this annulus, the X-ray emission from wind can be up to two orders of magnitude more luminous than emission from accreted gas, with the median X-ray emission from wind about an order of magnitude more luminous than from accreted gas for halos of mass ≤ 10 13 M . However, above this mass, the median X-ray emission from accreted gas is typically more luminous, but there is still significant scatter likely reflecting different recent star-formation rates. The wind contributes disproportionately to the X-ray luminosity compared to its contribution to the gas mass, which is not shown. This is because the gas defined as wind is consistently hotter, more metalrich and denser than accreted gas (Crain et al. 2010). The upper percentile of the X-ray emission from wind in the bottom-left panel of Fig. 2 shows that the L X − M halo relationship flattens at low halo masses. This reflects the increase in X-ray luminosity in these halos, M vir ≤ 10 13 M , whereas there is no increase in the median, total X-ray luminosity of higher mass halos, M vir ≥ 10 13 M , due to wind in any of the annuli considered. In the lowest mass halos, M 200 ≤ 10 12 M , the L X − M halo relation steepens again as below this halo mass there is very little accreted gas sufficiently hot to produce soft X-rays. Therefore, the X-ray emission drops rapidly with decreasing halo mass for low mass halos. In these same halos the recent star formation rates are not converged in the reference simulation, increasing (decreasing) the resolution of the simulation increases (decreases) the star formation rate. As the the Xray luminosity in these halos is dominated by wind (see Fig.2), this means the X-ray luminosity may not be converged in these halos. Therefore, the X-ray luminosity predictions for these low mass halos should be used with caution. In more massive halos, M 200 ≥ 10 × 10 12 M both the recent star formation rate, and X-ray luminosity, are well converged with varied resolution.
In radial regions further out, we see a reduction in the contribution of X-ray luminosity from wind at a given halo mass. This reduction happens because feedback processes, which generate winds, are concentrated in the central regions of the halo. In the upper-and lower-right panels of Fig. 2, where the inner region is excised, we see that the X-ray emission from wind in lower mass halos, M vir ≤ 10 12 M , is of the same order as the total X-ray emission within the halo. However, for higher mass halos, the median Xray emission from accreted material is significantly more luminous than wind. As the halo mass increases further, the fraction of the X-ray emission produced by accreted gas converges to ≈ 100% at a halo mass of ≈ 10 13 M . These outer annuli are therefore ideal for probing quasi-hydrostatic, accreted halos without pollution from the X-ray luminous, metal-rich wind. It should be noted, however, that the X-ray surface brightness is much lower in the outer regions, and thus difficult to observe around individual galaxies. Nevertheless, Oppenheimer et al. (2020) argue that 4-year eROSITA observations should be able to detect X-ray emission out to ≈ 200 kpc for stacked data around halos of mass, ≥ 10 12 M .
We note that the X-ray emission from diffuse gas which we classify as wind in the EAGLE simulations may not be representative of the X-ray emission around real highly star-forming galaxies. This X-ray emission is the result of a subgrid feedback model which injects thermal energy directly into gas particles. The direct heating of gas particles within the ISM of a galaxy, by both AGN and SNe feedback, leads to star particles of mass, M ≈ 10 6 M , with high-metallicities, Z ≈ Z , high densities n H ≥ 0.1 cm −3 and temperatures exceeding 10 7 K. The feedback model is, of course, just an approximation and its realism can only be established by comparison with observations, such as those in Section 4.3 below.
Interactions between wind and accreted gas complicate the identification of the origin of X-ray emission. In halos of mass ∼ 10 12 M we expect that the accreted gas is shock-heated to the virial temperature White & Frenk (1991). However, in some cases, there could be additional shocks caused by wind-halo interaction, whereby hot outflows heat the gas in the CGM. As a result energy injected by supernovae may be emitted by particles which we have classified as accreted. This can lead to an overestimation of the energy emitted by accreted gas. This effect will be largest in lower mass halos for two reasons. The first is that the velocity at which the ejected gas encounters the infalling gas is larger in small mass haloes. Secondly, in small halos, the X-ray emission produced by wind and accreted gas appear to be comparable, whereas in massive halos, accreted gas dominates the total X-ray emission.
In summary, we find that a large fraction of the X-ray emission in the central region, R < 0.10R vir , of halos of M vir ≤ 10 13 M is produced by wind, which is the direct result of feedback processes associated with stellar evolution and AGN. However, when the central region is excised, the gas classified as accretion becomes the predominant source of X-ray emission in halos of mass ≥ 10 12 M . This shows that accreted X-ray emitting coronae do exist around halos of mass M vir ≥ 10 12 , as predicted by White & Frenk (1991), at least within the EAGLE hydrodynamical simulations.

The X-ray scaling relations
The coronal soft X-ray luminosity in 2D annuli for our sample of disc galaxies selected from the reference EAGLE simulation is shown in Figs. 3 and 4 as a function of halo and stellar mass respectively. These annuli are the same as those considered in Fig. 2 The general trend in Figs. 3 and 4 is that the X-ray luminosity increases with both halo and stellar mass. We can also see that the scatter in X-ray luminosity, at either a fixed halo or stellar mass, increases with decreasing mass. The larger scatter at low mass may be interpreted as the result of the greater importance of non-gravitationally heated gas, which is concentrated around the central regions and not directly related to the halo mass. As the halo mass increases, the scatter in the X-ray luminosity decreases, reflecting the increasing importance of gravitational heating on the X-ray luminosity.
As we can see in Fig. 3 the L X − M vir relationship is fairly well described by a single power law over approximately three orders of magnitude in halo mass. We plot the best-fit line to the relation in all panels of the figure using linear regression on the logarithm of the median of the X-ray luminosity as a function of the logarithm of the median halo mass. We find the exponent of the scaling relation, L X ∝ M α vir , for the median X-ray luminosity to be α = 2.2 ± 0.1, 2.6 ± 0.1, 2.1 ± 0.1, 2.8 ± 0.1 in the halo mass range, (10 11.5 − 10 13.5 ) M , for the upper-left, upper-right, lower-left and lower-right panels, respectively. Repeating this process with a best fit to the mean X-ray luminosity gives α = 1.8 ± 0.1, 2.4 ± 0.1, 1.3 ± 0.1, 2.5 ± 0.1 in the same mass range for the upper-left, upperright, lower-left and lower-right panels, respectively. We apply the same methodology to the L X − M star relation, shown in Fig. 4, in the stellar-mass range (10 9 − 10 11 ) M and find the exponent of the relation to be, α * = 3.4 ± 0.1, 3.5 ± 0.2, 3.2 ± 0.1, 3.5 ± 0.2 for the median X-ray luminosity in the upper-left, upper-right, lowerleft and lower-right panels, respectively. These slopes reduce to α * = 2.7 ± 0.2, 3.2 ± 0.2, 2.2 ± 0.2, 3.2 ± 0.2 in the same mass range for the mean X-ray luminosity, respectively. In all panels the simulated median X-ray luminosity is calculated in halo mass bins of 0.20 dex. The luminosities of halos in bins sampled by fewer than five galaxies are shown individually. The shaded bands enclose the 15th and 85th percentiles within the same mass bins. The dashed (dotted) lines show the best-fit to median (mean) X-ray luminosity in the mass range 10 11.5 < M vir / M < 10 13.5 . The teal region in the lower-left panel shows the same sample with all galaxies of X-ray luminosity below 10 37 ergs −1 excluded. The halo mass in each panel is taken to be M 500 , except for the lower-left panel where we use M 200 , to provide the best comparison to the respective observations.
The L X − M vir and L X − M star scaling relations are systemically flatter in the two left panels of Figs. 3 and 4 which probe the inner region of the halo. We also see that the difference in the slope of the scaling relations, L X − M vir and L X − M star between the best fit to the median and the best fit to the mean X-ray luminosity is much larger in these two panels.
The origin of the flatter slope, and the discrepancy between the mean and median X-ray luminosity over a small range of halo mass, is due to the enhanced X-ray emission in low mass halos, ∼ (10 11 − 10 13 ) M in the inner region compared to the outer region. The increased X-ray luminosity within the central regions is caused by feedback, as shown in Fig. 2. However, not all low-mass galaxies have recent star formation. Thus, we see a scatter of up to four orders of magnitude in the X-ray luminosity in these halos. Therefore, a small sample of highly star-forming, X-ray luminous galaxies are able significantly to increase the mean X-ray luminosity, while having a smaller impact on the median X-ray luminosity, at a fixed halo mass. As the median X-ray luminosity is less affected by feedback from recent star formation, we focus on the median Xray luminosity in the remainder of this paper. In the outer regions, displayed in the two right panels of Fig. 3, we find that the slope of the scaling relation, L X − M vir , is steeper than the analytical prediction for self-similar gaseous halos, α = 4/3, presented by Kaiser (1986) and Sarazin (1986) and the 1.8 value inferred from the observations of Anderson et al. (2015). We investigate the origin of the steeper slope of the L X − M vir scaling relation in Section 4.4.  Figure 4. The same as Fig. 3, but with the X-ray luminosity plotted as a function of the stellar mass of the central galaxy. The stellar mass is defined to be the total mass of stars within a 3D sphere of radius 30 pkpc. The dashed (dotted) lines show the best-fit to median (mean) X-ray luminosity in the mass range 10 9.5 < M star / M < 10 11.5 . The teal region in the lower-left panel shows the sample with all galaxies of X-ray luminosities below 10 37 ergs −1 excluded.

Comparison to observations
We now calculate the coronal X-ray luminosity from the simulated galaxies in a way that allows a fair comparison to observations, that is, within the same annulus and energy range. However, there are still limitations in the direct comparison of simulated and observed X-ray luminosities. For example, when calculating the Xray emission in an annulus, we only include gas within a sphere of the virial radius. However, in real observations, the line-of-sight Xray emission may be contaminated by non-gaseous X-ray sources such as X-ray binaries in the galaxy, or unrelated background and foreground objects. A fraction of the coronal X-ray emission in the real universe may be absorbed, particularly at lower energies. These effects are not considered when calculating the X-ray emission from simulated galaxies. As our analysis of the simulations is not instrument-limited, we include galaxies with X-ray luminosities well below the current detection threshold. The simulations thus contain more low luminosity objects than observational samples, but we account for that in the comparison with the data.
In the top two panels of Fig. 3 and Fig. 4 we compare the simulations to the data presented by Bogdán et al. (2015), who used Chandra to search for soft X-ray emission around eight normal spiral galaxies. No statistically significant diffuse soft X-ray emission was detected around any of these galaxies. We therefore use the inferred 3σ upper limits for our comparison. As these observations excise the central regions, any contamination unresolved X-ray point sources should be small.
The upper limits derived from the observations of Bogdán et al. (2015) generally overlap with the 15th to 85th percentiles predicted by EAGLE. However, these upper limits Bogdán et al. (2015) are consistently lower than the mean and median X-ray luminosity found in the simulations. Therefore, there does appear to be some evidence that the simulations are slightly, but significantly overpredicting the X-ray emission at large luminosities. However, the X-ray luminosities as a function of stellar mass in the simulations are significantly higher than the observational limits, as may be seen in Fig. 4. The reason for the discrepancy between the results at fixed halo and at fixed stellar mass could be due to two reasons. The first is that the stellar-to-halo mass relationship in the EAGLE simulations could be incorrect. However, abundance matching suggests that the EAGLE relation agrees well with the data (Schaye et al. 2015). Secondly, it could be that the halo or stellar masses inferred for the real galaxies is incorrect. The stellar masses in Bogdán et al. (2015) are estimated from K-band luminosities in the 2MASS survey, while the halo masses are estimated from the circular velocity of gas in the disc, which is then converted to a halo mass following Navarro et al. (1997). In Appendix C, we compare the stellar-to-halo mass relation of these observations with results from the EAGLE simulation. In particular, the central panel of Fig. C1 compares the stellar baryon fraction as a function of halo mass in three different EAGLE simulations to the observational estimates of Bogdán et al. (2015). These observations imply that the stellar mass accounts for between 15% and 50% of the baryon budget of the halos. However, constraints from abundance matching suggest that this value should be closer to 10% (Moster et al. 2013). This is indicative of an overestimated stellar mass, or an underestimated halo mass. As the stellar mass is more directly inferred than the halo mass, we assume that it is the halo masses that are underestimated.
As the X-ray emission is calculated in a halo mass dependent aperture, (0.05 − 0.15) R 500 , this can lead to an incorrect value for the X-ray luminosity. Since the X-ray emission is typically centrally peaked; an overestimated halo mass implies that the central region excised would be too large, leading to too low an X-ray luminosity. Thus, if the assumed halo masses are indeed too large, the data points on the upper-left panel of Fig. 3 should be moved up and to the left, reducing the discrepancy with the EAGLE simulations. The same data points would remain at the same stellar mass, but may also increase in X-ray luminosity in Fig. 4. Fig. 2 shows that, at least within the simulations, the observations of Bogdán et al. (2015) probe the transition between wind and accretion dominated X-ray emission. If the Bogdán et al. (2015) halo masses are underestimated, their data will shift towards the accretion-dominated regime. The overestimated X-ray emission in the simulations could then reflect excessive hot gas baryon fractions, or incorrect thermodynamic properties for the gas.
In the bottom left panel of Figs. 3 and 4 we compare the predictions from the EAGLE simulations to observations of massive, isolated spiral galaxies homogeneously reanalysed by Li et al. (2017). This sample includes the detections of NGC 1961 (Bogdán et al. 2013;Anderson et al. 2016) and NGC 6753 (Bogdán et al. 2013), which are referred to as "massive spirals". The CGM-MASS sample of Li et al. (2017) and a measurement of the Milky Way Xray luminosity from Snowden et al. (1997) are also included alongside the original sample of inclined disc galaxies presented by Li & Wang (2013a) and Li et al. (2014). These observations use Chandra and XMM-Newton to probe the inner regions of nearby halos.
We first consider the X-ray luminosity as a function of halo mass from the innermost region. In this regime the observations are consistent, in both the overall trend and scatter, with the simulated galaxies within the halo mass range (10 11 − 10 13 ) M . The agreement is particularly good when we exclude all simulated galaxies with X-ray luminosities below 10 37 ergs −1 , as shown by the teal region in Figs. 3 and 4. This luminosity cut is consistent with the observational limits of the data. For the highest mass halos the simulations appear to overestimate the X-ray luminosity; however, this is a tentative result given the small size of the observational sample. The simulations also reproduce the trend of the observed L X − M star relation in this innermost annulus. In the lower-left panel of Fig. 4 we see that below a stellar mass of ≈ 10 11 M the simulations are consistent with the observations, particularly once we exclude halos of luminosity below 10 37 ergs −1 . Fig. 2 shows that the dominant source of X-ray emission in the innermost region in the EAGLE simulations is hot winds produced by feedback. We therefore suggest that the observations of Li et al. (2017) are probing SNe-heated hot gas, rather than the innermost region of a hot accreted halo.
Finally, the bottom right panel of Fig. 3 compares our simulations to the stacked X-ray observations of Anderson et al. (2015), which consist of a sample of approximately 250000 "locally brightest galaxies" from the Sloan Digital Sky Survey. A more detailed description of the selection criteria is given in Planck Collaboration et al. (2013) but, in summary, galaxies are selected if they are brighter than a threshold in extinction-corrected Petrosian rmagnitude band while also being the brightest object within a 1 Mpc projected radius. These selection criteria were chosen in an attempt to select a population of 'central' galaxies. Our sample of simulated galaxies is subject to a conceptually similar selection process, in that we also choose isolated galaxies. The X-ray emission from the real galaxies is stacked in bins of stellar mass, and these stellar masses are converted into halo masses. It should be noted that for this sample an overdensity of ∆ = 500 is used to define the halo mass; to facilitate a fair comparison we also compute this mass for our simulated halos.
In the regime of MW-mass halos we find that the X-ray luminosities in the EAGLE simulations are in good agreement with the observations at both fixed halo and stellar mass. However, above this mass, the slopes of the L X − M vir and L X − M star relations in the simulations are steeper than for the real galaxies. The overprediction of the X-ray luminosity in the simulation peaks at a halo mass of ∼ 3 × 10 13 M and then decreases to around a factor of three for the most massive halos, ∼ 10 14 M . Wang et al. (2016) recalibrated the estimated halo masses of the Anderson et al. (2015) sample using weak lensing data. Wang et al. (2016) suggest that the halo masses from Anderson et al. (2015) are slightly too large, with an almost constant overestimation of between 0.05−0.10 dex (see Fig.  10, right panel of Wang et al. (2016)). Thus, using the L X − M vir slope of 1.9 for the Anderson et al. (2015) data we predict that correcting the halo masses would increase the X-ray luminosity, at a given halo mass, by a factor of approximately ∼ 1.2 − 1.5. Furthermore, a decrease in the inferred halo mass would decrease the virial radius, and therefore decrease the size of the excised central region. This would increase the X-ray emission, as emission is centrally peaked. We expect that these effects may change the results by up to a factor of two when combined. Given the large dynamic range of the data, this correction does not significantly reduce the tension between the EAGLE simulations and observations.

Effects of AGN
In this section we use the three EAGLE simulations, Ref-L100N1034, NoAGN-L050N0752 and AGNdT9-L050N0752, to investigate the effects of varying the implementation of AGN feedback on the L X − M vir relationship. The three simulations were introduced in Section 2. We repeat the sample selection process outlined in Section 2.3 independently in each simulation. The X-ray luminosity as a function of halo mass in the three simulations is displayed in Fig. 5 for the same spatial regions, and compared to the same observational data as in Fig. 3.
In all four regions we see that the X-ray luminosity in lower mass halos, ≤ 10 12 M , is unchanged by the variation of the AGN feedback implementation. In the EAGLE galaxy formation model AGN have little effect on galactic properties below this critical mass (Schaye et al. 2015;Rosas-Guevara et al. 2016;Bower et al. 2017;Davies et al. 2019). Observationally, it is also known that galaxies of stellar mass below ∼ 10 10 M , which corresponds to a halo mass of ∼ 10 12 M , seldom host powerful AGN (Kauffmann et al. 2003). Above this halo mass we see a general trend across all the spatial annuli: halos with no-AGN feedback have higher X-ray luminosities. The differences in the X-ray luminosity in simulations with and without AGN peak in the (10 12 − 10 13 ) M mass range. At higher masses, ∼ 10 14 M , the results from all the simulations appear to converge. However, this is a tentative result as the two (50 Mpc) 3 simulations have a small number of haloes in this mass range.
The AGNdT9-L050N0752 simulation has a modified AGN feedback model in which the change in temperature, ∆T AGN , due to AGN feedback is increased to 10 9 K. In this simulation we see that the X-ray luminosity at fixed halo mass in the range, (10 12 − 10 13 ) M , is lower than in both the reference and no-AGN models. The decrease in luminosity, which is typically about 0.5 dex, improves the agreement with the observations in all spatial regions. This indicates that the AGN feedback in the reference model is under efficient. Schaye et al. (2015) also found that the modified AGN feedback in AGNdT9-L050N0752 improves the agreement between simulated and observed X-ray emission for some of the most massive objects, M 500 ≥ 10 13 M . Further to this, Correa et al. (2018) found an upturn in the ratio of the cooling radius to the virial radius of high mass halos, ≥ 10 13 M , within the EAGLE reference simulation. This upturn has also been attributed to under efficient AGN feedback in high-mass halos. The increase in the cooling radius can account for the significant overprediction of the X-ray luminosity in the inner regions of high-mass halos (as seen in the two left panels of Fig. 3).
In the EAGLE model, the main effect of AGN feedback is to eject gas beyond the virial radius of the halo, as we show in Section 5. This decreases the total hot gas mass and thus gas density in the halo, thus decreasing the X-ray luminosity at fixed halo mass. AGN feedback can also decrease the SFR in the galaxy, which would reduce the X-ray emission from wind in the inner-most regions. These results are consistent with those of Bogdán et al. (2015) who analysed a sample of spiral galaxies in the Illustris simulations. Their "textbook" Illustris spiral galaxies undershoot the observed X-ray emission, a fact that Bogdán et al. (2015) attributed to over-efficient radio-mode AGN feedback which acts to reduce the baryon fraction.
It is also interesting to note that the FIRE simulations analysed in van de Voort et al. (2016) do not include AGN feedback and recover the observed X-ray emission in (10 12 − 10 13 ) M more convincingly than the EAGLE reference model. The reason for the improved agreement in this case may the implementation of stellar feedback which, in the FIRE simulations, can drive efficient winds, even in high mass halos. It is clear from Fig. 2 in van de Voort et al. (2016) that the hot gas baryon fraction within their halos is ∼ 0.25 f b at a halo mass of ∼ 10 13 M , which is lower than that found in any of the EAGLE simulations we are considering.

ESTIMATING THE GAS FRACTIONS FROM THE
In Section 2.5 we showed that the dependence of the baryon fraction on halo mass is encoded in the L X − M vir relation. An increase in baryon fraction with halo mass increases the slope of the relation and vice versa. If a power law can describe the gas fraction as a function of halo mass, then Eqn. 4 can be used to calculate the halo mass dependency of the gas fraction from the logarithmic slope of the L X − M vir relation. We evaluate this technique using the Xray luminosity, halo masses and gas fractions of our three EAGLE simulations, Ref-L100N1034, NoAGN-L050N0752 and AGNdT9-L050N0752. The variations in AGN feedback lead to noticeable differences in baryon fraction and its dependence on halo mass for halos of M vir ≥ 10 12 M .
In the left-hand panel of Fig. 6 we plot the coronal soft X-ray luminosity, in mass bins of 0.20 dex, within an annulus, 0.15 < R/R 500 < 1.00. The X-ray luminosity is plotted as a function of halo mass, as in Fig. 3, focusing on the mass range of interest, M 200 ≥ 10 12 M , where significant gaseous halos are present (see Fig. 1). The right panel shows the median gas fraction within the same annulus as a function of halo mass, M 500 . As in Section 4.2, we fit straight-lines to the logarithm of both the median X-ray luminosity and the median gas fraction plotted against the logarithm of the halo mass. We fit both of these properties in the halo mass range, 10 12.5 −10 13.5 M , and tabulate the best-fit parameters in Table 2. The mass range we fit in is different from that in Section 4.2 and thus the slopes are slightly different.
We now use the slope of the L X − M vir relation to estimate the scaling of f gas with M vir . According to Eqn. 4, f gas ∝ M β vir with β = (α vir − 5/3)/2 (where α vir is defined through L X ∝ M α vir vir ). We can calculate this scaling directly in the simulations, as it is the slope of the best-fit line shown in the right-hand panel of Fig. 6. We tabulate α vir , the predicted value of β and the empirical value of β from the simulations in Table 2. The 1 − σ errors of the best-fit parameters, calculated from the covariance of the Jacobian, are also included.
As Table 2 shows, the measured values of the logarithmic slopes of the f gas − M vir relation in all three simulations agree well with our predictions from Section 4.2, within 1.3σ. The steepening of the L X − M vir above a slope of 5/3 is accounted for by the variation of the gas fraction as a function of halo mass. This demonstrates that the X-ray emission is adequately described by Eqn. 4 and that the variation of the gas fraction makes an important and measurable contribution to the logarithmic slope of the L X − M vir relation. In particular, we can distinguish between simulations with different AGN implementations by the slope of the corresponding L X − M vir relation. In principle, this same methodology can be applied to the real universe to understand how the gaseous baryon fraction varies, from MW-mass halos to galaxy clusters.
The L X − M vir relation flattens significantly at large halo mass, ≥ 10 13.5 M . This is caused by both a flattening of the soft X-ray cooling function with temperature (see Appendix B) and by the near-constant gas fraction in high mass halos. These effects should combine to produce an L X − M vir relation where L X ∝ M vir for halos of mass 10 13.5 M within the soft X-ray energy band. However, since the simulations analysed here have no objects in this mass range, we cannot test the validity of this prediction.
The data of Anderson et al. (2015) are consistent with a shallow L X − M vir scaling relation, with α vir ≈ 1.8, in the halo mass range M 500 ≥ 10 12 M . Anderson et al. (2015) attributed the increase from the logarithmic slope of 4/3 predicted by Kaiser (1986) and Sarazin (1986) to the effects of non-gravitational heating from AGN. They suggested that "self-regulated" AGN feedback should increase the X-ray luminosity of higher mass halos. In their picture, thermal instabilities due to radiative cooling in the hot halo result in high BH accretion rates, which cause energy build-up and subsequent feedback that heats the gas in the central region. This process repeats cyclically. However, in the EAGLE simulations, we find the opposite to be true. Table 2 shows that the shallowest slope of the L X − M vir relation occurs in the NoAGN-L050N0752 simulation. AGN feedback in the other two simulations significantly increases the logarithmic slope of the L X − M vir relation. We suggest that the primary effect of AGN feedback is to decrease the X-ray emission, at fixed halo mass, particularly in lower mass halos of M 200 ≈ (10 12 − 10 13 ) M . This is due to the ejective nature of AGN feedback which reduces both the mass and the density of the X-ray emitting gas.
A reinterpretation of the data of Anderson et al. (2015), shown in the left panel of Fig. 6, in the context of Eqn. 4 suggests that the halo gas fraction is approximately independent of halo mass, β ≈ 0.1. When comparing the simulation results with measurements derived from stacked observational data, it is more appropriate to compare to the mean of the simulated data rather than the median. We showed in Section 4.2 that the slope of the L X − M vir relation decreases by approximately 0.3 when fit to the mean, rather than the median, X-ray luminosity in the annulus 0.15 < R/R 500 < 1.00. This suggests that the low value of β, which we inferred from the Anderson et al. (2015) results could be higher, β ≈ 0.25. This result is more consistent with the gas fraction variation in the NoAGN EAGLE simulation which predicts the MW hot halo hosts approximately (30 − 40)% of the total halo baryon budget.
In summary, in the EAGLE simulations, we find that the steepening of the L X − M vir relation above 5/3 is due to the variation of the halo gas fraction with halo mass. Table 2 demonstrates that the slope of the f gas − M vir relation can be robustly and precisely extracted from observations of the L X − M vir relation in the halo mass range 10 12 − 10 13.5 M . This same methodology can be applied to the real universe to constrain the gas fraction of halos. As the f gas − M vir relation is strongly affected by AGN feedback, these constraints will provide insight on the scale and extent of AGN driven winds.   NoAGN AGNdT9 Figure 6. The coronal soft X-ray luminosity (left) and gas mass fraction (right) as a function of halo mass, M 500 . In both panels we only consider gas within the 3D virial radius, R 500 , and within the annulus 0.15 < R/R 500 < 1.00. The solid curves and shaded bands show the median and 15th to 85th percentiles in mass bins of 0.20 dex respectively. In bins that would enclose less than five objects we plot individual galaxies. The Ref-L100N1034, NoAGN-L050N0752 and AGNdT9-L050N752 are shown by the green, blue and red curves respectively. We also add best-fit lines in both panels, which are shown with dashed lines. The model parameters of the best fits are shown in Table 2. The black vertical lines show the range of halo mass over which the best-fit is calculated. The thick solid line segments in the right panel show the predicted slopes for the f gas − M vir estimated from the slopes of the L X − M 500 relation in the left panel, following Eqn. 4.

MISSING FEEDBACK PROBLEM
The inner region of the hot X-ray-emitting coronae around disc galaxies is the site of a complex interplay between the accreted, quasi-hydrostatic halo and the hot, metal-enriched winds driven by SNe feedback within the ISM (Putman et al. 2012). However, Xray observations of the inner regions of star-forming disc galaxies typically find relatively low X-ray luminosities (Li & Wang 2013a).
The observed X-ray luminosities can be compared with the rate of energy input into galaxies from SNe feedback. The coupling efficiency, η X , is defined as the ratio of the observed X-ray luminosity to the rate of energy input from SNe which can be calculated from the inferred recent star formation rate, η X = L X /Ė SN . In real observations, the mean value of this coupling efficiency has been found to be very small, approximately η X ≈ 0.004 (Li & Wang 2013b), and thus the energy input by SNe is said to be "missing". The apparent low X-ray luminosity is sometimes referred to as the "missing feedback" problem (e.g. Wang 2010). The fate of SNe-heated gas falls into one of three categories: (i) halo ejection: hot gas is rapidly blown out of the galactic halo and joins the intergalactic medium; (ii) galaxy ejection: hot gas is ejected from the galaxy but remains within the virial radius of the halo; (iii) galactic fountain: outflowing gas cools rapidly and infalls back into the ISM of the galaxy.
The low X-ray luminosity observed within the central regions of star-forming galaxies can be used to distinguish amongst these three possibilities. For example, in the case of an efficient galactic fountain, it is expected that there will be significant X-ray emission concentrated around the central regions of the halo. These X-rays will be emitted by hot, dense gas as it cools and falls back into the galaxy. The other two scenarios will lead to hot gas moving outwards through the galactic halo and thus reducing in density. These halos will have much less X-ray emission, for the same SFR, as less energy is radiated due to the lower density.
The value of the X-ray coupling efficiency in the EAGLE reference simulation is shown in Fig. 7 for a sample of isolated disc galaxies. We calculate the X-ray luminosity for all gas particles within a sphere of radius, R 200 , centred on the centre of mass of the halo. The rate of energy injection by SNe,Ė SN , is known in the EAGLE simulations: the subgrid model assumes that, on average, 8.73 × 10 15 erg g −1 of energy is injected per unit of initial stellar  Figure 7. The X-ray coupling efficiency, η X , as a function of halo mass in the EAGLE reference simulation for a sample of isolated disc galaxies. The X-ray coupling efficiency is defined as the ratio of the observed Xray luminosity to the rate of energy input due to SNe, L X /Ė SN . The power injected by SNe,Ė SN , can be calculated in the simulations from the mean star formation rate in the last 250 Myr and the mean energy injected per unit of initial stellar mass formed. The black line shows the median Xray coupling efficiency, in halo mass bins of 0.20 dex, where the X-ray luminosity has been calculated from all the gas within the virial radius. The shaded bands enclose the 15th and 85th percentiles. mass formed. This can be combined with the mean star formation within the last 250 Myr to calculate the mean energy injection rate. Fig. 7 shows that, typically, the X-ray coupling efficiency increases with halo mass. This is consistent with the work of Li & Wang (2013b) who suggest that halos with more gas in their central regions are able to retain more of the gas heated by feedback and thus be more X-ray luminous at a given SFR. The correlation between halo mass and X-ray coupling efficiency is consistent with the results of Fig. 3 which shows that in very low mass halos there is a very rapid increase in the X-ray luminosity with halo mass. As we can see in Fig. 2, low mass halos of M 200 ≤ 10 11.5 M , are winddominated and therefore the X-ray emission from them is powered by SNe. In these halos, there is a positive correlation between SFR and halo mass. As the X-ray coupling efficiency is also proportional to the halo mass, this results in a steep relationship between X-ray luminosity and halo mass for low mass halos.
We now attempt to understand the origin of the varying Xray coupling efficiency in the EAGLE simulations. We start by selecting all gas particles within the virial radius of disc galaxies in the EAGLE reference simulation that have been subject to direct SNe heating within the last 25 Myr at z = 0.1. We then use a series of high-cadence outputs from the simulations to track several properties of the selected particles as a function of time, starting approximately 300 Myr before the feedback event, until ≈ 800 Myr after. The particles are then separated into four z = 0 host halo mass bins: M 200 < 10 11 M , 10 11 < M 200 / M < 10 12 , 10 12 < M 200 / M < 10 13 and M 200 > 10 13 M . We plot the median atomic number density, temperature, radius and X-ray luminosity of each particle in each halo mass bin at every output. These are shown in the upper-left, upper-right, bottom-left and bottom-right panels of Fig. 8 respectively. The shaded regions show the bands that enclose the 20th and 80th percentiles.
In Fig. 8 we see that prior to the feedback event, the majority of the gas is dense (≈ 0.1 cm −3 ), cold (≈ 10 4 K) and near the centre of the halo. This is consistent with being the ISM of the central galaxy. In the output immediately after the feedback event, the gas undergoes an almost instantaneous temperature increase to approximately 10 7 K, which is lower than the peak temperature of 10 7.5 K imposed by SNe feedback. This suggests that the initial cooling rate must be very high and, as a result, the maximum temperature is poorly sampled. In the 25 Myr after the feedback event, the median temperature of the SNe-heated gas, in all but the most massive halos, declines to ≈ (1 − 3) × 10 6 K. As the gas evolves further, the median temperature stabilises; this is likely because the density has decreased and thus, the radiative cooling efficiency has also decreased. As the density and temperature stabilise, the X-ray luminosity reaches an approximately constant value that correlates with halo mass. In the most massive halos, ≥ 10 13 M , the post-SNe temperature of the gas is approximately a constant value of 10 7 K. This high temperature is likely the result of the feedbackheated gas approaching thermal equilibrium as it mixes with the surrounding hot halo gas.
The 3D physical distance from the centre of the galaxy, normalised by the virial radius of the host halo, is plotted in the bottomleft panel of Fig. 8 as a function of time since the feedback event.
In the lowest mass halos, M 200 < 10 11 M , the median gas particle subject to feedback leaves the virial radius of the halo in less than 200 Myr. On the other hand, in the more massive halos, 10 12 < M 200 / M < 10 13 , the median particle is still within the inner half of the virial radius after 500 Myr. In lower mass halos, the density drops more rapidly. These effects combine to compound the "missing feedback" problem in low mass halos, as seen in Fig. 7. It is also likely that these effects are not independent, e.g. leaving the halo more rapidly will result in faster decreasing densities.
Fundamentally, the EAGLE simulations predict that the socalled "missing feedback" is associated with outflowing material. Therefore we predict that halos with galactic fountains should have much higher X-ray coupling efficiencies. Future observations might be able to distinguish between efficient galactic fountains, as in the Auriga simulations (Grand et al. 2019), and the more outflowing, baryon-deficient halos produced in the EAGLE simulations.

CONCLUSIONS
The presence of hot accreted X-ray luminous gaseous atmospheres in quasi-hydrostatic equilibrium around late-type galaxies in halos of mass ≥ 10 12 M is a fundamental prediction of galaxy formation models within ΛCDM (White & Frenk 1991). After numerous failed searches for diffuse X-ray emission from these galaxies over the years, detections were finally forthcoming in the early 2000s, as discussed in the Introduction. However, these detections have often been attributed to hot, outflowing winds driven by feedback in the ISM of the galaxy rather than by accreted coronae. We have used the large-volume, cosmological hydrodynamics EAGLE simulations to investigate the origin and properties of the hot, X-ray emitting gas around disc galaxies. Although our focus has been on emission from individual ∼ L galaxies, we have also briefly considered more and less massive galaxies, particularly when discussing scaling relations. Our main results are as follows: • The EAGLE simulations predict that MW-mass halos are baryon deficient relative to the mean baryon faction (see Fig. 1). Specifically, they contain only ≈ 40% of the mean cosmic baryon fraction within their halo virial radius. About half of the baryons are present as a hot (T > 10 5.5 K) gaseous halo. This baryon deficiency is attributed to feedback which can drive halo-wide winds. In more massive haloes, M vir ≥ 5 × 10 13 M , the baryon fraction approaches the cosmic mean.
• The central halo X-ray emission in the EAGLE simulations is dominated by winds triggered by SNe feedback. The X-ray emission in the outer regions is generally produced by an accreted, quasi-hydrostatic hot gaseous halo (see Fig. 2). Excising the inner 0.10R vir of the halo is sufficient to remove the majority of the hot gas heated by SNe feedback in halos of mass ≥ 10 12 M , thus allowing us to probe the emission from hot, accreted atmospheres predicted in the analytic galaxy formation framework proposed by White & Rees (1978) and, for ΛCDM, by White & Frenk (1991).
• The EAGLE simulations reproduce the observed general trend of X-ray luminosity with halo mass; however, the simulations typically overpredict the X-ray luminosity in the outer regions of haloes of mass M vir ≥ 2 × 10 12 M (see Fig. 3). The origin of the ex-cess emission appears to be too high a gas fraction. Varying the parameters of AGN feedback to make it more expulsive, as in the AGNdT9-L050N0752 simulation, can improve the agreement with the observed X-ray luminosities. In the inner regions, where winds dominate the X-ray luminosity, the EAGLE simulations reproduce both the trend and scatter of the observed L X − M vir relation.
• We predict that any steepening of the logarithmic slope of the L X − M vir relation, above the self-similar value, α = 5/3, is due to a varying hot gas fraction with halo mass. We show that the logarithmic slope of the power-law relationship between gas baryon fraction and halo mass can be inferred from the L X − M vir relation using an analytical relation we derived, Eqn. 4. This relation holds across several EAGLE simulations which employ different AGN feedback prescriptions. The same methodology can be applied to future X-ray observations to constrain the slope, normalisation and scatter of the halo gas fraction as a function of halo mass.
• We identify the physical origin of the so-called "missing feed-back" around low-mass, star-forming galaxies. The EAGLE simulations suggest that much of the energy injected by SNe feedback is lost as hot gas is ejected from the halo into the low-density IGM (see Fig. 8). Hot winds, driven by SNe feedback, can leave low mass halos of mass, ≈ 10 11 M , in a timescale of ≈ 100 Myr. By contrast, in higher-mass halos, which have a more gas-rich central region, the outflowing gas is trapped at a higher density where it can radiate a larger fraction of the injected energy. This leads to a sharp increase in X-ray luminosity as a function of halo mass within the central regions. 10 12.0 -10 12.5 M 10 12.5 -10 13.0 M 10 13.0 -10 13.5 M Figure A1. Three-dimensional, spherically averaged radial density profiles of the gas within halos of disc galaxies in the EAGLE Ref-L100N1504 simulation. We show the median gas density profile in halos in mass bins of: 10 12 − 10 12.5 M (red), 10 12.5 − 10 13.0 M (blue) and 10 13 − 10 13.5 M (black). The density profiles are normalised by 200 times the critical mass density of the universe, the cosmic baryon-to-dark matter ratio and the gas fraction of each halo. The bands enclose the 30th and 70th percentiles.
halo. We see that the normalised gas density profiles in the central region vary significantly as a function of halo mass. However, in the outer regions, the gas density profiles exhibit self-similarity across two orders of magnitude of halo mass. This self-similarity also appears to be present in the GIMIC simulations (Crain et al. 2009) as may be seen in the top-left panel of fig 8 of Crain et al. (2010). While the slopes of the gas density profiles are clearly self-similar in Crain et al. (2010), the normalisation increases with halo mass due to the increasing gas fraction in high-mass halos.
In the central regions, the normalised gas density, at a fixed radius, is much higher in lower mass halos. This likely reflects the differing impact of feedback in these halos. In lower mass halos AGN feedback and, in some cases, SNe feedback, is able to eject gas to the virial radius and beyond. This will lower the total gas fraction of the halo, but if the process takes place over a long timescale, the density profile should remain unaffected. In more massive halos, winds driven by AGN are unlikely to leave the halo, and thus the net result is that gas is transported outwards. This process acts to increase the density at large radii while decreasing it at small radii.
The self-similarity of the hot gas profiles in the outer regions of the halo validates a key assumption in the derivation of Eqn. 3. The observed self-similarity reflects the fact that the gravitational forces are dominated by the dark matter distribution, which has previously been shown to be well converged for different subgrid physics models (Schaye et al. 2015). As such, when appropriately normalised by their individual gas fractions, the gas radial density profiles in the radial range, (0.15 − 1.00) R 500 , agree in both trend and normalisation. This is also expected from Fig. 2 in which we showed that the X-ray emission in this radial range (and the mass fraction which is not shown) are dominated by accreted gas. Although the gas density profiles in the EAGLE simulations display self-similarity, it is not clear whether this behaviour will be also be present in other cosmological hydrodynamical simulations or, indeed, in the real universe. Interesting future work might assess how well these results hold across other simulations with different subgrid models and parameters.

APPENDIX B: X-RAY EMISSION
In Fig. B1 we plot the cooling function from all ions assuming primordial abundance as well as metallicities Z , 0.1Z (Anders & Grevesse 1989), as a function of temperature using the AtomDB (v3.0.1) in the two energy bands (0.5 − 50) keV and (0.5 − 2.0) keV. We also show an approximation to the total soft X-ray cooling function for Z = 0.1Z . In general, we find that the behaviour of the cooling function in the (0.5 − 2.0) keV energy band can be well described by a simple power law relation Λ ∝ T for T ≈ (10 6 − 10 7 ) K and Λ = const for T ≈ (10 7 − 10 8 ) K.
These approximations do not adequately capture the rapid increase in the cooling function at a temperature of T ≈ 10 6 K. They also do not appropriately model the flattening of the soft X-ray cooling function at temperatures above 10 7 K, which is due to a significant fraction of the photons having energies outside the selected range. In general, these inadequacies have little impact in the halo mass range, 10 12 − 10 13.5 M , in which we apply these approximations. The right panel of Fig. B1 shows that a power law can describe well the cooling function in the (0.1 − 50) keV band over an even broader range of halo mass; however, there is limited observational data in that energy band.
A variety of observational estimates of the metallicity of gaseous coronae have yielded values of Z ≈ 0.1Z . This is consistent with the hot halo gas metallicity we find in the EAGLE simulations and in previous hydrodynamic simulations (e.g. Crain et al. 2010). It may be seen in Fig. B1 that the slope of the cooling function is largely independent of the metallicity which, however, has a larger effect on the normalisation. Therefore the metallicity of the gaseous corona is unimportant, as long as it does not vary significantly with halo mass.

APPENDIX C: STELLAR-HALO MASS RELATIONSHIP
In Fig. C1 we plot the stellar-to-halo mass ratio normalised by the mean universal baryon fraction, f b , as a function of M 500 (left panel) and M 200 (central and right panels). The results from three different EAGLE simulations, Ref-L100N1504, NoAGN-L050N0752 and AGNdT9-L050N0752, are shown. We also plot the observational data of Anderson et al. (2015) (left), Bogdán et al. (2015) (center) and Li et al. (2017) (right). We define the stellar mass as the total mass of stars within a fixed spherical aperture of radius 30 pkpc. This aperture is chosen as Schaye et al. (2015) found that it yields stellar masses similar to those inferred from the Petrosian-r band aperture often used in observational studies.
The two EAGLE simulations, Ref-L100N1504 and AGNdT9-L050N0752, have a consistent stellar-to-halo mass relation which, moreover, agrees with the results of Moster et al. (2013) from abundance matching (Schaye et al. 2015). However, the NoAGN-L050N0752 simulation overpredicts the stellar-mass in galaxies of ≥ 10 12 M . The stellar-halo mass relation of the two main simulations, Ref-L100N1504 and AGNdT9-L050N0752, broadly agree with the observations of Anderson et al. (2015) and Bogdán et al. (2015). However, the sample of Li et al. (2017) contains a population of low mass halos with very high stellar masses which are not found in the EAGLE simulations.
The stellar-dominated galaxies at low halo masses of Li et al. (2017) are inconsistent with the abundance matching predictions of Moster et al. (2013). The cause of this could be an incorrect inference of the halo mass from the measured rotation velocities. The uncertainty in the halo masses complicates the interpretation of the observational L X − M vir relation. This paper has been typeset from a T E X/L A T E X file prepared by the author.