PixelChannel

Macros

Line Code
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52
#ifndef PixelChannel_h
#define PixelChannel_h
/*! \file CalibFormats/SiPixelObjects/interface/PixelChannel.h
*   \brief This class implements...
*
*   A longer explanation will be placed here later
*/

#include <string>
#include <iostream>
#include "CalibFormats/SiPixelObjects/interface/PixelModuleName.h"
#include "CalibFormats/SiPixelObjects/interface/PixelTBMChannel.h"

// class holding module name and TBM channel ("A" or "B") associated with a channel

namespace pos {
  /*! \class PixelChannel PixelChannel.h "interface/PixelChannel.h"
*
*   A longer explanation will be placed here later
*/
  class PixelChannel {
  public:
    PixelChannel() { ; }
    PixelChannel(PixelModuleName module, std::string TBMChannel);
    PixelChannel(PixelModuleName module, PixelTBMChannel TBMChannel);
    PixelChannel(std::string name);  // takes a name of the form produced by channelname()

    const PixelModuleName& module() const { return module_; }
    std::string modulename() const { return module_.modulename(); }
    const PixelTBMChannel& TBMChannel() const { return TBMChannel_; }
    std::string TBMChannelString() const { return TBMChannel_.string(); }

    std::string channelname() const;

    // allows for use of find() function in a map of PixelChannels
    const bool operator<(const PixelChannel& aChannel) const {
      return (module_ < aChannel.module_ || (module_ == aChannel.module_ && TBMChannel_ < aChannel.TBMChannel_));
    }

    const bool operator==(const PixelChannel& aChannel) const {
      return (module_ == aChannel.module_ && TBMChannel_ == aChannel.TBMChannel_);
    }

  private:
    PixelModuleName module_;
    PixelTBMChannel TBMChannel_;
  };

  std::ostream& operator<<(std::ostream& s, const PixelChannel& channel);
}  // namespace pos

#endif