#include "ICOMETLog.hxx" #include "ITOFChannelId.hxx" ClassImp(COMET::ITOFChannelId); //---------------------------------------------------------------------- COMET::ITOFChannelId::ITOFChannelId(UInt_t id): IChannelId(id) {} //---------------------------------------------------------------------- COMET::ITOFChannelId::ITOFChannelId(const COMET::IChannelId& src) : IChannelId(src) {} //---------------------------------------------------------------------- COMET::ITOFChannelId::~ITOFChannelId() {} //---------------------------------------------------------------------- COMET::ITOFChannelId::ITOFChannelId(UInt_t subDet, UInt_t Channel) { if (subDet != COMET::IChannelId::kTOF) { COMETSevere("Invalid sub-detector field: " << subDet); } SetGuardBit(); SetSubDetector(COMET::IChannelId::kTOF); SetChannel(Channel); } //---------------------------------------------------------------------- COMET::ITOFChannelId::ITOFChannelId(UInt_t subDet, UInt_t layer, UInt_t module) { if (subDet != COMET::IChannelId::kTOF) { COMETSevere("Invalid sub-detector field: " << subDet); } SetGuardBit(); SetSubDetector(COMET::IChannelId::kTOF); SetLayer(layer); SetModule(module); } //---------------------------------------------------------------------- std::string COMET::ITOFChannelId::AsString() const { return GetAsString("TOF", this->GetChannel()); } //---------------------------------------------------------------------- const UInt_t COMET::ITOFChannelId::GetLayer() const { return GetField(kLayerMSB, kLayerLSB); } //---------------------------------------------------------------------- const UInt_t COMET::ITOFChannelId::GetModule() const { return GetField(kModuleMSB, kModuleLSB); } //---------------------------------------------------------------------- const UInt_t COMET::ITOFChannelId::GetChannel() const { return GetField(kChanMSB, kChanLSB); } //---------------------------------------------------------------------- void COMET::ITOFChannelId::SetChannel(int val) { SetField(val, kChanMSB, kChanLSB); } //---------------------------------------------------------------------- void COMET::ITOFChannelId::SetLayer(int val) { SetField(val, kLayerMSB, kLayerLSB); } //---------------------------------------------------------------------- void COMET::ITOFChannelId::SetModule(int val) { SetField(val, kModuleMSB, kModuleLSB); }