The topological B model as a twisted spinning particle