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),
52  ring_(ring),
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 
157  std::vector<CSCLabel> mapping_;
158  std::map<int, int> hw2sw_ COND_TRANSIENT;
159  std::map<int, CSCLabel> sw2hw_;
160 
162 };
163 
164 #endif
CSCReadoutMapping::CSCLabel::tmb_
int tmb_
Definition: CSCReadoutMapping.h:69
CSCReadoutMapping::~CSCReadoutMapping
virtual ~CSCReadoutMapping()
Destructor.
Definition: CSCReadoutMapping.cc:7
relativeConstraints.station
station
Definition: relativeConstraints.py:67
edm
HLT enums.
Definition: AlignableModifier.h:19
COND_SERIALIZABLE
#define COND_SERIALIZABLE
Definition: Serializable.h:39
COND_TRANSIENT
#define COND_TRANSIENT
Definition: Serializable.h:63
makeMuonMisalignmentScenario.endcap
endcap
Definition: makeMuonMisalignmentScenario.py:320
CSCReadoutMapping::setDebugV
void setDebugV(bool dbg)
Definition: CSCReadoutMapping.h:127
CSCDetId.h
CSCReadoutMapping::hwId
virtual int hwId(int endcap, int station, int vme, int dmb, int tmb) const =0
CSCReadoutMapping::CSCLabel::ddu_
int ddu_
Definition: CSCReadoutMapping.h:72
CSCReadoutMapping::dccId
int dccId(const CSCDetId &) const
returns DCC# given CSCDetId
Definition: CSCReadoutMapping.cc:104
CSCReadoutMapping::debugV
bool debugV(void) const
Definition: CSCReadoutMapping.h:132
CSCReadoutMapping::mapping_
std::vector< CSCLabel > mapping_
Definition: CSCReadoutMapping.h:157
CSCReadoutMapping::chamber
int chamber(int endcap, int station, int vmecrate, int dmb, int tmb) const
Definition: CSCReadoutMapping.cc:9
CSCReadoutMapping::CSCLabel::CSCLabel
CSCLabel()
Definition: CSCReadoutMapping.h:38
CSCReadoutMapping::findHardwareId
CSCLabel findHardwareId(const CSCDetId &) const
returns hardware ids given chamber id
Definition: CSCReadoutMapping.cc:77
phase1PixelTopology::layer
constexpr std::array< uint8_t, layerIndexSize > layer
Definition: phase1PixelTopology.h:99
AlCaHLTBitMon_QueryRunRegistry.string
string
Definition: AlCaHLTBitMon_QueryRunRegistry.py:256
CSCReadoutMapping::dduId
int dduId(const CSCDetId &) const
returns DDU# given CSCDetId
Definition: CSCReadoutMapping.cc:100
edm::ParameterSet
Definition: ParameterSet.h:47
CSCReadoutMapping::addRecord
void addRecord(int endcap, int station, int ring, int chamber, int vmecrate, int dmb, int tmb, int tsector, int cscid, int ddu, int dcc)
Definition: CSCReadoutMapping.cc:47
ParameterSet
Definition: Functions.h:16
CSCReadoutMapping::CSCLabel::vmecrate_
int vmecrate_
Definition: CSCReadoutMapping.h:67
CSCReadoutMapping::CSCLabel
Definition: CSCReadoutMapping.h:37
CSCReadoutMapping::CSCLabel::dmb_
int dmb_
Definition: CSCReadoutMapping.h:68
CSCReadoutMapping::hw2sw_
std::map< int, int > hw2sw_
Definition: CSCReadoutMapping.h:158
CSCReadoutMapping::CSCReadoutMapping
CSCReadoutMapping()
Default constructor.
Definition: CSCReadoutMapping.cc:5
CSCDetId
Definition: CSCDetId.h:26
CSCReadoutMapping::sw2hw_
std::map< int, CSCLabel > sw2hw_
Definition: CSCReadoutMapping.h:159
CSCReadoutMapping::CSCLabel::station_
int station_
Definition: CSCReadoutMapping.h:64
Serializable.h
CSCReadoutMapping::swId
int swId(int endcap, int station, int ring, int chamber) const
Definition: CSCReadoutMapping.cc:72
CSCReadoutMapping::CSCLabel::CSCLabel
CSCLabel(int endcap, int station, int ring, int chamber, int vmecrate, int dmb, int tmb, int tsector, int cscid, int ddu, int dcc)
Definition: CSCReadoutMapping.h:39
CSCReadoutMapping::myName_
std::string myName_
Definition: CSCReadoutMapping.h:155
CSCReadoutMapping::fill
virtual void fill(const edm::ParameterSet &)=0
CSCReadoutMapping::debugV_
bool debugV_
Definition: CSCReadoutMapping.h:156
CSCReadoutMapping::crate
int crate(const CSCDetId &) const
returns vmecrate given CSCDetId
Definition: CSCReadoutMapping.cc:92
CSCReadoutMapping::CSCLabel::ring_
int ring_
Definition: CSCReadoutMapping.h:65
CSCReadoutMapping::dmbId
int dmbId(const CSCDetId &) const
returns dmbId given CSCDetId
Definition: CSCReadoutMapping.cc:96
relativeConstraints.ring
ring
Definition: relativeConstraints.py:68
CSCReadoutMapping::CSCLabel::dcc_
int dcc_
Definition: CSCReadoutMapping.h:73
CSCReadoutMapping
Definition: CSCReadoutMapping.h:26
CSCReadoutMapping::CSCLabel::chamber_
int chamber_
Definition: CSCReadoutMapping.h:66
CSCReadoutMapping::CSCLabel::cscid_
int cscid_
Definition: CSCReadoutMapping.h:71
CSCReadoutMapping::CSCLabel::endcap_
int endcap_
Definition: CSCReadoutMapping.h:63
CSCReadoutMapping::CSCLabel::tsector_
int tsector_
Definition: CSCReadoutMapping.h:70
CSCReadoutMapping::CSCLabel::~CSCLabel
~CSCLabel()
Definition: CSCReadoutMapping.h:61
CSCReadoutMapping::detId
CSCDetId detId(int endcap, int station, int vmecrate, int dmb, int tmb, int cfeb, int layer=0) const
Definition: CSCReadoutMapping.cc:25
CSCReadoutMapping::myName
const std::string & myName(void) const
Definition: CSCReadoutMapping.h:137