#include "ICOMETLog.hxx" #include "IGeometryId.hxx" #include "COMETGeomId.hxx" #include "COMETGeomIdDef.hxx" #include "ITOFGeomId.hxx" bool COMET::GeomId::TOF::IsTOF(IGeometryId inputId) { ISettableGeometryId id(inputId); return (COMET::GeomId::Def::kTOF == id.GetField(COMET::GeomId::Def::kDetectorIdMSB, COMET::GeomId::Def::kDetectorIdLSB)); } COMET::IGeometryId COMET::GeomId::TOF::Detector() { ISettableGeometryId id; id.SetField(COMET::GeomId::Def::kTOF, COMET::GeomId::Def::kDetectorIdMSB, COMET::GeomId::Def::kDetectorIdLSB); return id; } COMET::IGeometryId COMET::GeomId::TOF::Module(int layer, int mod) { ISettableGeometryId id; id.SetField(COMET::GeomId::Def::kTOF, COMET::GeomId::Def::kDetectorIdMSB, COMET::GeomId::Def::kDetectorIdLSB); id.SetField(layer, COMET::GeomId::Def::TOF::kLayerIdMSB, COMET::GeomId::Def::TOF::kLayerIdLSB); id.SetField(mod, COMET::GeomId::Def::TOF::kModuleIdMSB, COMET::GeomId::Def::TOF::kModuleIdLSB); return id; } int COMET::GeomId::TOF::GetLayer(IGeometryId inputId) { ISettableGeometryId id(inputId); if (COMET::GeomId::Def::kTOF != id.GetField(COMET::GeomId::Def::kDetectorIdMSB, COMET::GeomId::Def::kDetectorIdLSB)) return -1; return id.GetField(COMET::GeomId::Def::TOF::kLayerIdMSB, COMET::GeomId::Def::TOF::kLayerIdLSB); } int COMET::GeomId::TOF::GetModule(IGeometryId inputId) { ISettableGeometryId id(inputId); if (COMET::GeomId::Def::kTOF != id.GetField(COMET::GeomId::Def::kDetectorIdMSB, COMET::GeomId::Def::kDetectorIdLSB)) return -1; return id.GetField(COMET::GeomId::Def::TOF::kModuleIdMSB, COMET::GeomId::Def::TOF::kModuleIdLSB); }