Add the option to only overlay secondary hits within a TDC range of the main event hits. Since we are using the secondary hits as background noise hits. We only need them in the time window close to the signal hits. We simulate monopoles with beta from 1E-4 to 0.8. For the slow monopoles which takes about ms to cross the far detector, we need to overlay ms of cosmic. For the fast monopoles we don't need to overlay 5ms cosmic data. We can still use the cosmic files as a larger data set for background study. This way we can save a lot of disk space for the monopole cosmic overlay files and computing time in the following analysis chain.
Set fOverlayWithTDCCut to true to only overlay secondary hits within [min_TDC - fTDCExtendValue, max_TDC + fTDCExtendValue] of main hits.
Set fTDCExtendValue to the value you want to use.