  Using a series of high-resolution N-body hydrodynamical numerical
simulations, we investigate several scenarios for the evolution of the baryon
budget in galactic halos. We derive individual halo star formation history
(SFH), as well as the global star formation rate in the universe. We develop a
simple analytical model that allows us to compute surprisingly accurate
predictions, when compared to our simulations, but also to other simulations
presented in Springel & Hernquist (2003). The model depends on two main
parameters: the star formation time scale t* and the wind efficiency eta_w. We
also compute, for halos of a given mass, the baryon fraction in each of the
following phases: cold disc gas, hot halo gas and stars. Here again, our
analytical model predictions are in good agreement with simulation results, if
one correctly takes into account finite resolution effect.
  We compare predictions of our analytical model to several observational
constraints, and conclude that a very narrow range of the model parameters is
allowed. The important role played by galactic winds is outlined, as well as a
possible `superwind' scenario in groups and clusters. The `anti-hierarchical'
behavior of observed SFH is well reproduced by our best model with t*=3Gyr and
eta_w=1.5. We obtain in this case a present-day cosmic baryon budget of Omega*=
0.004, Omega_cold=0.0004, Omega_hot=0.01 and Omega_back=0.02 (diffuse
background).
