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 #include <vector>
19 #include <map>
20 
22  public:
23 
26 
28  virtual ~CSCTriggerMapping();
29 
41  typedef struct CSCTriggerConnection{
43  CSCTriggerConnection( int rendcap, int rstation, int rsector, int rsubsector, int rcscid,
44  int cendcap, int cstation, int csector, int csubsector, int ccscid )
45  : rendcap_( rendcap ), rstation_( rstation ), rsector_( rsector ), rsubsector_( rsubsector ),
46  rcscid_( rcscid ), cendcap_( cendcap ), cstation_( cstation ), csector_( csector ),
47  csubsector_( csubsector ), ccscid_( ccscid ) {}
49 
50  int rendcap_;
51  int rstation_;
52  int rsector_;
54  int rcscid_;
55  int cendcap_;
56  int cstation_;
57  int csector_;
59  int ccscid_;
60  } Connection;
61 
67  // layer at end so it can have default arg
68  CSCDetId detId( int endcap, int station, int sector, int subsector, int cscid, int layer = 0 ) const;
69 
74  int chamber( int endcap, int station, int sector, int subsector, int cscid ) const;
75 
79  virtual void fill( void ) = 0;
80 
84  void addRecord( int rendcap, int rstation, int rsector, int rsubsector, int rcscid,
85  int cendcap, int cstation, int csector, int csubsector, int ccscid );
86 
90  void setDebugV( bool dbg ) { debugV_ = dbg; }
91 
95  bool debugV( void ) const { return debugV_; }
96 
100  const std::string& myName( void ) const { return myName_; }
101 
102  private:
103 
108  virtual int hwId( int endcap, int station, int sector, int subsector, int cscid ) const = 0;
109 
115  int swId( int endcap, int station, int sector, int subsector, int cscid) const;
116 
118  bool debugV_;
119  std::vector< Connection > mapping_;
120  std::map< int, int > hw2sw_;
121 };
122 
123 #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)
int swId(int endcap, int station, int sector, int subsector, int cscid) const
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