CMS 3D CMS Logo

CSCTriggerMapping.h
Go to the documentation of this file.
1 #ifndef CondFormats_CSCTriggerMapping_h
2 #define CondFormats_CSCTriggerMapping_h
3 
15 //@@ FIXME This whole design would better suit a Factory/Builder pattern
16 
18 
20 #include <vector>
21 #include <map>
22 
24 public:
27 
29  virtual ~CSCTriggerMapping();
30 
42  typedef struct CSCTriggerConnection {
44  CSCTriggerConnection(int rendcap,
45  int rstation,
46  int rsector,
47  int rsubsector,
48  int rcscid,
49  int cendcap,
50  int cstation,
51  int csector,
52  int csubsector,
53  int ccscid)
54  : rendcap_(rendcap),
55  rstation_(rstation),
56  rsector_(rsector),
57  rsubsector_(rsubsector),
58  rcscid_(rcscid),
59  cendcap_(cendcap),
60  cstation_(cstation),
61  csector_(csector),
62  csubsector_(csubsector),
63  ccscid_(ccscid) {}
65 
66  int rendcap_;
67  int rstation_;
68  int rsector_;
70  int rcscid_;
71  int cendcap_;
72  int cstation_;
73  int csector_;
75  int ccscid_;
76 
78  } Connection;
79 
85  // layer at end so it can have default arg
86  CSCDetId detId(int endcap, int station, int sector, int subsector, int cscid, int layer = 0) const;
87 
92  int chamber(int endcap, int station, int sector, int subsector, int cscid) const;
93 
97  virtual void fill(void) = 0;
98 
102  void addRecord(int rendcap,
103  int rstation,
104  int rsector,
105  int rsubsector,
106  int rcscid,
107  int cendcap,
108  int cstation,
109  int csector,
110  int csubsector,
111  int ccscid);
112 
116  void setDebugV(bool dbg) { debugV_ = dbg; }
117 
121  bool debugV(void) const { return debugV_; }
122 
126  const std::string& myName(void) const { return myName_; }
127 
128 private:
133  virtual int hwId(int endcap, int station, int sector, int subsector, int cscid) const = 0;
134 
140  int swId(int endcap, int station, int sector, int subsector, int cscid) const;
141 
144  std::vector<Connection> mapping_;
145  std::map<int, int> hw2sw_ COND_TRANSIENT;
146 
148 };
149 
150 #endif
struct CSCTriggerMapping::CSCTriggerConnection Connection
void setDebugV(bool dbg)
const std::string & myName(void) const
CSCTriggerMapping()
Default constructor.
int swId(int endcap, int station, int sector, int subsector, int cscid) const
void addRecord(int rendcap, int rstation, int rsector, int rsubsector, int rcscid, int cendcap, int cstation, int csector, int csubsector, int ccscid)
constexpr std::array< uint8_t, layerIndexSize > layer
std::map< int, int > hw2sw_
virtual ~CSCTriggerMapping()
Destructor.
CSCTriggerConnection(int rendcap, int rstation, int rsector, int rsubsector, int rcscid, int cendcap, int cstation, int csector, int csubsector, int ccscid)
int chamber(int endcap, int station, int sector, int subsector, int cscid) const
bool debugV(void) const
#define COND_TRANSIENT
Definition: Serializable.h:63
#define COND_SERIALIZABLE
Definition: Serializable.h:39
CSCDetId detId(int endcap, int station, int sector, int subsector, int cscid, int layer=0) const
virtual void fill(void)=0
std::vector< Connection > mapping_
virtual int hwId(int endcap, int station, int sector, int subsector, int cscid) const =0