Skip to content

Commit

Permalink
Merge pull request #95 from AxFoundation/constant_offset
Browse files Browse the repository at this point in the history
Constant time offset for MV
  • Loading branch information
darrylmasson committed Jun 2, 2022
2 parents c515ddc + 4e71aa9 commit 894f577
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 3 deletions.
5 changes: 4 additions & 1 deletion V1724_MV.cc
Original file line number Diff line number Diff line change
Expand Up @@ -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(){}
Expand All @@ -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,
Expand Down
1 change: 1 addition & 0 deletions V1724_MV.hh
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ public:
virtual std::tuple<int64_t, int, uint16_t, std::u32string_view> UnpackChannelHeader(std::u32string_view, long, uint32_t, uint32_t, int, int, short);

protected:
int fConstantTimeOffset;
};

#endif
5 changes: 3 additions & 2 deletions docs/daq_options.md
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand All @@ -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. |

0 comments on commit 894f577

Please sign in to comment.