CMS 3D CMS Logo

/data/refman/pasoursint/CMSSW_5_3_3/src/CondFormats/CSCObjects/interface/CSCTriggerMapping.h

Go to the documentation of this file.
00001 #ifndef CondFormats_CSCTriggerMapping_h
00002 #define CondFormats_CSCTriggerMapping_h
00003 
00015 //@@ FIXME This whole design would better suit a Factory/Builder pattern
00016 
00017 #include <DataFormats/MuonDetId/interface/CSCDetId.h>
00018 #include <vector>
00019 #include <map>
00020 
00021 class CSCTriggerMapping {
00022  public:
00023 
00025   CSCTriggerMapping();
00026 
00028   virtual ~CSCTriggerMapping();
00029 
00041   typedef struct CSCTriggerConnection{
00042     CSCTriggerConnection(){}
00043     CSCTriggerConnection( int rendcap, int rstation, int rsector, int rsubsector, int rcscid,  
00044                           int cendcap, int cstation, int csector, int csubsector, int ccscid )
00045       : rendcap_( rendcap ), rstation_( rstation ), rsector_( rsector ), rsubsector_( rsubsector ),
00046          rcscid_( rcscid ), cendcap_( cendcap ), cstation_( cstation ), csector_( csector ),
00047          csubsector_( csubsector ), ccscid_( ccscid ) {}
00048     ~CSCTriggerConnection(){}
00049 
00050     int rendcap_;
00051     int rstation_;
00052     int rsector_;
00053     int rsubsector_;
00054     int rcscid_;
00055     int cendcap_;
00056     int cstation_;
00057     int csector_;
00058     int csubsector_;
00059     int ccscid_;
00060   } Connection;
00061 
00067     // layer at end so it can have default arg
00068     CSCDetId detId( int endcap, int station, int sector, int subsector, int cscid, int layer = 0 ) const;
00069 
00074     int chamber( int endcap, int station, int sector, int subsector, int cscid ) const;
00075 
00079     virtual void fill( void ) = 0;
00080 
00084     void addRecord( int rendcap, int rstation, int rsector, int rsubsector, int rcscid, 
00085                     int cendcap, int cstation, int csector, int csubsector, int ccscid ); 
00086 
00090     void setDebugV( bool dbg ) { debugV_ = dbg; }
00091 
00095     bool debugV( void ) const { return debugV_; }
00096 
00100     const std::string& myName( void ) const { return myName_; }
00101 
00102  private: 
00103 
00108     virtual int hwId( int endcap, int station, int sector, int subsector, int cscid ) const = 0;
00109 
00115     int swId( int endcap, int station, int sector, int subsector, int cscid) const;
00116 
00117     std::string myName_;
00118     bool debugV_;
00119     std::vector< Connection > mapping_;
00120     std::map< int, int > hw2sw_;
00121 };
00122 
00123 #endif