An implementation of the trace fitting in ROOT