  We test the hypothesis that metal-poor globular clusters form within disk
galaxies at redshifts z>3. Numerical simulations demonstrate that giant gas
clouds, which are cold and dense enough to produce massive star clusters,
assemble naturally in hierarchical models of galaxy formation at high redshift.
Do model clusters evolve into observed globular clusters or are they disrupted
before present as a result of the dynamical evolution? To address this
question, we calculate the orbits of model clusters in the time-variable
gravitational potential of a Milky Way-sized galaxy, using the outputs of a
cosmological N-body simulation. We find that at present the orbits are
isotropic in the inner 50 kpc of the Galaxy and preferentially radial at larger
distances. All clusters located outside 10 kpc from the center formed in
satellite galaxies, some of which are now tidally disrupted and some of which
survive as dwarf galaxies. The spatial distribution of model clusters is
spheroidal and the fit to the density profile has a power-law slope of 2.7. The
combination of two-body relaxation, tidal shocks, and stellar evolution drives
the evolution of the cluster mass function from an initial power law to a
peaked distribution, in agreement with observations. However, not all initial
conditions and not all evolution scenarios are consistent with the observed
mass function of the Galactic globular clusters. The successful models require
the average cluster density to be constant initially for clusters of all mass
and to remain constant with time. Synchronous formation of all clusters at a
single epoch (z=4) and continuous formation over a span of 1.6 Gyr (between z=9
and z=3) are both consistent with the data. For both formation scenarios, we
provide online catalogs of the main physical properties of model clusters.
