Denoising selected layers

I would like to denoise only certain layers, not all of them.
There are objects at layer 1,2,3 I would like to denoise, but I would not like to denoise objects on layer 4. How to selectively denoise layers?

Just in case since there are many old experimental versions out there, are you using official Blender 2.79?

I’m not sure if I can understand you. Denoising configuration is independent in each layer. Just select a layer in Render Layers tab, and configure Denoising as you want for that layer.

Maybe you do not know how to work with Render Layers in Blender Cycles. You need to use Render Layers and then compose the image in compositor. You look for some tutorials in youtube containing the words “cycles render layers” for example, like this one:

I use full version 2.79 , and yes compositing was my idea too.

Well, that video that I have shared above is old. But if you open Blender 2.79 you will see that each Render Layer has its own Denoising configuration. So you can group objects in Render Layers with the configuration of Denoising that you want.
Maybe you will also want to investigate about Branched Path Tracing instead of Path Tracing (Render Tab > Sampling), because maybe tiles render/denoise faster with Branched Path Tracing in empty/transparent areas.