Back to home page

Project CMSSW displayed by LXR

 
 

    


File indexing completed on 2022-08-08 03:11:32

0001 /****************************************************************************
0002 *
0003 * This is a part of the TOTEM offline software.
0004 * Authors:
0005 *   Edoardo Bossini
0006 *   Laurent Forthomme
0007 *
0008 ****************************************************************************/
0009 
0010 #ifndef EventFilter_CTPPSRawToDigi_TotemT2VFATFrame
0011 #define EventFilter_CTPPSRawToDigi_TotemT2VFATFrame
0012 
0013 #include "EventFilter/CTPPSRawToDigi/interface/VFATFrame.h"
0014 
0015 #include <cstdint>
0016 
0017 /**
0018  * Utilitary namespace to retrieve timing/status information from nT2 VFAT frame
0019 **/
0020 namespace totem::nt2::vfat {
0021   /// get timing information for single leading edge
0022   inline uint16_t leadingEdgeTime(const VFATFrame& frame) { return frame.getData()[2] & 0xffff; }
0023   /// get timing information for single trailing edge
0024   inline uint16_t trailingEdgeTime(const VFATFrame& frame) { return frame.getData()[3] & 0xffff; }
0025   /// retrieve this channel marker
0026   inline uint8_t channelMarker(const VFATFrame& frame) { return frame.getData()[1] & 0x1f; }
0027   /// retrieve the GEO information for this channel
0028   inline uint8_t geoId(const VFATFrame& frame) { return frame.getData()[0] & 0x3f; }
0029   /// retrieve this channel identifier
0030   inline uint8_t channelId(const VFATFrame& frame) { return (frame.getData()[0] >> 8) & 0x3f; }
0031 }  // namespace totem::nt2::vfat
0032 
0033 #endif