Back to home page

Project CMSSW displayed by LXR

 
 

    


File indexing completed on 2021-02-14 12:47:21

0001 #ifndef PixelChannel_h
0002 #define PixelChannel_h
0003 /*! \file CalibFormats/SiPixelObjects/interface/PixelChannel.h
0004 *   \brief This class implements...
0005 *
0006 *   A longer explanation will be placed here later
0007 */
0008 
0009 #include <string>
0010 #include <iostream>
0011 #include "CalibFormats/SiPixelObjects/interface/PixelModuleName.h"
0012 #include "CalibFormats/SiPixelObjects/interface/PixelTBMChannel.h"
0013 
0014 // class holding module name and TBM channel ("A" or "B") associated with a channel
0015 
0016 namespace pos {
0017   /*! \class PixelChannel PixelChannel.h "interface/PixelChannel.h"
0018 *
0019 *   A longer explanation will be placed here later
0020 */
0021   class PixelChannel {
0022   public:
0023     PixelChannel() { ; }
0024     PixelChannel(PixelModuleName module, std::string TBMChannel);
0025     PixelChannel(PixelModuleName module, PixelTBMChannel TBMChannel);
0026     PixelChannel(std::string name);  // takes a name of the form produced by channelname()
0027 
0028     const PixelModuleName& module() const { return module_; }
0029     std::string modulename() const { return module_.modulename(); }
0030     const PixelTBMChannel& TBMChannel() const { return TBMChannel_; }
0031     std::string TBMChannelString() const { return TBMChannel_.string(); }
0032 
0033     std::string channelname() const;
0034 
0035     // allows for use of find() function in a map of PixelChannels
0036     const bool operator<(const PixelChannel& aChannel) const {
0037       return (module_ < aChannel.module_ || (module_ == aChannel.module_ && TBMChannel_ < aChannel.TBMChannel_));
0038     }
0039 
0040     const bool operator==(const PixelChannel& aChannel) const {
0041       return (module_ == aChannel.module_ && TBMChannel_ == aChannel.TBMChannel_);
0042     }
0043 
0044   private:
0045     PixelModuleName module_;
0046     PixelTBMChannel TBMChannel_;
0047   };
0048 
0049   std::ostream& operator<<(std::ostream& s, const PixelChannel& channel);
0050 }  // namespace pos
0051 
0052 #endif