You should be able to use a single preEuler operator to reset the pitch to zero. The following sample code demonstrates how to reset the pitch during runtime. It will take the current raw euler values from the tracker and apply the inverse pitch to a preEuler operator.
Code:
import viz
import vizact
viz.go()
viz.add('maze.osgb')
tracker = viz.add('testtrack_ori.dls')
view_link = viz.link(tracker,viz.MainView)
pitch_reset = view_link.preEuler([0,0,0],target=viz.LINK_ORI_OP)
def ResetPitch():
yaw,pitch,roll = tracker.getEuler()
pitch_reset.setEuler([0,-pitch,0])
vizact.onkeydown('r',ResetPitch)