Feature #275
closedTDC mode flag
Description
Classes for detectors that use TDC readouts should have a flag to set the TDC mode, either common stop or common start. Depending on the mode, the default handling of multiple hits on a channel should be to take the last or the first hit, respectively, assuming that multiple hits are usually caused by afterpulsing and that TDC hits are reported ordered in time. (Of course, neither assumption is always true, and so more advanced detector code would include more intelligent handling, but the simple approach here will handle the typical cases we have now.)
Updated by Ole Hansen almost 7 years ago
- Status changed from New to In Progress
- % Done changed from 0 to 80
Mostly implemented with commits d9d74c and e73b4af.
All TDC modules are assumed to be common stop when adding modules to the detector map. One needs to call THaDetMap::Module::SetTDCMode(true)
to mark a module as using common start. Each detector should read its TDC mode from the database, although a simple flag would not allow a mix of common stop and common start modules (which would be an unusual scenario). The database part still needs to be done.
Updated by Ole Hansen almost 7 years ago
- Status changed from In Progress to Closed
- % Done changed from 80 to 100
Implemented reading TDC mode from the database via optional key "tdc.cnmstart"
for THaScintillator
and THaCherenkov
. If set to 1, the detector assumes common start TDCs, if set to 0, it forces common stop mode processing. This affects the sign of the correlation between raw TDC data and calibrated times. For common start mode, we have
time = (rawdata - offset) * resolution
and for common stop,
time = (offset - rawdata) * resolution
Some old databases use a negative TDC resolution to handle common stop mode. This will still work, but only as long as the mode parameter is not present in the database. If the mode is set, regardless of how, the TDC resolution will be converted to positive. Setting the mode explicitly is encouraged.