CMS 3D CMS Logo

/data/doxygen/doxygen-1.7.3/gen/CMSSW_4_2_8/src/CondFormats/DTObjects/interface/DTStatusFlag.h

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