With this snippet. (After the ESHandle there is GEMGeometry in between brackets, and after the 1st get, there is MuonGeometryRecord in between brackets, but Markdown leaves it out. Just to be clear on this.)

  edm::ESHandle<GEMGeometry> h_gem;
  setup.get<MuonGeometryRecord>().get(h_gem);
  if (h_gem.isValid()) {
    lctBuilder_->setGEMGeometry(&*h_gem);
  } else {
    edm::LogInfo("L1CSCTPEmulatorNoGEMGeometry")
      << "+++ Info: GEM geometry is unavailable. Running CSC-only trigger algorithm. +++\n";
  }