CMS 3D CMS Logo

/data/refman/pasoursint/CMSSW_5_3_1/src/DataFormats/MuonDetId/interface/DTTracoId.h

Go to the documentation of this file.
00001 //-------------------------------------------------
00002 //
00008 //
00009 //--------------------------------------------------
00010 #ifndef DT_TRACO_ID_H_
00011 #define DT_TRACO_ID_H_
00012 
00013 //------------------------------------
00014 // Collaborating Class Declarations --
00015 //------------------------------------
00016 
00017 //----------------------
00018 // Base Class Headers --
00019 //----------------------
00020 #include "DataFormats/MuonDetId/interface/DTChamberId.h"
00021 
00022 //---------------
00023 // C++ Headers --
00024 //---------------
00025 
00026 //---------------------------------------------------
00027 //                      DTTracoChip
00028 //---------------------------------------------------
00029 
00030 
00031 //              ---------------------
00032 //              -- Class Interface --
00033 //              ---------------------
00034 
00035 class DTTracoId {
00036 
00037  public:
00038 
00040   DTTracoId() : _traco(0) {}
00041 
00043   DTTracoId(const DTChamberId& mu_stat_id, 
00044                     const int traco_id) : _statId(mu_stat_id),
00045                                              _traco(traco_id) {}
00046 
00048   DTTracoId(const int wheel_id, 
00049                 const int station_id, 
00050                 const int sector_id, 
00051                 const int traco_id) :
00052                   _statId(wheel_id,station_id,sector_id),
00053                   _traco(traco_id) {}
00054  
00056   DTTracoId(const DTTracoId& tracoId) :
00057                   _statId(tracoId._statId), 
00058                   _traco(tracoId._traco) {}
00059  
00061   virtual ~DTTracoId() {}
00062 
00064   inline int wheel()   const { return _statId.wheel(); }
00066   inline int station() const { return _statId.station(); }
00068   inline int sector()  const { return _statId.sector(); }
00070   inline int traco()   const { return _traco; }
00072   inline DTChamberId ChamberId() const { return _statId; }
00073 
00074   bool operator == ( const DTTracoId& id) const { 
00075     if ( wheel()!=id.wheel()) return false;
00076     if ( sector()!=id.sector())return false;
00077     if ( station()!=id.station())return false;
00078     if ( _traco!=id.traco())return false;
00079     return true;
00080   }
00081 
00082   bool operator <  ( const DTTracoId& id) const { 
00083     if ( wheel()       < id.wheel()      ) return true;
00084     if ( wheel()       > id.wheel()      ) return false;
00085   
00086     if ( station()     < id.station()    ) return true;
00087     if ( station()     > id.station()    ) return false;
00088     
00089     if ( sector()      < id.sector()     ) return true;
00090     if ( sector()      > id.sector()     ) return false;
00091 
00092     if ( traco()         < id.traco()    ) return true;
00093     if ( traco()         > id.traco()    ) return false;
00094 
00095     return false;
00096   
00097   }
00098 
00099 
00100  private:
00101   DTChamberId _statId; // this is 3 bytes
00102   int _traco;
00103 
00104 };
00105 
00106 #endif