CMS 3D CMS Logo

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 
22 namespace edm {
23  class ParameterSet;
24 }
25 
27 public:
30 
32  virtual ~CSCReadoutMapping();
33 
37  struct CSCLabel {
38  CSCLabel() {}
40  int station,
41  int ring,
42  int chamber,
43  int vmecrate,
44  int dmb,
45  int tmb,
46  int tsector,
47  int cscid,
48  int ddu,
49  int dcc)
50  : endcap_(endcap),
51  station_(station),
52  ring_(ring),
53  chamber_(chamber),
54  vmecrate_(vmecrate),
55  dmb_(dmb),
56  tmb_(tmb),
57  tsector_(tsector),
58  cscid_(cscid),
59  ddu_(ddu),
60  dcc_(dcc) {}
61  ~CSCLabel() {}
62 
63  int endcap_;
64  int station_;
65  int ring_;
66  int chamber_;
67  int vmecrate_;
68  int dmb_;
69  int tmb_;
70  int tsector_;
71  int cscid_;
72  int ddu_;
73  int dcc_;
74 
76  };
77 
84  // layer at end so it can have default arg
85  CSCDetId detId(int endcap, int station, int vmecrate, int dmb, int tmb, int cfeb, int layer = 0) const;
86 
91  int chamber(int endcap, int station, int vmecrate, int dmb, int tmb) const;
92 
96  virtual void fill(const edm::ParameterSet&) = 0;
97 
99  CSCLabel findHardwareId(const CSCDetId&) const;
101  int crate(const CSCDetId&) const;
103  int dmbId(const CSCDetId&) const;
105  int dccId(const CSCDetId&) const;
107  int dduId(const CSCDetId&) const;
108 
112  void addRecord(int endcap,
113  int station,
114  int ring,
115  int chamber,
116  int vmecrate,
117  int dmb,
118  int tmb,
119  int tsector,
120  int cscid,
121  int ddu,
122  int dcc);
123 
127  void setDebugV(bool dbg) { debugV_ = dbg; }
128 
132  bool debugV(void) const { return debugV_; }
133 
137  const std::string& myName(void) const { return myName_; }
138 
139 private:
146  virtual int hwId(int endcap, int station, int vme, int dmb, int tmb) const = 0;
147 
153  int swId(int endcap, int station, int ring, int chamber) const;
154 
156  bool debugV_ COND_TRANSIENT;
157  std::vector<CSCLabel> mapping_;
158  std::map<int, int> hw2sw_ COND_TRANSIENT;
159  std::map<int, CSCLabel> sw2hw_;
160 
162 };
163 
164 #endif
void setDebugV(bool dbg)
bool debugV(void) const
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_
static const char ring_[]
std::map< int, CSCLabel > sw2hw_
#define COND_TRANSIENT
Definition: Serializable.h:62
#define COND_SERIALIZABLE
Definition: Serializable.h:38
HLT enums.
unsigned dccId(DetId const &)