Particle-flow reconstruction and global event description with the CMS detector