I'm not so sure it won't hurt the hammer, but I don't have first-hand knowledge with the combo of the two. They're from the same family, so you might be OK. Not sure...
I made the mistake of putting my rather large colony of branching torch in the middle of my tank as a "centerpiece". Wrong move. It grew very nicely and behaved very well. Then it started sending out those long sweepers toward my stylophora. I actually watched it reach out, latch on, and sting the stylo one time. You could see the immediate tissue damage on the stylo. As a last resort, I actually "snipped" several tentacles of the torch. Others took over the job within a day. Really amazing to watch nature in action. Problem was, I couldn't move the torch anywhere else in the tank where it had more room. I sold it to the
LFS.
My "lessons learned" from that was to only locate torch corals (or most of the Euphyllia family) in the corner of a tank where you only have to worry about it "reaching out" in one direction. Even if it won't hurt the hammer, I'd still move it into a corner so you don't have as big of a "no-go" zone around it in the future. If it likes your tank, it will grow fast.