Back to home page

Project CMSSW displayed by LXR

 
 

    


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

0001 #ifndef RPCReadOutMapping_H
0002 #define RPCReadOutMapping_H
0003 /** \class RPCReadOutMapping
0004  *
0005  *  Description:
0006  *       Class to map read-out channels to physical RPC strips
0007  */
0008 
0009 #include "CondFormats/Serialization/interface/Serializable.h"
0010 
0011 #include <map>
0012 #include <vector>
0013 #include <utility>
0014 #include <string>
0015 
0016 #include "CondFormats/RPCObjects/interface/DccSpec.h"
0017 #include "CondFormats/RPCObjects/interface/LinkBoardElectronicIndex.h"
0018 #include "CondFormats/RPCObjects/interface/LinkBoardPackedStrip.h"
0019 #include <cstdint>
0020 class LinkBoardSpec;
0021 
0022 class RPCReadOutMapping {
0023 public:
0024   /// first member is DetUnit ID, second strip in DetUnit frame
0025   typedef std::pair<uint32_t, int> StripInDetUnit;
0026 
0027   RPCReadOutMapping(const std::string& version = "");
0028   virtual ~RPCReadOutMapping() {}
0029 
0030   /// FED identified by ID
0031   const DccSpec* dcc(int dccId) const;
0032 
0033   /// Range of FED IDs in map (min and max id)
0034   std::pair<int, int> dccNumberRange() const;
0035 
0036   /// all FEDs in map
0037   std::vector<const DccSpec*> dccList() const;
0038 
0039   /// attach FED to map
0040   void add(const DccSpec& dcc);
0041 
0042   /// version as string
0043   const std::string& version() const { return theVersion; }
0044 
0045   /// conversion between electronic and detector indexing
0046   virtual const LinkBoardSpec* location(const LinkBoardElectronicIndex& ele) const;
0047 
0048   /// convert strip location as in raw data (LB and LBchannel) to detUnit frame
0049   virtual StripInDetUnit detUnitFrame(const LinkBoardSpec& location, const LinkBoardPackedStrip& packedStrip) const;
0050 
0051   /// connection "paths" that lead from one digi to one strip
0052   std::vector<std::pair<LinkBoardElectronicIndex, LinkBoardPackedStrip> > rawDataFrame(
0053       const StripInDetUnit& duFrame) const;
0054 
0055   // TEMPORARY
0056   std::vector<const LinkBoardSpec*> getLBforChamber(const std::string& name) const;
0057   std::pair<LinkBoardElectronicIndex, int> getRAWSpecForCMSChamberSrip(uint32_t detId,
0058                                                                        int strip,
0059                                                                        int dccInputChannel) const;
0060 
0061 private:
0062   typedef std::map<int, DccSpec>::const_iterator IMAP;
0063   std::map<int, DccSpec> theFeds;
0064   std::string theVersion;
0065 
0066   COND_SERIALIZABLE;
0067 };
0068 
0069 #endif  // RPCReadOutMapping_H