Usually a Carbon platform release goes with a specific set of products (not all). you can find out which carbon version contains which product versions from the release matrix here.
The current version of CEP has been released with Carbon 4.0.7 as given in the release matrix (which is why it doesn't exist in 4.1.x). So you should be looking at that version if you are going to modify/build CEP from the code. Similarly for building other products you can follow the same approach. Note that it is not necessary to checkout the whole codebase in order to do a modification, you can checkout/modify/build the necessary components and apply it as a patch (more info here).
And when there's a new version of a product, it usually goes with a new release version of the Carbon platform.