Setting new bars from freely-recorded MIDI

Hi. I have a freely-recorded MIDI part that I want to prepare for notation, by aligning the bars/beats in Cubase to what I actually played. That is, all the downbeats as the first beat in the bar, and all other beats properly aligned within those bars.
In other words, I want the Grid re-drawn so that it corresponds to the beats that I played.

I’ve recorded a MIDI “click” track that follows the quarter-note beats of my free-form performance. I want this "click track’ to represent quarter notes in the notation. So, how do I turn this information into MIDI tracks that actually follow my new bar/tempo indications?

I’ve tried Merge Tempo with Tapping, which seems to indicate it would do what I want, but it doesn’t come close.

I’ve tried Tempo Detection, using it to analyze both my original piano track, and the new “click” track. Also doesn’t come close.

Any other ideas, or steps that I’m missing?
C8.5, Win7

Never mind, I think I’ve got it! The “secret” is to disable “Toggle time base between Musical and Linear” for all the MIDI tracks you want affected.
Then, select the “click” track and use the MIDI Merge Tempo from Tapping function.