#ifndef TTOFChannelId_hxx_seen #define TTOFChannelId_hxx_seen #include "IChannelId.hxx" namespace COMET { class ITOFChannelId; } ///Channel ID class for Channels using the TOF ///electronics hierachy. Can answer detailed questions about its ///elements. This should be used for constructing TTOFChannelIds from ///the information available. class COMET::ITOFChannelId : public COMET::IChannelId { public: ///Construct a TOF channel ID from a raw UInt_t explicit ITOFChannelId(UInt_t id =0); ///Constructor to specialise a Channel ID as a TOF channel ID explicit ITOFChannelId(const COMET::IChannelId& src); ///Construct a TOF channel ID from its electronics-space ///co-ordinates. The sub-detector ID should be ///COMET::IChannelId::kTOF(=2), but is explicitly required. ITOFChannelId(UInt_t subDet, UInt_t Channel); ITOFChannelId(UInt_t subDet, UInt_t layer, UInt_t module); virtual ~ITOFChannelId(); ///Format as a human readable string virtual std::string AsString() const; ///Get the layer virtual const UInt_t GetLayer() const; ///Get the module index virtual const UInt_t GetModule() 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, kLayerMSB=24, kLayerLSB=24, kModuleMSB=23, kModuleLSB=14 }; /// @} private: /// Set the channel. virtual void SetChannel(int val); /// Set the layer. virtual void SetLayer(int val); /// Set the module. virtual void SetModule(int val); ClassDef(ITOFChannelId, 0) }; #endif //TTOFChannelId_hxx_seen