Twrp boot loop after factory reset
I assume your recovery partition was wiped out partially during factory reset and I see the only solution here - to make full reinstall via Odin using one of the stock images. 
Then you can flash TWRP again and re-root.