Terahertz (THz) systems have the benefit of high bandwidth and hence are capable of supporting ultra-high data rates, albeit at the cost of high pathloss. Hence they tend to harness high-gain beamforming. Therefore a novel hybrid 3D beamformer relying on sophisticated sensor-based beam training and channel estimation is proposed for Reconfigurable Intelligent Surface (RIS) aided THz MIMO systems. A so-called array-of-subarray based THz BS architecture is adopted and the corresponding sub-RIS structure is proposed. The BS, RIS and receiver antenna arrays of the users are all uniform planar arrays (UPAs). The Ultra-wideband (UWB) sensors are integrated into the RIS and the user location information obtained by the UWB sensors is exploited for channel estimation and beamforming. Furthermore, the novel concept of a Precise Beamforming Algorithm (PBA) is proposed, which further improves the beam-forming accuracy by circumventing the performance limitations imposed by positioning errors. Moreover, the conditions of maintaining the orthogonality of the RIS-aided THz channel are derived in support of spatial multiplexing. The closed-form expressions of the near-field and far-field path-loss are also derived. Our simulation results show that the proposed scheme accurately estimates the RIS-aided THz channel and the spectral efficiency is much improved, despite its low complexity. This makes our solution eminently suitable for delay-sensitive applications.