CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
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:
25 
28 
30  virtual ~CSCTriggerMapping();
31 
43  typedef struct CSCTriggerConnection{
45  CSCTriggerConnection( int rendcap, int rstation, int rsector, int rsubsector, int rcscid,
46  int cendcap, int cstation, int csector, int csubsector, int ccscid )
47  : rendcap_( rendcap ), rstation_( rstation ), rsector_( rsector ), rsubsector_( rsubsector ),
48  rcscid_( rcscid ), cendcap_( cendcap ), cstation_( cstation ), csector_( csector ),
49  csubsector_( csubsector ), ccscid_( ccscid ) {}
51 
52  int rendcap_;
53  int rstation_;
54  int rsector_;
56  int rcscid_;
57  int cendcap_;
58  int cstation_;
59  int csector_;
61  int ccscid_;
62 
64 } Connection;
65 
71  // layer at end so it can have default arg
72  CSCDetId detId( int endcap, int station, int sector, int subsector, int cscid, int layer = 0 ) const;
73 
78  int chamber( int endcap, int station, int sector, int subsector, int cscid ) const;
79 
83  virtual void fill( void ) = 0;
84 
88  void addRecord( int rendcap, int rstation, int rsector, int rsubsector, int rcscid,
89  int cendcap, int cstation, int csector, int csubsector, int ccscid );
90 
94  void setDebugV( bool dbg ) { debugV_ = dbg; }
95 
99  bool debugV( void ) const { return debugV_; }
100 
104  const std::string& myName( void ) const { return myName_; }
105 
106  private:
107 
112  virtual int hwId( int endcap, int station, int sector, int subsector, int cscid ) const = 0;
113 
119  int swId( int endcap, int station, int sector, int subsector, int cscid) const;
120 
123  std::vector< Connection > mapping_;
124  std::map< int, int > hw2sw_ COND_TRANSIENT;
125 
127 };
128 
129 #endif
std::map< int, int > hw2sw_
int chamber(int endcap, int station, int sector, int subsector, int cscid) const
struct CSCTriggerMapping::CSCTriggerConnection Connection
void setDebugV(bool dbg)
bool debugV(void) const
CSCTriggerMapping()
Default constructor.
void addRecord(int rendcap, int rstation, int rsector, int rsubsector, int rcscid, int cendcap, int cstation, int csector, int csubsector, int ccscid)
std::vector< Connection > mapping_
virtual ~CSCTriggerMapping()
Destructor.
CSCTriggerConnection(int rendcap, int rstation, int rsector, int rsubsector, int rcscid, int cendcap, int cstation, int csector, int csubsector, int ccscid)
#define COND_TRANSIENT
Definition: Serializable.h:60
int swId(int endcap, int station, int sector, int subsector, int cscid) const
#define COND_SERIALIZABLE
Definition: Serializable.h:37
CSCDetId detId(int endcap, int station, int sector, int subsector, int cscid, int layer=0) const
const std::string & myName(void) const
virtual void fill(void)=0
virtual int hwId(int endcap, int station, int sector, int subsector, int cscid) const =0