MusE GAs FLOw and Wind (MEGAFLOW) X. The cool gas and covering fraction of Mg ii in galaxy groups.

We present a study of the cool gas ( ≈ 10 4 K) traced by Mg ii absorptions around groups of galaxies in the MEGAFLOW survey. Using a combination of two algorithms we blindly identify 32 groups of more than 5 galaxies at 0 . 3 < 𝑧 < 1 . 5 with 10 . 7 < log 10 ( 𝑀 / M ⊙ ) < 13 . 7. Among them 26 can be used to study potential counterpart Mg ii absorptions. We report that 21 out of the total 120 Mg ii absorption systems present in MEGAFLOW are associated with groups. We observe that the Mg ii rest-frame equivalent width ( 𝑊 2796r ) drops at an impact parameter of ≈ 150 projected kpc from the closest galaxy and ≈ one virial radius from the identified group center indicating that Mg ii halos scale with the mass of the groups. The impact parameter where the covering fraction exceeds 50% is log 10 ( 𝑏 / kpc ) = 2 . 17 ± 0 . 47 ( 2 𝜎 ) and ( 𝑏 / 𝑅 vir ) = 1 . 67 ± 0 . 98, which is ≈ 3 times larger than for field galaxies (log 10 ( 𝑏 / kpc ) = 1 . 67 ± 0 . 15). Finally, we estimate the cool gas column density profile in groups (from the 𝑊 2796r ) and show that its shape follows closely the typical dark matter column density profile for halos at similar redshift and masses.


INTRODUCTION
The detection of the Mg ii  [2796,2803] absorption doublet in the spectra of background quasars is one of the most efficient way to study the cool diffuse gas surrounding foreground galaxies or groups of galaxies.Indeed the low ionization potential of the magnesium (7.6 eV) makes it a good tracer of the cool photo-ionized gas at  ≈ 10 4 K and hence of H i (Ménard & Chelouche 2009;Lan & Fukugita 2017) that constitutes the major part of the mass of the Circumgalactic Medium (CGM).The Mg ii doublet has the advantage to be detectable in the optical from the ground at intermediate redshifts 0.3 ≲  ≲ 1.8.Mg ii absorption systems have played a crucial role in revealing the an-isotropic nature of the CGM, representing accretion along the galactic plane and bi-conical outflows (Bordoloi et al. 2011;Bouché et al. 2012;Kacprzak et al. 2012;Tumlinson et al. 2017;Zabl et al. 2019;Schroetter et al. 2019;Zabl et al. 2021).
However galaxies are not isolated objects.they are naturally clus-★ E-mail: maxime.cherrey@univ-lyon1.fr tered due to the hierarchical formation of large scale structures.A number of them live in groups (≲ 50 members) or clusters located at the nodes of the cosmic web and it is still not clear if Mg ii absorption systems are mainly associated with these over-dense regions.Indeed, even if several works revealed that Mg ii absorptions are often associated with multiple galaxies (Nielsen et al. 2018;Dutta et al. 2020;Hamanowicz et al. 2020), one can wonder if these observations can be explained by the natural correlation function or if they probe a favored presence of absorptions around over-densities.
halos.This picture was reinforced by several observations of strong absorptions probably caused by outflows from individual galaxies (Nestor et al. 2011;Guha et al. 2022).In group environments, the absorption strength would hence arise from the added contributions of the individual galaxies (Bordoloi et al. 2011;Fossati et al. 2019).However the study of the absorption kinematics in recent works points toward a more complex situation (Nielsen et al. 2018).Indeed several individual cases (Kacprzak et al. 2010;Gauthier 2013;Bielby et al. 2017;Epinat et al. 2018;Leclercq et al. 2022;Nielsen et al. 2022) revealed a complex intragroup medium affected both by outflows and various interactions.Furthermore, for more massive structures like clusters, the strength of the Mg ii absorption seems not to be correlated with their mass (Mishra & Muzahid 2022) nor the star formation rate (SFR) of the closest neighbour (Anand et al. 2022) and would thus be rather caused by interactions or intracluster media.
It is important to disentangle the strength (column density and kinematics), the probability and the spatial extent of the absorptions.Several works clearly found an anti-correlation of Mg ii absorption strength versus impact parameter for isolated galaxies or field galaxies but not for groups (Chen et al. 2010;Nielsen et al. 2018;Huang et al. 2021) indicating that the Mg ii halos would extend further in these environments (Bordoloi et al. 2011).Recent works also revealed that the probability to have an absorption associated with a group is significantly higher than for isolated galaxies (Nielsen et al. 2018;Dutta et al. 2020Dutta et al. , 2021) ) at similar impact parameter.
The above conclusions on Mg ii absorptions in dense environments are often difficult to draw for two main reasons.First the definition of what is a group is not always the same and in many cases it simply consists in having two or more galaxies in the field of view of the instrument (which implies that the definition depends on the field of view).Second because many surveys are absorption-centric, meaning that the groups/galaxies counterparts are only searched in the vicinity of the known absorptions.
We propose here to study the cool gas around groups in the MusE GAs FLOw and Wind survey (MEGAFLOW, desribed in Section 2) with an approach that remedies to these two issues.For that we first quantify clearly what is an over-density by using the two point correlation function and identify blindly all the groups in MEGAFLOW using a combination of two algorithms (Section 3).We then study potential Mg ii absorption counterparts (Section 4) and look at the Mg ii absorption profile.From that we estimate the H i column density profile and compare it to the dark matter column density profile for a halo of similar mass (Section 5).Finally we compute the Mg ii covering fraction around groups (Section 6) and compare our results to the existing literature (Section 7).Our conclusions are presented in Section 8.This approach is made possible by using VLT/MUSE as it offers the possibility to identify all galaxies down to the detection limit around a quasar LOS by scanning spectral cubes within a field of view of 1 × 1 arcmin 2 in the 4700 -9350 Å wavelength range.The Mg ii absorption lines are detected in the quasars spectra using high resolution spectroscopy performed with UVES (Dekker et al. 2000) in the range 3000 -11000 Å.

THE MEGAFLOW SURVEY
The present work is based on the MEGAFLOW survey (Schroetter et al. 2016;Zabl et al. 2019;Schroetter et al. 2019, Bouche et al. 2023 in prep), that aims at building a large Mg ii absorptionsgalaxies sample using combined observations from VLT/MUSE and VLT/UVES in 22 quasar fields.These quasars were identified in the Zhu & Ménard (2013) catalog built with SDSS spectral observations.They were selected because they have multiple (≥ 3) strong Mg ii absorptions ( 2796 r > 0.5 Å) at redshifts 0.3 <  < 1.5 such that the corresponding [O ii] doublet of their galaxy counterparts fall in the 4700 − 9350 Å range of MUSE.These selected quasars finally represent a total of 79 strong Mg ii absorption systems that constitute the MEGAFLOW DR1 catalog.
Follow-up observations were performed between 2014 and 2016 for each quasar using the VLT/UVES echelle spectrograph in order to obtain high-resolution (R ≈ 38000, pixel size ≈ 1.3 km s −1 ) 1D spectra.These observations were used to identify systematically all the Mg ii absorption systems in the 22 fields down to a detection limit of  2796 r ≈ 0.1 Å .Finally, 48 new absorption systems have been detected and added to the 79 already known strong absorptions to form a total of 127 absorptions that constitute the MEGAFLOW DR2 catalog.Among them 120 have low redshifts  < 1.5.For each absorption system,  2796 r was estimated with the evolutionary algorithm from Quast, R. et al. (2005) that models each absorption component as a Gaussian.
MUSE observations were performed between September 2014 and May 2017 during the Guaranteed Time of Observation (GTO) and using the Wide Field Mode.Adaptive Optics were used for 13 of the 22 fields.The cumulated exposure time per field ranges from 1h40 to 11h.The data reduction was performed using the ESO MUSE pipeline v1.6 (Weilbacher et al. 2012(Weilbacher et al. , 2014(Weilbacher et al. , 2016) ) and is described in detail in Schroetter et al. (2016), Zabl et al. (2019) and Bouche et al. 2023 in prep.In total, 2460 galaxies have been detected in the 22 quasar fields using both white light images and narrow band images produced by an algorithm that detects emission and absorption lines such as [O ii], H, Ca H&K, Ly and/or [O iii] (for a detailed description of the source detection process see Zabl et al. 2019).The redshift of the galaxies have been estimated by fitting their emission lines with a typical precision better than ≈ 30 km s −1 at  ≈ 1. Thanks to this double detection process the MEGAFLOW sample is not biased against either passive or star-forming galaxies and is 50% complete to r-mag ≈ 25.5 and to 7.7 et al. 2023 in prep ).
For this work, we are only interested in the 1208 galaxies that are located in the foreground of the quasars so we can study possible counterpart Mg ii absorptions.Most of them have a redshift 0.3 <  < 1.5 for which the [O ii] lines fall in the range of MUSE.The [O ii] flux detection limit corresponds to an un-obscured SFR limit of 0.07 M ⊙ yr −1 .The stellar masses of the galaxies are estimated, when possible, using the SED fitting algorithm coniecto (for details see Zabl et al. 2016) based on the stellar continuum and assuming a Chabrier Initial Mass Function (Chabrier 2003).The estimated stellar masses in MEGAFLOW range from 10 6 M ⊙ to 10 12 M ⊙ with a mean at 10 9.3 M ⊙ .

Characterization of over-densities
One of the difficulties while studying dense environments is to identify and to quantify local over-densities in the first place.A common way to proceed is to count the number of galaxies in the Field of View (FOV) around a given redshift.If this number is above a given threshold, then these galaxies are declared to belong to a group/an over-density.However, the threshold value is highly dependent on the size of the FOV of the instrument and must be chosen carefully to take into account the natural clustering present for all types of galaxies, even in non over-dense regions.
In order to quantify the number of galaxies that we expect in the MUSE FOV, we use the two-point correlation function  () which, by definition, gives the excess1 probability  to find a second galaxy in a volume d 2 at a distance  from a known galaxy position (Peebles 1980): where  is the mean number density if galaxies were not clustered.
The correlation function  () can be approximated by a power-law on large scales up to tens of Mpc: where the slope  is estimated to be  ≈ 1.8 (Marulli et al. 2013) and  0 is the correlation length.The latter is directly related to the mass of the halo considered (e.g.Mo & White 2002), and a large body of literature have measured  0 for a variety of galaxies and redshifts.
For instance, according to Cochrane et al. (2018), for star-forming galaxies at  ≈ 1 (similar to our survey), the  0 value corresponding to halos of mass  h = 10 11 M ⊙ is measured to be  0 ≈ 3 Mpc.On the other hand, for groups with halos of mass  h = 10 13 M ⊙ ,  0 is approximately 7 Mpc .Using Eqs.( 1)-(2), We can then compute how many galaxies above a given mass  we can expect to find in a cylinder of radius  and in a redshift interval ±Δ around the redshift  0 of a halo (this redshift interval corresponds to a distance   = Δ/((1 + ) ()) along the line of sight).For that we integrate the correlation function  () over the cylinder: (3) The number of expected galaxies above a given mass in such a cylinder is then ( ⊥ < ; | z | <   ) times (), the number density of halos of mass greater than  (here we use Tinker et al. 2008).
If we assume that a Mg ii absorption system is associated with a halo of mass ∼ 10 11 M ⊙ (here we do not consider an over-dense region), then we can estimate the number of galaxies that we can expect around it in the MUSE FOV.For that we can take  such that the cylinder has the same area on the sky as the MUSE FOV ≈ 3600 arcsec 2 ( ≈ 280 kpc at  = 1) and Δ corresponding to a velocity difference of 500 km s −1 .Adelberger et al. (2003) computed analytically the integrals in Equation 3 (their Equation.C2).Using their result we find that 3.3 ± 3.1 galaxies are expected in the MUSE FOV around an absorber in a region of mean density.It corresponds to an excess density of 14 compared to a pure random situation.The number of galaxies expected around an absorption system is presented in Table 1.We compare these values with Figure 1 that shows the observed distribution of the number of galaxies within ±500 km s −1 around each absorption system located at 0.3 <  < 1.5 in MEGAFLOW.We find on average 3.2 ± 3.0 galaxies per absorption system in the FOV which is consistent with the expected number computed above.We also observe that it is common to have up to four galaxies around an absorption system, but the histogram then falls at five galaxies due to the MUSE FOV.Thus we consider that this value defines over-densities (i.e.not consistent with the correlation function within the MUSE FOV).In this work we aim to study the cool gas in over-dense environment so we select groups made of at least five galaxies.
One can also calculate the number of groups with halo mass above a given value  h that we expect to find in MEGAFLOW.For that we multiply the volume of the survey by ( h ).We obtain that 8.1 ± 2.8 halos of mass  h > 10 13 M ⊙ are expected in MEGAFLOW.With the group finding method described below we find six groups with  h > 10 13 M ⊙ which is consistent with this estimation.

Method
To obtain a robust group sample, we proceed in two steps similarly to what is proposed in Rodriguez & Merchan (2020).First, we perform a classic Friends of Friends (FoF) algorithm in order to pre-select all the galaxies potentially belonging to groups.Second we refine the groups using an iterative method inspired by the halo occupation method described in Yang et al. (2005) (see details below).
For the first step, we use a standard FoF algorithm with the linking lengths Δ = 450 kpc and Δ = 500 km s −1 as recommended by Knobel et al. (2009) to optimize completeness and purity for the detection of groups of more than five galaxies.These values are in the high range of what can be found in the literature and we use them in order not to miss any galaxy that would belong to a group.With this FoF process, 38 groups of five or more galaxies are identified in the 22 fields of the MEGAFLOW sample.
As expected, some galaxies of the groups obtained with the simple FoF algorithm are suspected to be not gravitationally bound.Indeed, in some cases, phase space-diagrams reveal groups spread over redshift ranges corresponding to velocity differences up to 1500 km s -1 with some galaxies clearly standing out.
In order to remove the outlying galaxies, we use a process based on the halo occupation method described in Yang et al. (2005) and later in Tinker (2021).This process is based on the assumption, coming from both numerical simulations (Jung et al. 2022) and observations (Yang et al. 2009), that groups are usually formed in massive Dark Matter (DM) halos often containing a massive central galaxy.The idea is then to identify the most massive galaxies as potential group centers (defined as the center of mass of the DM halo in which the group is embedded) and to compute the corresponding DM halos properties (virial mass, virial radius, virial velocity) from their stellar masses using halo mass -stellar mass relation (Girelli et al. 2020) and concentration-mass (Correa et al. 2015) relation.The nearby galaxies located in the DM halos are then considered as satellite galaxies.Based on this idea, the following algorithm is performed to refine each group previously found by the FoF method: (i) If the galaxy with the highest  * has a mass larger than 1.5 times the mass of the second most massive in the group then we define it as the group center (hence the center of the halo).Otherwise we consider that there is no clear 'central galaxy' and we define the center as the group barycenter weighted by the estimated  * .
(ii) The group halo mass is estimated from the stellar mass of the most massive galaxy using the halo mass -stellar mass relation from Girelli et al. (2020).
(iii) The probability  sat to belong to the group is then estimated for each galaxy (see eq. 4).
(iv) The 4 galaxies with the highest  sat values are candidate members of the group.
(v) The halo mass of the group is recomputed from the velocity dispersion of these 5 galaxies (see eq. 9 below).
(vi) With the new halo mass, the  sat values are recomputed for the candidate galaxies.They are kept if  sat > 0.5.
(vii) The group halo mass is updated and the  sat values are recomputed for the remaining galaxies.The galaxy with the highest  sat value is added to the group if this value is above 0.5.
(viii) We repeat the process from step (vii) to add galaxies one by one until no remaining galaxy has a  sat value above 0.5.
The probability  sat to belong to the group is computed based on the DM halo properties following Yang et al. (2005).In practice, the probability  sat to belong to the halo is computed as: where  sat is the sensitivity parameter that would determine how far from the center of the halo we can go.Here we use  sat ≈ 10 which is the value recommended by Yang et al. (2005). proj and  z are the pseudo-probabilities corresponding to the projected and the line of sight directions respectively. proj at a given projected distance   from the center of the halo is given by: where  is a function defined as: and where  is the over-density corresponding to an isotropic Navarro-Frenk-White (NFW, see Navarro et al. 1997) DM profile defined as: where   is the characteristic scale parameter and  is the mean density of the universe.
z at a given redshift separation Δ from the center is given by: where  is the speed of light, Δ = Δ/(1 + ) is the velocity relative to the center and   is the velocity dispersion of the galaxies within the group, assumed to be The masses of the groups derived at step (vii) are estimated from the velocity dispersion of their members and their spatial extent.Indeed, under the assumption that a group is virialized, its mass can be related to the velocity dispersion of its galaxies along the line of sight  los and its radius  group : Where  group is estimated by taking the dispersion of the projected distance of the galaxies.The factor  must be taken such that the mass estimator is unbiased.Calibration tests using groups from TNG50 lead to a choice of  = 5.0 which is also the value recommended by Eke et al. (2004).
The virial radius of the groups are derived from their virial masses: where   () is the critical density of the universe at redshift  and Δ vir = 18 2 + 82 − 39 2 with  = Ω  () − 1 applicable for a flat universe with Ω  = 0 (Bryan & Norman 1998).
The main sources of error in our estimation of  vir are the estimation of the velocity dispersion  los and the estimation of the projected distance dispersion  group .Under the assumption of a normal distribution, the 1- uncertainty associated to an unbiased standard deviation estimator of value  on a sample of size  is equal to Markowitz 1968) where  () is given by: with Γ the gamma function.The above equation is used to estimate the uncertainty of the velocity dispersion and the projected distance dispersion.As a consequence, the error on  vir logically increases when the number of galaxies decreases.With fewer than five galaxies, the error on the virial radius is above 30%.For this reason and the one explained in Sect.3.1, we focus on groups of five galaxies or more in the rest of the analysis.The uncertainties on the virial mass are propagated to the virial radius.One of the main limitation of the method presented here is that groups can be truncated by the MUSE FOV.In such case the center of the group could be wrong and the group members badly identified.This effect is an additional source of error that we didn't take into account in this work.

The group sample
From the 38 groups of more than five galaxies detected by the FoF algorithm, we finally obtain 33 groups after the refinement process.One of them is at high redshift ( = 3.55), the others are in the range 0.3 <  < 1.5.We find six groups with an estimated halo mass above 10 13 M ⊙ , which is in line with the expected number estimated in Section 3.1.
Among the 33 groups, three have the same redshift as the quasar of the field (note that among our 22 quasars, only five of them are located at redshifts below 1.5 where our groups are preferentially detected using the [O ii] emission lines).We remove these three groups from the analysis because Mg ii absorption could be affected by the position of the quasar among the group and by the galaxy hosting the quasar (one of these groups is associated with an absorption).Another group is removed because it is located at a redshift higher than the redshift of the quasar.Three other groups located at redshift where there is no UVES coverage on Mg ii are removed from the analysis.In total seven groups are removed and we finally obtain a sample of 26 groups that we use as a basis to study Mg ii absorption in the quasars spectra.These groups have log 10 ( vir /M ⊙ ) ranging from 10.7 to 13.7 with a median value of 12.3 and with redshifts ranging from 0.5 to 1.4 with a median value of 1.0.16 out of the 26 groups have a central galaxy as defined at step (i).The centers of the other 10 groups are the barycenters weighted by the stellar masses of the galaxies.
The group sample is presented in Table 2.The individual groups are detailed in Table 3 and shown in Figure A. The number of galaxies per group as a function of their mass and redshift is shown in Figure 3.
We can also represent each group in a phase space diagram, where each galaxy is positioned according to its projected distance and its  Table 3. Characteristics of the groups of more than five galaxies identified in the MEGAFLOW sample.The groups are sorted by number of galaxy members identified.The columns present the group id (1), the quasar field (2), the number of members (3), the redshift (4), the angular coordinates (5 and 6), the estimated virial mass (7), the estimated virial radius in kpc (8), the Mg ii absorption rest-frame equivalent width in Å (9), the impact parameter relative to the center of the group normalized by the virial radius (10) and the impact parameter relative to the closest galaxy in kpc (11).velocity difference relative to the center of the group.The superposition of the 26 phase space diagrams is shown in Figure 4. We see that group members are found up to twice the virial speed and projected distances up to twice the virial radius of the groups.

Estimation of the SFR
We estimate the Star Formation Rate (SFR) of the group members using the dust corrected relation from Gilbank et al. (2010)  For 12 groups out of 33, the center corresponds to a galaxy that can be described as "passive" with a specific SFR (sSFR) below 0.1 Gyr −1 .For 5 additional groups, the center is within 50 projected kpc from a passive galaxy.This tendency to have quenched central galaxies due to interactions or merger events is well-know (Tal et al. 2014;Smethurst et al. 2017), and tends to confirm our group center identification.The passive galaxies are indicated in red in Figure A.

Mg ii ABSORPTION VERSUS IMPACT PARAMETER
Now that the groups have been identified in the MEGAFLOW sample, we want to study the cool gas around them by looking at Mg ii absorption seen in nearby quasars spectra obtained with UVES.For that we consider that a group is related to a Mg ii absorption system if the redshift difference relative to the group center is Δ < 1000 km s −1 .The choice of Δ is not crucial for the analysis as long as it is large enough to capture any potential absorption in the neighborhood of the group.For our sample, the group-absorption association remains identical for Δ ranging from 400 km s −1 to 6000 km s −1 .Out of the 26 selected groups, 21 can be paired with a Mg ii absorption system (nine having  2796 r > 1Å ) and five cannot be paired with any absorption system.To quantify the profile of Mg ii halos around groups of galaxies, we want to study how  2796 r varies with the impact parameter to the LOS.However, for groups of galaxies, We can see in Figure A that those different definitions are not necessarily in agreement.With our approach, the groups are assumed to lie in DM halos often containing a massive central galaxy.In consequence we focus on two definitions of the impact parameter:  min , the projected distance to the closest galaxy and  center , the projected distance to the group center.Even if these two definitions are correlated, they enable us to investigate whether absorption systems are more likely affected by the CGM of individual galaxies located close to the LOS or by the presence of an intragroup medium centered on the DM halo.
Intuitively one would expect the size of the cool gas halo to be correlated with the size of the DM halo of the group (and hence with its mass).For that reason we normalize  center by the virial radius of the group.We do not normalize  min by the virial radius of the closest galaxy because it would require to estimate the galaxy halo mass using the  * −  halo relation.However the stellar mass estimate from SED fitting could be uncertain in some cases and the  * −  halo relation has an important scatter. 2796 r as a function of  min and of  center / vir is shown in Figure 5.The uncertainties on  min are very small because they only consist in the precision with which the center of the quasar and the center of the closest galaxy could be determined.The uncertainties on  center are similar but for the groups with no central galaxy identified in step (i), they also include the propagation of the stellar mass uncertainties on the barycenter of the group.The uncertainties on  vir are computed by propagating the uncertainties on  vir described in Sect.3.2 using eq.10. Figure 5 clearly shows a scattered anti-correlation between  2796 r and impact parameter for both definitions. 2796 r seems to drop at ≈ 150 kpc from the closest galaxy or at the virial radius from the group center.The dispersion for the second case appears to be small even if some groups like the groups 7, 18 and 28 are standing outside of the main trend (see the discussion in section 7 for these cases).
To better characterize this decrease of  2796 r with the impact parameter, we fit it with a log-linear relation of the form: As shown in Figure 5, some groups with low  2796 r are affected by significant vertical uncertainties due to Mg ii absorption measurement meanwhile some groups are presenting high horizontal uncertainties when we consider  center / vir .These are mostly due to poor group center or group mass estimation.To take into account the uncertainties along the two axis, we use the results from Hogg et al. (2010) that define the angle  = arctan() and the vector orthogonal to the linear relation v⊺ = − sin  cos  .A measurement  of a given Mg ii equivalent width  2796  (hereafter we note   log  2796  ) at a given impact parameter   can be defined by the vector   and the associated covariance matrix   : The likelihood of such measurement can then be expressed as a function of the orthogonal displacement Δ  = v⊺   −  cos  and of the projected covariance matrix Σ  = v⊺   v. Finally, the total likelihood can be expressed as: where  is a constant.The first product corresponds to the likelihood of the points that have detected Mg ii absorption and the second products corresponds to the likelihood of the points that do not have Mg ii absorption detected but only have an upper on   .
For this fit we consider that    can be decomposed into two sub-terms: a measurement uncertainty    and an intrinsic scatter   due to the natural variations from group to group.In consequence we express    as the quadratic sum of these two components: The intrinsic scatter   is estimated following Chen et al. ( 2010) by comparing the deviation to the maximum likelihood solution to the measurement uncertainty: As the above equation depends on the likelihood solution, we iterate starting with   = 0 until we reach convergence.
Finally, when we consider the impact parameter  min , the intrinsic scatter converges to   = 0.42 dex and the best-fit parameter values are  = 1.14 ± 0.005 and  = −0.017± 0.001.
When we consider the impact parameter relative to the center of the group and normalized by the virial radius, the intrinsic scatter converges to   = 0.81 dex and the best-fit parameter values are  = 1.75 ± 0.42 and  = −3.90± 0.58.For this model  2796 r drops below 0.1 Å for an impact parameter of 1.03×  vir .The fitted models are shown along with the measured data in Figure 5.

H i AND DM COLUMN DENSITIES
In the previous section we have seen that the Mg ii absorption profile seems to scale with the halo mass which is consistent with the isotherm model from Tinker et al. (2008).If we assume that  2796 r is proportional to the amount of cool gas along the line of sight as suggested by the works of Rao et al. (2006) and Ménard & Chelouche (2009), it implies that the cool gas halo scales with the dark matter halo.Based on that idea we aim to compare the column density profile for these two components.
To estimate the DM column density profile we use the results from Diemer (2023).Instead of using a standard NFW profile (Navarro et al. 1997) which is not physical at high radii, they propose a functional form designed to take into account both orbiting and first in-falling DM particles as well as the asymptotic behaviour at large radii where the profile reaches the mean density of the universe.They finally suggest a form similar to a truncated Einasto profile.We use the colossus package (Diemer 2018), that implements this DM profile to compute the corresponding DM column density profile along the line of sight.For the comparison with our sample we consider a halo of mass 10 12 M ⊙ at  = 1 (the median halo mass and redshift for our group sample are respectively 10 12.3 M ⊙ and  = 1.0) We then estimate the H i column density from our Mg ii absorption measurement using the results from Lan & Fukugita (2017).They fit the correlation between Mg ii absorption strength and H i column density on a sample of Mg ii absorptions from several catalogs with redshift 0.1 <  < 4.5 for which H i column densities have been measured using H i absorption lines.They finally obtain the following relation: with  = 1.69 ± 0.13,  = 1.88 ± 0.29 and  = 10 18.96±0.10cm −2 .We use this model to estimate the H i column density in our groups and we propagate the uncertainties from the relation from Lan & Fukugita (2017).We find H i column densities of approximately 10 19 cm −2 to 10 20 cm −2 for the groups where we have Mg ii absorption detected.Our detection limit of ≈ 0.1 Å corresponds to a H i column density of approximately 2 × 10 17 cm −2 .We fit the H i column density profile with the method applied in section 4 on Mg ii .For H i we obtain the following parameters:  = −14.0± 0.3,  = −6.6 ± 0.2 .Figure 5 shows the DM column density profile along with the H i best fit and the H i column densities for each group.As we can see the H i and DM profiles present a very similar shape with a clear drop at the virial radius.

COVERING FRACTION
To further characterize the Mg ii absorption, the covering fraction is derived for the 26 selected groups of more than five galaxies.The covering fraction is commonly defined as the probability  of detecting a Mg ii absorption system at a given impact parameter from a galaxy or a group of galaxies.Practically, several methodologies are used in the literature to compute the covering fraction.Nielsen et al. (2018) compute the covering fraction in impact parameters bins by doing the ratio of galaxies associated to an absorption by the total number of galaxies in that bin.Dutta et al. (2020) use a cumulative covering fraction.Chen et al. ( 2010) take into account how the gaseous halo scales with the B-band luminosity to normalize the impact parameter.Here, to be consistent with previous analysis performed on MEGAFLOW, we adopt the logistic regression method described in Schroetter et al. (2021) to compute the differential covering fraction.This Bayesian method is particularly adapted in cases where bins would not be sufficiently or evenly populated.To describe it briefly, the probability  of detecting a Mg ii absorption system at a given impact parameter from a group is assumed to follow a logistic function of the form: where  is expressed as a function of the independent variables   and of the model parameters .In our case we consider that the variable is the impact parameter  and that  follows a logarithmic decrease of the form: The parameters of interest  and  are then fitted using a MCMC algorithm based on 9000 Bernoulli trials.This fit is performed using the pymc3 python module (Hoffman & Gelman 2011;Salvatier et al. 2015).Note that this method doesn't require any binning contrary to what can be found in other studies.In consequence our input are Booleans corresponding to the presence (or not) of an absorption.
In order to obtain a robust fit, two additional parameters are simultaneously fitted to take into account outliers:  out is the fraction of outliers in the sample and  out is the covering fraction associated to these outliers and assumed to be constant.The obtained best-fit parameters are listed in Table 4.

DISCUSSION
As mentioned in Section 4, three groups deviate significantly from the main  2796 r −  center / vir decreasing trend.Figure A gives us some hints on the particularities of these groups.The group 7 is below the relation.It's Mg ii equivalent width is low in spite of being at small impact parameter from the LOS.This behaviour could be explained by the fact that four galaxies around the group center are quenched.The low star formation activity in the central part of this group is synonym of low galactic winds and, hence, low amount of gas ejected from the galaxies into the CGM.The group 18 is also below the main trend.It presents an elongated shape with five out of six galaxies aligned so that they could be part of a filament.In such case this group would not be virialized and the cool gas could then possibly be preferentially distributed along the filament.The group 28 at the contrary is above of the relation.It is a very compact group with small velocity dispersion leading to a low estimated virial mass.As it is composed of only five galaxies the uncertainty on the virial mass is large.In addition the group has no clear heaviest galaxy, so we estimated the position of the center as the barycenter of the group members.The position of the barycenter suffers from high uncertainties from the estimated stellar masses of the members.These combined uncertainties lead to a large error bar that could explain why this group is standing outside of the main relation.
Figure A also reveals very different kinds of group morphologies.For instance groups 8, 15, 20, 27, 28, 29, 30 are very compact both in projected and in velocity space meanwhile groups 14, 19 and 21 seem extended and diffuse.We also observe few groups with particularly elongated shapes like groups 12, 18, 33.These groups could be part of filaments accreting toward nodes of the cosmic web.
The absorption systems also present some diversity.In many cases like for groups 1, 4 and 6, all the components seem to be mixed and form a single absorption system with large velocity dispersion.In other cases such as 13, 24 and 28 we clearly observe distinct components, that are nonetheless difficult to attribute to a specific member.In few cases like groups 4, 18, 19 or 22 we can possibly identify the galaxy counterpart of some absorption components.For the group 19, we can clearly attribute a specific absorption component for four out of the five members.For the group 4 we can see in the spectra an absorption component matching with the galaxy 13, lying outside of the group (and that have been rejected by the halo refinement algorithm).
We also observe that for five groups out of 26, no counterpart Mg ii absorption is found in the quasar spectra.For these five cases the estimated impact parameter to the center is relatively large which is consistent with the picture of a halo of cool gas vanishing at high distance.

Comparison with field and isolated galaxies
It is interesting to compare the covering fraction computed for our group sample to the covering fraction of field galaxies.For that we use the results from Schroetter et al. (2021) that estimated the Mg ii covering fraction for MEGAFLOW galaxies at redshifts 1 <  < 1.5 where both Mg ii and C iv absorptions could be observed with UVES.A total of 215 galaxies have been identified in this redshift range using their [O ii] emission.When multiple galaxies were present in the vicinity of an absorption system, they considered the impact parameter relatively to the closest galaxy.For that reason we compare their results to the covering fraction that we computed as a function of  min (top panel of Figure 7).The fact that we use the same survey and the same methodology to compute the covering fraction allows a consistent comparison between our results.The overlap between our group sample and the sample used by Schroetter et al. (2021) consists of five absorption systems out of the 52 that they used to compute their covering fraction.Finally we find that the covering fraction for groups is approximately three times larger than the one computed by Schroetter et al. (2021) (the 50% covering fractions are reached respectively at 148 kpc versus 47 kpc).
In terms of equivalent width, we observe that groups are not preferentially associated with strong absorptions in MEGAFLOW as shown in the  2796 r distribution presented in Figure 8. Indeed, on the 59 strong absorptions with  2796  > 1.0 Å only nine are associated with groups of five galaxies or more.Reversely, on the six groups with an estimated virial mass above 10 13  ⊙ only two present an associated absorption with  2796  > 1 Å .Our results are in line with the works from Bouché et al. (2006) and Lundgren et al. (2009) that have shown that  2796 r does not grow with the mass of the halo but is rather anti-correlated with it.
We also compare our results to Dutta et al. (2020).In their section 3.5 they present the covering fraction computed for their full sample of 228 galaxies at redshift 0.8 <  < 1.5.There are two major differ-ences with the work from Schroetter et al. (2021).First they did not select the quasar fields based on the presence of multiple Mg ii absorptions as it has been done for MEGAFLOW, arguing that it would prevent their analysis from any bias due to pre-selection.Second, their sample is mostly composed of continuum-detected galaxies (it contains only 14 galaxies that have been identified from the research of emission lines in the vicinity of known Mg ii absorptions).In their Figure 18 they show the covering fraction for their whole sample.When multiple galaxies are present around an absorption system they take into account all galaxies in their calculation.Their results show that the covering fraction is significantly affected by the choice of the absorption equivalent width limit.Nevertheless, in Figure 7 we show that their covering fraction is completely consistent with the covering fraction computed by Schroetter et al. (2021) on MEGAFLOW for an identical equivalent width limit of 0.1 Å.
It is also interesting to compare our result to the covering fraction estimated by Nielsen et al. (2013) for isolated galaxies.They defined galaxies as isolated if they have no neighbours within a projected distance of 100 kpc and LOS velocity interval of 500 km s −1 .They used 182 isolated galaxies at redshift 0.07 <  < 1.12 from the MAGIICAT sample which is built from a compilation of several galaxy-absorption pair samples (some of them consisting of galaxies identified around known Mg ii absorption systems).They computed the covering fraction for several absorption equivalent width limits.In Figure 7 we show their estimated covering fraction at 0.1 Å .We observe that their covering fraction for isolated galaxies is significantly higher than the covering fraction obtained for field galaxies in the previously mentioned papers but remains lower than the results we find for groups, though within the 95% confidence level.

Comparison with literature about groups
It is difficult to compare rigorously our results with the existing literature about groups, first because the definition of what is a group varies (for instance we do not consider pairs of galaxies as groups) and second because many different definitions/methods are used to estimate the covering fraction and could have impacts on the results.Nonetheless we can perform a qualitative comparison.Nielsen et al. (2018) studied the groups in the MAGIICAT sample.They show that the overall covering fraction (without taking into account the effect of the impact parameter) is higher for groups (at the 2.2  level) than for isolated galaxies.They also show that the Mg ii equivalent width is consistent with the superposition model proposed by Bordoloi et al. (2011) but that the absorption kinematics reveal a more complex behavior and make them favor the hypothesis that the absorptions are caused by an intragroup medium rather than by individual galaxies.This assumption is consistent with our finding that the extent of the Mg ii halo seems to scale with the mass (hence the virial radius) of the halo.Dutta et al. (2020) and Dutta et al. (2021) also studied the impact of environment on the Mg ii covering fraction at z ≈ 1.They find that the covering fraction around groups is three times higher than around isolated galaxies.This result is in line with our conclusion even if their definition of what is a group and their way to compute the covering fraction is different.
Finally, the interpretation of our results on groups along with the existing literature lead to the following picture: • Absorptions are mostly caused by individual or small ensemble of four or less galaxies compatible with their natural correlation in the field.In MEGAFLOW only 21 out of 120  < 1.5 absorptions are caused by groups of more than five galaxies.
• The  2796 r of absorptions associated with over-densities are not higher (Figure 8).This is consistent with the results from Bouché et al. (2006), Lundgren et al. (2009), Gauthier et al. (2009), that rather find an anti-correlation with the halo mass.Strong absorptions would hence be preferentially caused by un-virilized clouds of gas mostly due to strong outflows around starburst galaxies.At the contrary the quenching of galaxies as they enter groups lead to less extreme galactic winds and more virialized clouds.
• However, the spatial extent of Mg ii is higher for more massive halos, as  2796 r drops at the virial radius.
• The probability to find an absorption is much higher for dense environments (21 groups out of 26 are associated with an absorption, meanwhile the 101 remaining absorptions of MEGAFLOW are distributed between more than ≈ 1000 galaxies).

Potential effect of the quasar field pre-selection
One could object that the pre-selection of quasar line-of-sights based on the presence of multiple strong absorptions ( 2796 r > 0.5 Å ) could introduce a bias in the measurement of the covering fraction presented here.We believe that if it exists, this bias is small for the following reasons.
First, if a bias were present in MEGAFLOW it would have been seen in the analysis of Schroetter et al. (2021) for field galaxies.However, the covering fractions computed by Schroetter et al. (2021) and the covering fraction from Dutta et al. (2020) (on randomly selected LOS) or Lan (2020) are all very similar.
Second, as shown in Schroetter et al. (2021), the Mg ii equivalent width distribution (d/d) in MEGAFLOW follows the same exponential law (∝ exp(−  / 0 )) as found in random sight-lines (e.g Nestor et al. 2005;Zhu & Ménard 2013) but with a boosted normalization.Hence, even if there were a relation between the galaxy properties and the Mg ii absorption equivalent widths, the MEGAFLOW pre-selection procedure doesn't introduce a bias in the covering fraction.
Third, the covering fraction we compute for groups covers a very wide redshift range (0.3-1.5) with ≈ 4000 spectral channels, or ≈ 2000 independent possible redshifts given the MUSE resolution.The MEGAFLOW survey has ≈ 100 galaxies per field, of which ≈ 50-60 are at these low redshifts.Hence, having 3, 4 or 5 pre-selected absorptions might be affecting the covering fractions of 5-10% of the samples.In other words, there are no reasons to presume a strong bias due to the absorption pre-selection.
Finally, we performed a quantitative experiment using a simple toy model presented in appendix B to mimic the effect of the line-of-sight pre-selection based on the presence of multiple strong absorptions.For a sample of ≈ 20 selected fields (similar to what we have in MEGAFLOW) populated by ≈ 60 galaxies each, we only observe a small shift in the measured covering fraction, compatible with the 2- measurement error.With a sample ten times larger, this shift is significant at the 3.3- level.Finally we conclude that if existing, the bias would be at most 5-10% which is small compared to the factor three that we observe between the covering fraction of groups versus field galaxies.Bouché et al. 2023 (in prep) present an alternative model to estimate the effect of sight-lines pre-selection.They find that the field pre-selection has negligible effects on the measured covering fraction.They also reproduce the distribution of Mg ii absorption equivalent widths (d/d) and show that it is not affected by the selection process.

limitations and future prospects
The work presented here has several limitations.The first one is that, as can be seen from Figure A some groups are probably cropped by the FOV.In such cases the group center that we identified could be wrong, as well as the impact parameter relative to the quasar LOS.The impact of this effect is difficult to quantify and has not been taken into account in this work.However the fact that our group centers often match with one or several passive galaxies (as observed in the literature) makes us confident about the robustness of our group finding procedure.
The second one is that the redshift dependency of our results has not been investigated given the size of our sample.A possible improvement would be to increase the statistics and to fit the covering fraction as a function of both the impact parameter and redshift.
This work is focused on groups of 5 or more galaxies.We justified this choice by the analysis of the two point correlation function that reveals that the typical number of galaxies expected around an absorption system is ≈ 3 for the MUSE FOV.As we wanted to study over-densities, we focused on groups with a number of galaxies higher than this value.In addition, we wanted to derive the mass of the groups using the velocity dispersion of the galaxies.That method requires a sufficient number of galaxies.However, our FoF algorithm finds 93 groups having 3 to 5 galaxies.An extension of this work could be to investigate in more detail the absorptions in quasar sightlines in the vicinity of these smaller groups.
Finally, a detailed case by case analysis of the identified groupabsorption pairs taking advantage of the UVES high resolution spectra would be interesting and is planned to be explored in a future paper.

CONCLUSIONS
We presented our results about the cool gas traced by Mg ii around groups of galaxies in the MEGAFLOW survey.MEGAFLOW is based on observations from VLT/MUSE and VLT/UVES of 22 quasar fields presenting multiple (≥ 3) strong Mg ii absorptions.A total of 1208 galaxies were detected in the foreground of quasars, both from their continuum and emission lines (mainly [OII]), with estimated log 10 ( * /M ⊙ ) ranging from 6 to 12 and redshift ranging from 0.1 to 1.5.
Using a combination of a FoF algorithm and a halo occupation algorithm we identified a total of 33 groups of more than 5 galaxies.Among them 26 are located at the foreground of the quasars and can be used to study counterpart Mg ii absorptions within quasar spectra.These groups have 10.8 < log 10 (/M ⊙ ) < 13.7 and 0.4 <  < 1.5.The analysis of the group properties and their counterpart Mg ii absorptions led to the following conclusions: (i) On the 120 Mg ii absorption systems present in MEGAFLOW at  < 1.5, 21 could be associated with a group of more than five galaxies.
(ii) For five groups of more than five galaxies, no Mg ii absorption has been detected in the nearby quasar spectrum down to a detection limit of  2796 r ≈ 0.1 Å. (iii) The  2796  appears to be clearly anti-correlated with the impact parameter.It drops at ≈ 150 kpc from the closest galaxy and ≈  vir suggesting that Mg ii halos scale with halo masses.
(iv) The Mg ii covering fraction measured for groups is ≈ 3 times higher than the one computed for field galaxies.This result is consistent with other recent literature results.
(v) However contrary to some other studies we do not find that is higher in groups.It suggests that strong absorptions are preferentially caused by outflows induced by individual star forming galaxies rather than by accumulation of gas in the intragroup medium.
(vi) We derived H i column densities from  2796  and compared them to the dark matter column density profile for a halo of similar mass.The H i and DM profiles exhibit a very similar shape with a clear drop at the virial radius.
(vii) The groups present various morphologies: compact, diffuse, filamentary or irregular.The associated absorption systems are also diverse.They contain multiple absorption components that are difficult to attribute to individual galaxies.The dots are the galaxies, with a size proportional to the log of their estimated stellar mass.The red dots are the "passive" galaxies with a sSFR < 0.1 Gyr −1 .The galaxies circled in red are the galaxies that have been excluded from the group by the halo occupation method.The orange cross is the group center.The red star at (0,0) is the quasar.The green circle represents a 100 kpc radius around the quasar.Middle: the galaxy distribution in phase space (distance to the center of the group along the x-axis and velocity separation to the center of the group along the y-axis).The dashed vertical line is the estimated virial radius.The black lines are the escape velocity caustics computed from the estimated mass of the groups assuming NFW properties.Right: high-resolution spectra of the central quasar.The x-axis represents the velocity difference relative to the center of the group.The green vertical line is the estimated Mg ii absorption velocity difference.The blue lines are the velocity differences of the galaxies in the group.

Figure 2 .
Figure 2. Groups of more than five galaxies observed in each quasar field as a function of redshift.The groups are represented by the blue circles.The quasars are represented by the red stars.The detected Mg ii absorption systems are marked by the red vertical ticks.The blue vertical dotted lines indicate the [O ii] detection limits for MUSE.The green vertical dotted lines indicate the Mg ii detection limits for UVES.Two groups are present at similar redshift (≈ 0.61) in field J0800p1849 and cannot be distinguished on the figure.

Figure 3 .
Figure 3. Number of galaxies visible in the MUSE FOV as a function of the estimated halo masses for 26 selected groups of more than five galaxies identified in MEGAFLOW.The redshift of the groups is color coded.

Figure 4 .
Figure 4. Superposed phase diagram of the 26 selected groups of more than five galaxies.For all the groups the galaxies are plotted in the group center rest-frame.The projected distance to the center of the group is normalized by the virial radius and the velocity difference to the center of the group is normalized by the virial velocity.The grey open circles are the nearby galaxies rejected by the algorithm.The black lines are the escape velocity caustics computed from the estimated mass of the groups assuming NFW properties.

Figure 5 .
Figure 5. Mg ii absorption rest equivalent width versus impact parameter  to the closest galaxy (top) and to the group center normalized by the virial radius (bottom).The halo mass of the groups is color coded.The groups for which no Mg ii counterpart absorption system have been detected are represented by downward arrows and plotted at the detection limit.The represented error bars are 1-.The grey dashed line is the best fit of the form log 10 ( 2796  ) =  ×  +  and the shaded area is the corresponding 1- uncertainty.

Figure 6 .
Figure 6.Dots with right axis: H i column density derived from  2796  based on Lan & Fukugita (2017) for the 26 groups of more than 5 galaxies.The represented error bars are 1- uncertainties.The blue dotted line is the best fit of the form log 10 (Σ HI ) =  ×  + .Red dashed line with left axis: projected DM column density corresponding to the DM profile from Diemer (2023) for a halo with  = 10 12 M ⊙ and  = 1.

Figure 7 .
Figure 7. Differential covering fraction of Mg ii absorption of width  2796  > 0.1Å for the groups of five or more galaxies.Top: as a function of  min and compared with the results from Schroetter et al. (2021), Dutta et al. (2020) and Nielsen et al. (2013).Bottom: as a function of  center / vir .Each vertical black mark corresponds to a group, it is equal to one if there is a counterpart absorption system and zero otherwise.The shaded areas correspond to the 95% confidence level of the covering fraction.The error bars for Dutta et al. (2020) and Nielsen et al. (2013) correspond to the 68% confidence level.

Figure 8 .
Figure 8. Distribution of Mg ii absorption equivalent width for the 120 MEGAFLOW absorptions at 0.3 <  < 1.5 (in blue) and for the 21 groups of more than five galaxies (in orange) presenting absorption.The distributions have been normalized to be compared.

Figure A1 .
Figure A1.Visualization of the individual groups.Left column: groups in projected coordinates (right ascension and declination).The dots are the galaxies, with a size proportional to the log of their estimated stellar mass.The red dots are the "passive" galaxies with a sSFR < 0.1 Gyr −1 .The galaxies circled in red are the galaxies that have been excluded from the group by the halo occupation method.The orange cross is the group center.The red star at (0,0) is the quasar.The green circle represents a 100 kpc radius around the quasar.Middle: the galaxy distribution in phase space (distance to the center of the group along the x-axis and velocity separation to the center of the group along the y-axis).The dashed vertical line is the estimated virial radius.The black lines are the escape velocity caustics computed from the estimated mass of the groups assuming NFW properties.Right: high-resolution spectra of the central quasar.The x-axis represents the velocity difference relative to the center of the group.The green vertical line is the estimated Mg ii absorption velocity difference.The blue lines are the velocity differences of the galaxies in the group.

Figure B1 .
Figure B1.Assumed universal differential covering fractions used for the toy model for 0.1Å (orange) and 0.5Å (blue) detection limits.These assumed covering fraction are consistent with the differential covering fraction presented by Dutta et al. (2020).

Figure B2 .
Figure B2.Comparison of the computed 0.1Å covering fraction for the selected sample versus for the whole sample.

Table 1 .
Number of galaxies expected and number of galaxies found in MEGAFLOW in cylinders of radius  and depth 2|Δ | centered on halos of mass  min .Distribution of the number of counterpart galaxies observed in the MUSE FOV around each MgII absorption system detected in the UVES spectra in the range 0.3 <  < 1.5.

Table 2 .
Summary of the groups of more than five galaxies identified in MEGAFLOW.The left column presents the whole sample.The right column presents the sample selected to study counterpart Mg ii absorptions.

Table 4 .
Covering fraction fitted parameters for the two impact parameter definitions.The uncertainties are 2-.