CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros 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 #include <vector>
18 #include <map>
19 
20 namespace edm {
21  class ParameterSet;
22 }
23 
25  public:
26 
29 
31  virtual ~CSCReadoutMapping();
32 
36  struct CSCLabel{
38  CSCLabel( int endcap, int station, int ring, int chamber,
39  int vmecrate, int dmb, int tmb, int tsector, int cscid, int ddu, int dcc )
40  : endcap_( endcap ), station_( station ), ring_( ring ), chamber_( chamber ),
41  vmecrate_( vmecrate ), dmb_( dmb ), tmb_( tmb ),
42  tsector_( tsector ), cscid_( cscid ), ddu_(ddu), dcc_(dcc) {}
44 
45  int endcap_;
46  int station_;
47  int ring_;
48  int chamber_;
49  int vmecrate_;
50  int dmb_;
51  int tmb_;
52  int tsector_;
53  int cscid_;
54  int ddu_;
55  int dcc_;
56  };
57 
64  // layer at end so it can have default arg
65  CSCDetId detId( int endcap, int station, int vmecrate, int dmb, int tmb, int cfeb, int layer = 0 ) const;
66 
71  int chamber( int endcap, int station, int vmecrate, int dmb, int tmb ) const;
72 
76  virtual void fill( const edm::ParameterSet& ) = 0;
77 
79  CSCLabel findHardwareId(const CSCDetId&) const;
81  int crate(const CSCDetId&) const;
83  int dmbId(const CSCDetId&) const;
85  int dccId(const CSCDetId&) const;
87  int dduId(const CSCDetId&) const;
88 
89 
93  void addRecord( int endcap, int station, int ring, int chamber,
94  int vmecrate, int dmb, int tmb, int tsector, int cscid, int ddu, int dcc );
95 
99  void setDebugV( bool dbg ) { debugV_ = dbg; }
100 
104  bool debugV( void ) const { return debugV_; }
105 
109  const std::string& myName( void ) const { return myName_; }
110 
111  private:
112 
119  virtual int hwId( int endcap, int station, int vme, int dmb, int tmb ) const = 0;
120 
126  int swId( int endcap, int station, int ring, int chamber) const;
127 
129  bool debugV_;
130  std::vector< CSCLabel > mapping_;
131  std::map< int, int > hw2sw_;
132  std::map< int, CSCLabel > sw2hw_;
133 
134 };
135 
136 #endif
std::vector< CSCLabel > mapping_
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
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
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)
std::map< int, int > hw2sw_
int dccId(const CSCDetId &) const
returns DCC# given CSCDetId
CSCReadoutMapping()
Default constructor.
virtual void fill(const edm::ParameterSet &)=0
int dduId(const CSCDetId &) const
returns DDU# given CSCDetId
std::map< int, CSCLabel > sw2hw_
virtual ~CSCReadoutMapping()
Destructor.