Skip to content

Commit 6f56398

Browse files
Merge pull request #865 from SBNSoftware/lnguyen/frame_bugfix_v10_11_01
Add bug fix to FrameShift module when RWM signal is missing
2 parents 44c55d9 + 161123b commit 6f56398

1 file changed

Lines changed: 13 additions & 3 deletions

File tree

sbndcode/Timing/FrameShift/FrameShift_module.cc

Lines changed: 13 additions & 3 deletions
Original file line numberDiff line numberDiff 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;

0 commit comments

Comments
 (0)