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 
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),
48  ring_(ring),
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
CSCReadoutMapping::CSCLabel::tmb_
int tmb_
Definition: CSCReadoutMapping.h:65
CSCReadoutMapping::~CSCReadoutMapping
virtual ~CSCReadoutMapping()
Destructor.
Definition: CSCReadoutMapping.cc:7
relativeConstraints.station
station
Definition: relativeConstraints.py:67
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:118
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:68
CSCReadoutMapping::dccId
int dccId(const CSCDetId &) const
returns DCC# given CSCDetId
Definition: CSCReadoutMapping.cc:104
CSCReadoutMapping::debugV
bool debugV(void) const
Definition: CSCReadoutMapping.h:123
CSCReadoutMapping::mapping_
std::vector< CSCLabel > mapping_
Definition: CSCReadoutMapping.h:148
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:34
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
CSCReadoutMapping::dduId
int dduId(const CSCDetId &) const
returns DDU# given CSCDetId
Definition: CSCReadoutMapping.cc:100
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
CSCReadoutMapping::CSCLabel::vmecrate_
int vmecrate_
Definition: CSCReadoutMapping.h:63
CSCReadoutMapping::CSCLabel
Definition: CSCReadoutMapping.h:33
CSCReadoutMapping::CSCLabel::dmb_
int dmb_
Definition: CSCReadoutMapping.h:64
CSCReadoutMapping::hw2sw_
std::map< int, int > hw2sw_
Definition: CSCReadoutMapping.h:149
CSCReadoutMapping::CSCReadoutMapping
CSCReadoutMapping()
Default constructor.
Definition: CSCReadoutMapping.cc:5
CSCDetId
Definition: CSCDetId.h:26
CSCReadoutMapping::sw2hw_
std::map< int, CSCLabel > sw2hw_
Definition: CSCReadoutMapping.h:150
CSCReadoutMapping::CSCLabel::station_
int station_
Definition: CSCReadoutMapping.h:60
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:35
CSCReadoutMapping::myName_
std::string myName_
Definition: CSCReadoutMapping.h:146
CSCReadoutMapping::debugV_
bool debugV_
Definition: CSCReadoutMapping.h:147
AlCaHLTBitMon_QueryRunRegistry.string
string string
Definition: AlCaHLTBitMon_QueryRunRegistry.py:256
CSCReadoutMapping::crate
int crate(const CSCDetId &) const
returns vmecrate given CSCDetId
Definition: CSCReadoutMapping.cc:92
CSCReadoutMapping::CSCLabel::ring_
int ring_
Definition: CSCReadoutMapping.h:61
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:69
CSCReadoutMapping
Definition: CSCReadoutMapping.h:22
CSCReadoutMapping::CSCLabel::chamber_
int chamber_
Definition: CSCReadoutMapping.h:62
CSCReadoutMapping::CSCLabel::cscid_
int cscid_
Definition: CSCReadoutMapping.h:67
CSCReadoutMapping::CSCLabel::endcap_
int endcap_
Definition: CSCReadoutMapping.h:59
CSCReadoutMapping::CSCLabel::tsector_
int tsector_
Definition: CSCReadoutMapping.h:66
CSCReadoutMapping::CSCLabel::~CSCLabel
~CSCLabel()
Definition: CSCReadoutMapping.h:57
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:128