please initialise all variables with 0:
double genjet_phi(0);
Otherwise you can end up with gibberish values in case no genjet is found