Environmental dependence of AGN activity and star formation in galaxy clusters from Magneticum simulations

Context. The environment inside and on the outskirts of galaxy clusters has a profound impact on the star formation rate and active galactic nucleus (AGN) activity in cluster galaxies. While the overall star formation and AGN suppression in the inner cluster regions has been thoroughly studied in the past, recent X-ray studies also indicate that conditions on the cluster outskirts may promote AGN activity. Aims. We investigate how the environment and the properties of host galaxies impact the levels of AGN activity and star formation in galaxy clusters. We aim to identify signiﬁcant trends in di ﬀ erent galaxy populations and suggest possible explanations. Methods. We studied galaxies with stellar mass log M ∗ ( M (cid:12) ) > 10 . 15 in galaxy clusters with mass M 500 > 10 13 M (cid:12) extracted from box2b (640comovingMpc h − 1 ) of the Magneticum Pathﬁnder suite of cosmological hydrodynamical simulations at redshifts 0.25 and 0.90. We examined the inﬂuence of stellar mass, distance to the nearest neighbouring galaxy, cluster-centric radius, substructure membership, and large-scale surroundings on the fraction of galaxies hosting an AGN, star formation rate, and the ratio between star-forming and quiescent galaxies. Results. We ﬁnd that in low-mass galaxies, AGN activity and star formation are similarly a ﬀ ected by the environment and decline towards the cluster centre. In massive galaxies, the impact is di ﬀ erent; star-formation level increases in the inner regions and peaks between 0.5 and 1 R 500 with a rapid decline in the centre, whereas AGN activity declines in the inner regions and rapidly rises below R 500 towards the centre. We suggest that this increase is a result of the larger black hole masses relative to stellar masses in the cluster centre. After disentangling the contributions of neighbouring cluster regions, we ﬁnd an excess of AGN activity in massive galaxies on the cluster outskirts ( ∼ 3 R 500 ). We also ﬁnd that the local density, substructure membership, and stellar mass strongly inﬂuence star formation and AGN activity but verify that they cannot fully account for the observed radial trends.


Introduction
Galaxy clusters are the largest collapsed structures in the Universe.Their deep gravitational potential wells, densely populated with galaxies and filled with hot cluster gas, host extreme conditions that can significantly influence the evolution of cluster galaxies.In particular, different processes govern the abundance and distribution of cold gas, which fuels star formation and active galactic nuclei (AGNs) in cluster galaxies.We briefly summarize those processes in the following.
As the galaxies are moving through the intracluster medium, they are exposed to ram pressure which can remove the gas from the galaxy in the process called ram-pressure stripping (e.g., Boselli et al. 2022Boselli et al. , 2016;;Quilis et al. 2000;Abadi et al. 1999;Gunn & Gott 1972).Additionally, the cluster environment may prevent the accretion of the surrounding gas onto cluster galaxies, causing the cold gas reservoir to be gradually depleted by star formation in the process called strangulation (e.g., Peng et al. 2015;Larson et al. 1980).The processes operate on different timescales; Whereas ram pressure stripping is expected to quench the galaxy abruptly after the infall, strangulation is a longer and more gradual process.However, both result in a larger abundance of early-type morphologies (see Vulcani et al. 2023 and references therein), lower levels of star formation (e.g., Cohen et al. 2014;Wetzel et al. 2012;von der Linden et al. 2010;Gavazzi et al. 2006;Balogh et al. 1998;Kennicutt 1983) and suppressed AGN activity (Koulouridis et al. 2018;Ehlert et al. 2014;Martini et al. 2007;Koulouridis & Plionis 2010;Haines et al. 2012) in galaxy clusters compared to the field population of galaxies.The suppression is stronger in more massive clusters (Koulouridis et al. 2018;Ehlert et al. 2015).
The suppression of star formation due to environmental effects (i.e., environmental quenching) is particularly significant in the evolution of low-mass galaxies that still contain enough cold gas prior to infall.Massive galaxies, on the other hand, can be quenched on their own in isolation; they succumb to the so-called mass quenching (e.g., see Peng et al. 2010, Huertas-Company et al. 2016, Smethurst et al. 2017, Liu et al. 2019; see also Lotz et al. 2019 andTeklu et al. 2017, for results from the Magneticum simulations).Several causes for mass quenching have been proposed, such as the feedback processes from supernovae and local ionisation (e.g., Cantalupo 2010).Furthermore, the AGN activity in massive galaxies itself can lead to ejection and heating of the gas and can terminate star formation (Steinborn et al. 2015;King & Pounds 2015;Fabian 2012).For that reason, the connection between star formation and AGN ac-tivity is still debatable, even though both are fueled by the same cold gas reservoir in the host galaxy.The correlation between star formation and nuclear activity has been confirmed in several studies (e.g., Florez et al. 2020;Mullaney et al. 2012;Diamond-Stanic & Rieke 2012), while some studies favour the quenching role of AGNs (e.g., Leslie et al. 2016;Nandra et al. 2007).
Despite the net quenching influence of the cluster environment, processes, such as ram-pressure stripping, can, in some cases, promote star formation and AGN activity: while the hot gas can be removed from galaxies during their first infall into the cluster, some cold and dense clouds may remain bound within the galactic potential.When approaching the increasingly pressurized cluster centre, the pressure (ram pressure and static thermal pressure) may compress the remaining gas, leading to a short period of enhanced star formation, reported in several numerical studies (e.g., Evrard 1991;Bekki & Couch 2003;Kronberger et al. 2008;Kapferer et al. 2009Kapferer et al. , 2008;;Tonnesen & Bryan 2009).It is also theorized that ram pressure stripping can lead to the removal of angular momentum of gas clouds in the galaxy, funnelling the gas towards the galactic centre.This can lead to enhanced AGN activity, often observed in ram-pressure stripped galaxies (e.g., Poggianti et al. 2021Poggianti et al. , 2017)).
The inner cluster regions are densely packed with galaxies, and while high velocity dispersion inhibits mergers, galaxies can still gravitationally interact during frequent flybys.This process called harassment, can kinematically heat the galaxies, transforming disc galaxies into ellipticals, and can transport the gas to the centre of cluster galaxies, triggering central starbursts and AGN activity (Moore et al. 1996(Moore et al. , 1998;;Byrd & Valtonen 1990).Tidal forces exerted on the galaxy during a close encounter can also remove dark matter and stars from the galaxy via tidal stripping (e.g., Merritt 1983;Read et al. 2006;Saro et al. 2010;Iannuzzi & Dolag 2012;Smith et al. 2016;Montero-Dorta et al. 2023).
In contrast to overall AGN suppression inside the cluster environment, some studies suggest that the cluster outskirts are a much more suitable environment for AGN activity.An excess of AGNs on the cluster outskirts is reported for example in Koulouridis & Bartalucci (2019); Haines et al. (2012); Fassbender et al. (2012); Ruderman & Ebeling (2005).The galaxies on the outskirts more likely belong to the in-falling population that still possesses enough cold gas to fuel star formation and AGN activity.Furthermore, the velocity dispersion of galaxies on the cluster outskirts is lower compared to the inner regions, increasing the likelihood of mergers, which are thought to be an important (although not necessarily dominant) mechanism for AGN triggering (e.g., Steinborn et al. 2018;Hopkins et al. 2008;Springel et al. 2005a;Hernquist & Mihos 1995;Sanders et al. 1988).
To investigate the interplay between the environment and AGN activity, many studies resort to X-ray AGN selection.To get a complete sample of AGNs, not contaminated by other sources of X-ray emission, high luminosity thresholds (∼ 10 42 erg/s) are usually used (e.g., Koulouridis & Bartalucci 2019;Koulouridis et al. 2018;Ehlert et al. 2014;Haggard et al. 2010).The abundance of such X-ray bright AGNs is low; however, modern X-ray telescopes (e.g., Chandra X-ray observatory) and their deep extra-galactic surveys opened the door for statistically meaningful analysis of the environmental dependence of AGN activity (for an overview of X-ray surveys, see Brandt & Hasinger 2005).In this work, we investigate the distribution of AGNs and the relationship between AGN activity and the environment by means of cosmological hydrodynamical simula-tions.For a straightforward comparison with observations, we also mimic the X-ray AGN selection.
The paper is organized as follows.In Sect. 2 we describe the Magneticum simulations.In Sect. 3 we define clusters, used in this work, and different populations of galaxies based on their stellar mass and star formation rate.We define the distance to the nearest neighbour as a proxy for the local density and isolated and overlapping regions.We describe the calculation of AGN luminosities and define the star-forming ratio and AGN fraction, the principal quantities studied in this work.Section 4 is divided into several subsections.In Sect.4.1, we investigate the effects of the neighbouring clusters in a cosmological environment on the radial profiles of galaxy properties in galaxy clusters.in Sect.4.2 we look into the radial dependence of star formation rate and the star-forming ratio and explore the effects of substructures.In Sect.4.3 we investigate the effects of local density on star formation.In Sect.4.4 we discuss properties of AGN population in our simulations, focusing on the stellar mass dependence.We also investigate the radial dependence of the AGN fraction in the inner cluster regions (Sect.4.5) and up to large radii (Sect.4.6).Section 4.7 is dedicated to the impact of the local density on AGN fraction.In Sect.4.8 we compare our findings with X-ray observational studies, and we conclude our paper by summarizing the main findings in Sect. 5.

Simulations
For the purpose of this work we used the box2b from the Magneticum Pathfinder suite of cosmological hydrodynamical simulations1 , which covers a large cosmological volume with a sufficiently high number of galaxy clusters and groups for statistically meaningful analysis and has a large enough resolution to describe the behaviour inside individual galaxies realistically.
The Magneticum simulations were performed with the Tree/SPH code Gadget-3, a refined version of Gadget-2 (Springel 2005;Springel et al. 2005b).It uses an improved Smoothed Particle Hydrodynamics (SPH) solver for the gas evolution (Beck et al. 2016) and includes the treatment of viscosity following Dolag et al. (2005).The simulations take into account various physical processes such as gas cooling (Wiersma et al. 2009), star formation and stellar feedback (Springel et al. 2005a;Springel & Hernquist 2003), UV/X-ray background heating (after Haardt & Madau 2001), chemical enrichment (Tornatore et al. 2007(Tornatore et al. , 2004) ) and thermal conduction (Arth et al. 2014).The simulations follow the SMBH evolution powering AGN feedback, based on the models from Springel et al. (2005a) and Di Matteo et al. (2005) with further improvements by Fabjan et al. (2010) and Hirschmann et al. (2014).For a concise description of the simulations, refer to Dolag et al. (2016).The Magneticum simulations assume the WMAP cosmology (Komatsu et al. 2009) with Hubble constant H 0 = 70.4kms −1 Mpc −1 , total matter density parameter Ω = 0.272, baryonic fraction of 16.8 %, index of the primordial power spectrum n = 0.963, and normalization of the fluctuation amplitude σ 8 = 0.809.The hr resolution run box2b used in this work spans a volume of (640 comoving Mpc/h) 3 and contains 2•2880 3 particles.The mass resolution is 6.9 • 10 8 M ⊙ /h and 1.4 • 10 8 M ⊙ /h for dark matter and gas particles, respectively.The gas particles can form stellar particles with ∼ 1/4 of their mass.Softening lengths are 3.75kpc/h for dark matter and gas particles and 2kpc/h for stellar particles.The analysis of this work relies heavily on the substructure iden-tification, which is performed by the subhalo identifier Subfind (Dolag et al. 2009;Springel et al. 2001).

Definitions
In this work, we analyse two redshift snapshots of box2b; we will refer to z = 0.25 as low redshift and z = 0.90 as high redshift.At low redshift, Subfind identifies ∼ 56000 friends-of-friends (FoF) groups with M 500 > 10 13 M ⊙ 2 (henceforth referred to as (all) galaxy clusters) and 34000 at high redshift.If we restrict to massive systems with M 500 > 10 14 M ⊙ (referred to as massive clusters), we find 2000 groups at low redshift and 500 groups at high redshift.Note that there are also a few very massive clusters with M 500 > 10 15 M ⊙ , but they will not be considered separately in this work due to the small sample size.The centre of each cluster is defined as the position of the most bound particle and the clustercentric distance r is defined relative to R 500 of each cluster.The Subfind algorithm also allowed us to identify substructures embedded in clusters.We were thus able to compare the behaviour of galaxies in bound subgroups containing at least 2 substructure members (i.e.galaxies) with total stellar mass log M * (M ⊙ ) > 10.15 and single galaxies that are bound only to the main cluster halo.
Galaxies are divided into different categories based on their properties returned by Subfind.In terms of stellar mass M * , the galaxies are split into two classes.We refer to galaxies with log M * (M ⊙ ) > 11 as massive galaxies and galaxies with 10.15 < log M * (M ⊙ ) < 11 as low-mass galaxies.The lower selection limit log M * (M ⊙ ) = 10.15 is approximately equal to the stellar mass at which the black hole particles are seeded in galaxies.In terms of star formation rate (SFR), the galaxies are divided into star-forming galaxies with SFR > 0.02M ⊙ /yr, and quiescent galaxies with SFR < 0.02M ⊙ /yr.Below this threshold, galaxies in our simulations have essentially negligible SFR.Note that this definition differs from the conventional criterion based on specific star formation rate (sSFR) (e.g., Franx et al. 2008), however, it ensures that both categories are sufficiently populated at all mass ranges, allowing for a meaningful comparison.While the difference in classification is negligible in low-mass galaxies, the reader should keep in mind that massive star-forming galaxies in this work may be considered quiescent according to criteria that divide galaxies based on sSFR (e.g., Franx et al. 2008).
The brightest cluster galaxies (BCGs) were identified as the closest galaxies to the cluster centre, lying at the bottom of the cluster potential.As their properties differ significantly from other cluster members we in most cases excluded them from the innermost radial bins (refer to figure captions).In some cases, we also excluded BCGs of the neighbouring clusters (see fig. 3  and 10).
To investigate the effects of the local environment, we define the distance to the nearest neighbour d n as the distance of a galaxy to its nearest neighbouring galaxy with log M * (M ⊙ ) > 10.15.In large samples, this quantity correlates with the local number density of galaxies, while also enabling the identification of galaxies in the immediate proximity of another galaxy.Distance d n is given as a proper distance in kpc.
To study the effects of the global cluster environment, we count the number of AGNs and galaxies in spherical shells at 2 The cluster size in this work is defined with the overdensity radius R 500 which is the radius where the enclosed mean mass density is 500 times larger than the critical density of the Universe at the redshift of the cluster.Cluster mass M 500 is defined as the total mass enclosed within radius R 500 .
different clustercentric distances r (in R 500 ).To increase the sample size, the radial bins are stacked together and galaxies are counted in all clusters, similarly to Koulouridis & Bartalucci (2019), Koulouridis et al. (2018) and Ehlert et al. (2014).Note that some galaxies are close to several clusters and may be considered multiple times.The confidence intervals shown in this work (e.g., see Fig. 3) refer to the statistical error of the stacked profiles.In cases where the star-forming ratio between the number of star-forming galaxies N sfr and the number of quiescent galaxies N quies is shown, the confidence interval is obtained by assuming that N sfr and N quies are independent and are drawn from Poisson distribution.For an in-depth discussion about the ratio of Poisson variables refer to Park et al. (2006).In cases where the fraction of galaxies containing an AGN (henceforth AGN fraction) is plotted, the errors are obtained by assuming that the number of AGNs is drawn from the binomial distribution with the known total number of galaxies.
Since galaxy clusters are not isolated but are placed in a large-scale cosmological environment it is insightful to study how the radial profiles of their properties (i.e.AGN fraction & star-forming ratio) are influenced by their neighbouring clusters.Hence we define the overlapping and isolated population of galaxies.The overlapping population comprises the galaxies that are closer than the overlapping radius r ov to some neighbouring cluster (with M 500 > 10 13 M ⊙ ).All the other galaxies are assigned to the isolated population.In this work, we set r ov = 6R 500 , where R 500 refers to each neighbouring cluster.The rather large choice of r ov ensures that the isolated regions are not influenced by any nearby cluster, while it still divides the galaxies into two sufficiently populated samples for a statistically meaningful comparison.In Fig. 1, we demonstrate the definition of the overlapping and isolated population in three clusters.Note that some galaxies may simultaneously belong to the overlapping population of one cluster and the isolated population of another cluster.
To determine whether a galaxy in the simulation hosts an AGN we first match the black holes with their host galaxies by their positions.The bolometric X-ray luminosity L bol of the AGN is then calculated as L bol = ϵ r Ṁc 2 where the Ṁ represents the black hole mass accretion rate, ϵ r the efficiency which is set to 0.1 (see Maio et al. 2013 and references therein) and c the speed of light.Bolometric luminosity is then converted to X-ray luminosity by applying the bolometric corrections proposed by Marconi et al. (2004).Any galaxy hosting a black hole brighter than 10 42 erg/s in 0.5-10 keV band is considered to host an (X-ray bright) AGN.This simple luminosity estimate allows for a straightforward comparison to observational studies (e.g., Koulouridis et al. 2018) while keeping the intuitive connection with the mass accretion rate Ṁ and thus directly reflecting the environmental effects.

Influence of the large-scale environment
First, we will investigate how the radial dependence of galaxy properties in clusters is influenced by the neighbouring clusters in a cosmological environment.To this scope, let's assume that some property of cluster galaxies p(r) (e.g., the AGN fraction or the star-forming ratio of galaxies) only depends on the distance r to its "parent" cluster and that the profiles p(r) of all clusters are identical if re-scaled to R 500 of each cluster.For this example, we further assume that when several clusters are brought together to overlap in a cosmological environment, their profiles remain the  1.The three panels depict the region of 18 x 18 x 2 comoving Mpc/h at redshift 0.25 containing 3 clusters.Dots represent comoving positions of galaxies.Different panels depict the definition of the overlapping (red) and the isolated (black) regions in each cluster, marked with black circles that represent its 2R 500 , 4R 500 and 6R 500 .Red circles represent r ov = 6R 500 of the neighbouring clusters, and the crosses mark the cluster centres.Mass M 500 of the considered cluster is displayed in each panel.
same -each galaxy still belongs to its parent cluster.The average property ⟨p⟩ of galaxies in volume ∆V at position i is calculated by summing the contributions of the central and other surrounding clusters.Each cluster j at a distance r i j (relative to R 500 of j-th cluster) from position i contributes the number of galaxies with properties p(r i j ), proportional to the number density dN/dV(r i j ).In other words, ⟨p⟩ at position i is calculated as the average of the profiles p(r i j ) of all clusters, weighted by their number density at position i.In this work, we will not be interested in the average ⟨p⟩ at a single point i, but in the average ⟨p⟩ in the radial shells at a distance r from the centre of the cluster.This can be achieved by sampling the volume of the spherical shells at a distance r from the cluster centres with random points i.The average property of galaxies ⟨p⟩ at r can be calculated as follows: . (1) The sum in equation ( 1) runs over all points i in the radial shells at some distance r from the central clusters, and at each point, over the contributions of all clusters j.If the radial dependence of the property p and number density of galaxies in an isolated galaxy cluster are known, equation ( 1) can be used to estimate how the profile would appear in the large-scale environment when influenced by the identical profiles of other clusters.While equation ( 1) can be used for the profile of any property of galaxies p, it is already instructive to define p(r) = r.The average ⟨p⟩ = ⟨r⟩, obtained with equation (1), can be interpreted as a characteristic clustercentric distance of galaxies at a distance r.It tells us the expected distance of galaxies at a distance r from the central cluster to any (central or other) cluster.If a cluster is in complete isolation, that means that ⟨r⟩ = r; all galaxies belong to the central cluster and have properties characteristic of the distance r.However, if a cluster is surrounded by other clusters, the ⟨r⟩ decreases at large r; some galaxies may belong to the inner regions of other clusters in the vicinity, with properties characteristic of low r.We emphasize that r refers to the distance relative to the R 500 of each parent cluster (central and other) and that the characteristic distance ⟨r⟩ should be interpreted merely as a proxy for the properties of galaxies, rather than the measure of the local density.
To estimate the characteristic distance of galaxies ⟨r⟩ as a function of r, we used the following procedure.In each cluster, we generated a set of 80000 uniformly distributed random points in the sphere of radius 8R 5003 .We then selected the points in a narrow radial shell at a distance r from the centre of the considered (central) cluster.In each of those points i, we added the contributions of all clusters j, based on their distance from the point i and their number density at this distance (see equation 1).For the number density dN/dV(r i j ), we assumed the Navarro-Frenk-White (NFW) profile (Navarro et al. 1997(Navarro et al. , 1996(Navarro et al. , 1995)).The parameters of the profile were obtained by fitting the profile to the number density of galaxies with log M * (M ⊙ ) > 10.15 (mostly low-mass galaxies) in the simulation box.NFW profile was assumed between 0.15R 500 and 10R 500 .Below 0.15R 500 , the number density was set to a constant value to avoid the unrealistically high contribution of cluster centres, where the NFW profile diverges.Above 10R 500 , the number density was set to 0 to neglect the influence of individual clusters over large cosmological distances.With this assumption, the sum over all clusters effectively reduces to a sum over all clusters comprised within 10R 500 from the central one, which we call hereafter neighbouring clusters.We verified that our conclusions do not depend on the choice of those two threshold distances.After summing the contributions of all central and neighbouring clusters in each point, we summed the contributions of all points i at a distance r from their central clusters to obtain average ⟨r⟩ at a distance r (see equation 1).
Characteristic distance ⟨r⟩ as a function of r, obtained with the described procedure, is plotted in Fig. 2 (black solid line).We also repeated the computation by neglecting the contribution of the central clusters (orange dashed line).The blue dotted line represents the case where only the contribution of the central clusters is considered (⟨r⟩ = r).For the red solid line, we have not considered all generated points i but only those in the   1) where p(r) = r) as a function of the clustercentric distance computed at low redshift (z = 0.25) with procedure and definition of neighbouring clusters described in section 4.1.Clustercentric distance r is given in R 500 of the central clusters and the characteristic distance ⟨r⟩ is given in R 500 of all clusters in the calculation (central or neighbouring).In the calculation of the blue dotted profile, only the contributions of the central clusters are considered, and all distances contributing to ⟨r⟩ are given relative to R 500 of the central cluster.In the calculations of the dashed orange profile, the contributions of neighbouring clusters are considered -each neighbouring cluster contributes a number of galaxies with distances, given relative to its R 500 .The black profile is the combined profile of central and neighbouring clusters.As the distances are re-scaled to different R 500 , ⟨r⟩ should be seen as a proxy for the properties of galaxies at some distance r, rather than the measure of the local density.Red solid line is calculated in the same way as the combined profile (black solid line) but in the overlapping regions only.
overlapping regions (see section 3).In the combined profiles of all (central and neighbouring) clusters, we can see how in the inner regions (≲ 4R 500 ) the contribution of neighbouring clusters causes a relative increase of ⟨r⟩.This is unsurprising as at those radii, the average distance to the neighbouring clusters (r i j ) is larger than the distance to the central cluster r.As the number density of the central cluster decreases at large radii (≳ 4R 500 ), the contributions of the inner regions of neighbouring clusters become increasingly important, causing a relative decrease of ⟨r⟩.This is evident in the combined profile of all regions (black line) and the profile of overlapping regions (red line).In the latter, the transition from the central cluster dominating the inner regions to the significant contribution of neighbours at large r appears as a peak; galaxies between 3 and 4 R 500 have, on average, the highest ⟨r⟩, i.e., are the furthest away from any cluster in terms of R 500 .The exact position of the peak depends on the definition of the overlapping regions (overlapping radius r ov ).This peak implies that if some property p has a distinctively lower value in the inner cluster regions, this may appear as a peak on the cluster outskirts simply because the galaxies there are the furthest away from any cluster regions.This peak is a consequence of geometrically overlapping cluster regions and does not necessarily imply any physical excess on the cluster outskirts with respect to the field.Figure 2 shows the behaviour at low redshift (z = 0.25).We verified that the behaviour at high redshift (z = 0.90) is qualitatively similar, despite the peak of the overlapping regions is found at slightly lower r, at around 3R 500 .

Star formation and the global environment
To get some insight into processes governing the star formation rate, we plot the star-forming ratio as a function of clustercentric distance r (Fig. 3).The ratio is plotted at high and low redshift and for low-mass and massive galaxies divided into overlapping and isolated populations as described in Sect.3. In low-mass galaxies (left panels), we can notice a strong decline of the starforming ratio towards the cluster centre at low and high redshift, which is in agreement with observations (e.g., Cohen et al. 2014;Wetzel et al. 2012).The star-forming ratio of massive galaxies (right panels, isolated regions) behaves considerably differently -it increases towards the inner cluster regions.The overall increase features two peaks, one located on the outskirts (around 3 R 500 at low z) and one in the inner cluster regions, between 0.5 and 1 R 500 , which is followed by a rapid decline towards the centre.The drastic difference in the behaviour between low-mass and massive galaxies is related to the role of mass quenching in massive galaxies.Whereas low-mass galaxies mostly succumb to environmental quenching mechanisms and would likely still be forming stars outside the cluster, massive galaxies are already quenched prior to their infall.Infalling massive galaxies then have star formation briefly reignited due to the pressure inside the ICM (see section 1).
This behaviour has been thourughly investigated in a smaller simulations box from the Magneticum suite in a dedicated study by Lotz et al. 2019, for a smaller sample of galaxies tracked during their infall trajectories.Lotz et al. 2019 found that the specific star formation rate of galaxies with M * > 1.5 • 10 10 M ⊙ increased briefly after the galaxies crossed the virial radius (see Figure 10 in Lotz et al. 2019).They also report that the levels of star formation in massive galaxies are lower than in low-mass galaxies prior to infall and gradually decline, indicating the role of mass quenching.Low-mass galaxies on the other hand are quenched rapidly after crossing the virial radius.
In Fig. 3, we can also see how the behaviour in the inner cluster regions is reflected in the profile of the overlapping population and, consequently, in the combined profile.The central decline of the star-forming ratio found in low-mass galaxies (left panels) is reflected in the decrease at large r (r > 4R 500 ), where inner regions of neighbouring clusters are considered, as was demonstrated in Sect.4.1.The peak of the star-forming ratio in low-mass galaxies in the overlapping regions around 3R 500 is analagous to that predicted in Fig. 2 and can thus be explained by geometric overlaps of the cluster regions and superposition of their profiles; it does not imply the excess of star formation on the outskirts of each cluster.Analogously, an increase of the star-forming ratio in massive galaxies (right panels) in the overlapping regions at large r (r > 4R 500 ) results from the central increase in the neighbouring clusters.Note that the star-forming ratio of the massive overlapping population is profoundly influenced by the neighbouring BCGs (compare dashed lines with BCGs and dotted lines with BCGs excluded).We also verified that despite the small sample size, signs of the secondary peak at ∼ 3R 500 in Fig. 3 remain even if a sub-sample of isolated clusters (as opposed to the isolated regions of any cluster) and if only single galaxies (not substructure members) are selected.
The star-forming ratio and its increase in the inner regions depends on the substructure membership.In Fig. 4, we plot the star-forming ratio in the inner cluster regions as a function of clustercentric distance for the substructure members (red line) and single galaxies that belong directly to the main cluster (black line).Galaxies in narrow M * ranges are selected in each panel to mitigate the effects of mass segregation.The star-forming ra- tio in massive substructure members (bottom panels) is generally higher and shows a much more pronounced peak around R 500 than in their isolated counterparts.This is most likely due to a combination of two effects.The group atmosphere can shield the galaxy from the quenching effects of the intracluster medium.Lotz et al. (2019) found that massive central galaxies of in-falling groups remain star-forming the longest after the in-fall.They attribute this to their higher stellar mass and the group environment mitigating the effects of ram-pressure stripping.The other effect contributing to the difference between substructure members and cluster satellites in Fig. 4 is orbital selection.Since galaxy groups inside the cluster environment usually get unbound soon after the pericentric passage, they are likely in-falling into the cluster (e.g., Haggar et al. 2023;Choque-Challapa et al. 2019).By examining orientations of velocities of galaxies with 0 < r < 3R 500 (in all mass ranges used in Fig. 4), we checked that a larger fraction of substructure members have radially inward-oriented velocities with dominant radial components, indicating a larger fraction of the in-falling population than in the single galaxy sample.Quantifying how much both of those effects contribute to the shape of the radial profiles shown in Fig. 4 would, however, require a more elaborate analysis, including tracking individual galaxies during their infall, and is beyond the scope of this work.The overall increase of the starforming ratio in clusters with rich substructure is also found in observations (e.g., Cohen et al. 2014).
Low-mass substructure members (top panels), on the other hand, exhibit a lower star-forming ratio than their isolated counterparts.This is consistent with environmental quenching effects in denser environments (see also Sect. 4.3).It was shown by Lotz et al. 2019 that low-mass cluster satellites that are not substructure members have the highest level of star formation prior to in-fall.
Aside from the star-forming ratio it is also instructive to see how the sSFR value of star-forming galaxies varies with r.In Fig. 5 the M * − sSFR distribution of massive galaxies is shown in different radial ranges.The expected sSFR value depends on the environment.Star-forming galaxies of some mass M * have higher expected sSFR in the inner cluster regions (below R 500 , left panel) than on the outskirts (above 2R 500 , middle and right panel), which is in agreement with what is found in IllustrisTNG simulations (Hwang et al. 2019).This also means that the expected star formation rate of massive galaxies roughly traces the star-forming ratio and that the galaxy mass segregation cannot be the sole reason for the observed trend.We also examined the M * − sSFR distribution of low-mass galaxies (not shown explicitly) and, in contrast to massive galaxies, found no noticeable changes of sSFR with r, despite the drastic r dependence of the star-forming ratio, shown in Fig. 3.In other words, lowmass galaxies are more likely to be quiescent in the cluster environment than in the field, but if they manage to retain conditions for star formation, the sSFR tends to be on the same level, regardless of the global environment (r).The lack of environmental dependence of the sSFR of star-forming galaxies, despite the strong environmental dependence of the star-forming ratio is also reported in observations (e.g., Peng et al. 2010;Muzzin et al. 2012).In our case, it is likely a consequence of rapid quenching time scales of galaxies in our simulations (see Lotz et al. 2019) which explains the absence of galaxies in the transition phase with low sSFR.

Star formation and local density
We also checked how the star-forming ratio depends on the local density, traced by the distance to the nearest neighbour d n .The star-forming ratio as a function of d n is shown in Fig. 6 for lowmass and massive galaxies at constant r in the field and in the were selected.The dashed line indicates the conventional division between star-forming and quiescent used in some other works (Franx et al. 2008).In the top left corner of each panel, the fraction of star-forming galaxies (SFR > 0.02M ⊙ /yr) in each region is shown.The contours show regions containing 68% and 95% of galaxies.The color range is normalized to the total number of galaxies in each panel.Results are shown at low redshift (z = 0.25).
inner cluster regions.The star-forming ratio of massive galaxies increases with local density in clusters and the field, which may indicate the importance of mass quenching.In the hierarchical structure formation framework, galaxies tend to migrate from the less dense environment to denser clusters and groups and unlikely vice versa.That means a galaxy in isolation has probably formed and evolved there without being subjected to environmental quenching in the dense environments.On the contrary, a denser environment seems to either trigger star formation in quenched massive galaxies or prevent the cessation of star formation -not just in the dense cluster environment (as already discussed in section 4.2), but wherever the local density is elevated (see dashed black line in Fig. 6).We also found that the increase of star-forming ratio of massive galaxies with local density inside the cluster environment is more pronounced if they are substructure members.
While low-mass galaxies display similar behaviour in clusters, the trend is different in the field; low-mass galaxies have the highest star-forming ratio if they are far from their neighbours, which again points to the role of environmental quenching.In other words: a low-mass galaxy is more likely to form stars if it is in the field, far from any aggregations of galaxies that generally suppress star formation but if it does find itself inside the cluster environment, it is more protected from the environmental quenching if it is in a locally very dense environment.We verified that galaxies in a locally very dense environment were more likely to be substructure members.
We should also stress that since d n is highly correlated with r it was crucial to select galaxies in very narrow radial bins in Fig. 6 to disentangle the effects of local density and the global cluster environment.This is demonstrated with the blue solid line, where a wider radial bin was chosen.The increase of starforming ratio with local density found in narrow radial bins (0.25R 500 < r < 0.5R 500 , red solid line) is not noticeable anymore if the width of the radial bin is increased to 0 < r < R 500 .

AGN population
In the following sections, we investigate the fraction of galaxies hosting an X-ray bright AGN (henceforth AGN fraction, see Sect.3).Before delving into the radial dependence of the AGN fraction, we first discuss a few general properties of AGNs and .Ratio between the number of star-forming (SFR > 0.02M ⊙ /yr) and quiescent galaxies as a function of the distance to the nearest neighbour d n .Results are shown at low redshift for low-mass (solid line) and massive galaxies (dashed line).In black, we show the ratio of the field galaxies (galaxies in the isolated regions between 6R 500 and 7R 500 of each cluster) and in red the ratio of galaxies in the inner cluster regions (0.25R 500 < r < 0.5R 500 ).Narrow radial bins are selected to disentangle the local density effects from radial dependence; their importance is demonstrated with a blue solid plot, depicting low-mass population in a wider radial bin (0 < r < R 500 ).BCGs are excluded in all plots.The coloured bands represent the 68 % confidence intervals obtained with Poisson statistics (see Sect. 3).
their hosts in Magneticum simulations.For an in-depth discussion, refer to Biffi et al. (2018), Steinborn et al. (2015) and Hirschmann et al. (2014); here, we summarize the most important trends and point out the limitations of the simulations.In Fig. 7, we show the AGN fraction as a function of M * in starforming and quiescent galaxies at low and high redshift in the field and the cluster regions.First, we can see that the AGN fraction is generally higher at high redshift (right panels) than at low redshift (left panels), regardless of the environment or stellar mass.This indicates the anti-hierarchical growth of the luminous AGNs; the comoving number density of AGNs increases with time, peaks around z = 1 − 2, and then declines for z < 1 due to the decreasing cold gas content in the vicinity of massive black holes (see Hirschmann et al. 2014).Moreover, we can see that at masses larger than the black hole seeding stellar mass (log M * (M ⊙ ) ≈ 10.15) the AGN fraction rapidly rises, reaching the peak at log M * (M ⊙ ) ≈ 10.4 then falling off before rising again at large M * .The peak is not observed in nature and is a consequence of the black hole sub-grid model; black hole particles are seeded well below the M • − M * relation (e.g., Magorrian et al. 1998) and thus undergo a phase of very efficient AGN feedback.They accrete below the Eddington limit and are unable to suppress the gas cooling.Thus, the black holes grow rapidly until they reach the M • − M * relation, where they abruptly quench the star formation and halt AGN activity in the host galaxy (see Steinborn et al. 2015).Note that the mass M * corresponding to the peak in Fig. 7 is determined by our choice of black hole seeding stellar mass.Quenching due to AGN feedback also causes an accumulation of galaxies and a peak in the stellar mass function at log M * (M ⊙ ) ≈ 10.5, not found in observations (e.g., see Figure 4 in Hirschmann et al. 2014).The properties of low-mass galaxies in this work should therefore be taken with a grain of salt, although we still show them to demonstrate the effects of the cluster environment.In Fig. 7, we can see that in contrast to field galaxies, no peak of AGN fraction at log M * (M ⊙ ) ≈ 10.4 is observed within clusters, demonstrating a decisive role of the environment on the AGN fraction in low-mass galaxies.We can also see that the AGN activity is suppressed more gradually at M * larger than the peak value if a galaxy retains conditions for star formation (upper panels) compared to quiescent galaxies (bottom panels).In massive galaxies (log M * (M ⊙ ) > 11), on the other hand, the decisive factor for AGN activity becomes stellar mass M * .The relative differences in AGN fraction between massive galaxies in clusters and in the field are not as drastic as in low-mass galaxies.On the other hand, even small changes of M * can overshadow the difference in AGN fraction between the two environments.The rapid increase of AGN fraction with M * can be readily explained with the correlation between stellar mass and the black hole mass (e.g., Magorrian et al. 1998) and with Bondi model for mass accretion rate used in Magneticum simulations in which the accretion rate scales with the square of the hole mass (Springel et al. 2005a;Bondi 1952).Galaxies with sufficiently massive black holes can make it above the AGN selection threshold even if they are in gas-poor environment according to our simple luminosity estimate described in Sect.3. Note that some of those galaxies may in reality be considered radio galaxies due to their low Eddington ratio.

Radial dependence of the AGN fraction
In Fig. 8 we show the AGN fraction as a function of the clustercentric radius r up to 4R 500 for low-mass, massive, star-forming and quiescent galaxies.Considering the most abundant low-mass quiescent galaxies (red dashed line) we notice a strong decline towards the cluster centre, which is broadly consistent with the decline of the star-forming ratio of low-mass galaxies (Fig. 3).This may imply that the processes in the cluster environment affect star formation and AGN activity in low-mass galaxies similarly.Low-mass galaxies are known to be less shielded from the ICM compared to massive galaxies in our simulations (see Lotz et al. 2019), and if the entire cold gas reservoir is removed, this is expected to affect the star formation of the whole galaxy as well as the black hole mass accretion rate.Note that the plot of the AGN fraction in quiescent galaxies allows us to infer the effects of the cluster environment on the gas content even when star for-  .AGN fraction as a function of the stellar mass M * of star-forming (upper panels) and quiescent galaxies (lower panels) at high redshift (right panels) and low redshift (left panels).The solid line represents the AGN fraction of the field galaxies (galaxies in the isolated regions between 6R 500 and 7R 500 of each cluster) and the dashed line the ratio of galaxies in the cluster centre (below 0.4 R 500 ).The dotted vertical line divides galaxies into low-mass and massive galaxies as defined in this work.The coloured bands represent the 68 % confidence intervals obtained with binomial statistics (see Sect. 3).mation rate is already too low to be meaningfully investigated in our simulations.
At around 2R 500 the central decline is temporarily halted, and the AGN fraction levels out.We verified that this feature becomes more pronounced if substructure members are excluded (not shown explicitly), which resembles the behaviour of the star-forming ratio in low-mass galaxies at the same r (see the first panel in Fig. 4).
At first glance, low-mass star-forming galaxies (dashed blue line in Fig. 8) show different behaviour to low-mass quiescent galaxies.At low redshift (left panel), a broad peak of the AGN fraction can be detected between 1 and 2R 500 , roughly centred around 1.3 R 500 .However, before delving into potential environmental causes, we ought to carefully consider the sensitivity of AGN fraction to stellar mass, which already plays a role at the upper end of the low-mass range (see Fig. 5).We investigated how the observed trends change if a narrow stellar mass range (10.6 < log M * (M odot ) < 10.7) is selected instead of the entire low-mass range (not shown explicitly).We noticed that the peak at around 2R 500 becomes less pronounced, and the central decline resembles the behaviour of quiescent galaxies.The occurrence of mass segregation of star-forming galaxies is not surprising; in Sect.4.2 we demonstrated that the low-mass galaxies are quenched more easily than massive galaxies, thus the star-forming population in the inner regions consists of more massive galaxies, hosting more massive and more active black holes.The central decline below 1R 500 , however, is still a consequence of environmental effects.It tells us that the AGN activity in low-mass galaxies is suppressed in the cluster centre, even if the galaxies retain enough gas to form stars.
Massive galaxies (solid lines in Fig. 8) display somewhat different behaviour than low-mass galaxies.We can see a gradual decline of the AGN fraction towards the inner regions, with a minimum between 1 and 2 R 500 , followed by a drastic increase in the centre.This shape is found in massive star-forming and quiescent galaxies and is not caused by different stellar masses (we verified that the trend persists even if a narrow M * range is selected).When comparing to Fig. 3 we can see that the AGN fraction does not match the star-forming ratio; The minimum of AGN activity around 1R 500 is contrasted by significantly elevated star formation in massive galaxies.
While this may hint at a possible causal connection between the cessation of AGN activity and elevated star formation, it is more likely an indicator that the AGN activity and star formation in massive galaxies are not affected by the same processes to the same extent.For instance, we found that, unlike star-forming ratio (Fig. 4), the behaviour of AGN fraction is qualitatively the same in members of substructures and single galaxies that orbit the cluster alone -all galaxies show diminished AGN activity around 1R 500 .The differences between star formation and AGN activity are not inconceivable since, apart from the availability of cold gas (and its compression) that drives star formation, AGN activity also requires the loss of angular momentum and transport of the gas towards the galactic centre.One possible explanation of the trends would be that the abundance of galaxy mergers and interactions on the cluster outskirts keeps the AGN fraction (and star-forming ratio) high.Inside the virial radius, merging activity seizes due to higher velocity dispersion, and AGN activity drops.On the other hand, star formation in massive galaxies is triggered after infall, causing the peak of the star-forming fraction, and drops again when the galaxy approaches the centre (r < 1R 500 ) (discussed in section 4.2 and investigated in Lotz et al. 2019).
We also tried to identify the possible reason for the increase of AGN fraction in massive galaxies below 1R 500 , seen in Fig. 8.When examining galaxies in narrow stellar mass ranges, we noticed that their median black hole mass increases towards the cluster centre at low r (most drastically below 1R 500 ).Higher black hole mass then leads to higher AGN fraction in massive galaxies, as discussed in section 4.4.We verified that the black hole mass increase does not result from spurious Subfind M * determination.It remains even if maximum circular velocity is used as a proxy for stellar mass.We propose two reasons for the increasing black hole mass towards the cluster centre.One is faster black hole growth relative to stellar mass growth.When examining the ratio between black hole mass accretion rate and star formation rate, we found an increase below 0.5 R 500 (i.e., star formation is, on average, more suppressed than black hole mass accretion rate, which increases in the centre).Over time, this increase would result in even higher black hole masses; however, mass accretion rates found in our simulation cannot fully account for the high black hole mass increase on reasonable time scales.The second possible reason is tidal stripping.Galaxies in the inner regions can lose both dark matter and stellar mass due to tidal interactions with cluster members and cluster potential (e.g., Montero-Dorta et al. 2023;Smith et al. 2016;Iannuzzi & Dolag 2012;Saro et al. 2010;Read et al. 2006).A decrease in stellar mass can then be reflected in higher black hole mass at constant M * .We found an indication of the presence of tidal stripping by examining the dark matter halo to stellar mass ratio.Since dark matter halos are more extended than stellar components, they get stripped more effectively (e.g., Smith et al. 2016Smith et al. , 2013;;Peñarrubia et al. 2008).We found that dark matter halo mass (relative to stellar mass) decreases drastically towards the cluster centre.Dark matter halo mass of galaxies with constant M * decreased by a factor of ∼ 3 when going from 3 to 0.5R 500 .To evaluate the contribution of both effects to the increase of median black hole mass at low r, a comprehensive study of the time evolution of a large number of galaxies would be required, z=0.90 Fig. 8. Fraction of galaxies containing an X-ray bright AGN as a function of r at low redshift (left panel) and high redshift (right panel).The AGN fraction is plotted separately for quiescent galaxies (in red), starforming (in blue), low-mass (dashed line) and massive galaxies (solid line).The coloured bands represent the 68 % confidence intervals obtained with binomial statistics (see Sect. 3).Central BCGs are excluded.
which is beyond the scope of this work.We should also keep in mind that some of those central black holes may, in reality, be accreting with low radiative efficiency and might not be considered X-ray bright.
So far, we have considered all clusters in the simulation with M 500 > 10 13 M ⊙ -the sample dominated by low-mass clusters.We also investigated whether the trends shown so far are preserved in more massive clusters.In Fig. 9 we show the AGN fraction as a function of r in low-mass and massive galaxies in clusters in four M 500 ranges.Qualitatively, the behaviour does not depend on M 500 , except that the suppression of AGN activity at low r is stronger in massive clusters (i.e., the AGN fraction at low r is lower).There is also a mild indication that the delay in the AGN fraction drop, found in the profile of low-mass galaxies around 2R 500 , is more pronounced in low-mass clusters below 10 14 M ⊙ (upper panels).In clusters between 10 14 and 5 × 10 14 M ⊙ (bottom left panel), the decline in the central regions is smoother.
Another question that may arise is whether the trends change if the AGN luminosity threshold is increased and only the brightest AGNs are selected.When the luminosity threshold was raised from 10 42 erg/s to 10 43 erg/s we found no significant qualitative difference compared to radial profiles shown in Fig. 8. Raising the threshold even more proved to be meaningless due to the small AGN sample size.

AGN fraction on the cluster outskirts
In Fig. 10 we plot the AGN fraction as a function of r in extended cluster regions up to 8R 500 .As outlined in Sect.4.1 and already done with the star-forming ratio in Fig. 3, we take into account the large-scale surroundings of the clusters and separately consider overlapping and isolated regions.The profile of low-mass galaxies (left panels) is almost identical to the profile of the star-forming ratio in Fig. 3 with central suppression of AGN activity, which is reflected in a drop of AGN activity at large r in the overlapping population.The peak of AGN fraction between 2 and 4R 500 can be explained with geometric overlaps, as was demonstrated in Fig. 2  M 500 (M ) > 5 10 14 Fig. 9. AGN fraction as a function of r, shown for low-mass (dashed line) and massive galaxies (solid line) at low redshift (in blue) and high redshift (in red).Each panel represents the AGN fraction in clusters of different mass M 500 range.High-redshift massive clusters are omitted due to their low abundance and thus high statistical uncertainty.The coloured bands represent the 68 % confidence intervals obtained with binomial statistics (see Sect. 3).Central BCGs are excluded.
AGN activity on the outskirts of individual low-mass clusters.This peak in the overlapping regions is also the reason for the subtle peak in the combined profile at high redshift (solid black line on the lower left panel) at around 3R 500 ; it is absent in the profile of isolated regions (blue dash-dotted line).
Considering massive galaxies (right panels), we can notice similar behaviour in the overlapping population, especially when the contribution of the neighbouring BCGs is removed (red dotted line).But interestingly, the isolated population also clearly shows an excess of AGN activity on the outskirts, at ∼ 3R 500 .This excess remains even if we tighten the definition of the isolated regions and only keep single massive galaxies that do not belong to any group with multiple galaxies (and not just clusters above our selection threshold).Hence, this excess most likely shows that the outskirts of clusters are a particularly suitable environment for AGN activity, as was reported by observational studies by Koulouridis & Bartalucci (2019).We should also remember that at the same r, signs of an excess of the star-forming ratio were found (Fig. 3), meaning that unlike in the inner regions, the conditions in the outer regions may trigger both AGN activity and star formation.We expect this excess of AGN activity to be particularly noticeable in relaxed clusters in isolation that do not contain massive groups in their vicinity.If the profiles of all clusters are combined (black solid line), the excess of AGN activity is not discernible anymore at low redshift (upper right panel); the profiles of overlapping and isolated regions have their peaks at different r, and the physical excess in the isolated population is counterbalanced by the rapid ascent of the AGN fraction in the overlapping population (probably due to geometric overlaps).Tentative signs of the AGN excess can still be identified in the combined profile at high redshift (bottom right panel) since the peak due to geometric overlaps coincides with the excess in the isolated population.Furthermore, we verified that the profiles are qualitatively similar in massive clusters (M 500 > 10 14 M ⊙ ) with a few minor differences, e.g., the peak  due to geometric overlaps in massive galaxies in the overlapping regions is reached at lower r (around 3 R 500 ) compared to all clusters (see the red line in the upper right panel of Fig. 10).

AGN fraction and local density
As in Sect.4.3 we tried to disentangle the effects of the local density on AGN activity from radial dependence.In Fig. 11, we plot the AGN fraction as a function of the distance to the nearest neighbour d n and stellar mass M * at low and high redshift in the inner cluster regions (left panels), on the outskirts (middle panels) and in the field (right panels).We can see that the AGN fraction is drastically higher in a locally denser environment (low d n ).We have already partially discussed this trend in section 4.5.In the innermost regions, the expected d n of galaxies is highly correlated with r.Thus, the increase of black hole mass and the AGN fraction with decreasing r, shown in Fig. 4.5, is also reflected in the rise of AGN fraction with local density in the left panels of Fig. 11.However, we verified that this trend holds more generally.We verified that the median black hole mass rises with local density not only in the cluster centre but also at larger r.This is reflected in the increased AGN activity at small d n (see middle and right panels in figure 11).We performed similar tests as in section 4.5 and found signs of an increase of black hole mass accretion relative to star formation rate, as well as a decrease in the ratio between dark matter halo and stellar mass in very dense environments at larger r.Thus, we can argue that the same mechanisms, as discussed in section 4.5 (faster black hole growth relative to star formation, tidal stripping), are also applicable in dense regions at high r.Aside from the black hole mass increase, we cannot rule out other environmental factors.Interestingly, the general behaviour and the increasing trend with local density, especially in massive galax-  ies with d n > 50kpc, resembles the behaviour of the star-forming ratio in Fig. 6, which does not directly depend on the black hole mass.Furthermore, we verified that, similarly to the star-forming ratio, the drastic d n dependence of the AGN fraction is more pronounced in the members of massive substructures with multiple galaxies.We found that most galaxies with d n below a few hundred kpc are substructure members.
Despite the strong influence of d n on star-forming ratio and AGN fraction, we verified that it cannot fully explain all trends discussed in sections 4.2 and 4.5.We investigated radial profiles of AGN fraction and the star-forming ratio of massive galaxies in a narrow range of local densities (1.8 < log d n (kpc) < 1.9, not shown explicitly).We found that both the decline of AGN activity inside the cluster, observed in Fig. 8, and the increase in the star-forming ratio, observed in Fig. 3, can still be identified with similar amplitudes if d n is constant.However, the central rise of the AGN fraction is almost absent, pointing to the importance of the increasing black hole mass with local density, discussed in the previous paragraph.

Comparison with observational studies
We compared the radial profiles of the AGN fraction in our simulations with the results of several X-ray studies, which are summarized in table 1.In Fig. 12 we plot their results together with the results of the Magneticum simulations.We separately plot the AGN fraction in low-mass galaxies and massive galaxies at low and high redshift as a function of projected distance r with projection depth 7.6 Mpc4 as opposed to the three-dimensional distance that was used in Fig. 8 and 10.The studies used different redshift ranges, cluster mass ranges, and the galaxy and AGN selection criteria (see Table 1), which makes direct comparison with our results challenging -our study indicated that the definition of the galaxy sample and the different selections in terms of mass and geometrical configuration might impact the resulting trends.By doing an order of magnitude estimate, it can be seen that many studies in table 1 use stellar mass limit close to 10 10 M ⊙ , which corresponds to the low-mass galaxies in this work.However, this threshold is critically close to the black hole seeding value -more massive galaxies are better resolved in our simulations and might be more suitable for comparison with observations.
Almost all studies in Fig. 12 report a significant decrease in AGN activity in the inner cluster regions (Koulouridis et al. 2018;Ehlert et al. 2014;Haines et al. 2012;Koulouridis & Plionis 2010;Martini et al. 2007), which is consistent with our findings.As for other features discussed in this section, they are difficult to discern in Fig. 12 since they only appear in certain populations of galaxies and since projection further blurs any radial dependence, but we can nonetheless try to identify some similarities with observations.The profile of low-mass clusters from Koulouridis et al. (2018) (where the galaxy magnitude selection criteria, roughly correspond to our low-mass galaxies) shows an absence of strong central decline and an excess of AGN activity between 1 and 2R 500 .This is in qualitative agreement with the profiles of low-mass galaxies in low-mass clusters found in the simulations (top left panel of Fig. 9), where the central decline is shallower compared to massive clusters (bottom panels).Although no excess is found between 1 and 2R 500 in Fig. 9, there is a plateau of AGN activity which could be interpreted as an excess with respect to the overall decline.This plateau is less apparent in massive clusters.
Particularly interesting are the results of Koulouridis & Bartalucci (2019).In the top right panel, we plot the quantity Σ from figure 1 in Koulouridis & Bartalucci (2019), which represents the total surface density of X-ray point sources in excess of the field value, divided by the optical galaxy profile in high-redshift clusters (around z = 1).The plot clearly shows an excess of AGN activity between 2R 500 and 2.5R 500 .Note that at approximately this distance, we find a slight excess of AGN activity in massive galaxies at high redshift (bottom right panel of figure 10), where the peaks in isolated regions (due to the environmental conditions) and in the overlapping regions (due to geometric overlaps) align.Signs of excess are also present in low-mass galaxies (bottom left panel of figure 10), which are closer to the mass range used by Koulouridis & Bartalucci (2019).It should be, however, stressed that Σ is not equivalent to the AGN fraction we used.Different approaches adopted by both works prevent a direct quantitative comparison of our results.Whereas the existence of the peak and its cluster-centric distance r is found in both works the amplitudes of the peaks cannot be meaningfully compared.

Summary & Conclusions
In this work we investigated the properties of cluster galaxies in the Magneticum suite of cosmological hydrodynamical simulations, with particular emphasis on the AGN activity and levels of star formation in cluster galaxies as a function of their environment.For our analysis we used a cosmological box spanning over 640 comoving Mpc/h which provided a large sample of clusters and galaxies for a statistically meaningful analysis.We mainly considered clusters with M 500 > 10 13 M ⊙ and galaxies with log M * (M ⊙ ) > 10.15 split in two mass ranges and investigated whether they contained AGNs with X-ray luminosity above 10 42 erg/s in 0.5-10 keV band.We identified several trends in certain populations of galaxies and compared their behaviour with X-ray studies.We also provided some possible interpretations of the observed trends, with our main conclusions summarized as follows.
1.By splitting the galaxies into overlapping and isolated populations based on their distance to the neighbouring clusters, we explored the influence of the large-scale surroundings on the radial dependence of galaxy properties in clusters.We predicted the influence of the neighbouring clusters by generating a set of random points around each cluster and in each point, estimating the contribution of all (central and neighbouring) clusters based on their distance from that point.We computed the average distance of galaxies to their parent clusters at each point, which we use as a proxy for their properties.We found that in the overlapping population, the galaxies are, on average, the furthest away from any cluster if they are between r = 3R 500 and 4R 500 away from the central cluster (if the overlapping distance of 6R 500 is chosen).
If the distance r increases even more, the inner regions of neighbouring clusters become increasingly important.This prediction was tested against the radial profile of the fraction of galaxies hosting an AGN (AGN fraction) and of the ratio between the number of star-forming and quiescent galaxies (star-forming ratio) in the overlapping population, and it was indeed found that they are the highest at around the same r; the shape of the profile of the overlapping populations is likely a consequence of geometric overlaps between cluster regions and does not require additional physical effects which would promote star formation or AGN activity on the cluster outskirts.Furthermore, the overlaps may conceal some features that are clearly discernible in the isolated population and should thus be carefully accounted for when the properties of clusters and cluster galaxies are studied up to very high radii (above ∼ 3R 500 ). 2. We demonstrate how the AGN activity in galaxies with different stellar masses reflects the implementation of supermassive black holes in the simulations; recently seeded black holes produce a peak of AGN activity in galaxies with log M * (M ⊙ ) ≈ 10.4, rapidly quenching their host and reducing the AGN fraction.The strength of the peak of AGN activity in low-mass galaxies (10.15 < log M * (M ⊙ ) < 11) depends strongly on the global environment (clustercentric radius).In massive galaxies on the other hand (log M * (M ⊙ ) > 11), the AGN fraction is decisively influenced by the black hole mass (and consequently stellar mass).3. The AGN fraction and star-forming ratio in low-mass galaxies rapidly decline in the inner cluster regions, suggesting a major role of processes such as ram pressure stripping, strangulation and other environmental quenching mechanisms in the depletion of the cold gas reservoir in cluster galaxies.
A similar central decline is also reported in observational studies of star formation (e.g., Cohen et al. 2014;Wetzel et al. 2012) and X-ray bright AGNs (Koulouridis et al. 2018;Ehlert et al. 2014;Haines et al. 2012;Koulouridis & Plionis 2010;Martini et al. 2007) in galaxy clusters.4. Massive galaxies, on the other hand, show an increase in the star-forming ratio towards the inner cluster regions, which peaks at around R 500 , followed by a steep decline in the innermost regions.This is consistent with a brief increase of star formation after the in-fall in massive galaxies, reported by Lotz et al. (2019) using the same simulations.The peak is especially prominent in substructure members, that are more likely in-falling.This trend is in stark contrast to the AGN fraction in massive galaxies, which exhibits a decline of AGN activity in the inner regions with a sharp rise in the cluster centre below R 500 , regardless of the substructure membership.The difference indicates that the processes in the cluster environment do not have the same effect on star formation and AGN activity in massive galaxies.5. We found that an increase of AGN activity in massive galaxies below 1R 500 is a consequence of increasing black hole masses relative to stellar mass in denser local environments.
The increase is likely a consequence of stellar mass stripping or higher black hole mass accretion relative to star formation rate.6.We explored the influence of the local density (traced with the distance to the nearest neighbour d n ) on the star-forming ratio and the AGN fraction and found that low-mass galaxies in the field have the highest star-forming ratio if they are in environments with very low local density (large d n ), indicating the role of environmental quenching.Massive galaxies in the field exhibit opposite behaviour -their star-forming ratio is the lowest in low-density environments, potentially due to mass quenching.Inside the clusters, higher local density generally means a higher star-forming ratio and AGN frac-Table 1. Redshift range, cluster mass range, AGN luminosity L X (or flux F X ) of the AGNs, and magnitudes of optically selected galaxies from several studies, shown in Fig. 12. Refer to original papers and references therein for descriptions of the magnitude thresholds R, M * i , M k and m r , and details about the selected clusters where their mass was not given explicitly.all galaxies massive galaxies Fig. 12. Fraction of galaxies containing an X-ray bright AGN, divided with the background fraction, as a function of projected clustercentric distance r.Magneticum results are shown at low redshift (left panel) and high redshift (bottom right panel) for all galaxies with log M * (M ⊙ ) > 10.15 (in red) and only massive galaxies (log M * (M ⊙ ) > 11, in blue).The projection depth is 7.6 Mpc.The plot represents the mean profile of many lines of sight and the coloured interval ± standard deviation of different lines of sight.Dotted lines mark the 68% binomial confidence interval when only one line of sight is considered.The confidence intervals of low-mass galaxies are too narrow to be meaningfully displayed.The centralmost bins, influenced by the BCGs, are omitted.The background AGN fraction is defined as the mean fraction in the annulus between 4.5 and 6 R 500 .
The fraction at low redshift (left panel) is compared with results of Ehlert et al. (2014) and Koulouridis et al. (2018), from which we also obtained the results of Martini et al. (2007), Koulouridis & Plionis (2010) and Haines et al. (2012).In the upper right panel, we plot the quantity Σ from figure 1 in Koulouridis & Bartalucci (2019).The data points from the literature are placed at the centre of radial bins and are shown without the radial errorbars.
tion regardless of stellar mass.The local density dependence is especially strong in substructure members.7.While local density could, in principle, play a role in r dependence as it is highly correlated with r, we verified that it cannot account for most of the observed trends.For example, central AGN suppression and the increase of the starforming ratio in massive galaxies remain even if a narrow d n range is selected, indicating the impact of the global cluster environment.They persist even if a narrow stellar mass range is chosen, thus ruling out the decisive influence of mass segregation.The increase of AGN fraction below 1R 500 , on the other hand, becomes almost absent if the local density is kept constant.This further proves the role of increasing black hole mass with local density.8.We report increased AGN activity on the cluster outskirts.
The peak of AGN fraction at around 3R 500 is discernible in the isolated population of galaxies.However, when all galaxies are selected, this trend is contaminated by overlaps with neighbouring cluster regions, albeit it still remains marginally visible at high redshift.The increase in AGN activity on the cluster outskirts may correspond to the trends found in X-ray study by Koulouridis & Bartalucci (2019).9. We found that the expected value of specific star formation rate sSFR in low-mass star-forming galaxies remains constant despite the declining star-forming ratio in the inner regions, whereas sSFR of massive star-forming galaxies roughly traces the star-forming ratio and is lower in the cluster centre.
In this work, we demonstrated that despite the complexity of the underlying physical processes, which poses a numerical and computational challenge for simulations, the Magneticum simulations capture several observed trends and can thus shed some light on the underlying physical mechanisms.The trends reported in this work should be investigated in more detail in future studies to better constrain their physical origin by a complementary kinematic analysis, for instance.This would allow identifying the infalling population and recent gravitational interactions, providing further insight into the detailed physical processes at work.

Fig. 2 .
Fig.2.Characteristic distance ⟨r⟩ (equation (1) where p(r) = r) as a function of the clustercentric distance computed at low redshift (z = 0.25) with procedure and definition of neighbouring clusters described in section 4.1.Clustercentric distance r is given in R 500 of the central clusters and the characteristic distance ⟨r⟩ is given in R 500 of all clusters in the calculation (central or neighbouring).In the calculation of the blue dotted profile, only the contributions of the central clusters are considered, and all distances contributing to ⟨r⟩ are given relative to R 500 of the central cluster.In the calculations of the dashed orange profile, the contributions of neighbouring clusters are considered -each neighbouring cluster contributes a number of galaxies with distances, given relative to its R 500 .The black profile is the combined profile of central and neighbouring clusters.As the distances are re-scaled to different R 500 , ⟨r⟩ should be seen as a proxy for the properties of galaxies at some distance r, rather than the measure of the local density.Red solid line is calculated in the same way as the combined profile (black solid line) but in the overlapping regions only.

Fig. 3 .
Fig. 3. Ratio between the number of star-forming (SFR > 0.02M ⊙ /yr) and quiescent galaxies as a function of clustercentric distance r.Lowmass galaxies (10.15 < log M * (M ⊙ ) < 11) are shown on the left and massive galaxies (log M * (M ⊙ ) > 11) on the right.Results are shown at low redshift (upper panels) and high redshift (lower panels).For r > 2R 500 we separately plot the profiles of the overlapping and isolated regions (r ov = 6R 500 , see Sect.3).On the right panels, the dotted line represents the massive overlapping populations without the BCGs of the neighbouring clusters, central BCGs are excluded in all plots.The coloured bands represent the 68 % confidence intervals obtained with Poisson statistics (see Sect. 3).

Fig. 4 .
Fig.4.Star-forming ratio as a function of r for galaxies in 4 different M * ranges (different panels).The red line represents galaxies that are embedded in substructures with at least two galaxies with log M * (M ⊙ ) > 10.15.The black line represents single galaxies that orbit the cluster alone.Central BCGs are excluded.The coloured bands represent the 68 % confidence intervals obtained with Poisson statistics (see Sect. 3).

Fig. 5 .
Fig.5.Distribution of stellar mass M * and specific star formation rate sSFR of massive galaxies at different clustercentric distances r.Only isolated were selected.The dashed line indicates the conventional division between star-forming and quiescent used in some other works(Franx et al. 2008).In the top left corner of each panel, the fraction of star-forming galaxies (SFR > 0.02M ⊙ /yr) in each region is shown.The contours show regions containing 68% and 95% of galaxies.The color range is normalized to the total number of galaxies in each panel.Results are shown at low redshift (z = 0.25).
Fig. 6.Ratio between the number of star-forming (SFR > 0.02M ⊙ /yr) and quiescent galaxies as a function of the distance to the nearest neighbour d n .Results are shown at low redshift for low-mass (solid line) and massive galaxies (dashed line).In black, we show the ratio of the field galaxies (galaxies in the isolated regions between 6R 500 and 7R 500 of each cluster) and in red the ratio of galaxies in the inner cluster regions (0.25R 500 < r < 0.5R 500 ).Narrow radial bins are selected to disentangle the local density effects from radial dependence; their importance is demonstrated with a blue solid plot, depicting low-mass population in a wider radial bin (0 < r < R 500 ).BCGs are excluded in all plots.The coloured bands represent the 68 % confidence intervals obtained with Poisson statistics (see Sect. 3).

Fig. 7
Fig. 7. AGN fraction as a function of the stellar mass M * of star-forming (upper panels) and quiescent galaxies (lower panels) at high redshift (right panels) and low redshift (left panels).The solid line represents the AGN fraction of the field galaxies (galaxies in the isolated regions between 6R 500 and 7R 500 of each cluster) and the dashed line the ratio of galaxies in the cluster centre (below 0.4 R 500 ).The dotted vertical line divides galaxies into low-mass and massive galaxies as defined in this work.The coloured bands represent the 68 % confidence intervals obtained with binomial statistics (see Sect. 3).
and does not require an excess of

Fig. 10 .
Fig.10.Fraction of galaxies hosting an X-ray bright AGN as a function of clustercentric distance r.The fraction of low-mass galaxies (10.15 < log M * (M ⊙ ) < 11) is shown on the left and of the massive galaxies (log M * (M ⊙ ) > 11) on the right.Results are shown for low redshift (upper panels) and high redshift (lower panels) and for the overlapping and isolated regions (r ov = 6R 500 , see Sect.3).On the right panels, the dotted line represents the massive overlapping populations without the BCGs of the neighbouring clusters.Central BCGs are excluded in all plots.The coloured bands represent the 68 % confidence intervals obtained with binomial statistics (see Sect. 3).
Fig.10.Fraction of galaxies hosting an X-ray bright AGN as a function of clustercentric distance r.The fraction of low-mass galaxies (10.15 < log M * (M ⊙ ) < 11) is shown on the left and of the massive galaxies (log M * (M ⊙ ) > 11) on the right.Results are shown for low redshift (upper panels) and high redshift (lower panels) and for the overlapping and isolated regions (r ov = 6R 500 , see Sect.3).On the right panels, the dotted line represents the massive overlapping populations without the BCGs of the neighbouring clusters.Central BCGs are excluded in all plots.The coloured bands represent the 68 % confidence intervals obtained with binomial statistics (see Sect. 3).

Fig. 11 .
Fig. 11.Fraction of galaxies hosting an X-ray bright AGN as a function of the distance to the nearest neighbour d n and stellar mass M * .The contours represent the distribution of galaxies.Results are displayed for different radial ranges (different columns).In the rightmost column, only isolated regions were selected to remove the contributions of the neighbouring clusters.The upper row shows the fraction at low redshift and the lower row at high redshift.The bins where the 68% binomial confidence interval of the AGN fraction is wider than 0.2 are not displayed.