#ifndef TCTHChannelId_hxx_seen #define TCTHChannelId_hxx_seen #include "IChannelId.hxx" namespace COMET { class ICTHChannelId; } ///Channel ID class for Channels using the CTH ///electronics hierachy. Can answer detailed questions about its ///elements. This should be used for constructing TCTHChannelIds from ///the information available. class COMET::ICTHChannelId : public COMET::IChannelId { public: ///Construct a CTH channel ID from a raw UInt_t explicit ICTHChannelId(UInt_t id =0); ///Constructor to specialise a Channel ID as a CTH channel ID explicit ICTHChannelId(const COMET::IChannelId& src); ///Construct a CTH channel ID from its electronics-space ///co-ordinates. The sub-detector ID should be ///COMET::IChannelId::kCTH(=2), but is explicitly required. ICTHChannelId(UInt_t subDet, UInt_t Channel); ICTHChannelId(UInt_t subDet, UInt_t mod, UInt_t segId, UInt_t scint, UInt_t lightG); virtual ~ICTHChannelId(); ///Format as a human readable string virtual std::string AsString() const; ///Get the module virtual const UInt_t GetModule() const; ///Get the segment index virtual const UInt_t GetSegmentId() const; ///Get the scintillator flag virtual const UInt_t GetScint() const; ///Get the light guid flag virtual const UInt_t GetLightGuide() const; /// Get the channel. virtual const UInt_t GetChannel() const; protected: /// @{ Define the sub-detector specific part of the channel id. The /// sub-detector specific part of the channel id is a 25 bit field with /// bits number from 0 (lsb) to 24 (msb). The sub-fields are defined /// /// cccccccccccccccccccccccc /// /// - c(25) Bits 0-24: A twentyfive bit field indicating which channel. /// /// Note: The shift and the least significant bit (lsb) must be the same. enum BitDefinitions { kChanMSB=24, kChanLSB=0, kModMSB=24, kModLSB=24, kCountMSB=23, kCountLSB=17, kScintMSB=16, kScintLSB=16, kLGMSB=15, kLGLSB=15 }; /// @} private: /// Set the channel. virtual void SetChannel(int val); /// Set the module. virtual void SetModule(int val); /// Set the segment index. virtual void SetSegmentId(int val); /// Set scintillator/cherenkov flag. virtual void SetScint(int val); /// Set light guide flag. virtual void SetLightGuide(int val); ClassDef(ICTHChannelId, 2) }; #endif //TCTHChannelId_hxx_seen