Common Isolation & Selection Frameworks 71X Edition

71X Backport of #5011

@arizzi @ikrav @Sam-Harper
@lgray 
for my information, for the future, would it not be better to import here RecoEgamma,
and make the required changes, rather than maintaining two almost identical pieces of code?