  (Abridged) Cluster environment has a strong impact on the star formation rate
and AGN activity in cluster galaxies. In this work, we investigate the
behaviour of different galaxy populations in galaxy clusters and their vicinity
by means of cosmological hydrodynamical simulations. We studied galaxies with
stellar mass $\log M_\ast (M_\odot) > 10.15$ in galaxy clusters with mass
$M_{500} > 10^{13} M_\odot$ extracted from box2b (640 comoving Mpc/$h$) of the
Magneticum Pathfinder suite of cosmological hydrodynamical simulations at
redshifts 0.25 and 0.90. We examined the influence of stellar mass, distance to
the nearest neighbouring galaxy, clustercentric 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. We
found that in low-mass galaxies, AGN activity and star formation are similarly
affected by the environment and decline towards the cluster centre. In massive
galaxies, the impact is different; 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 - likely due to stellar mass stripping and
the consequent selection of galaxies with more massive black holes. After
disentangling the contributions of neighbouring cluster regions, we found an
excess of AGN activity in massive galaxies on the cluster outskirts ($\sim 3
R_{500}$). We also found that the local density, substructure membership and
stellar mass strongly influence star formation and AGN activity but verified
that they cannot fully account for the observed radial trends.
