File indexing completed on 2024-04-06 12:02:00
0001 #ifndef CondFormats_CSCTriggerMapping_h
0002 #define CondFormats_CSCTriggerMapping_h
0003
0004
0005
0006
0007
0008
0009
0010
0011
0012
0013
0014
0015
0016
0017 #include "CondFormats/Serialization/interface/Serializable.h"
0018
0019 #include <DataFormats/MuonDetId/interface/CSCDetId.h>
0020 #include <vector>
0021 #include <map>
0022
0023 class CSCTriggerMapping {
0024 public:
0025
0026 CSCTriggerMapping();
0027
0028
0029 virtual ~CSCTriggerMapping();
0030
0031
0032
0033
0034
0035
0036
0037
0038
0039
0040
0041
0042 typedef struct CSCTriggerConnection {
0043 CSCTriggerConnection() {}
0044 CSCTriggerConnection(int rendcap,
0045 int rstation,
0046 int rsector,
0047 int rsubsector,
0048 int rcscid,
0049 int cendcap,
0050 int cstation,
0051 int csector,
0052 int csubsector,
0053 int ccscid)
0054 : rendcap_(rendcap),
0055 rstation_(rstation),
0056 rsector_(rsector),
0057 rsubsector_(rsubsector),
0058 rcscid_(rcscid),
0059 cendcap_(cendcap),
0060 cstation_(cstation),
0061 csector_(csector),
0062 csubsector_(csubsector),
0063 ccscid_(ccscid) {}
0064 ~CSCTriggerConnection() {}
0065
0066 int rendcap_;
0067 int rstation_;
0068 int rsector_;
0069 int rsubsector_;
0070 int rcscid_;
0071 int cendcap_;
0072 int cstation_;
0073 int csector_;
0074 int csubsector_;
0075 int ccscid_;
0076
0077 COND_SERIALIZABLE;
0078 } Connection;
0079
0080
0081
0082
0083
0084
0085
0086 CSCDetId detId(int endcap, int station, int sector, int subsector, int cscid, int layer = 0) const;
0087
0088
0089
0090
0091
0092 int chamber(int endcap, int station, int sector, int subsector, int cscid) const;
0093
0094
0095
0096
0097 virtual void fill(void) = 0;
0098
0099
0100
0101
0102 void addRecord(int rendcap,
0103 int rstation,
0104 int rsector,
0105 int rsubsector,
0106 int rcscid,
0107 int cendcap,
0108 int cstation,
0109 int csector,
0110 int csubsector,
0111 int ccscid);
0112
0113
0114
0115
0116 void setDebugV(bool dbg) { debugV_ = dbg; }
0117
0118
0119
0120
0121 bool debugV(void) const { return debugV_; }
0122
0123
0124
0125
0126 const std::string& myName(void) const { return myName_; }
0127
0128 private:
0129
0130
0131
0132
0133 virtual int hwId(int endcap, int station, int sector, int subsector, int cscid) const = 0;
0134
0135
0136
0137
0138
0139
0140 int swId(int endcap, int station, int sector, int subsector, int cscid) const;
0141
0142 std::string myName_ COND_TRANSIENT;
0143 bool debugV_ COND_TRANSIENT;
0144 std::vector<Connection> mapping_;
0145 std::map<int, int> hw2sw_ COND_TRANSIENT;
0146
0147 COND_SERIALIZABLE;
0148 };
0149
0150 #endif