CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
CSCReadoutMapping.h
Go to the documentation of this file.
1 #ifndef CondFormats_CSCReadoutMapping_h
2 #define CondFormats_CSCReadoutMapping_h
3 
14 //@@ FIXME This whole design would better suit a Factory/Builder pattern
15 
17 
19 #include <vector>
20 #include <map>
21 
23 public:
26 
28  virtual ~CSCReadoutMapping();
29 
33  struct CSCLabel {
34  CSCLabel() {}
36  int station,
37  int ring,
38  int chamber,
39  int vmecrate,
40  int dmb,
41  int tmb,
42  int tsector,
43  int cscid,
44  int ddu,
45  int dcc)
46  : endcap_(endcap),
47  station_(station),
48  ring_(ring),
49  chamber_(chamber),
50  vmecrate_(vmecrate),
51  dmb_(dmb),
52  tmb_(tmb),
53  tsector_(tsector),
54  cscid_(cscid),
55  ddu_(ddu),
56  dcc_(dcc) {}
57  ~CSCLabel() {}
58 
59  int endcap_;
60  int station_;
61  int ring_;
62  int chamber_;
63  int vmecrate_;
64  int dmb_;
65  int tmb_;
66  int tsector_;
67  int cscid_;
68  int ddu_;
69  int dcc_;
70 
72  };
73 
80  // layer at end so it can have default arg
81  CSCDetId detId(int endcap, int station, int vmecrate, int dmb, int tmb, int cfeb, int layer = 0) const;
82 
87  int chamber(int endcap, int station, int vmecrate, int dmb, int tmb) const;
88 
90  CSCLabel findHardwareId(const CSCDetId&) const;
92  int crate(const CSCDetId&) const;
94  int dmbId(const CSCDetId&) const;
96  int dccId(const CSCDetId&) const;
98  int dduId(const CSCDetId&) const;
99 
103  void addRecord(int endcap,
104  int station,
105  int ring,
106  int chamber,
107  int vmecrate,
108  int dmb,
109  int tmb,
110  int tsector,
111  int cscid,
112  int ddu,
113  int dcc);
114 
118  void setDebugV(bool dbg) { debugV_ = dbg; }
119 
123  bool debugV(void) const { return debugV_; }
124 
128  const std::string& myName(void) const { return myName_; }
129 
130 private:
137  virtual int hwId(int endcap, int station, int vme, int dmb, int tmb) const = 0;
138 
144  int swId(int endcap, int station, int ring, int chamber) const;
145 
148  std::vector<CSCLabel> mapping_;
149  std::map<int, int> hw2sw_ COND_TRANSIENT;
150  std::map<int, CSCLabel> sw2hw_;
151 
153 };
154 
155 #endif
int chamber(int endcap, int station, int vmecrate, int dmb, int tmb) const
int swId(int endcap, int station, int ring, int chamber) const
void setDebugV(bool dbg)
int dmbId(const CSCDetId &) const
returns dmbId given CSCDetId
CSCLabel findHardwareId(const CSCDetId &) const
returns hardware ids given chamber id
virtual int hwId(int endcap, int station, int vme, int dmb, int tmb) const =0
CSCDetId detId(int endcap, int station, int vmecrate, int dmb, int tmb, int cfeb, int layer=0) const
bool debugV(void) const
constexpr std::array< uint8_t, layerIndexSize > layer
CSCLabel(int endcap, int station, int ring, int chamber, int vmecrate, int dmb, int tmb, int tsector, int cscid, int ddu, int dcc)
const std::string & myName(void) const
std::vector< CSCLabel > mapping_
int crate(const CSCDetId &) const
returns vmecrate given CSCDetId
void addRecord(int endcap, int station, int ring, int chamber, int vmecrate, int dmb, int tmb, int tsector, int cscid, int ddu, int dcc)
int dccId(const CSCDetId &) const
returns DCC# given CSCDetId
std::map< int, CSCLabel > sw2hw_
#define COND_TRANSIENT
Definition: Serializable.h:63
std::map< int, int > hw2sw_
CSCReadoutMapping()
Default constructor.
#define COND_SERIALIZABLE
Definition: Serializable.h:39
int dduId(const CSCDetId &) const
returns DDU# given CSCDetId
virtual ~CSCReadoutMapping()
Destructor.