Back to home page

Project CMSSW displayed by LXR

 
 

    


File indexing completed on 2022-06-24 22:51:44

0001 #ifndef CondFormatsRPCObjectsFebConnectorSpec_H
0002 #define CondFormatsRPCObjectsFebConnectorSpec_H
0003 
0004 #include "CondFormats/Serialization/interface/Serializable.h"
0005 
0006 #include <vector>
0007 #include "DataFormats/DetId/interface/DetId.h"
0008 #include "CondFormats/RPCObjects/interface/ChamberStripSpec.h"
0009 #include "CondFormats/RPCObjects/interface/ChamberLocationSpec.h"
0010 #include "CondFormats/RPCObjects/interface/FebLocationSpec.h"
0011 #include <string>
0012 #include <atomic>
0013 
0014 /** \class FebConnectorSpec 
0015  * Specifies the input for LinkBoard. In hardware the data goes through
0016  * FEB connector which collects data from input strips.
0017  * This class provides access to strip on one side and DetUnit location
0018  * (through ChamberLocationSpec and FebSpec info) on the other side.
0019  *
0020  * FIXME - afer debug fill theRawId in constructor and remove theChamber,theFeb
0021  *
0022  */
0023 
0024 class FebConnectorSpec {
0025 public:
0026   FebConnectorSpec(int num = -1) : theLinkBoardInputNum(num), theRawId(0) {}
0027   FebConnectorSpec(int num, const ChamberLocationSpec& chamber, const FebLocationSpec& feb);
0028   FebConnectorSpec(FebConnectorSpec const&);
0029 
0030   FebConnectorSpec& operator=(FebConnectorSpec const&);
0031 
0032   /// this FEB channel in LinkBoard
0033   int linkBoardInputNum() const { return theLinkBoardInputNum; }
0034 
0035   /// add strip info
0036   void addStrips(int algo) { theAlgo = algo; }
0037 
0038   /// strip info for input pin
0039   const ChamberStripSpec strip(int pinNumber) const;
0040 
0041   /// DetUnit to which data belongs
0042   uint32_t rawId() const;
0043 
0044   const ChamberLocationSpec& chamber() const { return theChamber; }
0045   const FebLocationSpec& feb() const { return theFeb; }
0046 
0047   const int nstrips() const { return theAlgo / 10000; }
0048 
0049   const int chamberStripNum(int istrip) const;
0050 
0051   const int cmsStripNum(int istrip) const { return 0; }
0052 
0053   const int cablePinNum(int istrip) const;
0054 
0055   /// debug
0056   std::string print(int depth = 0) const;
0057 
0058 private:
0059   int theLinkBoardInputNum;
0060 
0061   ChamberLocationSpec theChamber;
0062   FebLocationSpec theFeb;
0063 
0064   int theAlgo;
0065   mutable std::atomic<uint32_t> theRawId COND_TRANSIENT;
0066 
0067   COND_SERIALIZABLE;
0068 };
0069 
0070 #endif