File tree Expand file tree Collapse file tree
sbndcode/Timing/FrameShift Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -661,11 +661,21 @@ void sbnd::FrameShift::produce(art::Event& e)
661661 // + Data: t = 0 = abitrary. All subsystem electronics time is reference to the last PPS
662662
663663 if (_isBeam){
664- _frame_tdc_rwm += fShiftRWM2Gate ; //
665- _frame_apply_at_caf = _frame_tdc_rwm; // +frame_data2mc
664+ if (_frame_tdc_rwm != 0 ){
665+ _frame_tdc_rwm += fShiftRWM2Gate ; // align RWM signal to gate opening frame
666+ _frame_apply_at_caf = _frame_tdc_rwm; // +frame_data2mc
667+ }else if (_frame_hlt_gate != 0 ){
668+ _frame_apply_at_caf = _frame_hlt_gate; // +frame_data2mc
669+ }else {
670+ _frame_apply_at_caf = 0 ;
671+ }
666672 }
667673 else if (_isOffbeam){
668- _frame_apply_at_caf = _frame_hlt_gate; // +frame_data2mc
674+ if (_frame_hlt_gate != 0 ){
675+ _frame_apply_at_caf = _frame_hlt_gate; // +frame_data2mc
676+ }else {
677+ _frame_apply_at_caf = 0 ;
678+ }
669679 }
670680 else if (_isXmuon){
671681 _frame_apply_at_caf = 0 ;
You can’t perform that action at this time.
0 commit comments