CMS 3D CMS Logo

/data/refman/pasoursint/CMSSW_5_2_9/src/CalibFormats/SiPixelObjects/interface/PixelChannel.h

Go to the documentation of this file.
00001 #ifndef PixelChannel_h
00002 #define PixelChannel_h
00003 
00009 #include <string>
00010 #include <iostream>
00011 #include "CalibFormats/SiPixelObjects/interface/PixelModuleName.h"
00012 #include "CalibFormats/SiPixelObjects/interface/PixelTBMChannel.h"
00013 
00014 // class holding module name and TBM channel ("A" or "B") associated with a channel
00015 
00016 namespace pos{
00021   class PixelChannel
00022   {
00023     public:
00024 
00025     PixelChannel(){;}
00026     PixelChannel(PixelModuleName module, std::string TBMChannel);
00027     PixelChannel(PixelModuleName module, PixelTBMChannel TBMChannel);
00028     PixelChannel(std::string name); // takes a name of the form produced by channelname()
00029 
00030     const PixelModuleName& module() const { return module_; }
00031     std::string modulename() const { return module_.modulename(); }
00032     const PixelTBMChannel& TBMChannel() const { return TBMChannel_; }
00033     std::string TBMChannelString() const { return TBMChannel_.string(); }
00034 
00035     std::string channelname() const;
00036 
00037     friend std::ostream& operator<<(std::ostream& s, const PixelChannel& channel);
00038 
00039     // allows for use of find() function in a map of PixelChannels
00040     const bool operator<(const PixelChannel& aChannel) const{
00041       return (module_<aChannel.module_ || (module_==aChannel.module_ && TBMChannel_ < aChannel.TBMChannel_) );
00042     }
00043     
00044     const bool operator==(const PixelChannel& aChannel) const{
00045       return (module_==aChannel.module_ && TBMChannel_==aChannel.TBMChannel_);
00046     }
00047 
00048     private:
00049     PixelModuleName module_    ;
00050     PixelTBMChannel TBMChannel_;
00051   };
00052 }
00053 
00054 #endif