Back to home page

Project CMSSW displayed by LXR

 
 

    


File indexing completed on 2021-02-14 12:51:26

0001 /****************************************************************************
0002 *
0003 * This is a part of TOTEM offline software.
0004 * Authors: 
0005 *   Maciej Wróbel (wroblisko@gmail.com)
0006 *   Jan Kašpar (jan.kaspar@cern.ch)
0007 *
0008 ****************************************************************************/
0009 
0010 #ifndef CondFormats_PPSObjects_TotemDAQMapping
0011 #define CondFormats_PPSObjects_TotemDAQMapping
0012 
0013 #include "CondFormats/PPSObjects/interface/TotemFramePosition.h"
0014 
0015 #include "CondFormats/PPSObjects/interface/TotemSymbId.h"
0016 
0017 #include <map>
0018 
0019 //----------------------------------------------------------------------------------------------------
0020 
0021 /**
0022  *\brief Contains mappind data related to a VFAT.
0023  */
0024 class TotemVFATInfo {
0025 public:
0026   /// the symbolic id
0027   TotemSymbID symbolicID;
0028 
0029   /// the hardware ID (16 bit)
0030   unsigned int hwID;
0031 
0032   friend std::ostream& operator<<(std::ostream& s, const TotemVFATInfo& fp);
0033 };
0034 
0035 //----------------------------------------------------------------------------------------------------
0036 
0037 /**
0038  *\brief The mapping between FramePosition and VFATInfo.
0039  */
0040 class TotemDAQMapping {
0041 public:
0042   std::map<TotemFramePosition, TotemVFATInfo> VFATMapping;
0043 
0044   /// Hw Id mapping for Totem Timing (dynamical mapping in Sampic)
0045   struct TotemTimingPlaneChannelPair {
0046     int plane;
0047     int channel;
0048 
0049     TotemTimingPlaneChannelPair(const int& plane = -1, const int& channel = -1) : plane(plane), channel(channel){};
0050   };
0051   std::map<uint8_t, TotemTimingPlaneChannelPair> totemTimingChannelMap;
0052 
0053   void insert(const TotemFramePosition& fp, const TotemVFATInfo& vi);
0054 
0055   /// Given the hardware ID, returns the corresponding Plane, Channel pair (TotemTimingPlaneChannelPair)
0056   const TotemTimingPlaneChannelPair getTimingChannel(const uint8_t hwId) const;
0057 };
0058 
0059 #endif