File indexing completed on 2024-04-06 12:02:05
0001 #ifndef DTHVStatus_H
0002 #define DTHVStatus_H
0003
0004
0005
0006
0007
0008
0009
0010
0011
0012
0013
0014
0015
0016
0017
0018
0019
0020 #include "CondFormats/Serialization/interface/Serializable.h"
0021 #include "FWCore/Utilities/interface/ConstRespectingPtr.h"
0022
0023 class DTWireId;
0024 class DTLayerId;
0025 class DTChamberId;
0026
0027
0028
0029
0030 #include <string>
0031 #include <vector>
0032 #include <utility>
0033
0034 template <class Key, class Content>
0035 class DTBufferTree;
0036
0037
0038
0039
0040
0041 class DTHVStatusId {
0042 public:
0043 DTHVStatusId();
0044 ~DTHVStatusId();
0045
0046 int wheelId;
0047 int stationId;
0048 int sectorId;
0049 int slId;
0050 int layerId;
0051 int partId;
0052
0053 COND_SERIALIZABLE;
0054 };
0055
0056 class DTHVStatusData {
0057 public:
0058 DTHVStatusData();
0059 ~DTHVStatusData();
0060
0061 int fCell;
0062 int lCell;
0063 int flagA;
0064 int flagC;
0065 int flagS;
0066
0067 COND_SERIALIZABLE;
0068 };
0069
0070 class DTHVStatus {
0071 public:
0072
0073
0074 DTHVStatus();
0075 DTHVStatus(DTHVStatus const&) = delete;
0076 DTHVStatus& operator=(DTHVStatus const&) = delete;
0077 DTHVStatus(const std::string& version);
0078
0079
0080
0081 ~DTHVStatus();
0082
0083
0084
0085
0086 int get(int wheelId,
0087 int stationId,
0088 int sectorId,
0089 int slId,
0090 int layerId,
0091 int partId,
0092 int& fCell,
0093 int& lCell,
0094 int& flagA,
0095 int& flagC,
0096 int& flagS) const;
0097 int get(const DTLayerId& id, int partId, int& fCell, int& lCell, int& flagA, int& flagC, int& flagS) const;
0098 int get(const DTWireId& id, int& flagA, int& flagC, int& flagS) const;
0099 int offChannelsNumber() const;
0100 int offChannelsNumber(const DTChamberId& id) const;
0101 int badChannelsNumber() const;
0102 int badChannelsNumber(const DTChamberId& id) const;
0103
0104 const std::string& version() const;
0105 std::string& version();
0106
0107
0108 void clear();
0109
0110 int set(int wheelId,
0111 int stationId,
0112 int sectorId,
0113 int slId,
0114 int layerId,
0115 int partId,
0116 int fCell,
0117 int lCell,
0118 int flagA,
0119 int flagC,
0120 int flagS);
0121 int set(const DTLayerId& id, int partId, int fCell, int lCell, int flagA, int flagC, int flagS);
0122 int setFlagA(int wheelId, int stationId, int sectorId, int slId, int layerId, int partId, int flag);
0123 int setFlagA(const DTLayerId& id, int partId, int flag);
0124 int setFlagC(int wheelId, int stationId, int sectorId, int slId, int layerId, int partId, int flag);
0125 int setFlagC(const DTLayerId& id, int partId, int flag);
0126 int setFlagS(int wheelId, int stationId, int sectorId, int slId, int layerId, int partId, int flag);
0127 int setFlagS(const DTLayerId& id, int partId, int flag);
0128
0129
0130 typedef std::vector<std::pair<DTHVStatusId, DTHVStatusData> >::const_iterator const_iterator;
0131 const_iterator begin() const;
0132 const_iterator end() const;
0133
0134 void initialize();
0135
0136 private:
0137 std::string dataVersion;
0138
0139 std::vector<std::pair<DTHVStatusId, DTHVStatusData> > dataList;
0140
0141 edm::ConstRespectingPtr<DTBufferTree<int, int> > dBuf COND_TRANSIENT;
0142
0143
0144 std::string mapName() const;
0145
0146 COND_SERIALIZABLE;
0147 };
0148 #endif