A self-consistent formalism to jointly study cosmic reionization and thermal
history of the IGM is presented. The model implements most of the relevant
physics governing these processes, such as the inhomogeneous IGM density
distribution, three different sources of ionizing photons (PopIII stars, PopII
stars and QSOs), and radiative feedback. By constraining the free parameters
with available data on redshift evolution of Lyman-limit systems, Gunn-Peterson
and electron scattering optical depths, Near InfraRed Background (NIRB), and
cosmic star formation history, we select a fiducial model, whose main
predictions are: (i) H was completely reionized at z \approx 15, while HeII
must have been reionized by z \approx 12. At z \approx 7, HeIII suffered an
almost complete recombination as a result of the extinction of PopIII stars, as
required by the interpretation of the NIRB. (ii) A QSO-induced complete HeII
reionization occurs at z=3.5; a similar double H reionization does not take
place due to the large number of photons above 1 Ryd from PopII stars and QSOs,
even after PopIII stars have disappeared. (iii) Following reionization, the
temperature of the IGM corresponding to the mean gas density is boosted to
15000 K. Observations of T_0 are consistent with the fact that He is singly
ionized at z > 3.5, while they are consistent with He being doubly ionized at z
< 3.5. This might be interpreted as a signature of (second) HeII reionization.
(iv) Only 0.3% of the stars produced by z=2 need to be PopIII stars in order to
achieve the hydrogen reionization. Such model not only relieves the tension
between the Gunn-Peterson optical depth and WMAP observations, but also
accounts self-consistently for all known observational constraints (abridged).Comment: Revised version. Accepted for publication in MNRA