Back to home page

Project CMSSW displayed by LXR

 
 

    


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

0001 #ifndef DTLVStatus_H
0002 #define DTLVStatus_H
0003 /** \class DTLVStatus
0004  *
0005  *  Description:
0006  *       Class to hold CCB status
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 #include "FWCore/Utilities/interface/ConstRespectingPtr.h"
0021 
0022 class DTChamberId;
0023 
0024 //---------------
0025 // C++ Headers --
0026 //---------------
0027 #include <string>
0028 #include <vector>
0029 #include <utility>
0030 
0031 template <class Key, class Content>
0032 class DTBufferTree;
0033 
0034 //              ---------------------
0035 //              -- Class Interface --
0036 //              ---------------------
0037 
0038 class DTLVStatusId {
0039 public:
0040   DTLVStatusId();
0041   ~DTLVStatusId();
0042 
0043   int wheelId;
0044   int stationId;
0045   int sectorId;
0046 
0047   COND_SERIALIZABLE;
0048 };
0049 
0050 class DTLVStatusData {
0051 public:
0052   DTLVStatusData();
0053   ~DTLVStatusData();
0054 
0055   int flagCFE;
0056   int flagDFE;
0057   int flagCMC;
0058   int flagDMC;
0059 
0060   COND_SERIALIZABLE;
0061 };
0062 
0063 class DTLVStatus {
0064 public:
0065   /** Constructor
0066    */
0067   DTLVStatus();
0068   DTLVStatus(DTLVStatus const&) = delete;
0069   DTLVStatus& operator=(DTLVStatus const&) = delete;
0070   DTLVStatus(const std::string& version);
0071 
0072   /** Destructor
0073    */
0074   ~DTLVStatus();
0075 
0076   /** Operations
0077    */
0078   /// get content
0079   int get(int wheelId, int stationId, int sectorId, int& flagCFE, int& flagDFE, int& flagCMC, int& flagDMC) const;
0080   int get(const DTChamberId& id, int& flagCFE, int& flagDFE, int& flagCMC, int& flagDMC) const;
0081   /// access version
0082   const std::string& version() const;
0083   std::string& version();
0084 
0085   /// reset content
0086   void clear();
0087 
0088   int set(int wheelId, int stationId, int sectorId, int flagCFE, int flagDFE, int flagCMC, int flagDMC);
0089   int set(const DTChamberId& id, int flagCFE, int flagDFE, int flagCMC, int flagDMC);
0090   int setFlagCFE(int wheelId, int stationId, int sectorId, int flag);
0091   int setFlagCFE(const DTChamberId& id, int flag);
0092   int setFlagDFE(int wheelId, int stationId, int sectorId, int flag);
0093   int setFlagDFE(const DTChamberId& id, int flag);
0094   int setFlagCMC(int wheelId, int stationId, int sectorId, int flag);
0095   int setFlagCMC(const DTChamberId& id, int flag);
0096   int setFlagDMC(int wheelId, int stationId, int sectorId, int flag);
0097   int setFlagDMC(const DTChamberId& id, int flag);
0098 
0099   /// Access methods to data
0100   typedef std::vector<std::pair<DTLVStatusId, DTLVStatusData> >::const_iterator const_iterator;
0101   const_iterator begin() const;
0102   const_iterator end() const;
0103 
0104   void initialize();
0105 
0106 private:
0107   std::string dataVersion;
0108 
0109   std::vector<std::pair<DTLVStatusId, DTLVStatusData> > dataList;
0110 
0111   edm::ConstRespectingPtr<DTBufferTree<int, int> > dBuf COND_TRANSIENT;
0112 
0113   /// read and store full content
0114   std::string mapName() const;
0115 
0116   COND_SERIALIZABLE;
0117 };
0118 #endif  // DTLVStatus_H