Alignment of the CMS tracker with LHC and cosmic ray data