  We analyze the star formation history (SFH) of galaxies as a function of
present-day environment, galaxy stellar mass and morphology. The SFH is derived
by means of a non-parametric spectrophotometric model applied to individual
galaxies at z ~ 0.04- 0.1 in the WINGS clusters and the PM2GC field. The field
reconstructed evolution of the star formation rate density (SFRD) follows the
values observed at each redshift (Madau & Dickinson 2014), except at z > 2
where our estimate is ~ 1.7x higher than the high-z observed value. The slope
of the SFRD decline with time gets progressively steeper going from low mass to
high mass haloes. The decrease of the SFRD since z = 2 is due to 1) quenching -
50% of the SFRD in the field and 75% in clusters at z > 2 originated in
galaxies that are passive today - and 2) the fact that the average SFR of
today's star-forming galaxies has decreased with time. We quantify the
contribution to the SFRD(z) of galaxies of today's different masses and
morphologies. The current morphology correlates with the current star formation
activity but is irrelevant for the past stellar history. The average SFH
depends on galaxy mass, but galaxies of a given mass have different histories
depending on their environment. We conclude that the variation of the SFRD(z)
with environment is not driven by different distributions of galaxy masses and
morphologies in clusters and field, and must be due to an accelerated formation
in high mass haloes compared to low mass ones even for galaxies that will end
up having the same galaxy mass today.
