  The present work explores the origin of the formation of star clusters in our
Galaxy and in Small Magellanic Cloud (SMC) through simulated H-R diagrams and
compare those with observed star clusters. The simulation study produces
synthetic H-R diagrams by Markov Chain Monte Carlo (MCMC) technique using star
formation history (SFH), luminosity function (LF), abundance of heavy metal (Z)
and a big library of isochrones as basic inputs and compares them with observed
H-R diagrams of various star clusters. The distance based comparison between
those two diagrams is carried out through two dimensional matching of points in
Color-Magnitude Diagram (CMD) after optimal choice of bin size and appropriate
distance function. It is found that a poor medium of heavy elements (Z =
0.0004), Gaia LF along with mixture of multiple Gaussian distributions of SFH
may be the origin of formation of globular clusters (GCs). On the contrary,
enriched medium (Z = 0.019) is favoured with Gaia LF along with double power
law (i.e. unimodal) SFH. For SMC clusters, the choice of exponential LF and
exponential SFH is a proper combination for poor medium whereas Gaia LF with
Beta type SFH is preferred in an enriched medium for the formation of star
clusters.
