#ifndef TECALTrigChannelId_hxx_seen #define TECALTrigChannelId_hxx_seen #include "IChannelId.hxx" namespace COMET { class IECALTrigChannelId; } ///Channel ID class for Channels using the ECAL electronics hierarchy /// ///Can answer detailed questions about its elements. ///This should be used for constructing IECALTrigChannelIds from the information available. class COMET::IECALTrigChannelId : public COMET::IChannelId { public: ///Construct a ECAL channel ID from a raw UInt_t explicit IECALTrigChannelId(UInt_t id =0); ///Constructor to specialise a Channel ID as a ECAL channel ID explicit IECALTrigChannelId(const COMET::IChannelId& src); ///Construct an ECAL channel ID from its electronics-space co-ordinates. ///The sub-detector ID should be COMET::IChannelId::kECALTrig, but is explicitly required. IECALTrigChannelId(const UInt_t subDet, const UInt_t Channel); virtual ~IECALTrigChannelId(); ///Format as a human readable string virtual std::string AsString() const; /// Get the channel. virtual const UInt_t GetChannel() const; /// Encode set of the SimG4 geometry component numbers into ChannelId /// The second argument is ignored, just for the inheritance:IECALChannelId virtual void SetFromGeomComponentNumber(const UInt_t block, const UInt_t = -1); /// Convert this ChannelId into SimG4 geometrical component numbers. bool GetComponentNumber(UInt_t& block) 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 /// /// bbbb bbbb bbbb xxxx xxxx xxxx x /// /// b(12) [24:13] -- Block (Module) Channel /// x(9) [12: 0] -- Spare /// /// Note: The shift and the least significant bit (lsb) must be the same. enum BitDefinitions { kChanMSB = 24, kChanLSB = 0, kBlockMSB = 24, kBlockLSB = 13, kSpareMSB = 12, kSpareLSB = 0 }; /// @} private: /// Set the channel virtual void SetChannel(int val); // Release note: // Ver.1 (unknown ) Bit fields defined as the same as ECALGeomId // Ver.2 (2015/11/16) Bit fields defined only for the block and crystal modules. ClassDef(IECALTrigChannelId, 1) }; #endif