CMS 3D CMS Logo

DiamondVFATFrame.h
Go to the documentation of this file.
1 /****************************************************************************
2 *
3 * This is a part of the PPS offline software.
4 * Authors:
5 * Seyed Mohsen Etesami (setesami@cern.ch)
6 * Laurent Forthomme
7 * Nicola Minafra
8 *
9 ****************************************************************************/
10 
11 #ifndef EventFilter_CTPPSRawToDigi_DiamondVFATFrame
12 #define EventFilter_CTPPSRawToDigi_DiamondVFATFrame
13 
15 
16 #include <cstdint>
17 
21 namespace pps::diamond::vfat {
23  inline uint32_t correctTime(const uint32_t& time) { return (time & 0xFFE7FFFF) << 2 | (time & 0x00180000) >> 19; }
24 
26  inline uint32_t getLeadingEdgeTime(const VFATFrame& frame) {
27  uint32_t time = ((frame.getData()[7] & 0x1f) << 16) + frame.getData()[8];
28  return correctTime(time);
29  }
31  inline uint32_t getTrailingEdgeTime(const VFATFrame& frame) {
32  uint32_t time = ((frame.getData()[5] & 0x1f) << 16) + frame.getData()[6];
33  return correctTime(time);
34  }
36  inline uint32_t getThresholdVoltage(const VFATFrame& frame) {
37  return ((frame.getData()[3] & 0x7ff) << 16) + frame.getData()[4];
38  }
40  inline VFATFrame::word getMultihit(const VFATFrame& frame) { return frame.getData()[2] & 0x01; }
42  inline VFATFrame::word getHptdcErrorFlag(const VFATFrame& frame) { return frame.getData()[1] & 0xFFFF; }
43 } // namespace pps::diamond::vfat
44 
45 #endif
uint32_t getLeadingEdgeTime(const VFATFrame &frame)
get timing information for single leading edge
uint16_t word
Definition: VFATFrame.h:21
VFATFrame::word getMultihit(const VFATFrame &frame)
flag stating whether the HPTDC channel encountered multiple hits
uint32_t getTrailingEdgeTime(const VFATFrame &frame)
get timing information for single trailing edge
VFATFrame::word getHptdcErrorFlag(const VFATFrame &frame)
retrieve the list of error/status flags for the HPTDC when the frame was recorded ...
uint32_t getThresholdVoltage(const VFATFrame &frame)
retrieve the threshold voltage for this channel
uint32_t correctTime(const uint32_t &time)
Account for MSB/LSB "HW feature" reversal in HPTDC interpolation bits.