Back to home page

Project CMSSW displayed by LXR

 
 

    


File indexing completed on 2024-04-06 12:02:28

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 #include "CondFormats/PPSObjects/interface/TotemSymbId.h"
0015 #include "CondFormats/PPSObjects/interface/TotemT2FramePosition.h"
0016 #include "CondFormats/Serialization/interface/Serializable.h"
0017 #include <map>
0018 #include <cstdint>
0019 
0020 //----------------------------------------------------------------------------------------------------
0021 
0022 /**
0023  *\brief Contains mappind data related to a VFAT.
0024  */
0025 class TotemVFATInfo {
0026 public:
0027   /// the symbolic id
0028   TotemSymbID symbolicID;
0029 
0030   /// the hardware ID (16 bit)
0031   unsigned int hwID;
0032 
0033   friend std::ostream& operator<<(std::ostream& s, const TotemVFATInfo& fp);
0034 
0035   void print(std::ostream& os, std::string subSystemName) const;
0036 
0037   COND_SERIALIZABLE;
0038 };
0039 
0040 //----------------------------------------------------------------------------------------------------
0041 
0042 /**
0043  *\brief The mapping between FramePosition and VFATInfo.
0044  */
0045 class TotemDAQMapping {
0046 public:
0047   std::map<TotemFramePosition, TotemVFATInfo> VFATMapping;
0048 
0049   /// Hw Id mapping for Totem Timing (dynamical mapping in Sampic)
0050   struct TotemTimingPlaneChannelPair {
0051     int plane;
0052     int channel;
0053 
0054     TotemTimingPlaneChannelPair(const int& plane = -1, const int& channel = -1) : plane(plane), channel(channel){};
0055     COND_SERIALIZABLE;
0056   };
0057   std::map<uint8_t, TotemTimingPlaneChannelPair> totemTimingChannelMap;
0058 
0059   void insert(const TotemFramePosition& fp, const TotemVFATInfo& vi);
0060   void insert(const TotemT2FramePosition& fp2, const TotemVFATInfo& vi);
0061   void print(std::ostream& os, std::string subSystemName) const;
0062 
0063   /// Given the hardware ID, returns the corresponding Plane, Channel pair (TotemTimingPlaneChannelPair)
0064   const TotemTimingPlaneChannelPair getTimingChannel(const uint8_t hwId) const;
0065 
0066   COND_SERIALIZABLE;
0067 };
0068 
0069 std::ostream& operator<<(std::ostream& os, TotemDAQMapping mapping);
0070 
0071 #endif