CMS 3D CMS Logo

/data/refman/pasoursint/CMSSW_5_3_10_patch1/src/CondFormats/DTObjects/interface/DTDeadFlag.h

Go to the documentation of this file.
00001 #ifndef DTDeadFlag_H
00002 #define DTDeadFlag_H
00003 
00014 //----------------------
00015 // Base Class Headers --
00016 //----------------------
00017 
00018 
00019 //------------------------------------
00020 // Collaborating Class Declarations --
00021 //------------------------------------
00022 #include "CondFormats/DTObjects/interface/DTBufferTree.h"
00023 #include "DataFormats/MuonDetId/interface/DTWireId.h"
00024 
00025 //---------------
00026 // C++ Headers --
00027 //---------------
00028 #include <string>
00029 #include <vector>
00030 
00031 //              ---------------------
00032 //              -- Class Interface --
00033 //              ---------------------
00034 
00035 class DTDeadFlagId {
00036 
00037  public:
00038 
00039   DTDeadFlagId();
00040   ~DTDeadFlagId();
00041 
00042   int   wheelId;
00043   int stationId;
00044   int  sectorId;
00045   int      slId;
00046   int   layerId;
00047   int    cellId;
00048 
00049 };
00050 
00051 
00052 class DTDeadFlagData {
00053 
00054  public:
00055 
00056   DTDeadFlagData();
00057   ~DTDeadFlagData();
00058 
00059   bool dead_HV;
00060   bool dead_TP;
00061   bool dead_RO;
00062   bool discCat;
00063 
00064 };
00065 
00066 
00067 class DTDeadFlag {
00068 
00069  public:
00070 
00073   DTDeadFlag();
00074   DTDeadFlag( const std::string& version );
00075 
00078   ~DTDeadFlag();
00079 
00082 
00083   int cellStatus( int   wheelId,
00084                   int stationId,
00085                   int  sectorId,
00086                   int      slId,
00087                   int   layerId,
00088                   int    cellId,
00089                   bool& dead_HV,
00090                   bool& dead_TP,
00091                   bool& dead_RO,
00092                   bool& discCat ) const
00093       { return get( wheelId, stationId, sectorId, slId, layerId, cellId, 
00094                     dead_HV, dead_TP, dead_RO, discCat ); };
00095   int cellStatus( const DTWireId& id,
00096                   bool& dead_HV,
00097                   bool& dead_TP,
00098                   bool& dead_RO,
00099                   bool& discCat ) const
00100       { return get( id, dead_HV, dead_TP, dead_RO, discCat ); };
00101   int get( int   wheelId,
00102            int stationId,
00103            int  sectorId,
00104            int      slId,
00105            int   layerId,
00106            int    cellId,
00107            bool& dead_HV,
00108            bool& dead_TP,
00109            bool& dead_RO,
00110            bool& discCat ) const;
00111   int get( const DTWireId& id,
00112            bool& dead_HV,
00113            bool& dead_TP,
00114            bool& dead_RO,
00115            bool& discCat ) const;
00116 
00117   bool getCellDead_HV( int   wheelId,
00118                        int stationId,
00119                        int  sectorId,
00120                        int      slId,
00121                        int   layerId,
00122                        int    cellId ) const;
00123   bool getCellDead_HV( const DTWireId& id ) const;
00124 
00125   bool getCellDead_TP( int   wheelId,
00126                        int stationId,
00127                        int  sectorId,
00128                        int      slId,
00129                        int   layerId,
00130                        int    cellId ) const;
00131   bool getCellDead_TP( const DTWireId& id ) const;
00132 
00133   bool getCellDead_RO( int   wheelId,
00134                        int stationId,
00135                        int  sectorId,
00136                        int      slId,
00137                        int   layerId,
00138                        int    cellId ) const;
00139   bool getCellDead_RO( const DTWireId& id ) const;
00140 
00141   bool getCellDiscCat( int   wheelId,
00142                        int stationId,
00143                        int  sectorId,
00144                        int      slId,
00145                        int   layerId,
00146                        int    cellId ) const;
00147   bool getCellDiscCat( const DTWireId& id ) const;
00148 
00150   const
00151   std::string& version() const;
00152   std::string& version();
00153 
00155   void clear();
00156 
00157   int setCellStatus( int   wheelId,
00158                      int stationId,
00159                      int  sectorId,
00160                      int      slId,
00161                      int   layerId,
00162                      int    cellId,
00163                      bool dead_HV,
00164                      bool dead_TP,
00165                      bool dead_RO,
00166                      bool discCat )
00167       { return set( wheelId, stationId, sectorId, slId, layerId, cellId, 
00168                     dead_HV, dead_TP, dead_RO, discCat ); };
00169   int setCellStatus( const DTWireId& id,
00170                      bool dead_HV,
00171                      bool dead_TP,
00172                      bool dead_RO,
00173                      bool discCat )
00174       { return set( id, dead_HV, dead_TP, dead_RO, discCat ); };
00175 
00176   int set( int   wheelId,
00177            int stationId,
00178            int  sectorId,
00179            int      slId,
00180            int   layerId,
00181            int    cellId,
00182            bool dead_HV,
00183            bool dead_TP,
00184            bool dead_RO,
00185            bool discCat ) ;
00186   int set( const DTWireId& id,
00187            bool dead_HV,
00188            bool dead_TP,
00189            bool dead_RO,
00190            bool discCat );
00191 
00192   int setCellDead_HV( int   wheelId,
00193                       int stationId,
00194                       int  sectorId,
00195                       int      slId,
00196                       int   layerId,
00197                       int    cellId,
00198                       bool flag );
00199   int setCellDead_HV( const DTWireId& id,
00200                       bool flag );
00201 
00202   int setCellDead_TP( int   wheelId,
00203                       int stationId,
00204                       int  sectorId,
00205                       int      slId,
00206                       int   layerId,
00207                       int    cellId,
00208                       bool flag );
00209   int setCellDead_TP( const DTWireId& id,
00210                       bool flag );
00211 
00212   int setCellDead_RO( int   wheelId,
00213                       int stationId,
00214                       int  sectorId,
00215                       int      slId,
00216                       int   layerId,
00217                       int    cellId,
00218                       bool flag );
00219   int setCellDead_RO( const DTWireId& id,
00220                       bool flag );
00221 
00222   int setCellDiscCat( int   wheelId,
00223                       int stationId,
00224                       int  sectorId,
00225                       int      slId,
00226                       int   layerId,
00227                       int    cellId,
00228                       bool flag );
00229   int setCellDiscCat( const DTWireId& id,
00230                       bool flag );
00231 
00233   typedef std::vector< std::pair<DTDeadFlagId,
00234                                  DTDeadFlagData> >::const_iterator
00235                                                     const_iterator;
00236   const_iterator begin() const;
00237   const_iterator end() const;
00238 
00239  private:
00240 
00241   std::string dataVersion;
00242 
00243   std::vector< std::pair<DTDeadFlagId,DTDeadFlagData> > dataList;
00244 
00245   DTBufferTree<int,int>* dBuf;
00246 
00248   void cacheMap() const;
00249   std::string mapName() const;
00250 
00251 };
00252 
00253 
00254 #endif // DTDeadFlag_H
00255