The CMS analysis chain in a distributed environment