Transverse momentum distributions of final-state particles produced in soft process in proton-proton (pp) and nucleus-nucleus (AA) collisions at Relativistic Heavy Ion Collider (RHIC) and Large Hadron Collider (LHC) energies are studied by using a multisource thermal model. Each source in the model is treated as a relativistic and quantum ideal gas. Because the quantum effect can be neglected in investigation on the transverse momentum distribution in high energy collisions, we consider only the relativistic effect. The concerned distribution is finally described by the Boltzmann or two-component Boltzmann distribution. Our modeling results are in agreement with available experimental data.