Match an objID to a PhotoPrimary and set/unset the first field bit.

Given an objID this function determines whether there is a PhotoPrimary with a matching (skyversion, run, rerun, camcol, field, obj) and returns the objID with the first field bit set properly to correspond to that PhotoPrimary. It returns 0 if there is no corresponding PhotoPrimary. It does not matter whether the first field bit is set or unset in the input objID.

Input and output parameters