#include "ICOMETLog.hxx" #include "IGeometryId.hxx" #include "COMETGeomId.hxx" #include "COMETGeomIdDef.hxx" #include "IStrawTrkGeomId.hxx" bool COMET::GeomId::StrawTrk::IsStrawTrk(IGeometryId inputId) { ISettableGeometryId id(inputId); return (COMET::GeomId::Def::kStrawTrk == id.GetField(COMET::GeomId::Def::kDetectorIdMSB, COMET::GeomId::Def::kDetectorIdLSB)); } COMET::IGeometryId COMET::GeomId::StrawTrk::Detector() { ISettableGeometryId id; id.SetField(COMET::GeomId::Def::kStrawTrk, COMET::GeomId::Def::kDetectorIdMSB, COMET::GeomId::Def::kDetectorIdLSB); return id; } COMET::IGeometryId COMET::GeomId::StrawTrk::Module(int station, int manifoldXY, int layer, int strawTube, int strawGas, int strawWire) { ISettableGeometryId id; id.SetField(COMET::GeomId::Def::kStrawTrk, COMET::GeomId::Def::kDetectorIdMSB, COMET::GeomId::Def::kDetectorIdLSB); id.SetField(station, COMET::GeomId::Def::StrawTrk::kStationMSB, COMET::GeomId::Def::StrawTrk::kStationLSB); id.SetField(manifoldXY, COMET::GeomId::Def::StrawTrk::kManifoldXYMSB, COMET::GeomId::Def::StrawTrk::kManifoldXYLSB); id.SetField(layer, COMET::GeomId::Def::StrawTrk::kLayerMSB, COMET::GeomId::Def::StrawTrk::kLayerLSB); id.SetField(strawTube, COMET::GeomId::Def::StrawTrk::kStrawTubeMSB, COMET::GeomId::Def::StrawTrk::kStrawTubeLSB); id.SetField(strawGas, COMET::GeomId::Def::StrawTrk::kStrawGasMSB, COMET::GeomId::Def::StrawTrk::kStrawGasLSB); id.SetField(strawWire, COMET::GeomId::Def::StrawTrk::kStrawWireMSB, COMET::GeomId::Def::StrawTrk::kStrawWireLSB); return id; } bool COMET::GeomId::StrawTrk::IsStrawGas(IGeometryId id) { if (!IsStrawTrk(id)) return false; int strawGas = id.GetField(COMET::GeomId::Def::StrawTrk::kStrawGasMSB, COMET::GeomId::Def::StrawTrk::kStrawGasLSB); if (!strawGas) return false; else return true; } int COMET::GeomId::StrawTrk::GetStationId(IGeometryId id) { int station = id.GetField(COMET::GeomId::Def::StrawTrk::kStationMSB, COMET::GeomId::Def::StrawTrk::kStationLSB); return station; } int COMET::GeomId::StrawTrk::GetManifoldId(IGeometryId id) { int direction = id.GetField(COMET::GeomId::Def::StrawTrk::kManifoldXYMSB, COMET::GeomId::Def::StrawTrk::kManifoldXYLSB); return (direction == 0)? kStrawTrkDirectionX : kStrawTrkDirectionY; } int COMET::GeomId::StrawTrk::GetStrawId(IGeometryId id) { int straw = id.GetField(COMET::GeomId::Def::StrawTrk::kStrawTubeMSB, COMET::GeomId::Def::StrawTrk::kStrawTubeLSB); return straw; }