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 
19 #include <vector>
20 #include <map>
21 
22 namespace edm {
23  class ParameterSet;
24 }
25 
27  public:
28 
31 
33  virtual ~CSCReadoutMapping();
34 
38  struct CSCLabel{
40  CSCLabel( int endcap, int station, int ring, int chamber,
41  int vmecrate, int dmb, int tmb, int tsector, int cscid, int ddu, int dcc )
42  : endcap_( endcap ), station_( station ), ring_( ring ), chamber_( chamber ),
43  vmecrate_( vmecrate ), dmb_( dmb ), tmb_( tmb ),
44  tsector_( tsector ), cscid_( cscid ), ddu_(ddu), dcc_(dcc) {}
46 
47  int endcap_;
48  int station_;
49  int ring_;
50  int chamber_;
51  int vmecrate_;
52  int dmb_;
53  int tmb_;
54  int tsector_;
55  int cscid_;
56  int ddu_;
57  int dcc_;
58 
60 };
61 
68  // layer at end so it can have default arg
69  CSCDetId detId( int endcap, int station, int vmecrate, int dmb, int tmb, int cfeb, int layer = 0 ) const;
70 
75  int chamber( int endcap, int station, int vmecrate, int dmb, int tmb ) const;
76 
80  virtual void fill( const edm::ParameterSet& ) = 0;
81 
83  CSCLabel findHardwareId(const CSCDetId&) const;
85  int crate(const CSCDetId&) const;
87  int dmbId(const CSCDetId&) const;
89  int dccId(const CSCDetId&) const;
91  int dduId(const CSCDetId&) const;
92 
93 
97  void addRecord( int endcap, int station, int ring, int chamber,
98  int vmecrate, int dmb, int tmb, int tsector, int cscid, int ddu, int dcc );
99 
103  void setDebugV( bool dbg ) { debugV_ = dbg; }
104 
108  bool debugV( void ) const { return debugV_; }
109 
113  const std::string& myName( void ) const { return myName_; }
114 
115  private:
116 
123  virtual int hwId( int endcap, int station, int vme, int dmb, int tmb ) const = 0;
124 
130  int swId( int endcap, int station, int ring, int chamber) const;
131 
134  std::vector< CSCLabel > mapping_;
135  std::map< int, int > hw2sw_ COND_TRANSIENT;
136  std::map< int, CSCLabel > sw2hw_;
137 
138 
140 };
141 
142 #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
#define COND_TRANSIENT
Definition: Serializable.h:53
CSCReadoutMapping()
Default constructor.
#define COND_SERIALIZABLE
Definition: Serializable.h:30
virtual void fill(const edm::ParameterSet &)=0
int dduId(const CSCDetId &) const
returns DDU# given CSCDetId
std::map< int, CSCLabel > sw2hw_
virtual ~CSCReadoutMapping()
Destructor.