#include #include "ICOMETLog.hxx" #include "ICTHChannelId.hxx" ClassImp(COMET::ICTHChannelId); //---------------------------------------------------------------------- COMET::ICTHChannelId::ICTHChannelId(UInt_t id): IChannelId(id) {} //---------------------------------------------------------------------- COMET::ICTHChannelId::ICTHChannelId(const COMET::IChannelId& src) : IChannelId(src) {} //---------------------------------------------------------------------- COMET::ICTHChannelId::~ICTHChannelId() {} //---------------------------------------------------------------------- COMET::ICTHChannelId::ICTHChannelId(UInt_t subDet, UInt_t Channel) { if (subDet != COMET::IChannelId::kCTH) { COMETSevere("Invalid sub-detector field: " << subDet); } SetGuardBit(); SetSubDetector(COMET::IChannelId::kCTH); SetChannel(Channel); } //---------------------------------------------------------------------- COMET::ICTHChannelId::ICTHChannelId(UInt_t subDet, UInt_t mod, UInt_t segId, UInt_t scint, UInt_t lightG) { if (subDet != COMET::IChannelId::kCTH) { COMETSevere("Invalid sub-detector field: " << subDet); } SetGuardBit(); SetSubDetector(COMET::IChannelId::kCTH); SetModule(mod); SetSegmentId(segId); SetScint(scint); SetLightGuide(lightG); } //---------------------------------------------------------------------- std::string COMET::ICTHChannelId::AsString() const { return GetAsString("CTH", this->GetChannel()); } //---------------------------------------------------------------------- const UInt_t COMET::ICTHChannelId::GetModule() const { return GetField(kModMSB, kModLSB); } //---------------------------------------------------------------------- const UInt_t COMET::ICTHChannelId::GetSegmentId() const { return GetField(kCountMSB, kCountLSB); } //---------------------------------------------------------------------- const UInt_t COMET::ICTHChannelId::GetScint() const { return GetField(kScintMSB, kScintLSB); } //---------------------------------------------------------------------- const UInt_t COMET::ICTHChannelId::GetLightGuide() const { return GetField(kLGMSB, kLGLSB); } //---------------------------------------------------------------------- const UInt_t COMET::ICTHChannelId::GetChannel() const { return GetField(kChanMSB, kChanLSB); } //---------------------------------------------------------------------- void COMET::ICTHChannelId::SetChannel(int val) { SetField(val, kChanMSB, kChanLSB); } //---------------------------------------------------------------------- void COMET::ICTHChannelId::SetModule(int val) { SetField(val, kModMSB, kModLSB); } //---------------------------------------------------------------------- void COMET::ICTHChannelId::SetSegmentId(int val) { SetField(val, kCountMSB, kCountLSB); } //---------------------------------------------------------------------- void COMET::ICTHChannelId::SetScint(int val) { SetField(val, kScintMSB, kScintLSB); } //---------------------------------------------------------------------- void COMET::ICTHChannelId::SetLightGuide(int val) { SetField(val, kLGMSB, kLGLSB); }