Shadow from camera vs shadow from reflection Is it possible to distinguish between shadows viewed directly from the camera, and shadows seen in the reflection of an object?

For example, the shadows circled here:



From the cameras's perspective, I'd like the tile to disappear (along with its shadow, diffuse effects, etc).

If I make the tile transparent for camera rays, shadow rays, and diffuse ray, I get this:



I'd like the shadow to be visible in reflections though. If I remove shadow rays from my transparency condition, I get this:



So here's what I'm trying to achieve:



Is there a way to determine whether the shadow is viewed directly from camera, or if it's being viewed through a reflection?
So for this I would use render layers. This means you can't really view the effect 'live' in the viewport, but it will be applied when rendered and composited.

I have 2 render layers:


Render layer 1, called 'Main', renders layer 1 which holds the sphere and light only.





Render layer 2, called 'Floor', renders layer 2 which is the floor object and excludes layer 3, which is the red plane.




'Transparent' must be enabled in film section of the Render tab to allow layers to be composited together.



Note: All 3 scene layers should be made visible before rendering. All 3 layers are required, the render layers take care of what appears in the render.

'Main' render layer will only include the sphere, but will still be effected by the other layers, so will include the plane and floor in the reflection.

'Floor' render layer will only include the floor object and will only be effected by layer 1 because red object is excluded on layer 3.

These render layers can then be combined in the compositor:



Which results in: