how to mask an object so that it emerges from the floor I'm just trying to get an object to come out of the floor (the floor is real footage and object is just motion tracked in)

Now the floor I want to be invisible so it doesn't show in the final render, but still hide the cube until it passes through.
This is how you do that:


The cube needs this material, you can exchange the diffuse shader by any node tree you want, but the last node must be the mix shader with the holdout and transparent depth as factor. 
The plane needs a transparent shader. Everywhere the cube would be visible through the transparent plane, it will be alpha.