CMS 3D CMS Logo

/afs/cern.ch/work/a/aaltunda/public/www/CMSSW_5_3_13_patch3/src/DataFormats/MuonDetId/interface/RPCCompDetId.h

Go to the documentation of this file.
00001 #ifndef MuonDetId_RPCCompDetId_h
00002 #define MuonDetId_RPCCompDetId_h
00003 // -*- C++ -*-
00004 //
00005 // Package:     MuonDetId
00006 // Class  :     RPCCompDetId
00007 // 
00013 //
00014 // Author:      Marcello Maggi
00015 // Created:     Wed Nov  2 12:09:10 CET 2011
00016 // $Id: RPCCompDetId.h,v 1.1 2011/11/05 10:39:53 mmaggi Exp $
00017 //
00018 #include <DataFormats/DetId/interface/DetId.h>
00019 #include <FWCore/Utilities/interface/Exception.h>
00020 #include <string>
00021 
00022 class RPCCompDetId :public DetId {
00023   
00024  public:
00025       
00026   RPCCompDetId();
00027 
00030   RPCCompDetId(uint32_t id);
00031   RPCCompDetId(DetId id);
00032 
00033 
00035   RPCCompDetId(int region, 
00036                int ring,
00037                int station, 
00038                int sector,
00039                int layer,
00040                int subsector,
00041                int type);
00042 
00044   RPCCompDetId(const std::string& dbname, int type);
00045 
00047   bool operator < (const RPCCompDetId& r) const;
00048 
00049   int region() const;
00050   int ring() const;
00051   int wheel() const;
00052   int station() const;
00053   int disk() const;
00054   int sector() const;
00055   int layer() const;
00056   int subsector() const;
00057   int type() const;
00058   std::string dbname() const; 
00059 
00060   static const int minRegionId=     -1;
00061   static const int maxRegionId=      1;
00062   static const int allRegionId=minRegionId-1;
00063  
00064   static const int minRingForwardId=   1;
00065   static const int maxRingForwardId=   3;
00066   static const int minRingBarrelId=   -2;
00067   static const int maxRingBarrelId=    2;
00068   static const int RingBarrelOffSet=   3;
00069   static const int allRingId=minRingBarrelId-1; 
00070  
00071   static const int minStationId=     1;
00072   static const int maxStationId=     4;
00073   static const int allStationId=minStationId-1; 
00074 
00075   static const int minSectorId=     1;
00076   static const int maxSectorId=     36;
00077   static const int minSectorBarrelId=     1;
00078   static const int maxSectorBarrelId=     12;
00079   static const int minSectorForwardId=     1;
00080   static const int maxSectorForwardId=    36;
00081   static const int allSectorId=minSectorId-1; 
00082 
00083   static const int minLayerId=     1;
00084   static const int maxLayerId=     2;
00085   static const int allLayerId=minLayerId-1; 
00086   
00087 
00088   static const int minSubSectorId= 1;
00089   static const int maxSubSectorId= 2;
00090   static const int allSubSectorId=minSubSectorId-1; 
00091 
00092  private:
00093   static const int RegionNumBits_  =  2;
00094   static const int RegionStartBit_ =  0;  
00095   static const int RegionMask_     =  0X3;
00096 
00097   static const int RingNumBits_  =  3;
00098   static const int RingStartBit_ =  RegionStartBit_+RegionNumBits_;  
00099   static const unsigned int RingMask_     =  0X7;
00100 
00101   static const int StationNumBits_  =  3;
00102   static const int StationStartBit_ =  RingStartBit_+RingNumBits_;  
00103   static const unsigned int StationMask_     =  0X7;
00104 
00105   static const int SectorNumBits_  =  6;
00106   static const int SectorStartBit_ =  StationStartBit_+StationNumBits_;  
00107   static const unsigned int SectorMask_     =  0X3F;
00108 
00109   static const int LayerNumBits_  =  2;
00110   static const int LayerStartBit_ =  SectorStartBit_+SectorNumBits_;  
00111   static const unsigned int LayerMask_     =  0X3;
00112 
00113   static const int SubSectorNumBits_  =  2;
00114   static const int SubSectorStartBit_ =  LayerStartBit_+LayerNumBits_;  
00115   static const unsigned int SubSectorMask_     =  0X3;
00116 
00117 
00118  private:
00119   void init(int region, 
00120             int ring,
00121             int station, 
00122             int sector,
00123             int layer,
00124             int subsector);
00125 
00126   void init();
00127   void initGas();
00128   std::string gasDBname() const;
00129  private:
00130   std::string _dbname;
00131   int _type;
00132 
00133 }; // RPCCompDetId
00134 
00135 std::ostream& operator<<( std::ostream& os, const RPCCompDetId& id );
00136 
00137 #endif