Android continues rebooting and 'optimizing'
It may be problem by the rom


clear the data 
clear dalvik  cache 
reinstall ROM 


This may help cause you may have directly the ROM without clearing data



Footnote: Though in Android 5, Dalvik was replaced by ART, parts of the Dalvik stuff are still used (/data/dalvik-cache/arm/*; also see e.g. Should Dalvik Cache be wiped in ART). While in the end, apps will run from native Elf binaries, ART creates those via .oat files. Details can be found e.g. in this Wikipedia article. So don't be confused about "clearing Dalvik cache" here. You could still make sure to remove ART cache by running rm -rf /data/dalvik-cache/arm/* as root via e.g. adb shell when in recovery.