Back to home page

Project CMSSW displayed by LXR

 
 

    


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

0001 #ifndef DTCCBConfig_H
0002 #define DTCCBConfig_H
0003 /** \class DTCCBConfig
0004  *
0005  *  Description:
0006  *       Class to hold configuration identifier for chambers
0007  *
0008  *  \author Paolo Ronchese INFN Padova
0009  *
0010  */
0011 
0012 //----------------------
0013 // Base Class Headers --
0014 //----------------------
0015 
0016 //------------------------------------
0017 // Collaborating Class Declarations --
0018 //------------------------------------
0019 #include "CondFormats/Serialization/interface/Serializable.h"
0020 
0021 #include "DataFormats/MuonDetId/interface/DTChamberId.h"
0022 #include "FWCore/Utilities/interface/ConstRespectingPtr.h"
0023 
0024 //---------------
0025 // C++ Headers --
0026 //---------------
0027 #include <string>
0028 #include <vector>
0029 #include <utility>
0030 
0031 class DTBufferTreeUniquePtr;
0032 
0033 //              ---------------------
0034 //              -- Class Interface --
0035 //              ---------------------
0036 
0037 class DTCCBId {
0038 public:
0039   DTCCBId();
0040   ~DTCCBId();
0041 
0042   int wheelId;
0043   int stationId;
0044   int sectorId;
0045 
0046   COND_SERIALIZABLE;
0047 };
0048 
0049 class DTConfigKey {
0050 public:
0051   DTConfigKey();
0052   ~DTConfigKey();
0053 
0054   int confType;
0055   int confKey;
0056 
0057   COND_SERIALIZABLE;
0058 };
0059 
0060 class DTCCBConfig {
0061 public:
0062   DTCCBConfig();
0063   DTCCBConfig(DTCCBConfig const&) = delete;
0064   DTCCBConfig& operator=(DTCCBConfig const&) = delete;
0065   DTCCBConfig(const std::string& version);
0066 
0067   virtual ~DTCCBConfig();
0068 
0069   std::vector<DTConfigKey> fullKey() const;
0070   int stamp() const;
0071   int configKey(int wheelId, int stationId, int sectorId, std::vector<int>& confKey) const;
0072   int configKey(const DTChamberId& id, std::vector<int>& confKey) const;
0073   typedef std::vector<std::pair<DTCCBId, std::vector<int> > > ccb_config_map;
0074   typedef ccb_config_map::const_iterator ccb_config_iterator;
0075   ccb_config_map configKeyMap() const;
0076 
0077   /// access version
0078   const std::string& version() const;
0079   std::string& version();
0080 
0081   /// reset content
0082   void clear();
0083 
0084   void setFullKey(const std::vector<DTConfigKey>&);
0085   void setStamp(int s);
0086 
0087   int setConfigKey(int wheelId, int stationId, int sectorId, const std::vector<int>& confKey);
0088   int setConfigKey(const DTChamberId& id, const std::vector<int>& confKey);
0089 
0090   int appendConfigKey(int wheelId, int stationId, int sectorId, const std::vector<int>& confKey);
0091   int appendConfigKey(const DTChamberId& id, const std::vector<int>& confKey);
0092 
0093   /// Access methods to data
0094   typedef std::vector<std::pair<DTCCBId, int> >::const_iterator const_iterator;
0095   const_iterator begin() const;
0096   const_iterator end() const;
0097 
0098   void initialize();
0099 
0100 private:
0101   int timeStamp;
0102   std::string dataVersion;
0103   std::vector<DTConfigKey> fullConfigKey;
0104   std::vector<std::pair<DTCCBId, int> > dataList;
0105 
0106   edm::ConstRespectingPtr<DTBufferTreeUniquePtr> dBuf COND_TRANSIENT;
0107 
0108   COND_SERIALIZABLE;
0109 };
0110 #endif  // DTCCBConfig_H