Candidate Optimized 

see #3961
Automatically ported from CMSSW_7_2_X #3969
Automatically ported from CMSSW_7_3_X #5397