File indexing completed on 2023-03-17 10:46:38
0001
0002
0003
0004
0005
0006
0007
0008
0009
0010
0011
0012
0013
0014
0015
0016
0017
0018
0019 #ifndef CSCDQM_DCSBASE_H
0020 #define CSCDQM_DCSBASE_H
0021
0022 #include "CondFormats/Serialization/interface/Serializable.h"
0023
0024 #include <iostream>
0025 #include <sstream>
0026
0027 #include "DataFormats/MuonDetId/interface/CSCDetId.h"
0028
0029 namespace cscdqm {
0030
0031
0032 typedef long long TimeType;
0033
0034
0035 enum DCSBoardType { ANY = 0, ALCT = 1, CFEB = 2, DMB = 3 };
0036
0037
0038 struct DCSBoardUtility {
0039 DCSBoardType boardType;
0040 DCSBoardUtility(const DCSBoardType boardType_) : boardType(boardType_) {}
0041
0042
0043
0044
0045
0046
0047 static DCSBoardType getDCSBoard(const std::string board) {
0048 if (board.compare("ALCT"))
0049 return ALCT;
0050 if (board.compare("CFEB"))
0051 return CFEB;
0052 if (board.compare("DMB"))
0053 return DMB;
0054 return ANY;
0055 }
0056
0057 friend std::ostream& operator<<(std::ostream& out, const DCSBoardUtility& b) {
0058 switch (b.boardType) {
0059 case ANY:
0060 return out << "ANY";
0061 case ALCT:
0062 return out << "ALCT";
0063 case CFEB:
0064 return out << "CFEB";
0065 case DMB:
0066 return out << "DMB";
0067 }
0068 return out << "?";
0069 }
0070 };
0071
0072
0073
0074
0075 struct DCSAddressType {
0076
0077 unsigned short iendcap;
0078
0079
0080 unsigned short istation;
0081
0082
0083 unsigned short iring;
0084
0085
0086 unsigned int ichamber;
0087
0088
0089 CSCDetId getDetId() const { return CSCDetId(iendcap, istation, iring, ichamber); }
0090
0091
0092 DCSAddressType& operator=(const DCSAddressType& a) {
0093 iendcap = a.iendcap;
0094 istation = a.istation;
0095 iring = a.iring;
0096 ichamber = a.ichamber;
0097 return *this;
0098 }
0099
0100
0101 friend std::ostream& operator<<(std::ostream& out, const DCSAddressType& a) {
0102 std::ostringstream os;
0103 os << "endcap = " << a.iendcap << " ";
0104 os << "station = " << a.istation << " ";
0105 os << "ring = " << a.iring << " ";
0106 os << "chamber = " << a.ichamber;
0107 return out << os.str();
0108 }
0109
0110 COND_SERIALIZABLE;
0111 };
0112
0113 }
0114
0115 #endif