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
protons_cff.time
time
Definition: protons_cff.py:39
pps::diamond::vfat::getLeadingEdgeTime
uint32_t getLeadingEdgeTime(const VFATFrame &frame)
get timing information for single leading edge
Definition: DiamondVFATFrame.h:32
pps::diamond::vfat::correctTime
uint32_t correctTime(const uint32_t &time)
Account for MSB/LSB "HW feature" reversal in HPTDC interpolation bits.
Definition: DiamondVFATFrame.h:29
pps::diamond::vfat::getMultihit
VFATFrame::word getMultihit(const VFATFrame &frame)
flag stating whether the HPTDC channel encountered multiple hits
Definition: DiamondVFATFrame.h:46
VFATFrame.h
pps::diamond::vfat
Definition: DiamondVFATFrame.h:20
VFATFrame::word
uint16_t word
Definition: VFATFrame.h:25
VFATFrame
Definition: VFATFrame.h:18
pps::diamond::vfat::getTrailingEdgeTime
uint32_t getTrailingEdgeTime(const VFATFrame &frame)
get timing information for single trailing edge
Definition: DiamondVFATFrame.h:37
amptDefault_cfi.frame
frame
Definition: amptDefault_cfi.py:12
pps::diamond::vfat::getThresholdVoltage
uint32_t getThresholdVoltage(const VFATFrame &frame)
retrieve the threshold voltage for this channel
Definition: DiamondVFATFrame.h:42
pps::diamond::vfat::getHptdcErrorFlag
VFATFrame::word getHptdcErrorFlag(const VFATFrame &frame)
retrieve the list of error/status flags for the HPTDC when the frame was recorded
Definition: DiamondVFATFrame.h:48