A configurable tracking algorithm to detect cosmic muon tracks for the CMS-RPC based technical trigger