We present a study of transverse momentum (p T ) spectra of unidentified charged particles in pp collisions at RHIC and LHC energies from s 62.4 GeV = to 13 TeV using Tsallis/Hagedorn function. The power law of Tsallis/Hagedorn form gives very good description of the hadron spectra in p T range from 0.2 to 300 GeV/c. The power index n of the p T distributions is found to follow a function of the type a b s + with asymptotic value a=6.8. The parameter T governing the soft bulk contribution to the spectra remains almost same over wide range of collision energies. We also provide a Tsallis/Hagedorn fit to the p T spectra of hadrons in pPb and different centralities of PbPb collisions at s 5.02 TeV NN =. The data/fit shows deviations from the Tsallis distribution which become more pronounced as the system size increases. We suggest simple modifications in the Tsallis/Hagedorn power law function and show that the above deviations can be attributed to the transverse flow in low p T region and to the in-medium energy loss in high p T region.