File indexing completed on 2023-03-17 10:46:39
0001 #ifndef CondFormats_CSCReadoutMapping_h
0002 #define CondFormats_CSCReadoutMapping_h
0003
0004
0005
0006
0007
0008
0009
0010
0011
0012
0013
0014
0015
0016 #include "CondFormats/Serialization/interface/Serializable.h"
0017
0018 #include "DataFormats/MuonDetId/interface/CSCDetId.h"
0019 #include <vector>
0020 #include <map>
0021
0022 class CSCReadoutMapping {
0023 public:
0024
0025 CSCReadoutMapping();
0026
0027
0028 virtual ~CSCReadoutMapping();
0029
0030
0031
0032
0033 struct CSCLabel {
0034 CSCLabel() {}
0035 CSCLabel(int endcap,
0036 int station,
0037 int ring,
0038 int chamber,
0039 int vmecrate,
0040 int dmb,
0041 int tmb,
0042 int tsector,
0043 int cscid,
0044 int ddu,
0045 int dcc)
0046 : endcap_(endcap),
0047 station_(station),
0048 ring_(ring),
0049 chamber_(chamber),
0050 vmecrate_(vmecrate),
0051 dmb_(dmb),
0052 tmb_(tmb),
0053 tsector_(tsector),
0054 cscid_(cscid),
0055 ddu_(ddu),
0056 dcc_(dcc) {}
0057 ~CSCLabel() {}
0058
0059 int endcap_;
0060 int station_;
0061 int ring_;
0062 int chamber_;
0063 int vmecrate_;
0064 int dmb_;
0065 int tmb_;
0066 int tsector_;
0067 int cscid_;
0068 int ddu_;
0069 int dcc_;
0070
0071 COND_SERIALIZABLE;
0072 };
0073
0074
0075
0076
0077
0078
0079
0080
0081 CSCDetId detId(int endcap, int station, int vmecrate, int dmb, int tmb, int cfeb, int layer = 0) const;
0082
0083
0084
0085
0086
0087 int chamber(int endcap, int station, int vmecrate, int dmb, int tmb) const;
0088
0089
0090 CSCLabel findHardwareId(const CSCDetId&) const;
0091
0092 int crate(const CSCDetId&) const;
0093
0094 int dmbId(const CSCDetId&) const;
0095
0096 int dccId(const CSCDetId&) const;
0097
0098 int dduId(const CSCDetId&) const;
0099
0100
0101
0102
0103 void addRecord(int endcap,
0104 int station,
0105 int ring,
0106 int chamber,
0107 int vmecrate,
0108 int dmb,
0109 int tmb,
0110 int tsector,
0111 int cscid,
0112 int ddu,
0113 int dcc);
0114
0115
0116
0117
0118 void setDebugV(bool dbg) { debugV_ = dbg; }
0119
0120
0121
0122
0123 bool debugV(void) const { return debugV_; }
0124
0125
0126
0127
0128 const std::string& myName(void) const { return myName_; }
0129
0130 private:
0131
0132
0133
0134
0135
0136
0137 virtual int hwId(int endcap, int station, int vme, int dmb, int tmb) const = 0;
0138
0139
0140
0141
0142
0143
0144 int swId(int endcap, int station, int ring, int chamber) const;
0145
0146 std::string myName_ COND_TRANSIENT;
0147 bool debugV_ COND_TRANSIENT;
0148 std::vector<CSCLabel> mapping_;
0149 std::map<int, int> hw2sw_ COND_TRANSIENT;
0150 std::map<int, CSCLabel> sw2hw_;
0151
0152 COND_SERIALIZABLE;
0153 };
0154
0155 #endif