The Fourier coefficients and characterizing the anisotropy of the azimuthal distribution of charged particles produced in PbPb collisions at are measured with data collected by the CMS experiment. The measurements cover a broad transverse momentum range, . The analysis focuses on the range, where anisotropic azimuthal distributions should reflect the path-length dependence of parton energy loss in the created medium. Results are presented in several bins of PbPb collision centrality, spanning the 60% most central events. The coefficient is measured with the scalar product and the multiparticle cumulant methods, which have different sensitivities to initial-state fluctuations. The values from both methods remain positive up to , in all examined centrality classes. The coefficient, only measured with the scalar product method, tends to zero for . Comparisons between theoretical calculations and data provide new constraints on the path-length dependence of parton energy loss in heavy ion collisions and highlight the importance of the initial-state fluctuations.