diff --git a/V1724_MV.cc b/V1724_MV.cc index b6785c7..13bd0ed 100644 --- a/V1724_MV.cc +++ b/V1724_MV.cc @@ -12,6 +12,9 @@ V1724(log, opts, bid, address) { fDefaultPreTrig = 0; // no default provided fPreTrigRegister = 0x8114; // actually the post-trig register fPreTrigChRegister = 0xFFFFFFFF; // disabled + // the MV is offset by ~2.5us relative to the other detectors for reasons + // related to trigger formation. This is the easiest way to handle this + fConstantTimeOffset = opts->GetInt("mv_time_offset", 2420); } V1724_MV::~V1724_MV(){} @@ -26,7 +29,7 @@ V1724_MV::UnpackChannelHeader(std::u32string_view sv, long rollovers, // short and polled frequently compared to the rollover timescale, so there // will never be a large difference in timestamps in one data packet // also 'fPreTrig' is actually the post-trigger, so we convert back here - int pre_trig_ns = words * 2 * fSampleWidth - fPreTrigPerCh[ch]; + int pre_trig_ns = words * 2 * fSampleWidth - fPreTrigPerCh[ch] + fConstantTimeOffset; if (event_time > 15e8 && header_time < 5e8 && rollovers != 0) rollovers--; else if (event_time < 5e8 && header_time > 15e8) rollovers++; return {((rollovers<<31)+event_time)*fClockCycle - pre_trig_ns, diff --git a/V1724_MV.hh b/V1724_MV.hh index 8d45d85..ff91fcb 100644 --- a/V1724_MV.hh +++ b/V1724_MV.hh @@ -12,6 +12,7 @@ public: virtual std::tuple UnpackChannelHeader(std::u32string_view, long, uint32_t, uint32_t, int, int, short); protected: + int fConstantTimeOffset; }; #endif diff --git a/docs/daq_options.md b/docs/daq_options.md index 55d05e8..652d45e 100644 --- a/docs/daq_options.md +++ b/docs/daq_options.md @@ -281,7 +281,7 @@ Note that if there are any skipped channels (for instance, if you are using inpu ## Trigger thresholds -Redax assigns trigger thresholds using a syntax identical to that of the channel map (above). +Redax assigns trigger thresholds using a syntax identical to that of the channel map (above). The field is called `thresholds`. ## Lower-level diagnostic options @@ -304,5 +304,6 @@ Redax accepts a variety of options that control various low-level operations. Th | baseline_dac_start | Int. The starting DAC value for the baseline fitting sequence. Closer to the final value is better, but too close might cause some issues. Default 10000. | | do_sn_check | 0/1. Whether or not to have each board check its serial number during initialization. Default 0. | | us_between_reads | Int. How many microseconds to sleep between polling digitizers for data. This has a major performance impact that will matter when under extremely high loads (ie, the bleeding edge of what your server(s) and boards are capable of), but otherwise shouldn't matter much. Default 10. | -| transfer_batch | Int. After how many readout loops do you send accumulated data packets out for processing? Higher values mean less time waiting for mutexes, but too high could lead to problems at the processing stage. Default 8. | +| transfer_batch | Int. After how many readout loops do you send accumulated data packets out for processing? Higher values mean less time waiting for mutexes, but too high could lead to problems at the processing stage, especially if rates are very low. Default 8. | +| mv_time_offset | Int. A constant value to subtract from all timestamps recorded by V1724_MV boards. Default 2420. |