#include "ICOMETLog.hxx" #include "IGeometryId.hxx" #include "COMETGeomId.hxx" #include "COMETGeomIdDef.hxx" #include "ICTHGeomId.hxx" bool COMET::GeomId::CTH::IsCTH(IGeometryId inputId) { ISettableGeometryId id(inputId); return (COMET::GeomId::Def::kCTH == id.GetField(COMET::GeomId::Def::kDetectorIdMSB, COMET::GeomId::Def::kDetectorIdLSB)); } COMET::IGeometryId COMET::GeomId::CTH::Detector() { ISettableGeometryId id; id.SetField(COMET::GeomId::Def::kCTH, COMET::GeomId::Def::kDetectorIdMSB, COMET::GeomId::Def::kDetectorIdLSB); return id; } COMET::IGeometryId COMET::GeomId::CTH::Module(int mod) { ISettableGeometryId id; id.SetField(COMET::GeomId::Def::kCTH, COMET::GeomId::Def::kDetectorIdMSB, COMET::GeomId::Def::kDetectorIdLSB); id.SetField(mod, COMET::GeomId::Def::CTH::kCTHIdMSB, COMET::GeomId::Def::CTH::kCTHIdLSB); return id; } COMET::IGeometryId COMET::GeomId::CTH::Counter(int mod, int segId, int scint, int lightG) { ISettableGeometryId id; id.SetField(COMET::GeomId::Def::kCTH, COMET::GeomId::Def::kDetectorIdMSB, COMET::GeomId::Def::kDetectorIdLSB); id.SetField(mod, COMET::GeomId::Def::CTH::kCTHIdMSB, COMET::GeomId::Def::CTH::kCTHIdLSB); id.SetField(segId, COMET::GeomId::Def::CTH::kCTHSegIdMSB, COMET::GeomId::Def::CTH::kCTHSegIdLSB); //plastic scintillator or Cherenkov counter id.SetField(scint, COMET::GeomId::Def::CTH::kCTHPSIdMSB, COMET::GeomId::Def::CTH::kCTHPSIdLSB); //light guide? id.SetField(lightG, COMET::GeomId::Def::CTH::kCTHLGIdMSB, COMET::GeomId::Def::CTH::kCTHLGIdLSB); return id; } int COMET::GeomId::CTH::GetModule(IGeometryId inputId) { ISettableGeometryId id(inputId); if (COMET::GeomId::Def::kCTH != id.GetField(COMET::GeomId::Def::kDetectorIdMSB, COMET::GeomId::Def::kDetectorIdLSB)) return -1; return id.GetField(COMET::GeomId::Def::CTH::kCTHIdMSB, COMET::GeomId::Def::CTH::kCTHIdLSB); } int COMET::GeomId::CTH::GetSegmentId(IGeometryId inputId) { ISettableGeometryId id(inputId); if (COMET::GeomId::Def::kCTH != id.GetField(COMET::GeomId::Def::kDetectorIdMSB, COMET::GeomId::Def::kDetectorIdLSB)) return -1; if (1 < id.GetField(COMET::GeomId::Def::CTH::kCTHIdMSB, COMET::GeomId::Def::CTH::kCTHIdLSB)) return -1; return id.GetField(COMET::GeomId::Def::CTH::kCTHSegIdMSB, COMET::GeomId::Def::CTH::kCTHSegIdLSB); } int COMET::GeomId::CTH::GetScintillator(IGeometryId inputId) { ISettableGeometryId id(inputId); if (COMET::GeomId::Def::kCTH != id.GetField(COMET::GeomId::Def::kDetectorIdMSB, COMET::GeomId::Def::kDetectorIdLSB)) return -1; if (1 < id.GetField(COMET::GeomId::Def::CTH::kCTHIdMSB, COMET::GeomId::Def::CTH::kCTHIdLSB)) return -1; return id.GetField(COMET::GeomId::Def::CTH::kCTHPSIdMSB, COMET::GeomId::Def::CTH::kCTHPSIdLSB); } int COMET::GeomId::CTH::GetLightGuide(IGeometryId inputId) { ISettableGeometryId id(inputId); if (COMET::GeomId::Def::kCTH != id.GetField(COMET::GeomId::Def::kDetectorIdMSB, COMET::GeomId::Def::kDetectorIdLSB)) return -1; if (1 < id.GetField(COMET::GeomId::Def::CTH::kCTHIdMSB, COMET::GeomId::Def::CTH::kCTHIdLSB)) return -1; return id.GetField(COMET::GeomId::Def::CTH::kCTHLGIdMSB, COMET::GeomId::Def::CTH::kCTHLGIdLSB); }