When the LHC starts its operation, CMS will have a unique opportunity to
study q uarkonium production in pp collisions and later in PbPb collisions.
Here we report on the methods and plans for measuring the differential pT
Jpsi->mu+mu- production cross section, using data to be collected in the first
LHC run by the CMS detector. Furthermore we discuss the performance of the CMS
detector for quarkonium measurements in PbPb collisions.Comment: Presented at the 34th International Conference on High Energy Physic