QIPBTAG works properly only on real data for which the VDET is OK (runs given by the SCANBOOK selection VDET OK), and on events for which XVDEOK = .TRUE. and for which QFNDIP has found a good interaction point.
To use QIPBTAG only for events with a good interaction point and VDET OK you should call it after performing some tests like in the example below:
IF (XVDEOK(DUMM).AND.XGETBP.AND.QVCHIF(KFREV).GT.0.) THEN CALL QIPBTAG(.....) ENDIF