Removed poor use of Ref classes in PFTracking and fixed getByToken problem

There were a number of uses of RefToBase::castTo where a dynamic_cast would be more appropriate. 
A getByToken was using tokens obtained from a 'consumes' call for a different type. This was probably due to the fact that in the past two getByLabels for the different types were sharing the same InputTag. This was probably not seen since the product is only optionally obtained.

These changes are a prequel to internal framework changes which can affect castTo.